You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-8Lines changed: 24 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,21 @@ module "db" {
56
56
}
57
57
```
58
58
59
+
## Conditional creation
60
+
61
+
Sometimes you need to have a way to create RDS Aurora resources conditionally but Terraform does not allow to use `count` inside `module` block, so the solution is to specify argument `create_cluster`.
62
+
63
+
```hcl
64
+
# This RDS cluster will not be created
65
+
module "db" {
66
+
source = "terraform-aws-modules/rds-aurora/aws"
67
+
version = "~> 2.0"
68
+
69
+
create_cluster = false
70
+
# ... omitted
71
+
}
72
+
```
73
+
59
74
## Examples
60
75
61
76
-[PostgreSQL](examples/postgresql): A simple example with VPC and PostgreSQL cluster.
@@ -73,16 +88,16 @@ Terraform documentation is generated automatically using [pre-commit hooks](http
73
88
74
89
| Name | Version |
75
90
|------|---------|
76
-
| terraform | >= 0.12.6, < 0.14|
77
-
| aws | >= 2.45, < 4.0|
78
-
| random |~> 2.2 |
91
+
| terraform | >= 0.12.6 |
92
+
| aws | >= 2.45 |
93
+
| random |>= 2.2 |
79
94
80
95
## Providers
81
96
82
97
| Name | Version |
83
98
|------|---------|
84
-
| aws | >= 2.45, < 4.0|
85
-
| random |~> 2.2 |
99
+
| aws | >= 2.45 |
100
+
| random |>= 2.2 |
86
101
87
102
## Inputs
88
103
@@ -96,6 +111,7 @@ Terraform documentation is generated automatically using [pre-commit hooks](http
96
111
| backup\_retention\_period | How long to keep backups for (in days) |`number`|`7`| no |
97
112
| ca\_cert\_identifier | The identifier of the CA certificate for the DB instance |`string`|`"rds-ca-2019"`| no |
98
113
| copy\_tags\_to\_snapshot | Copy all Cluster tags to snapshots. |`bool`|`false`| no |
114
+
| create\_cluster | Controls if RDS cluster should be created (it affects almost all resources) |`bool`|`true`| no |
99
115
| create\_monitoring\_role | Whether to create the IAM role for RDS enhanced monitoring |`bool`|`true`| no |
100
116
| create\_security\_group | Whether to create security group for RDS cluster |`bool`|`true`| no |
101
117
| database\_name | Name for an automatically created database on cluster creation |`string`|`""`| no |
@@ -112,13 +128,13 @@ Terraform documentation is generated automatically using [pre-commit hooks](http
112
128
| global\_cluster\_identifier | The global cluster identifier specified on aws\_rds\_global\_cluster |`string`|`""`| no |
113
129
| iam\_database\_authentication\_enabled | Specifies whether IAM Database authentication should be enabled or not. Not all versions and instances are supported. Refer to the AWS documentation to see which versions are supported. |`bool`|`false`| no |
114
130
| iam\_roles | A List of ARNs for the IAM roles to associate to the RDS Cluster. |`list(string)`|`[]`| no |
115
-
| instance\_type | Instance type to use at master instance. If instance\_type\_replica is not set it will use the same type for replica instances |`string`|n/a|yes|
131
+
| instance\_type | Instance type to use at master instance. If instance\_type\_replica is not set it will use the same type for replica instances |`string`|`""`|no|
116
132
| instance\_type\_replica | Instance type to use at replica instance |`string`|`null`| no |
| kms\_key\_id | The ARN for the KMS encryption key if one is set to the cluster. |`string`|`""`| no |
119
135
| monitoring\_interval | The interval (seconds) between points when Enhanced Monitoring metrics are collected |`number`|`0`| no |
120
136
| monitoring\_role\_arn | IAM role for RDS to send enhanced monitoring metrics to CloudWatch |`string`|`""`| no |
121
-
| name | Name given resources |`string`|n/a|yes|
137
+
| name | Name given resources |`string`|`""`|no|
122
138
| password | Master DB password |`string`|`""`| no |
123
139
| performance\_insights\_enabled | Specifies whether Performance Insights is enabled or not. |`bool`|`false`| no |
124
140
| performance\_insights\_kms\_key\_id | The ARN for the KMS key to encrypt Performance Insights data. |`string`|`""`| no |
@@ -146,7 +162,7 @@ Terraform documentation is generated automatically using [pre-commit hooks](http
146
162
| subnets | List of subnet IDs to use |`list(string)`|`[]`| no |
147
163
| tags | A map of tags to add to all resources. |`map(string)`|`{}`| no |
148
164
| username | Master DB username |`string`|`"root"`| no |
149
-
| vpc\_id | VPC ID |`string`|n/a|yes|
165
+
| vpc\_id | VPC ID |`string`|`""`|no|
150
166
| vpc\_security\_group\_ids | List of VPC security groups to associate to the cluster in addition to the SG we create in this module |`list(string)`|`[]`| no |
0 commit comments