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
Adds *_hostname_enabled vars for explicit opt-in to hostnames (#73)
* Adds *_hostname_enabled vars for explicit opt-in to hostnames
Implicit opt-in through checking dns_zone_id was causing folks problems as count / enabled need to be calculated during the plan which caused using target.
See #13 + https://sweetops.slack.com/archives/CB6GHNLG0/p1600294860394500
* Updates examples/complete to fix tests
* Update to `context.tf`. Update example. Update Terratest to `go` modules
Co-authored-by: aknysh <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+25-12Lines changed: 25 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,6 @@ If you don't enable zone awareness, Amazon ES places an endpoint into only one s
79
79
Instead pin to the release tag (e.g. `?ref=tags/x.y.z`) of one of our [latest releases](https://github.com/cloudposse/terraform-aws-elasticsearch/releases).
80
80
81
81
82
-
Basic [example](examples/basic)
83
82
84
83
```hcl
85
84
module "elasticsearch" {
@@ -110,6 +109,14 @@ module "elasticsearch" {
110
109
111
110
112
111
112
+
## Examples
113
+
114
+
Here is a working example of using this module:
115
+
-[`examples/complete`](examples/complete)
116
+
117
+
Here are automated tests for the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest) (which tests and deploys the example on AWS):
118
+
-[`test`](test)
119
+
113
120
114
121
115
122
<!-- markdownlint-disable -->
@@ -131,20 +138,21 @@ Available targets:
131
138
|------|---------|
132
139
| terraform | >= 0.12.0 |
133
140
| aws | >= 2.0 |
134
-
| null |~> 2.0 |
135
-
| template |~> 2.0 |
141
+
| null |>= 2.0 |
142
+
| template |>= 2.0 |
136
143
137
144
## Providers
138
145
139
146
| Name | Version |
140
147
|------|---------|
141
148
| aws | >= 2.0 |
142
-
| null |~> 2.0 |
149
+
| null |>= 2.0 |
143
150
144
151
## Inputs
145
152
146
153
| Name | Description | Type | Default | Required |
| additional\_tag\_map | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. |`map(string)`|`{}`| no |
148
156
| advanced\_options | Key-value string pairs to specify advanced configuration options |`map(string)`|`{}`| no |
149
157
| allowed\_cidr\_blocks | List of CIDR blocks to be allowed to connect to the cluster |`list(string)`|`[]`| no |
150
158
| attributes | Additional attributes (e.g. `1`) |`list(string)`|`[]`| no |
@@ -155,44 +163,49 @@ Available targets:
155
163
| cognito\_iam\_role\_arn | ARN of the IAM role that has the AmazonESCognitoAccess policy attached |`string`|`""`| no |
156
164
| cognito\_identity\_pool\_id | The ID of the Cognito Identity Pool to use |`string`|`""`| no |
157
165
| cognito\_user\_pool\_id | The ID of the Cognito User Pool to use |`string`|`""`| no |
166
+
| 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. | <pre>object({<br> enabled = bool<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> delimiter = string<br> attributes = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> label_order = list(string)<br> id_length_limit = number<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_order": [],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no |
158
167
| create\_iam\_service\_linked\_role | Whether to create `AWSServiceRoleForAmazonElasticsearchService` service-linked role. Set it to `false` if you already have an ElasticSearch cluster created in the AWS account and AWSServiceRoleForAmazonElasticsearchService already exists. See https://github.com/terraform-providers/terraform-provider-aws/issues/5218 for more info |`bool`|`true`| no |
159
168
| dedicated\_master\_count | Number of dedicated master nodes in the cluster |`number`|`0`| no |
160
169
| dedicated\_master\_enabled | Indicates whether dedicated master nodes are enabled for the cluster |`bool`|`false`| no |
161
170
| dedicated\_master\_type | Instance type of the dedicated master nodes in the cluster |`string`|`"t2.small.elasticsearch"`| no |
162
-
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`|`string`|`"-"`| no |
171
+
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. |`string`|`null`| no |
163
172
| dns\_zone\_id | Route53 DNS Zone ID to add hostname records for Elasticsearch domain and Kibana |`string`|`""`| no |
164
173
| domain\_endpoint\_options\_enforce\_https | Whether or not to require HTTPS |`bool`|`false`| no |
165
174
| domain\_endpoint\_options\_tls\_security\_policy | The name of the TLS security policy that needs to be applied to the HTTPS endpoint |`string`|`"Policy-Min-TLS-1-0-2019-07"`| no |
175
+
| domain\_hostname\_enabled | Explicit flag to enable creating a DNS hostname for ES. If `true`, then `var.dns_zone_id` is required. |`bool`|`false`| no |
166
176
| ebs\_iops | The baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the Provisioned IOPS EBS volume type |`number`|`0`| no |
167
177
| ebs\_volume\_size | EBS volumes for data storage in GB |`number`|`0`| no |
168
178
| ebs\_volume\_type | Storage type of EBS volumes |`string`|`"gp2"`| no |
169
179
| elasticsearch\_subdomain\_name | The name of the subdomain for Elasticsearch in the DNS zone (\_e.g.\_`elasticsearch`, `ui`, `ui-es`, `search-ui`) |`string`|`""`| no |
170
180
| elasticsearch\_version | Version of Elasticsearch to deploy (\_e.g.\_`7.4`, `7.1`, `6.8`, `6.7`, `6.5`, `6.4`, `6.3`, `6.2`, `6.0`, `5.6`, `5.5`, `5.3`, `5.1`, `2.3`, `1.5`|`string`|`"7.4"`| no |
171
-
| enabled | Set to false to prevent the module from creating any resources |`bool`|`true`| no |
181
+
| enabled | Set to false to prevent the module from creating any resources |`bool`|`null`| no |
172
182
| encrypt\_at\_rest\_enabled | Whether to enable encryption at rest |`bool`|`true`| no |
173
183
| encrypt\_at\_rest\_kms\_key\_id | The KMS key ID to encrypt the Elasticsearch domain with. If not specified, then it defaults to using the AWS/Elasticsearch service KMS key |`string`|`""`| no |
174
-
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' |`string`|`""`| no |
184
+
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' |`string`|`null`| no |
175
185
| iam\_actions | List of actions to allow for the IAM roles, _e.g._`es:ESHttpGet`, `es:ESHttpPut`, `es:ESHttpPost`|`list(string)`|`[]`| no |
176
186
| iam\_authorizing\_role\_arns | List of IAM role ARNs to permit to assume the Elasticsearch user role |`list(string)`|`[]`| no |
177
187
| iam\_role\_arns | List of IAM role ARNs to permit access to the Elasticsearch domain |`list(string)`|`[]`| no |
178
188
| iam\_role\_max\_session\_duration | The maximum session duration (in seconds) for the user role. Can have a value from 1 hour to 12 hours |`number`|`3600`| no |
189
+
| id\_length\_limit | Limit `id` to this many characters.<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. |`number`|`null`| no |
179
190
| ingress\_port\_range\_end | End number for allowed port range. (e.g. `443`) |`number`|`65535`| no |
180
191
| ingress\_port\_range\_start | Start number for allowed port range. (e.g. `443`) |`number`|`0`| no |
181
192
| instance\_count | Number of data nodes in the cluster |`number`|`4`| no |
182
193
| instance\_type | Elasticsearch instance type for data nodes in the cluster |`string`|`"t2.small.elasticsearch"`| no |
183
-
| kibana\_subdomain\_name | The name of the subdomain for Kibana in the DNS zone (\_e.g.\_`kibana`, `ui`, `ui-es`, `search-ui`, `kibana.elasticsearch`) |`string`|`"kibana"`| no |
184
-
| label\_order | The naming order of the id output and Name tag |`list(string)`|`[]`| no |
194
+
| kibana\_hostname\_enabled | Explicit flag to enable creating a DNS hostname for Kibana. If `true`, then `var.dns_zone_id` is required. |`bool`|`false`| no |
195
+
| kibana\_subdomain\_name | The name of the subdomain for Kibana in the DNS zone (\_e.g.\_`kibana`, `ui`, `ui-es`, `search-ui`, `kibana.elasticsearch`) |`string`| n/a | yes |
196
+
| label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. |`list(string)`|`null`| no |
185
197
| log\_publishing\_application\_cloudwatch\_log\_group\_arn | ARN of the CloudWatch log group to which log for ES\_APPLICATION\_LOGS needs to be published |`string`|`""`| no |
186
198
| log\_publishing\_application\_enabled | Specifies whether log publishing option for ES\_APPLICATION\_LOGS is enabled or not |`bool`|`false`| no |
187
199
| log\_publishing\_index\_cloudwatch\_log\_group\_arn | ARN of the CloudWatch log group to which log for INDEX\_SLOW\_LOGS needs to be published |`string`|`""`| no |
188
200
| log\_publishing\_index\_enabled | Specifies whether log publishing option for INDEX\_SLOW\_LOGS is enabled or not |`bool`|`false`| no |
189
201
| log\_publishing\_search\_cloudwatch\_log\_group\_arn | ARN of the CloudWatch log group to which log for SEARCH\_SLOW\_LOGS needs to be published |`string`|`""`| no |
190
202
| log\_publishing\_search\_enabled | Specifies whether log publishing option for SEARCH\_SLOW\_LOGS is enabled or not |`bool`|`false`| no |
191
-
| name | Solution name, e.g. 'app' or 'jenkins' |`string`|`""`| no |
192
-
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' |`string`|`""`| no |
203
+
| name | Solution name, e.g. 'app' or 'jenkins' |`string`|`null`| no |
204
+
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' |`string`|`null`| no |
193
205
| node\_to\_node\_encryption\_enabled | Whether to enable node-to-node encryption |`bool`|`false`| no |
206
+
| regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. |`string`|`null`| no |
194
207
| security\_groups | List of security group IDs to be allowed to connect to the cluster |`list(string)`|`[]`| no |
195
-
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' |`string`|`""`| no |
208
+
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' |`string`|`null`| no |
196
209
| subnet\_ids | VPC Subnet IDs |`list(string)`|`[]`| no |
197
210
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')`|`map(string)`|`{}`| no |
198
211
| vpc\_enabled | Set to false if ES should be deployed outside of VPC. |`bool`|`true`| no |
Copy file name to clipboardExpand all lines: README.yaml
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,15 @@ introduction: |-
45
45
The subnets must be in different Availability Zones in the same region.
46
46
If you don't enable zone awareness, Amazon ES places an endpoint into only one subnet. You also need to set `availability_zone_count` to `1`.
47
47
48
+
examples: |-
49
+
Here is a working example of using this module:
50
+
- [`examples/complete`](examples/complete)
51
+
52
+
Here are automated tests for the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest) (which tests and deploys the example on AWS):
0 commit comments