File tree 3 files changed +34
-24
lines changed 3 files changed +34
-24
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 0.0.4 "
2
+ "version" : " 0.0.5 "
3
3
}
Original file line number Diff line number Diff line change 1
1
resource "aws_cloudfront_distribution" "static_site" {
2
2
comment = " Distribution for ${ var . domain_name } "
3
- aliases = [ var . domain_name ]
3
+ aliases = var. cloudfront . aliases
4
4
enabled = true
5
5
is_ipv6_enabled = true
6
6
default_root_object = " index.html"
@@ -13,8 +13,8 @@ resource "aws_cloudfront_distribution" "static_site" {
13
13
14
14
restrictions {
15
15
geo_restriction {
16
- restriction_type = var. restriction_type
17
- locations = var. locations
16
+ restriction_type = var. cloudfront . type
17
+ locations = var. cloudfront . locations
18
18
}
19
19
}
20
20
@@ -39,7 +39,7 @@ resource "aws_cloudfront_distribution" "static_site" {
39
39
viewer_certificate {
40
40
acm_certificate_arn = aws_acm_certificate. cloudfront_cert . arn
41
41
ssl_support_method = " sni-only"
42
- minimum_protocol_version = var. minimum_protocol_version
42
+ minimum_protocol_version = var. cloudfront . viewer_certificate . minimum_protocol_version
43
43
cloudfront_default_certificate = false
44
44
}
45
45
Original file line number Diff line number Diff line change @@ -8,36 +8,46 @@ variable "domain_name" {
8
8
description = " The custom domain for your CloudFront distribution"
9
9
}
10
10
11
- variable "minimum_protocol_version" {
12
- type = string
13
- description = " Set the minimum viewer certificate version for the CloudFront distribution"
14
- default = " TLSv1.2_2021"
15
- }
16
-
17
11
variable "role_name" {
18
12
type = string
19
13
description = " The name of the role and policy with the ability to deploy"
20
14
default = " deploy-static-site"
21
15
}
22
16
23
- variable "restriction_type" {
24
- type = string
25
- description = " The restriction type for the CloudFront distribution"
26
- default = " none"
17
+ variable "repo" {
18
+ type = string
19
+ description = " The repo path for the project"
27
20
}
28
21
29
- variable "locations" {
30
- type = list (string )
31
- description = " The locations for the restriction type"
32
- default = []
22
+ variable "cloudfront" {
23
+ type = object ({
24
+ aliases = list (string )
25
+
26
+ restriction = object ({
27
+ type = string
28
+ locations = list (string )
29
+ })
30
+
31
+ viewer_certificate = object ({
32
+ minimum_protocol_version = string
33
+ })
34
+ })
35
+
36
+ default = {
37
+ aliases = [var.domain_name]
38
+
39
+ restriction = {
40
+ type = " none"
41
+ locations = []
42
+ }
43
+
44
+ viewer_certificate = {
45
+ minimum_protocol_version = " TLSv1.2_2021"
46
+ }
47
+ }
33
48
}
34
49
35
50
variable "tags" {
36
51
type = map (string )
37
52
description = " The tags to apply to all resources created"
38
53
}
39
-
40
- variable "repo_path" {
41
- type = string
42
- description = " The repo path for the project"
43
- }
You can’t perform that action at this time.
0 commit comments