Skip to content

Commit bd85174

Browse files
committed
chore: Stash WIP
1 parent 9462b7e commit bd85174

File tree

13 files changed

+78
-229
lines changed

13 files changed

+78
-229
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,7 @@ No modules.
255255
| [aws_rds_cluster_parameter_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_parameter_group) | resource |
256256
| [aws_rds_cluster_role_association.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_role_association) | resource |
257257
| [aws_security_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
258-
| [aws_security_group_rule.cidr_ingress](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
259-
| [aws_security_group_rule.default_ingress](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
260-
| [aws_security_group_rule.egress](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
258+
| [aws_security_group_rule.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
261259
| [random_id.snapshot_identifier](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
262260
| [random_password.master_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |
263261
| [aws_iam_policy_document.monitoring_rds_assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
@@ -269,8 +267,6 @@ No modules.
269267
|------|-------------|------|---------|:--------:|
270268
| <a name="input_allocated_storage"></a> [allocated\_storage](#input\_allocated\_storage) | The amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster. (This setting is required to create a Multi-AZ DB cluster) | `number` | `null` | no |
271269
| <a name="input_allow_major_version_upgrade"></a> [allow\_major\_version\_upgrade](#input\_allow\_major\_version\_upgrade) | Enable to allow major engine version upgrades when changing engine versions. Defaults to `false` | `bool` | `false` | no |
272-
| <a name="input_allowed_cidr_blocks"></a> [allowed\_cidr\_blocks](#input\_allowed\_cidr\_blocks) | A list of CIDR blocks which are allowed to access the database | `list(string)` | `[]` | no |
273-
| <a name="input_allowed_security_groups"></a> [allowed\_security\_groups](#input\_allowed\_security\_groups) | A list of Security Group ID's to allow access to | `list(string)` | `[]` | no |
274270
| <a name="input_apply_immediately"></a> [apply\_immediately](#input\_apply\_immediately) | Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is `false` | `bool` | `null` | no |
275271
| <a name="input_auto_minor_version_upgrade"></a> [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true` | `bool` | `null` | no |
276272
| <a name="input_autoscaling_enabled"></a> [autoscaling\_enabled](#input\_autoscaling\_enabled) | Determines whether autoscaling of the cluster read replicas is enabled | `bool` | `false` | no |
@@ -293,7 +289,7 @@ No modules.
293289
| <a name="input_create_cluster"></a> [create\_cluster](#input\_create\_cluster) | Whether cluster should be created (affects nearly all resources) | `bool` | `true` | no |
294290
| <a name="input_create_db_cluster_parameter_group"></a> [create\_db\_cluster\_parameter\_group](#input\_create\_db\_cluster\_parameter\_group) | Determines whether a cluster parameter should be created or use existing | `bool` | `false` | no |
295291
| <a name="input_create_db_parameter_group"></a> [create\_db\_parameter\_group](#input\_create\_db\_parameter\_group) | Determines whether a DB parameter should be created or use existing | `bool` | `false` | no |
296-
| <a name="input_create_db_subnet_group"></a> [create\_db\_subnet\_group](#input\_create\_db\_subnet\_group) | Determines whether to create the database subnet group or use existing | `bool` | `true` | no |
292+
| <a name="input_create_db_subnet_group"></a> [create\_db\_subnet\_group](#input\_create\_db\_subnet\_group) | Determines whether to create the database subnet group or use existing | `bool` | `false` | no |
297293
| <a name="input_create_monitoring_role"></a> [create\_monitoring\_role](#input\_create\_monitoring\_role) | Determines whether to create the IAM role for RDS enhanced monitoring | `bool` | `true` | no |
298294
| <a name="input_create_random_password"></a> [create\_random\_password](#input\_create\_random\_password) | Determines whether to create random password for RDS primary cluster | `bool` | `true` | no |
299295
| <a name="input_create_security_group"></a> [create\_security\_group](#input\_create\_security\_group) | Determines whether to create security group for RDS cluster | `bool` | `true` | no |
@@ -359,8 +355,7 @@ No modules.
359355
| <a name="input_s3_import"></a> [s3\_import](#input\_s3\_import) | Configuration map used to restore from a Percona Xtrabackup in S3 (only MySQL is supported) | `map(string)` | `{}` | no |
360356
| <a name="input_scaling_configuration"></a> [scaling\_configuration](#input\_scaling\_configuration) | Map of nested attributes with scaling properties. Only valid when `engine_mode` is set to `serverless` | `map(string)` | `{}` | no |
361357
| <a name="input_security_group_description"></a> [security\_group\_description](#input\_security\_group\_description) | The description of the security group. If value is set to empty string it will contain cluster name in the description | `string` | `null` | no |
362-
| <a name="input_security_group_egress_rules"></a> [security\_group\_egress\_rules](#input\_security\_group\_egress\_rules) | A map of security group egress rule definitions to add to the security group created | `map(any)` | `{}` | no |
363-
| <a name="input_security_group_tags"></a> [security\_group\_tags](#input\_security\_group\_tags) | Additional tags for the security group | `map(string)` | `{}` | no |
358+
| <a name="input_security_group_rules"></a> [security\_group\_rules](#input\_security\_group\_rules) | Map of security group rules to add to the cluster security group created | `any` | `{}` | no |
364359
| <a name="input_security_group_use_name_prefix"></a> [security\_group\_use\_name\_prefix](#input\_security\_group\_use\_name\_prefix) | Determines whether the security group name (`name`) is used as a prefix | `bool` | `true` | no |
365360
| <a name="input_serverlessv2_scaling_configuration"></a> [serverlessv2\_scaling\_configuration](#input\_serverlessv2\_scaling\_configuration) | Map of nested attributes with serverless v2 scaling properties. Only valid when `engine_mode` is set to `provisioned` | `map(string)` | `{}` | no |
366361
| <a name="input_skip_final_snapshot"></a> [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final snapshot is created before the cluster is deleted. If true is specified, no snapshot is created | `bool` | `false` | no |

examples/autoscaling/README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ Note that this example may create resources which cost money. Run `terraform des
2424

2525
## Providers
2626

27-
| Name | Version |
28-
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.30 |
27+
No providers.
3028

3129
## Modules
3230

@@ -38,10 +36,7 @@ Note that this example may create resources which cost money. Run `terraform des
3836

3937
## Resources
4038

41-
| Name | Type |
42-
|------|------|
43-
| [aws_db_parameter_group.example](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |
44-
| [aws_rds_cluster_parameter_group.example](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_parameter_group) | resource |
39+
No resources.
4540

4641
## Inputs
4742

examples/autoscaling/main.tf

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ module "aurora" {
2626
instance_class = "db.r6g.large"
2727
instances = { 1 = {} }
2828

29-
vpc_id = module.vpc.vpc_id
30-
db_subnet_group_name = module.vpc.database_subnet_group_name
31-
create_db_subnet_group = false
32-
create_security_group = true
33-
allowed_cidr_blocks = module.vpc.private_subnets_cidr_blocks
29+
vpc_id = module.vpc.vpc_id
30+
db_subnet_group_name = module.vpc.database_subnet_group_name
31+
security_group_rules = {
32+
vpc_ingress = {
33+
cidr_blocks = module.vpc.private_subnets_cidr_blocks
34+
}
35+
}
3436

3537
autoscaling_enabled = true
3638
autoscaling_min_capacity = 1
@@ -46,27 +48,11 @@ module "aurora" {
4648
apply_immediately = true
4749
skip_final_snapshot = true
4850

49-
db_parameter_group_name = aws_db_parameter_group.example.id
50-
db_cluster_parameter_group_name = aws_rds_cluster_parameter_group.example.id
5151
enabled_cloudwatch_logs_exports = ["postgresql"]
5252

5353
tags = local.tags
5454
}
5555

56-
resource "aws_db_parameter_group" "example" {
57-
name_prefix = "${local.name}-aurora-db-postgres11-parameter-group"
58-
family = "aurora-postgresql11"
59-
description = "${local.name}-aurora-db-postgres11-parameter-group"
60-
tags = local.tags
61-
}
62-
63-
resource "aws_rds_cluster_parameter_group" "example" {
64-
name_prefix = "${local.name}-aurora-postgres11-cluster-parameter-group"
65-
family = "aurora-postgresql11"
66-
description = "${local.name}-aurora-postgres11-cluster-parameter-group"
67-
tags = local.tags
68-
}
69-
7056
module "disabled_aurora" {
7157
source = "../../"
7258

examples/global-cluster/main.tf

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ module "aurora_primary" {
5252
instances = { for i in range(2) : i => {} }
5353
kms_key_id = aws_kms_key.primary.arn
5454

55-
vpc_id = module.primary_vpc.vpc_id
56-
db_subnet_group_name = module.primary_vpc.database_subnet_group_name
57-
create_db_subnet_group = false
58-
create_security_group = true
59-
allowed_cidr_blocks = module.primary_vpc.private_subnets_cidr_blocks
55+
vpc_id = module.primary_vpc.vpc_id
56+
db_subnet_group_name = module.primary_vpc.database_subnet_group_name
57+
allowed_cidr_blocks = module.primary_vpc.private_subnets_cidr_blocks
6058

6159
skip_final_snapshot = true
6260

@@ -79,11 +77,9 @@ module "aurora_secondary" {
7977
instances = { for i in range(2) : i => {} }
8078
kms_key_id = aws_kms_key.secondary.arn
8179

82-
vpc_id = module.secondary_vpc.vpc_id
83-
db_subnet_group_name = module.secondary_vpc.database_subnet_group_name
84-
create_db_subnet_group = false
85-
create_security_group = true
86-
allowed_cidr_blocks = module.secondary_vpc.private_subnets_cidr_blocks
80+
vpc_id = module.secondary_vpc.vpc_id
81+
db_subnet_group_name = module.secondary_vpc.database_subnet_group_name
82+
allowed_cidr_blocks = module.secondary_vpc.private_subnets_cidr_blocks
8783

8884
skip_final_snapshot = true
8985

examples/multi-az/main.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ module "aurora" {
2424
engine = "postgres" # This uses RDS, not Aurora
2525
engine_version = "13.7"
2626

27-
vpc_id = module.vpc.vpc_id
28-
subnets = module.vpc.private_subnets
27+
vpc_id = module.vpc.vpc_id
28+
db_subnet_group_name = module.vpc.database_subnet_group_name
2929

3030
create_db_cluster_parameter_group = true
3131
db_cluster_parameter_group_family = "postgres13"
@@ -60,8 +60,7 @@ module "vpc" {
6060
private_subnets = ["10.99.3.0/24", "10.99.4.0/24", "10.99.5.0/24"]
6161
database_subnets = ["10.99.7.0/24", "10.99.8.0/24", "10.99.9.0/24"]
6262

63-
create_database_subnet_group = false
64-
enable_nat_gateway = false # Disabled NAT to be able to run this example quicker
63+
enable_nat_gateway = false # Disabled NAT to be able to run this example quicker
6564

6665
tags = local.tags
6766
}

examples/mysql/main.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ module "aurora" {
3939
}
4040
}
4141

42-
vpc_id = module.vpc.vpc_id
43-
db_subnet_group_name = module.vpc.database_subnet_group_name
44-
create_db_subnet_group = false
45-
create_security_group = true
46-
allowed_cidr_blocks = module.vpc.private_subnets_cidr_blocks
42+
vpc_id = module.vpc.vpc_id
43+
db_subnet_group_name = module.vpc.database_subnet_group_name
44+
security_group_rules = {
45+
vpc_ingress = {
46+
cidr_blocks = module.vpc.private_subnets_cidr_blocks
47+
}
48+
}
4749

4850
iam_database_authentication_enabled = true
4951
master_password = random_password.master.result

examples/postgresql/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ module "aurora" {
5454
}
5555
}
5656

57-
vpc_id = module.vpc.vpc_id
58-
db_subnet_group_name = module.vpc.database_subnet_group_name
59-
create_db_subnet_group = false
60-
create_security_group = true
61-
allowed_cidr_blocks = module.vpc.private_subnets_cidr_blocks
62-
security_group_egress_rules = {
63-
to_cidrs = {
57+
vpc_id = module.vpc.vpc_id
58+
db_subnet_group_name = module.vpc.database_subnet_group_name
59+
security_group_rules = {
60+
vpc_ingress = {
61+
cidr_blocks = module.vpc.private_subnets_cidr_blocks
62+
}
63+
egress_example = {
6464
cidr_blocks = ["10.33.0.0/28"]
6565
description = "Egress to corporate printer closet"
6666
}

examples/s3-import/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ Note that this example may create resources which cost money. Run `terraform des
7171

7272
| Name | Type |
7373
|------|------|
74-
| [aws_db_parameter_group.example](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |
7574
| [aws_iam_role.s3_import](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
7675
| [aws_iam_role_policy.s3_import](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
77-
| [aws_rds_cluster_parameter_group.example](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_parameter_group) | resource |
7876
| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource |
7977
| [aws_iam_policy_document.s3_import](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
8078
| [aws_iam_policy_document.s3_import_assume](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |

examples/s3-import/main.tf

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ module "aurora" {
2626
instance_class = "db.r5.large"
2727
instances = { 1 = {} }
2828

29-
vpc_id = module.vpc.vpc_id
30-
db_subnet_group_name = module.vpc.database_subnet_group_name
31-
create_db_subnet_group = false
32-
create_security_group = true
33-
allowed_cidr_blocks = module.vpc.private_subnets_cidr_blocks
29+
vpc_id = module.vpc.vpc_id
30+
db_subnet_group_name = module.vpc.database_subnet_group_name
31+
security_group_rules = {
32+
vpc_ingress = {
33+
cidr_blocks = module.vpc.private_subnets_cidr_blocks
34+
}
35+
}
3436

3537
iam_roles = {
3638
s3_import = {
@@ -48,27 +50,11 @@ module "aurora" {
4850

4951
skip_final_snapshot = true
5052

51-
db_parameter_group_name = aws_db_parameter_group.example.id
52-
db_cluster_parameter_group_name = aws_rds_cluster_parameter_group.example.id
5353
enabled_cloudwatch_logs_exports = ["audit", "error", "general", "slowquery"]
5454

5555
tags = local.tags
5656
}
5757

58-
resource "aws_db_parameter_group" "example" {
59-
name = "${local.name}-aurora-db-57-parameter-group"
60-
family = "aurora-mysql5.7"
61-
description = "${local.name}-aurora-db-57-parameter-group"
62-
tags = local.tags
63-
}
64-
65-
resource "aws_rds_cluster_parameter_group" "example" {
66-
name = "${local.name}-aurora-57-cluster-parameter-group"
67-
family = "aurora-mysql5.7"
68-
description = "${local.name}-aurora-57-cluster-parameter-group"
69-
tags = local.tags
70-
}
71-
7258
################################################################################
7359
# Supporting Resources
7460
################################################################################

examples/serverless/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ Note that this example may create resources which cost money. Run `terraform des
4242

4343
| Name | Type |
4444
|------|------|
45-
| [aws_db_parameter_group.example_mysql](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |
46-
| [aws_db_parameter_group.example_mysql8](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |
47-
| [aws_db_parameter_group.example_postgresql](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |
48-
| [aws_db_parameter_group.example_postgresql13](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |
49-
| [aws_rds_cluster_parameter_group.example_mysql](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_parameter_group) | resource |
50-
| [aws_rds_cluster_parameter_group.example_mysql8](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_parameter_group) | resource |
51-
| [aws_rds_cluster_parameter_group.example_postgresql](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_parameter_group) | resource |
52-
| [aws_rds_cluster_parameter_group.example_postgresql13](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_parameter_group) | resource |
5345
| [aws_rds_engine_version.postgresql](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/rds_engine_version) | data source |
5446

5547
## Inputs

0 commit comments

Comments
 (0)