Skip to content

Support AWS Provider V5 #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'docs/**'
- 'examples/**'
- 'test/**'
- 'README.*'

permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ permissions:

jobs:
terraform-module:
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release.yml@main
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release-published.yml@main
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ Available targets:

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |

Expand Down
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |

Expand Down
18 changes: 10 additions & 8 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ provider "aws" {
}

module "vpc" {
source = "cloudposse/vpc/aws"
version = "0.18.1"
cidr_block = var.vpc_cidr_block
source = "cloudposse/vpc/aws"
version = "2.1.0"

ipv4_primary_cidr_block = var.vpc_cidr_block

context = module.this.context
}

module "subnets" {
source = "cloudposse/dynamic-subnets/aws"
version = "0.33.0"
source = "cloudposse/dynamic-subnets/aws"
version = "2.3.0"

availability_zones = var.availability_zones
vpc_id = module.vpc.vpc_id
igw_id = module.vpc.igw_id
cidr_block = module.vpc.vpc_cidr_block
nat_gateway_enabled = true
igw_id = [module.vpc.igw_id]
ipv4_cidr_block = [module.vpc.vpc_cidr_block]
nat_gateway_enabled = false
nat_instance_enabled = false

context = module.this.context
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.12.26"
required_version = ">= 1.0"

required_providers {
aws = {
Expand Down
2 changes: 1 addition & 1 deletion examples/with_cognito_authentication/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.12.26"
required_version = ">= 1.0"

required_providers {
aws = {
Expand Down
2 changes: 1 addition & 1 deletion examples/with_google_oidc_authentication/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.12.26"
required_version = ">= 1.0"

required_providers {
aws = {
Expand Down
2 changes: 1 addition & 1 deletion examples/without_authentication/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.12.26"
required_version = ">= 1.0"

required_providers {
aws = {
Expand Down
24 changes: 12 additions & 12 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ locals {
hostname = var.hostname != "" ? var.hostname : local.default_hostname
atlantis_webhook_url = format(var.atlantis_webhook_format, local.hostname)
atlantis_url = format(var.atlantis_url_format, local.hostname)
atlantis_gh_webhook_secret = var.atlantis_gh_webhook_secret != "" ? var.atlantis_gh_webhook_secret : join("", random_string.atlantis_gh_webhook_secret.*.result)
default_hostname = join("", aws_route53_record.default.*.fqdn)
atlantis_gh_webhook_secret = var.atlantis_gh_webhook_secret != "" ? var.atlantis_gh_webhook_secret : join("", random_string.atlantis_gh_webhook_secret[*].result)
default_hostname = join("", aws_route53_record.default[*].fqdn)
kms_key_id = var.kms_key_id != "" ? var.kms_key_id : format("alias/%s-%s-chamber", module.this.namespace, module.this.stage)
}

# GitHub tokens
locals {
github_oauth_token = var.github_oauth_token != "" ? var.github_oauth_token : join("", data.aws_ssm_parameter.atlantis_gh_token.*.value)
github_oauth_token = var.github_oauth_token != "" ? var.github_oauth_token : join("", data.aws_ssm_parameter.atlantis_gh_token[*].value)
github_oauth_token_ssm_name = var.github_oauth_token_ssm_name != "" ? var.github_oauth_token_ssm_name : format(var.chamber_format, var.chamber_service, "atlantis_gh_token")

github_webhooks_token = var.github_webhooks_token != "" ? var.github_webhooks_token : join("", data.aws_ssm_parameter.github_webhooks_token.*.value)
github_webhooks_token = var.github_webhooks_token != "" ? var.github_webhooks_token : join("", data.aws_ssm_parameter.github_webhooks_token[*].value)
github_webhooks_token_ssm_name = var.github_webhooks_token_ssm_name != "" ? var.github_webhooks_token_ssm_name : format(var.chamber_format, var.chamber_service, "github_webhooks_token")
}

Expand Down Expand Up @@ -239,7 +239,7 @@ resource "aws_ssm_parameter" "atlantis_gh_team_whitelist" {
resource "aws_ssm_parameter" "atlantis_gh_webhook_secret" {
count = local.enabled ? 1 : 0
description = "Atlantis GitHub webhook secret"
key_id = join("", data.aws_kms_key.chamber_kms_key.*.id)
key_id = join("", data.aws_kms_key.chamber_kms_key[*].id)
name = format(var.chamber_format, var.chamber_service, "atlantis_gh_webhook_secret")
overwrite = var.overwrite_ssm_parameter
type = "SecureString"
Expand Down Expand Up @@ -300,7 +300,7 @@ resource "aws_ssm_parameter" "atlantis_wake_word" {
resource "aws_ssm_parameter" "atlantis_gh_token" {
count = local.enabled && var.github_oauth_token != "" ? 1 : 0
description = "Atlantis GitHub OAuth token"
key_id = join("", data.aws_kms_key.chamber_kms_key.*.id)
key_id = join("", data.aws_kms_key.chamber_kms_key[*].id)
name = local.github_oauth_token_ssm_name
overwrite = var.overwrite_ssm_parameter
type = "SecureString"
Expand All @@ -311,7 +311,7 @@ resource "aws_ssm_parameter" "atlantis_gh_token" {
resource "aws_ssm_parameter" "github_webhooks_token" {
count = local.enabled && var.github_webhooks_token != "" ? 1 : 0
description = "GitHub OAuth token with permission to create webhooks"
key_id = join("", data.aws_kms_key.chamber_kms_key.*.id)
key_id = join("", data.aws_kms_key.chamber_kms_key[*].id)
name = local.github_webhooks_token_ssm_name
overwrite = var.overwrite_ssm_parameter
type = "SecureString"
Expand Down Expand Up @@ -370,39 +370,39 @@ resource "aws_iam_role_policy_attachment" "default" {
}

locals {
authentication_cognito_user_pool_arn = var.authentication_cognito_user_pool_arn != "" ? var.authentication_cognito_user_pool_arn : join("", data.aws_ssm_parameter.atlantis_cognito_user_pool_arn.*.value)
authentication_cognito_user_pool_arn = var.authentication_cognito_user_pool_arn != "" ? var.authentication_cognito_user_pool_arn : join("", data.aws_ssm_parameter.atlantis_cognito_user_pool_arn[*].value)

authentication_cognito_user_pool_arn_ssm_name = var.authentication_cognito_user_pool_arn_ssm_name != "" ? var.authentication_cognito_user_pool_arn_ssm_name : format(
var.chamber_format,
var.chamber_service,
"atlantis_cognito_user_pool_arn"
)

authentication_cognito_user_pool_client_id = var.authentication_cognito_user_pool_client_id != "" ? var.authentication_cognito_user_pool_client_id : join("", data.aws_ssm_parameter.atlantis_cognito_user_pool_client_id.*.value)
authentication_cognito_user_pool_client_id = var.authentication_cognito_user_pool_client_id != "" ? var.authentication_cognito_user_pool_client_id : join("", data.aws_ssm_parameter.atlantis_cognito_user_pool_client_id[*].value)

authentication_cognito_user_pool_client_id_ssm_name = var.authentication_cognito_user_pool_client_id_ssm_name != "" ? var.authentication_cognito_user_pool_client_id_ssm_name : format(
var.chamber_format,
var.chamber_service,
"atlantis_cognito_user_pool_client_id"
)

authentication_cognito_user_pool_domain = var.authentication_cognito_user_pool_domain != "" ? var.authentication_cognito_user_pool_domain : join("", data.aws_ssm_parameter.atlantis_cognito_user_pool_domain.*.value)
authentication_cognito_user_pool_domain = var.authentication_cognito_user_pool_domain != "" ? var.authentication_cognito_user_pool_domain : join("", data.aws_ssm_parameter.atlantis_cognito_user_pool_domain[*].value)

authentication_cognito_user_pool_domain_ssm_name = var.authentication_cognito_user_pool_domain_ssm_name != "" ? var.authentication_cognito_user_pool_domain_ssm_name : format(
var.chamber_format,
var.chamber_service,
"atlantis_cognito_user_pool_domain"
)

authentication_oidc_client_id = var.authentication_oidc_client_id != "" ? var.authentication_oidc_client_id : join("", data.aws_ssm_parameter.atlantis_oidc_client_id.*.value)
authentication_oidc_client_id = var.authentication_oidc_client_id != "" ? var.authentication_oidc_client_id : join("", data.aws_ssm_parameter.atlantis_oidc_client_id[*].value)

authentication_oidc_client_id_ssm_name = var.authentication_oidc_client_id_ssm_name != "" ? var.authentication_oidc_client_id_ssm_name : format(
var.chamber_format,
var.chamber_service,
"atlantis_oidc_client_id"
)

authentication_oidc_client_secret = var.authentication_oidc_client_secret != "" ? var.authentication_oidc_client_secret : join("", data.aws_ssm_parameter.atlantis_oidc_client_secret.*.value)
authentication_oidc_client_secret = var.authentication_oidc_client_secret != "" ? var.authentication_oidc_client_secret : join("", data.aws_ssm_parameter.atlantis_oidc_client_secret[*].value)

authentication_oidc_client_secret_ssm_name = var.authentication_oidc_client_secret_ssm_name != "" ? var.authentication_oidc_client_secret_ssm_name : format(
var.chamber_format,
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.13.0"
required_version = ">= 1.0"

required_providers {
aws = {
Expand Down