Skip to content

Commit aaaa014

Browse files
committed
feat: Add variable optional attribute type definitions
1 parent 109240c commit aaaa014

File tree

10 files changed

+533
-385
lines changed

10 files changed

+533
-385
lines changed

README.md

Lines changed: 19 additions & 23 deletions
Large diffs are not rendered by default.

docs/UPGRADE-6.0.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,27 @@ If you find a bug, please open an issue with supporting configuration to reprodu
1717
### Modified
1818

1919
- Variable definitions now contain detailed `object` types in place of the previously used any type.
20+
- `is_ipv6_enabled` now defaults to `true` if not specified.
2021

2122
### Variable and output changes
2223

2324
1. Removed variables:
2425

2526
- `create_origin_access_identity`
2627
- `origin_access_identities`
28+
- `create_origin_access_control`
29+
- `create_vpc_origin`
30+
- `vpc_origin_timeouts` - use `timeouts` block within `vpc_origin` variable instead
31+
- `create_response_headers_policy`
32+
- `create_cloudfront_function`
2733

2834
2. Renamed variables:
2935

30-
-
36+
- `create_distribution` -> `create`
3137

3238
3. Added variables:
3339

34-
-
40+
- `anycast_ip_list_id`
3541

3642
4. Removed outputs:
3743

examples/complete/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ Note that this example may create resources which cost money. Run `terraform des
3232
| Name | Version |
3333
|------|---------|
3434
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
35-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.100 |
35+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.20 |
3636
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 2.0 |
3737
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
3838

3939
## Providers
4040

4141
| Name | Version |
4242
|------|---------|
43-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.100 |
43+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.20 |
4444
| <a name="provider_null"></a> [null](#provider\_null) | >= 2.0 |
4545
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
4646

examples/complete/main.tf

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ module "cloudfront" {
3838
# This rate is charged only once per month, per metric (up to 8 metrics per distribution).
3939
create_monitoring_subscription = true
4040

41-
create_origin_access_control = true
4241
origin_access_control = {
4342
s3_oac = {
4443
description = "CloudFront access to S3"
@@ -48,7 +47,6 @@ module "cloudfront" {
4847
}
4948
}
5049

51-
create_vpc_origin = true
5250
vpc_origin = {
5351
ec2_vpc_origin = {
5452
name = random_pet.this.id
@@ -60,18 +58,13 @@ module "cloudfront" {
6058
items = ["TLSv1.2"]
6159
quantity = 1
6260
}
63-
}
64-
}
65-
66-
vpc_origin_timeouts = {
67-
create = "20m"
68-
update = "20m"
69-
delete = "20m"
70-
}
7161

72-
logging_config = {
73-
bucket = module.log_bucket.s3_bucket_bucket_domain_name
74-
prefix = "cloudfront"
62+
timeouts = {
63+
create = "20m"
64+
update = "20m"
65+
delete = "20m"
66+
}
67+
}
7568
}
7669

7770
origin = {
@@ -84,16 +77,10 @@ module "cloudfront" {
8477
origin_ssl_protocols = ["TLSv1", "TLSv1.1", "TLSv1.2"]
8578
}
8679

87-
custom_header = [
88-
{
89-
name = "X-Forwarded-Scheme"
90-
value = "https"
91-
},
92-
{
93-
name = "X-Frame-Options"
94-
value = "SAMEORIGIN"
95-
}
96-
]
80+
custom_header = {
81+
"X-Forwarded-Scheme" = "https"
82+
"X-Frame-Options" = "SAMEORIGIN"
83+
}
9784

9885
origin_shield = {
9986
enabled = true
@@ -125,10 +112,14 @@ module "cloudfront" {
125112
}
126113

127114
origin_group = {
128-
group_one = {
129-
failover_status_codes = [403, 404, 500, 502]
130-
primary_member_origin_id = "appsync"
131-
secondary_member_origin_id = "s3_one"
115+
group-one = {
116+
failover_criteria = {
117+
status_codes = [403, 404, 500, 502]
118+
}
119+
member = [
120+
{ origin_id = "appsync" },
121+
{ origin_id = "s3_one" }
122+
]
132123
}
133124
}
134125

@@ -218,7 +209,6 @@ module "cloudfront" {
218209
allowed_methods = ["GET", "HEAD", "OPTIONS"]
219210
cached_methods = ["GET", "HEAD"]
220211
}
221-
222212
]
223213

224214
viewer_certificate = {
@@ -236,13 +226,14 @@ module "cloudfront" {
236226
response_page_path = "/errors/403.html"
237227
}]
238228

239-
geo_restriction = {
240-
restriction_type = "whitelist"
241-
locations = ["NO", "UA", "US", "GB"]
229+
restrictions = {
230+
geo_restriction = {
231+
restriction_type = "whitelist"
232+
locations = ["NO", "UA", "US", "GB"]
233+
}
242234
}
243235

244236
# CloudFront Functions - module managed
245-
create_cloudfront_function = true
246237
cloudfront_functions = {
247238
viewer-request-security = {
248239
runtime = "cloudfront-js-2.0"
@@ -274,7 +265,6 @@ module "cloudfront" {
274265
# }
275266
}
276267

277-
create_response_headers_policy = true
278268
response_headers_policies = {
279269
cors_policy = {
280270
name = "CORSPolicy"

examples/complete/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.100"
7+
version = ">= 6.20"
88
}
99
random = {
1010
source = "hashicorp/random"

0 commit comments

Comments
 (0)