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
+11-13
Original file line number
Diff line number
Diff line change
@@ -58,11 +58,11 @@ This AWS PostgreSQL database terraform module requires these input variables.
58
58
59
59
| Input Variable | Type | Comment |
60
60
|:-------- |:---- |:------- |
61
-
**in_database_name** | String | **alphanumeric only name** to give the new database and it must start with a letter - note that providing a different name causes terraform to create a different database
62
-
**in_clone_snapshot** | Boolean | if true the in_id_of_db_to_clone must be provided and will cause the database to be created from the last available snapshot of the specified database
63
-
**in_id_of_db_to_clone** | String | this ID must be provided if **`in_clone_snapshot`** is true causing the database to be created from the last available snapshot
64
-
**in_security_group_id** | String | the security group that will constrain traffic to and from the database
65
-
**in_db_subnet_ids** | List | list of private subnet IDs in at least two availability zones (see example) for housing database instances
61
+
**`in_database_name`** | String | **alphanumeric only name** to give the new database and it must start with a letter - note that providing a different name causes terraform to create a different database
62
+
**`in_clone_snapshot`** | Boolean | if true the in_id_of_db_to_clone must be provided and will cause the database to be created from the last available snapshot of the specified database
63
+
**`in_id_of_db_to_clone`** | String | this ID must be provided if **`in_clone_snapshot`** is true causing the database to be created from the last available snapshot
64
+
**`in_security_group_id`** | String | the security group that will constrain traffic to and from the database
65
+
**`in_db_subnet_ids`** | List | list of private subnet IDs in at least two availability zones (see example) for housing database instances
66
66
67
67
68
68
### Resource Tag Inputs
@@ -84,11 +84,9 @@ $ export TF_VAR_in_description="was created by $USER@$HOSTNAME on $(date)."
84
84
85
85
## Outputs
86
86
87
-
| Output Variable | Type | Comment |
88
-
|:------------------------ |:------ |:------- |
89
-
**out_database_username** | String | The first database username prefixed with user_rw_ followed by randomized characters.
90
-
**out_database_password** | String | Robust terraform created 48 character password that includes the allowed special characters
91
-
**out_clone_db_hostname** | String | The addressable hostname of the database that has been cloned from a snapshot
92
-
**out_clone_db_endpoint** | String | The database endpoint with protool suffix of the database that has been cloned from a snapshot
93
-
**out_fresh_db_hostname** | String | The addressable hostname of the newly created (fresh) database
94
-
**out_fresh_db_endpoint** | String | The database endpoint with protool suffix of the newly created (fresh) database
87
+
| Output Variable | Type | Comment |
88
+
|:-------------------------- |:------ |:------- |
89
+
**`out_database_username`** | String | The first database username prefixed with user_rw_ followed by randomized characters.
90
+
**`out_database_password`** | String | Robust terraform created 48 character password that includes the allowed special characters
91
+
**`out_clone_db_hostname`** | String | The addressable hostname of the database that has been cloned from a snapshot
92
+
**`out_fresh_db_hostname`** | String | The addressable hostname of the newly created (fresh) database
sudo ls -lah /var/lib/docker/volumes/vol.postgres.tfstate/_data
19
+
```
20
+
21
+
**verify** - when you list the files in the container you will see the terraform module's contents there.
22
+
23
+
24
+
### Step 2 | terraform init via docker
25
+
26
+
As our volume contains the terraform module code from git we are now ready to perform a terraform init. We use the **[devops4me/terraform container](https://cloud.docker.com/repository/docker/devops4me/terraform/general)** container which adds a VOLUME mapping to the **[hashicorp/terraform](https://hub.docker.com/r/hashicorp/terraform/)** container at the **`/terraform-work`** location.
27
+
28
+
```
29
+
docker run --interactive \
30
+
--tty \
31
+
--rm \
32
+
--name vm.terraform \
33
+
--volume vol.postgres.tfstate:/terraform-work \
34
+
devops4me/terraform init example
35
+
sudo ls -lah /var/lib/docker/volumes/vol.postgres.tfstate/_data
36
+
```
37
+
38
+
**verify** - the directory listing now contains a **`.terraform`** directory.
39
+
40
+
41
+
42
+
### Step 3 | terraform apply via docker
43
+
44
+
At last we can run the terraform apply. Provide a **role arn** only if your organization works with roles alongside the other 3 AWS authentication keys.
0 commit comments