Skip to content

Commit 0818b34

Browse files
Improve DNS-related variable descriptions (#137)
Co-authored-by: cloudpossebot <[email protected]>
1 parent 1188b5d commit 0818b34

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ module "cdn" {
104104
source = "cloudposse/cloudfront-s3-cdn/aws"
105105
# Cloud Posse recommends pinning every module to a specific version
106106
# version = "x.x.x"
107-
namespace = "eg"
108-
stage = "prod"
109-
name = "app"
110-
aliases = ["assets.cloudposse.com"]
111-
parent_zone_name = "cloudposse.com"
107+
namespace = "eg"
108+
stage = "prod"
109+
name = "app"
110+
aliases = ["assets.cloudposse.com"]
111+
dns_alias_enabled = true
112+
parent_zone_name = "cloudposse.com"
112113
}
113114
```
114115

@@ -222,7 +223,7 @@ Available targets:
222223
| default\_root\_object | Object that CloudFront return when requests the root URL | `string` | `"index.html"` | no |
223224
| default\_ttl | Default amount of time (in seconds) that an object is in a CloudFront cache | `number` | `60` | no |
224225
| 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 |
225-
| dns\_alias\_enabled | Explicitly opt into DNS aliasing the CDN. | `bool` | `false` | no |
226+
| dns\_alias\_enabled | Create a DNS alias for the CDN. Requires `parent_zone_id` or `parent_zone_name` | `bool` | `false` | no |
226227
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
227228
| encryption\_enabled | When set to 'true' the resource will have aes256 encryption enabled by default | `bool` | `true` | no |
228229
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
@@ -259,8 +260,8 @@ Available targets:
259260
| origin\_path | An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. It must begin with a /. Do not add a / at the end of the path. | `string` | `""` | no |
260261
| origin\_ssl\_protocols | The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. | `list(string)` | <pre>[<br> "TLSv1",<br> "TLSv1.1",<br> "TLSv1.2"<br>]</pre> | no |
261262
| override\_origin\_bucket\_policy | When using an existing origin bucket (through var.origin\_bucket), setting this to 'false' will make it so the existing bucket policy will not be overriden | `bool` | `true` | no |
262-
| parent\_zone\_id | ID of the hosted zone to contain this record (or specify `parent_zone_name`) | `string` | `""` | no |
263-
| parent\_zone\_name | Name of the hosted zone to contain this record (or specify `parent_zone_id`) | `string` | `""` | no |
263+
| parent\_zone\_id | ID of the hosted zone to contain this record (or specify `parent_zone_name`). Requires `dns_alias_enabled` set to true | `string` | `""` | no |
264+
| parent\_zone\_name | Name of the hosted zone to contain this record (or specify `parent_zone_id`). Requires `dns_alias_enabled` set to true | `string` | `""` | no |
264265
| price\_class | Price class for this distribution: `PriceClass_All`, `PriceClass_200`, `PriceClass_100` | `string` | `"PriceClass_100"` | no |
265266
| redirect\_all\_requests\_to | A hostname to redirect all website requests for this distribution to. If this is set, it overrides other website settings | `string` | `""` | no |
266267
| 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 |

README.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ usage: |-
6666
source = "cloudposse/cloudfront-s3-cdn/aws"
6767
# Cloud Posse recommends pinning every module to a specific version
6868
# version = "x.x.x"
69-
namespace = "eg"
70-
stage = "prod"
71-
name = "app"
72-
aliases = ["assets.cloudposse.com"]
73-
parent_zone_name = "cloudposse.com"
69+
namespace = "eg"
70+
stage = "prod"
71+
name = "app"
72+
aliases = ["assets.cloudposse.com"]
73+
dns_alias_enabled = true
74+
parent_zone_name = "cloudposse.com"
7475
}
7576
```
7677

docs/terraform.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
| default\_root\_object | Object that CloudFront return when requests the root URL | `string` | `"index.html"` | no |
6767
| default\_ttl | Default amount of time (in seconds) that an object is in a CloudFront cache | `number` | `60` | no |
6868
| 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 |
69-
| dns\_alias\_enabled | Explicitly opt into DNS aliasing the CDN. | `bool` | `false` | no |
69+
| dns\_alias\_enabled | Create a DNS alias for the CDN. Requires `parent_zone_id` or `parent_zone_name` | `bool` | `false` | no |
7070
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
7171
| encryption\_enabled | When set to 'true' the resource will have aes256 encryption enabled by default | `bool` | `true` | no |
7272
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
@@ -103,8 +103,8 @@
103103
| origin\_path | An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. It must begin with a /. Do not add a / at the end of the path. | `string` | `""` | no |
104104
| origin\_ssl\_protocols | The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. | `list(string)` | <pre>[<br> "TLSv1",<br> "TLSv1.1",<br> "TLSv1.2"<br>]</pre> | no |
105105
| override\_origin\_bucket\_policy | When using an existing origin bucket (through var.origin\_bucket), setting this to 'false' will make it so the existing bucket policy will not be overriden | `bool` | `true` | no |
106-
| parent\_zone\_id | ID of the hosted zone to contain this record (or specify `parent_zone_name`) | `string` | `""` | no |
107-
| parent\_zone\_name | Name of the hosted zone to contain this record (or specify `parent_zone_id`) | `string` | `""` | no |
106+
| parent\_zone\_id | ID of the hosted zone to contain this record (or specify `parent_zone_name`). Requires `dns_alias_enabled` set to true | `string` | `""` | no |
107+
| parent\_zone\_name | Name of the hosted zone to contain this record (or specify `parent_zone_id`). Requires `dns_alias_enabled` set to true | `string` | `""` | no |
108108
| price\_class | Price class for this distribution: `PriceClass_All`, `PriceClass_200`, `PriceClass_100` | `string` | `"PriceClass_100"` | no |
109109
| redirect\_all\_requests\_to | A hostname to redirect all website requests for this distribution to. If this is set, it overrides other website settings | `string` | `""` | no |
110110
| 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 |

variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,19 @@ variable "geo_restriction_locations" {
246246
variable "parent_zone_id" {
247247
type = string
248248
default = ""
249-
description = "ID of the hosted zone to contain this record (or specify `parent_zone_name`)"
249+
description = "ID of the hosted zone to contain this record (or specify `parent_zone_name`). Requires `dns_alias_enabled` set to true"
250250
}
251251

252252
variable "parent_zone_name" {
253253
type = string
254254
default = ""
255-
description = "Name of the hosted zone to contain this record (or specify `parent_zone_id`)"
255+
description = "Name of the hosted zone to contain this record (or specify `parent_zone_id`). Requires `dns_alias_enabled` set to true"
256256
}
257257

258258
variable "dns_alias_enabled" {
259259
type = bool
260260
default = false
261-
description = "Explicitly opt into DNS aliasing the CDN."
261+
description = "Create a DNS alias for the CDN. Requires `parent_zone_id` or `parent_zone_name`"
262262
}
263263

264264
variable "static_s3_bucket" {

0 commit comments

Comments
 (0)