Skip to content

Commit 3e581cf

Browse files
authored
Merge pull request #31 from Datatamer/provider_upgrade
DSD-3568: upgrade aws provider to no longer use deprecated name
2 parents fb45027 + 958708a commit 3e581cf

File tree

12 files changed

+39
-10
lines changed

12 files changed

+39
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Tamr Terraform Template Repo
22

3+
## v5.0.0 - September 1st 2022
4+
* Update for breaking change in provider versions
5+
36
## v4.1.0 - September 1st 2022
47
* Adds support for configuring multiple AZs
58
* Adds support for configuring performance insights

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
5.0.0

examples/minimal/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module "rds_postgres" {
22
# source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=4.1.0"
33
source = "../.."
44

5-
identifier_prefix = "${var.name_prefix}-example-rds-pg-"
5+
identifier_prefix = "${var.name_prefix}example-rds-pg-"
66
postgres_name = "example0"
7-
parameter_group_name = "${var.name_prefix}-example-rds-postgres-pg"
7+
parameter_group_name = "${var.name_prefix}example-rds-postgres-pg"
88
username = "exampleUsername"
99
password = "examplePassword" #tfsec:ignore:GEN003
1010

examples/minimal/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ variable "multi_az" {
1515
}
1616

1717
variable "name_prefix" {
18+
type = string
1819
description = "A string to prepend to names of resources created by this example"
1920
}
2021

examples/minimal/versions.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
required_version = ">= 0.13"
3+
required_providers {
4+
aws = {
5+
source = "hashicorp/aws"
6+
version = ">= 4.0.0"
7+
}
8+
}
9+
}

main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ resource "aws_db_subnet_group" "rds_postgres_subnet_group" {
2929
}
3030

3131
resource "aws_db_instance" "rds_postgres" {
32-
# 'name' is deprecated in favor of 'db_name' after provider version 4.0.0
33-
name = var.postgres_name
32+
db_name = var.postgres_name
3433

3534
identifier_prefix = var.identifier_prefix
3635
allocated_storage = var.allocated_storage
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
required_version = ">= 0.13"
3+
required_providers {
4+
aws = {
5+
source = "hashicorp/aws"
6+
version = ">= 4.0.0"
7+
}
8+
}
9+
}

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ output "rds_username" {
2626
}
2727

2828
output "rds_dbname" {
29-
value = aws_db_instance.rds_postgres.name
29+
value = aws_db_instance.rds_postgres.db_name
3030
}
3131

3232
output "cloudwatch_logs_path" {

test/create_db_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func initTestCases() []RdsTestCase {
3434
"database_subnets": []string{"172.18.0.0/24", "172.18.1.0/24"},
3535
"egress_cidr_blocks": []string{"0.0.0.0/0"},
3636
"ingress_cidr_blocks": []string{"0.0.0.0/0"},
37-
"name_prefix": "",
37+
"name_prefix": "test",
3838
},
3939
},
4040
}

test_examples/minimal/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ module "rds_postgres" {
1010
}
1111

1212
module "vpc" {
13-
source = "terraform-aws-modules/vpc/aws"
14-
version = "3.1.0"
13+
source = "terraform-aws-modules/vpc/aws"
1514

1615
name = "${var.name_prefix}-terratest-vpc"
1716
cidr = var.vpc_cidr

test_examples/minimal/versions.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
required_version = ">= 0.13"
3+
required_providers {
4+
aws = {
5+
source = "hashicorp/aws"
6+
version = ">= 4.0.0"
7+
}
8+
}
9+
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
aws = {
55
source = "hashicorp/aws"
6-
version = ">= 3.36, !=4.0.0, !=4.1.0, !=4.2.0, !=4.3.0, !=4.4.0, !=4.5.0, !=4.6.0, !=4.7.0, !=4.8.0"
6+
version = ">= 4.0.0"
77
}
88
}
99
}

0 commit comments

Comments
 (0)