Skip to content

Commit 9fe956f

Browse files
authored
Support AWS Provider V5 (#20)
1 parent 2a2e152 commit 9fe956f

File tree

8 files changed

+23
-22
lines changed

8 files changed

+23
-22
lines changed

.github/workflows/release-branch.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- 'docs/**'
1111
- 'examples/**'
1212
- 'test/**'
13+
- 'README.*'
1314

1415
permissions:
1516
contents: write

.github/workflows/release-published.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ permissions:
1111

1212
jobs:
1313
terraform-module:
14-
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release.yml@main
14+
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release-published.yml@main

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Available targets:
133133

134134
| Name | Version |
135135
|------|---------|
136-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
136+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
137137
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
138138
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.2 |
139139

docs/terraform.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
| Name | Version |
55
|------|---------|
6-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
6+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
77
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
88
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.2 |
99

examples/complete/main.tf

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ provider "aws" {
44

55
module "vpc" {
66
source = "cloudposse/vpc/aws"
7-
version = "0.21.1"
7+
version = "2.1.0"
88

9-
cidr_block = var.vpc_cidr_block
9+
ipv4_primary_cidr_block = var.vpc_cidr_block
1010

1111
context = module.this.context
1212
}
1313

1414
module "subnets" {
1515
source = "cloudposse/dynamic-subnets/aws"
16-
version = "0.38.0"
16+
version = "2.3.0"
1717

1818
availability_zones = var.availability_zones
1919
vpc_id = module.vpc.vpc_id
20-
igw_id = module.vpc.igw_id
21-
cidr_block = module.vpc.vpc_cidr_block
22-
nat_gateway_enabled = true
20+
igw_id = [module.vpc.igw_id]
21+
ipv4_cidr_block = [module.vpc.vpc_cidr_block]
22+
nat_gateway_enabled = false
2323
nat_instance_enabled = false
2424

2525
context = module.this.context

examples/complete/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.12.26"
2+
required_version = ">= 1.0"
33

44
required_providers {
55
aws = {

main.tf

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ locals {
22
enabled = module.this.enabled
33

44
count = local.enabled ? 1 : 0
5-
id = local.enabled ? join("", aws_codedeploy_app.default.*.id) : null
6-
name = local.enabled ? join("", aws_codedeploy_app.default.*.name) : null
7-
group_id = local.enabled ? join("", aws_codedeploy_deployment_group.default.*.id) : null
8-
deployment_config_name = local.enabled ? join("", aws_codedeploy_deployment_config.default.*.id) : null
9-
deployment_config_id = local.enabled ? join("", aws_codedeploy_deployment_config.default.*.deployment_config_id) : null
5+
id = local.enabled ? join("", aws_codedeploy_app.default[*].id) : null
6+
name = local.enabled ? join("", aws_codedeploy_app.default[*].name) : null
7+
group_id = local.enabled ? join("", aws_codedeploy_deployment_group.default[*].id) : null
8+
deployment_config_name = local.enabled ? join("", aws_codedeploy_deployment_config.default[*].id) : null
9+
deployment_config_id = local.enabled ? join("", aws_codedeploy_deployment_config.default[*].deployment_config_id) : null
1010
auto_rollback_configuration_enabled = local.enabled && var.auto_rollback_configuration_events != null && length(var.auto_rollback_configuration_events) > 0
1111
alarm_configuration_enabled = local.enabled && var.alarm_configuration != null
1212
default_sns_topic_enabled = local.enabled && var.create_default_sns_topic
1313
sns_topic_arn = local.default_sns_topic_enabled ? module.sns_topic.sns_topic.arn : var.sns_topic_arn
1414
default_service_role_enabled = local.enabled && var.create_default_service_role
1515
default_service_role_count = local.default_service_role_enabled ? 1 : 0
16-
service_role_arn = local.default_service_role_enabled ? join("", aws_iam_role.default.*.arn) : var.service_role_arn
16+
service_role_arn = local.default_service_role_enabled ? join("", aws_iam_role.default[*].arn) : var.service_role_arn
1717
default_policy_arn = {
18-
Server = "arn:${join("", data.aws_partition.current.*.partition)}:iam::aws:policy/service-role/AWSCodeDeployRole"
19-
Lambda = "arn:${join("", data.aws_partition.current.*.partition)}:iam::aws:policy/service-role/AWSCodeDeployRoleForLambda"
20-
ECS = "arn:${join("", data.aws_partition.current.*.partition)}:iam::aws:policy/AWSCodeDeployRoleForECS"
18+
Server = "arn:${join("", data.aws_partition.current[*].partition)}:iam::aws:policy/service-role/AWSCodeDeployRole"
19+
Lambda = "arn:${join("", data.aws_partition.current[*].partition)}:iam::aws:policy/service-role/AWSCodeDeployRoleForLambda"
20+
ECS = "arn:${join("", data.aws_partition.current[*].partition)}:iam::aws:policy/AWSCodeDeployRoleForECS"
2121
}
2222
}
2323

@@ -42,14 +42,14 @@ data "aws_partition" "current" {
4242
resource "aws_iam_role" "default" {
4343
count = local.default_service_role_count
4444
name = module.this.id
45-
assume_role_policy = join("", data.aws_iam_policy_document.assume_role.*.json)
45+
assume_role_policy = join("", data.aws_iam_policy_document.assume_role[*].json)
4646
tags = module.this.tags
4747
}
4848

4949
resource "aws_iam_role_policy_attachment" "default" {
5050
count = local.default_service_role_count
5151
policy_arn = format("%s", lookup(local.default_policy_arn, var.compute_platform))
52-
role = join("", aws_iam_role.default.*.name)
52+
role = join("", aws_iam_role.default[*].name)
5353
}
5454

5555
module "sns_topic" {

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.13"
2+
required_version = ">= 1.0"
33

44
required_providers {
55
aws = {

0 commit comments

Comments
 (0)