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
{{ message }}
This repository was archived by the owner on Jul 20, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,9 +75,29 @@ The instance will run [init.sh](data/init.sh) to enable NAT as follows:
75
75
76
76
## Configuration
77
77
78
-
### Allow SSH access
78
+
### User data
79
79
80
-
You can log in to the NAT instance from [AWS Systems Manager Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html).
80
+
You can set additional `write_files` and `runcmd` section. For example,
81
+
82
+
```tf
83
+
module "nat" {
84
+
user_data_write_files = [
85
+
{
86
+
path : "/opt/nat/run.sh",
87
+
content : file("./run.sh"),
88
+
permissions : "0755",
89
+
},
90
+
]
91
+
user_data_runcmd = [
92
+
["/opt/nat/run.sh"],
93
+
]
94
+
}
95
+
```
96
+
97
+
See also the [example](example/) for more.
98
+
99
+
100
+
### SSH access
81
101
82
102
You can enable SSH access by setting `key_name` option and opening the security group. For example,
83
103
@@ -127,6 +147,8 @@ No requirements.
127
147
| public\_subnet | ID of the public subnet to place the NAT instance |`string`| n/a | yes |
128
148
| tags | Tags applied to resources created with this module |`map`|`{}`| no |
129
149
| use\_spot\_instance | Whether to use spot or on-demand EC2 instance |`bool`|`true`| no |
150
+
| user\_data\_runcmd | Additional runcmd section of cloud-init |`list`|`[]`| no |
151
+
| user\_data\_write\_files | Additional write\_files section of cloud-init |`list`|`[]`| no |
0 commit comments