Skip to content

Commit 3eecf04

Browse files
committed
Cleanup fomratting
1 parent 47f291c commit 3eecf04

File tree

7 files changed

+142
-142
lines changed

7 files changed

+142
-142
lines changed

examples/minimal/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module "rds_postgres" {
2-
source = "git::https://github.com/Datatamer/terraform-rds-postgres.git?ref=0.1.0"
3-
postgres_name = "example_rds_postgres"
2+
source = "git::https://github.com/Datatamer/terraform-rds-postgres.git?ref=0.1.0"
3+
postgres_name = "example_rds_postgres"
44
parameter_group_name = "example-rds-postgres-pg"
5-
identifier_prefix = "example-rds-"
5+
identifier_prefix = "example-rds-"
66

77
username = "exampleUsername"
88
password = "examplePassword"
99

10-
subnet_name = "example_subnet"
10+
subnet_name = "example_subnet"
1111
spark_cluster_sg_ids = ["sg-examplesecuritygroup1", "sg-examplesecuritygroup2"]
12-
tamr_vm_sg_id = "sg-exampletamrsecuritygroup"
13-
vpc_id = "vpc-examplevpcnetworkid"
12+
tamr_vm_sg_id = "sg-exampletamrsecuritygroup"
13+
vpc_id = "vpc-examplevpcnetworkid"
1414
}

examples/minimal/variables.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
variable "postgres_db_name" {
2-
type = string
2+
type = string
33
description = "Name of the postgres db"
44
}
55

66
variable "parameter_group_name" {
7-
type = string
7+
type = string
88
description = "Name of the parameter group"
99
}
1010

1111
variable "identifier_prefix" {
12-
type = string
12+
type = string
1313
description = "Identifier prefix for the resources"
1414
}
1515

1616
variable "pg_username" {
17-
type = string
17+
type = string
1818
description = "Username for postgres"
1919
}
2020

2121
variable "pg_password" {
22-
type = string
22+
type = string
2323
description = "Password for postgres"
2424
}
2525

main.tf

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
resource "aws_db_parameter_group" "rds_postgres_pg" {
2-
name = var.parameter_group_name
3-
family = "postgres9.6"
4-
description = "TAMR RDS parameter group"
5-
tags = var.additional_tags
2+
name = var.parameter_group_name
3+
family = "postgres9.6"
4+
description = "TAMR RDS parameter group"
5+
tags = var.additional_tags
66
}
77

88
module "rds_sg" {
9-
source = "./modules/rds-postgres-sg"
10-
spark_cluster_sg_ids = var.spark_cluster_sg_ids
11-
tamr_vm_sg_id = var.tamr_vm_sg_id
12-
vpc_id = var.vpc_id
13-
security_group_name = var.security_group_name
14-
additional_cidrs = var.additional_cidrs
15-
additional_tags = var.additional_tags
9+
source = "./modules/rds-postgres-sg"
10+
spark_cluster_sg_ids = var.spark_cluster_sg_ids
11+
tamr_vm_sg_id = var.tamr_vm_sg_id
12+
vpc_id = var.vpc_id
13+
security_group_name = var.security_group_name
14+
additional_cidrs = var.additional_cidrs
15+
additional_tags = var.additional_tags
1616
}
1717

1818
resource "aws_db_instance" "rds_postgres" {
19-
name = var.postgres_name
19+
name = var.postgres_name
2020

21-
identifier_prefix = var.identifier_prefix
22-
allocated_storage = var.allocated_storage
23-
max_allocated_storage = var.max_allocated_storage
24-
storage_type = var.storage_type
25-
storage_encrypted = true
21+
identifier_prefix = var.identifier_prefix
22+
allocated_storage = var.allocated_storage
23+
max_allocated_storage = var.max_allocated_storage
24+
storage_type = var.storage_type
25+
storage_encrypted = true
2626

27-
engine = "postgres"
28-
engine_version = "9.6"
29-
instance_class = var.instance_class
27+
engine = "postgres"
28+
engine_version = "9.6"
29+
instance_class = var.instance_class
3030

31-
username = var.username
32-
password = var.password
31+
username = var.username
32+
password = var.password
3333

34-
db_subnet_group_name = var.subnet_name
35-
multi_az = true
36-
publicly_accessible = false
37-
vpc_security_group_ids = [module.rds_sg.rds_sg_id]
38-
parameter_group_name = aws_db_parameter_group.rds_postgres_pg.name
34+
db_subnet_group_name = var.subnet_name
35+
multi_az = true
36+
publicly_accessible = false
37+
vpc_security_group_ids = [module.rds_sg.rds_sg_id]
38+
parameter_group_name = aws_db_parameter_group.rds_postgres_pg.name
3939

40-
maintenance_window = var.maintenance_window
41-
backup_window = var.backup_window
42-
backup_retention_period = var.backup_retention_period
43-
skip_final_snapshot = var.skip_final_snapshot
40+
maintenance_window = var.maintenance_window
41+
backup_window = var.backup_window
42+
backup_retention_period = var.backup_retention_period
43+
skip_final_snapshot = var.skip_final_snapshot
4444

45-
apply_immediately = var.apply_immediately
45+
apply_immediately = var.apply_immediately
4646

47-
copy_tags_to_snapshot = var.copy_tags_to_snapshot
48-
tags = var.additional_tags
47+
copy_tags_to_snapshot = var.copy_tags_to_snapshot
48+
tags = var.additional_tags
4949

50-
lifecycle {
51-
ignore_changes = [password]
52-
}
50+
lifecycle {
51+
ignore_changes = [password]
52+
}
5353
}

modules/rds-postgres-sg/main.tf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
resource "aws_security_group" "rds_postgres_sg" {
2-
name = var.security_group_name
2+
name = var.security_group_name
33
description = "VPC Security group that will be attached to the RDS Postgres instance"
4-
vpc_id = var.vpc_id
5-
tags = var.additional_tags
4+
vpc_id = var.vpc_id
5+
tags = var.additional_tags
66
}
77

88
resource "aws_security_group_rule" "tamr_vm" {
9-
from_port = 5432
10-
protocol = "tcp"
11-
security_group_id = aws_security_group.rds_postgres_sg.id
12-
to_port = 5432
13-
type = "ingress"
9+
from_port = 5432
10+
protocol = "tcp"
11+
security_group_id = aws_security_group.rds_postgres_sg.id
12+
to_port = 5432
13+
type = "ingress"
1414
source_security_group_id = var.tamr_vm_sg_id
1515
}
1616

1717
resource "aws_security_group_rule" "spark_cluster" {
18-
count = length(var.spark_cluster_sg_ids)
19-
from_port = 5432
20-
protocol = "tcp"
21-
security_group_id = aws_security_group.rds_postgres_sg.id
22-
to_port = 5432
23-
type = "ingress"
18+
count = length(var.spark_cluster_sg_ids)
19+
from_port = 5432
20+
protocol = "tcp"
21+
security_group_id = aws_security_group.rds_postgres_sg.id
22+
to_port = 5432
23+
type = "ingress"
2424
source_security_group_id = var.spark_cluster_sg_ids[count.index]
2525
}
2626

2727
resource "aws_security_group_rule" "additional_cidrs" {
28-
count = length(var.additional_cidrs) == 0 ? 0 : 1
29-
from_port = 5432
30-
protocol = "tcp"
28+
count = length(var.additional_cidrs) == 0 ? 0 : 1
29+
from_port = 5432
30+
protocol = "tcp"
3131
security_group_id = aws_security_group.rds_postgres_sg.id
32-
to_port = 5432
33-
type = "ingress"
34-
cidr_blocks = var.additional_cidrs
32+
to_port = 5432
33+
type = "ingress"
34+
cidr_blocks = var.additional_cidrs
3535
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
variable "security_group_name" {
22
description = "Name for the security group for the rds instance"
3-
type = string
4-
default = "tamr_rds_sg"
3+
type = string
4+
default = "tamr_rds_sg"
55
}
66

77
variable "tamr_vm_sg_id" {
88
description = "Security group id attached to the tamr vm"
9-
type = string
9+
type = string
1010
}
1111

1212
variable "spark_cluster_sg_ids" {
1313
description = "List of Security groups attached to the ec2 instances of EMR Spark"
14-
type = list(string)
14+
type = list(string)
1515
}
1616

1717
variable "vpc_id" {
1818
description = "VPC ID for the rds security group"
19-
type = string
19+
type = string
2020
}
2121

2222
variable "additional_cidrs" {
2323
description = "Additional CIDR to connect to RDS Postgres instance"
24-
type = list(string)
25-
default = []
24+
type = list(string)
25+
default = []
2626
}
2727

2828
variable "additional_tags" {
2929
description = "Additional tags to set on the RDS instance"
30-
type = map
31-
default = {}
30+
type = map
31+
default = {}
3232
}

outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
output "rds_postgres_pg_id" {
2-
value = aws_db_parameter_group.rds_postgres_pg.id
2+
value = aws_db_parameter_group.rds_postgres_pg.id
33
description = "ID of the RDS postgres parameter group"
44
}
55

66
output "rds_postgres_id" {
7-
value = aws_db_instance.rds_postgres.id
7+
value = aws_db_instance.rds_postgres.id
88
description = "ID of the of the RDS instance"
99
}
1010

1111
output "rds_sg_id" {
12-
value = module.rds_sg.rds_sg_id
12+
value = module.rds_sg.rds_sg_id
1313
description = "ID of the security group attached to the rds instance"
1414
}
1515

0 commit comments

Comments
 (0)