File tree Expand file tree Collapse file tree 8 files changed +37
-7
lines changed Expand file tree Collapse file tree 8 files changed +37
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Tamr Terraform Template Repo
2
2
3
+ ## v2.1.0 - July 12nd 2021
4
+ * Adds tags for RDS Subnet Group.
5
+ * Adds new variable ` tags ` to set tags for all resources
6
+ * Deprecates ` additional_tags ` in favor of ` tags `
7
+
3
8
## v2.0.0 - June 30th 2021
4
9
* Accepts a list of security groups
5
10
* Returns a list of ports used by RDS
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ This terraform module will create:
54
54
| subnet\_ group\_ name | The name of the subnet group to add the RDS instance to | ` string ` | n/a | yes |
55
55
| vpc\_ id | VPC ID for the rds security group | ` string ` | n/a | yes |
56
56
| additional\_ cidrs | Additional CIDR to connect to RDS Postgres instance | ` list(string) ` | ` [] ` | no |
57
- | additional\_ tags | Additional tags to set on the RDS instance | ` map(string) ` | ` {} ` | no |
57
+ | additional\_ tags | [ DEPRECATED: Use ` tags ` instead ] Additional tags to set on the RDS instance. | ` map(string) ` | ` {} ` | no |
58
58
| allocated\_ storage | Allocate storage | ` number ` | ` 20 ` | no |
59
59
| apply\_ immediately | Apply immediately, do not set this to true for production | ` bool ` | ` false ` | no |
60
60
| backup\_ retention\_ period | Backup retention period in days | ` number ` | ` 14 ` | no |
@@ -72,6 +72,7 @@ This terraform module will create:
72
72
| security\_ group\_ name | Name for the security group for the rds instance | ` string ` | ` "tamr_rds_sg" ` | no |
73
73
| skip\_ final\_ snapshot | Skip final snapshot | ` bool ` | ` true ` | no |
74
74
| storage\_ type | Storage type (e.g. gp2, io1) | ` string ` | ` "gp2" ` | no |
75
+ | tags | A map of tags to add to all resources. Replaces ` additional_tags ` . | ` map(string) ` | ` {} ` | no |
75
76
| username | The username for the master DB user. | ` string ` | ` "tamr" ` | no |
76
77
77
78
## Outputs
Original file line number Diff line number Diff line change 1
- 2.0 .0
1
+ 2.1 .0
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ No provider.
17
17
| subnet\_ ids | List of at least 2 subnets in different AZs for DB subnet group | ` list(string) ` | n/a | yes |
18
18
| vpc\_ id | VPC ID of network. | ` string ` | n/a | yes |
19
19
| egress\_ cidr\_ blocks | CIDR blocks to attach to security groups for egress | ` list(string) ` | <pre >[ <br > "0.0.0.0/0"<br >] </pre > | no |
20
+ | tags | A map of tags to add to all resources created by this example. | ` map(string) ` | <pre >{<br > "Author": "Tamr",<br > "Environment": "Example"<br >}</pre > | no |
20
21
21
22
## Outputs
22
23
Original file line number Diff line number Diff line change @@ -8,11 +8,12 @@ module "rds_postgres" {
8
8
username = " exampleUsername"
9
9
password = " examplePassword" # tfsec:ignore:GEN003
10
10
11
- vpc_id = var. vpc_id
12
- subnet_group_name = " example_subnet_group"
11
+ vpc_id = var. vpc_id
12
+ subnet_group_name = " example_subnet_group"
13
13
# Network requirement: DB subnet group needs a subnet in at least two Availability Zones
14
14
rds_subnet_ids = var. subnet_ids
15
15
security_group_ids = module. rds-postgres-sg . security_group_ids
16
+ tags = var. tags
16
17
}
17
18
18
19
module "sg-ports" {
@@ -29,4 +30,5 @@ module "rds-postgres-sg" {
29
30
sg_name_prefix = var. name_prefix
30
31
egress_protocol = " all"
31
32
ingress_protocol = " tcp"
33
+ tags = var. tags
32
34
}
Original file line number Diff line number Diff line change @@ -27,3 +27,13 @@ variable "egress_cidr_blocks" {
27
27
type = list (string )
28
28
default = [" 0.0.0.0/0" ]
29
29
}
30
+
31
+ variable "tags" {
32
+ type = map (string )
33
+ description = " A map of tags to add to all resources created by this example."
34
+ default = {
35
+ Author = " Tamr"
36
+ Environment = " Example"
37
+ }
38
+ }
39
+
Original file line number Diff line number Diff line change
1
+ locals {
2
+ effective_tags = length (var. tags ) > 0 ? var. tags : var. additional_tags
3
+ }
4
+
1
5
resource "aws_db_parameter_group" "rds_postgres_pg" {
2
6
name = var. parameter_group_name
3
7
family = var. parameter_group_family
4
8
description = " TAMR RDS parameter group"
5
- tags = var . additional_tags
9
+ tags = local . effective_tags
6
10
}
7
11
8
12
resource "aws_db_subnet_group" "rds_postgres_subnet_group" {
9
13
name = var. subnet_group_name
10
14
subnet_ids = var. rds_subnet_ids
15
+ tags = local. effective_tags
11
16
}
12
17
13
18
resource "aws_db_instance" "rds_postgres" {
@@ -41,7 +46,7 @@ resource "aws_db_instance" "rds_postgres" {
41
46
apply_immediately = var. apply_immediately
42
47
43
48
copy_tags_to_snapshot = var. copy_tags_to_snapshot
44
- tags = var . additional_tags
49
+ tags = local . effective_tags
45
50
46
51
lifecycle {
47
52
ignore_changes = [password ]
Original file line number Diff line number Diff line change @@ -104,8 +104,14 @@ variable "copy_tags_to_snapshot" {
104
104
}
105
105
106
106
variable "additional_tags" {
107
- description = " Additional tags to set on the RDS instance"
108
107
type = map (string )
108
+ description = " [DEPRECATED: Use `tags` instead] Additional tags to set on the RDS instance."
109
+ default = {}
110
+ }
111
+
112
+ variable "tags" {
113
+ type = map (string )
114
+ description = " A map of tags to add to all resources. Replaces `additional_tags`."
109
115
default = {}
110
116
}
111
117
You can’t perform that action at this time.
0 commit comments