Skip to content

DSD-3568: upgrade aws provider to no longer use deprecated name #31

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

Merged
merged 9 commits into from
Mar 14, 2024
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Tamr Terraform Template Repo

## v5.0.0 - September 1st 2022
* Update for breaking change in provider versions

## v4.1.0 - September 1st 2022
* Adds support for configuring multiple AZs
* Adds support for configuring performance insights
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0
5.0.0
4 changes: 2 additions & 2 deletions examples/minimal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module "rds_postgres" {
# source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=4.1.0"
source = "../.."

identifier_prefix = "${var.name_prefix}-example-rds-pg-"
identifier_prefix = "${var.name_prefix}example-rds-pg-"
postgres_name = "example0"
parameter_group_name = "${var.name_prefix}-example-rds-postgres-pg"
parameter_group_name = "${var.name_prefix}example-rds-postgres-pg"
username = "exampleUsername"
password = "examplePassword" #tfsec:ignore:GEN003

Expand Down
1 change: 1 addition & 0 deletions examples/minimal/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ variable "multi_az" {
}

variable "name_prefix" {
type = string
description = "A string to prepend to names of resources created by this example"
}

Expand Down
9 changes: 9 additions & 0 deletions examples/minimal/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0.0"
}
}
}
3 changes: 1 addition & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ resource "aws_db_subnet_group" "rds_postgres_subnet_group" {
}

resource "aws_db_instance" "rds_postgres" {
# 'name' is deprecated in favor of 'db_name' after provider version 4.0.0
name = var.postgres_name
db_name = var.postgres_name

identifier_prefix = var.identifier_prefix
allocated_storage = var.allocated_storage
Expand Down
9 changes: 9 additions & 0 deletions modules/rds-postgres-ports/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0.0"
}
}
}
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ output "rds_username" {
}

output "rds_dbname" {
value = aws_db_instance.rds_postgres.name
value = aws_db_instance.rds_postgres.db_name
}

output "cloudwatch_logs_path" {
Expand Down
2 changes: 1 addition & 1 deletion test/create_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func initTestCases() []RdsTestCase {
"database_subnets": []string{"172.18.0.0/24", "172.18.1.0/24"},
"egress_cidr_blocks": []string{"0.0.0.0/0"},
"ingress_cidr_blocks": []string{"0.0.0.0/0"},
"name_prefix": "",
"name_prefix": "test",
},
},
}
Expand Down
3 changes: 1 addition & 2 deletions test_examples/minimal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ module "rds_postgres" {
}

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "3.1.0"
source = "terraform-aws-modules/vpc/aws"

name = "${var.name_prefix}-terratest-vpc"
cidr = var.vpc_cidr
Expand Down
9 changes: 9 additions & 0 deletions test_examples/minimal/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0.0"
}
}
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
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"
version = ">= 4.0.0"
}
}
}