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
This is a Terraform Module to create a simple, autoscaled [Tailscale Subnet Router](https://tailscale.com/kb/1019/subnets/) on EC2 instance along with generated auth key, and its corresponding IAM resources. The instance should cycle itself on a schedule.
9
6
10
7
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
@@ -46,7 +43,6 @@ Here is an example of using this module:
| <aname="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map)| Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. |`map(string)`|`{}`| no |
70
-
| <aname="input_advertise_routes"></a> [advertise\_routes](#input\_advertise\_routes)| The routes (expressed as CIDRs) to advertise as part of the Tailscale Subnet Router. e.g. [ '10.0.2.0/24', '10.0.1.0/24]|`list(string)`|`[]`| no |
71
-
| <aname="input_ami"></a> [ami](#input\_ami)| The AMI to use for the Tailscale Subnet Router EC2 instance.If not provided, the latest Amazon Linux 2 AMI will be used.Note: This will update periodically as AWS releases updates to their AL2 AMI. Pin to a specific AMI if you would like to avoid these updates. |`string`|`""`| no |
65
+
| <aname="input_advertise_routes"></a> [advertise\_routes](#input\_advertise\_routes)| The routes (expressed as CIDRs) to advertise as part of the Tailscale Subnet Router.<br> Example: ["10.0.2.0/24", "0.0.1.0/24"]|`list(string)`|`[]`| no |
66
+
| <aname="input_ami"></a> [ami](#input\_ami)| The AMI to use for the Tailscale Subnet Router EC2 instance.<br> If not provided, the latest Amazon Linux 2 AMI will be used.<br> Note: This will update periodically as AWS releases updates to their AL2 AMI.<br> Pin to a specific AMI if you would like to avoid these updates. |`string`|`""`| no |
72
67
| <aname="input_attributes"></a> [attributes](#input\_attributes)| ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. |`list(string)`|`[]`| no |
73
68
| <aname="input_context"></a> [context](#input\_context)| Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. |`any`| <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "descriptor_formats": {},<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "labels_as_tags": [<br> "unset"<br> ],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {},<br> "tenant": null<br>}</pre> | no |
74
69
| <aname="input_create_run_shell_document"></a> [create\_run\_shell\_document](#input\_create\_run\_shell\_document)| Whether or not to create the SSM-SessionManagerRunShell SSM Document. |`bool`|`true`| no |
@@ -79,7 +74,7 @@ Here is an example of using this module:
79
74
| <aname="input_ephemeral"></a> [ephemeral](#input\_ephemeral)| Indicates if the key is ephemeral. |`bool`|`false`| no |
80
75
| <aname="input_expiry"></a> [expiry](#input\_expiry)| The expiry of the auth key in seconds. |`number`|`7776000`| no |
81
76
| <aname="input_id_length_limit"></a> [id\_length\_limit](#input\_id\_length\_limit)| Limit `id` to this many characters (minimum 6).<br>Set to `0` for unlimited length.<br>Set to `null` for keep the existing setting, which defaults to `0`.<br>Does not affect `id_full`. |`number`|`null`| no |
82
-
| <aname="input_instance_count"></a> [instance\_count](#input\_instance\_count)| The number of Tailscale Subnet Router EC2 instances you would like to deploy. |`number`|`1`| no |
77
+
| <aname="input_instance_count"></a> [instance\_count](#input\_instance\_count)| The number of Tailscale Subnet Router EC2 instances you would like to deploy. |`number`|`1`| no |
83
78
| <aname="input_instance_type"></a> [instance\_type](#input\_instance\_type)| The instance type to use for the Tailscale Subnet Router EC2 instance. |`string`|`"t3.nano"`| no |
84
79
| <aname="input_key_pair_name"></a> [key\_pair\_name](#input\_key\_pair\_name)| The name of the key-pair to associate with the Tailscale Subnet Router EC2 instance. |`string`|`null`| no |
85
80
| <aname="input_label_key_case"></a> [label\_key\_case](#input\_label\_key\_case)| Controls the letter case of the `tags` keys (label names) for tags generated by this module.<br>Does not affect keys of tags passed in via the `tags` input.<br>Possible values: `lower`, `title`, `upper`.<br>Default value: `title`. |`string`|`null`| no |
@@ -91,14 +86,14 @@ Here is an example of using this module:
91
86
| <aname="input_preauthorized"></a> [preauthorized](#input\_preauthorized)| Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default. |`bool`|`true`| no |
92
87
| <aname="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars)| Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. |`string`|`null`| no |
93
88
| <aname="input_reusable"></a> [reusable](#input\_reusable)| Indicates if the key is reusable or single-use. |`bool`|`true`| no |
94
-
| <aname="input_session_logging_enabled"></a> [session\_logging\_enabled](#input\_session\_logging\_enabled)| To enable CloudWatch and S3 session logging or not. Note this does not apply to SSH sessions as AWS cannot log those sessions. |`bool`|`true`| no |
95
-
| <aname="input_session_logging_kms_key_alias"></a> [session\_logging\_kms\_key\_alias](#input\_session\_logging\_kms\_key\_alias)| Alias name for `session_logging` KMS Key.This is only applied if 2 conditions are met: (1) `session_logging_kms_key_arn` is unset, (2) `session_logging_encryption_enabled` = true. |`string`|`"alias/session_logging"`| no |
96
-
| <aname="input_session_logging_ssm_document_name"></a> [session\_logging\_ssm\_document\_name](#input\_session\_logging\_ssm\_document\_name)| Name for `session_logging` SSM document.This is only applied if 2 conditions are met: (1) `session_logging_enabled` = true, (2) `create_run_shell_document` = true. |`string`|`"SSM-SessionManagerRunShell-Tailscale"`| no |
89
+
| <aname="input_session_logging_enabled"></a> [session\_logging\_enabled](#input\_session\_logging\_enabled)| To enable CloudWatch and S3 session logging or not.<br> Note this does not apply to SSH sessions as AWS cannot log those sessions. |`bool`|`true`| no |
90
+
| <aname="input_session_logging_kms_key_alias"></a> [session\_logging\_kms\_key\_alias](#input\_session\_logging\_kms\_key\_alias)| Alias name for `session_logging` KMS Key.<br> This is only applied if 2 conditions are met: (1) `session_logging_kms_key_arn` is unset,<br> (2) `session_logging_encryption_enabled` = true. |`string`|`"alias/session_logging"`| no |
91
+
| <aname="input_session_logging_ssm_document_name"></a> [session\_logging\_ssm\_document\_name](#input\_session\_logging\_ssm\_document\_name)| Name for `session_logging` SSM document.<br> This is only applied if 2 conditions are met: (1) `session_logging_enabled` = true,<br> (2) `create_run_shell_document` = true. |`string`|`"SSM-SessionManagerRunShell-Tailscale"`| no |
97
92
| <aname="input_stage"></a> [stage](#input\_stage)| ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' |`string`|`null`| no |
98
93
| <aname="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids)| The Subnet IDs which the Tailscale Subnet Router EC2 instance will run in. These *should* be private subnets. |`list(string)`| n/a | yes |
99
94
| <aname="input_tags"></a> [tags](#input\_tags)| Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. |`map(string)`|`{}`| no |
100
95
| <aname="input_tenant"></a> [tenant](#input\_tenant)| ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for |`string`|`null`| no |
101
-
| <aname="input_user_data"></a> [user\_data](#input\_user\_data)| The user\_data to use for the Tailscale Subnet Router EC2 instance. You can use this to automate installation of all the required command line tools. |`string`|`""`| no |
96
+
| <aname="input_user_data"></a> [user\_data](#input\_user\_data)| The user\_data to use for the Tailscale Subnet Router EC2 instance.<br> You can use this to automate installation of all the required command line tools. |`string`|`""`| no |
102
97
| <aname="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id)| The ID of the VPC which the Tailscale Subnet Router EC2 instance will run in. |`string`| n/a | yes |
description="To enable CloudWatch and S3 session logging or not. Note this does not apply to SSH sessions as AWS cannot log those sessions."
24
+
description=<<EOF
25
+
To enable CloudWatch and S3 session logging or not.
26
+
Note this does not apply to SSH sessions as AWS cannot log those sessions.
27
+
EOF
25
28
}
26
29
27
30
variable"session_logging_kms_key_alias" {
28
31
default="alias/session_logging"
29
32
type=string
30
-
description="Alias name for `session_logging` KMS Key. This is only applied if 2 conditions are met: (1) `session_logging_kms_key_arn` is unset, (2) `session_logging_encryption_enabled` = true."
33
+
description=<<EOF
34
+
Alias name for `session_logging` KMS Key.
35
+
This is only applied if 2 conditions are met: (1) `session_logging_kms_key_arn` is unset,
36
+
(2) `session_logging_encryption_enabled` = true.
37
+
EOF
31
38
}
32
39
33
40
34
41
variable"session_logging_ssm_document_name" {
35
42
default="SSM-SessionManagerRunShell-Tailscale"
36
43
type=string
37
-
description="Name for `session_logging` SSM document. This is only applied if 2 conditions are met: (1) `session_logging_enabled` = true, (2) `create_run_shell_document` = true."
44
+
description=<<EOF
45
+
Name for `session_logging` SSM document.
46
+
This is only applied if 2 conditions are met: (1) `session_logging_enabled` = true,
47
+
(2) `create_run_shell_document` = true.
48
+
EOF
38
49
}
39
50
40
51
variable"key_pair_name" {
@@ -46,13 +57,21 @@ variable "key_pair_name" {
46
57
variable"user_data" {
47
58
default=""
48
59
type=string
49
-
description="The user_data to use for the Tailscale Subnet Router EC2 instance. You can use this to automate installation of all the required command line tools."
60
+
description=<<EOF
61
+
The user_data to use for the Tailscale Subnet Router EC2 instance.
62
+
You can use this to automate installation of all the required command line tools.
63
+
EOF
50
64
}
51
65
52
66
variable"ami" {
53
67
default=""
54
68
type=string
55
-
description="The AMI to use for the Tailscale Subnet Router EC2 instance. If not provided, the latest Amazon Linux 2 AMI will be used. Note: This will update periodically as AWS releases updates to their AL2 AMI. Pin to a specific AMI if you would like to avoid these updates."
69
+
description=<<EOF
70
+
The AMI to use for the Tailscale Subnet Router EC2 instance.
71
+
If not provided, the latest Amazon Linux 2 AMI will be used.
72
+
Note: This will update periodically as AWS releases updates to their AL2 AMI.
73
+
Pin to a specific AMI if you would like to avoid these updates.
74
+
EOF
56
75
}
57
76
58
77
variable"instance_type" {
@@ -64,7 +83,7 @@ variable "instance_type" {
64
83
variable"instance_count" {
65
84
default=1
66
85
type=number
67
-
description="The number of Tailscale Subnet Router EC2 instances you would like to deploy."
86
+
description="The number of Tailscale Subnet Router EC2 instances you would like to deploy."
68
87
}
69
88
70
89
################
@@ -74,7 +93,14 @@ variable "instance_count" {
74
93
variable"advertise_routes" {
75
94
default=[]
76
95
type=list(string)
77
-
description="The routes (expressed as CIDRs) to advertise as part of the Tailscale Subnet Router. e.g. [ '10.0.2.0/24', '10.0.1.0/24 ]"
96
+
description=<<EOF
97
+
The routes (expressed as CIDRs) to advertise as part of the Tailscale Subnet Router.
0 commit comments