File tree 7 files changed +33
-13
lines changed 7 files changed +33
-13
lines changed Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ resource "aws_acm_certificate" "cloudfront_cert" {
2
2
domain_name = var. domain_name
3
3
validation_method = " DNS"
4
4
tags = var. tags
5
- provider = aws. useast1
5
+ provider = aws. acm
6
6
}
Original file line number Diff line number Diff line change @@ -51,7 +51,9 @@ resource "aws_cloudfront_distribution" "static_site" {
51
51
error_caching_min_ttl = 0
52
52
}
53
53
54
- tags = var. tags
54
+ tags = var. tags
55
+ provider = aws. default
56
+
55
57
}
56
58
57
59
resource "aws_cloudfront_origin_access_control" "oac" {
@@ -60,6 +62,8 @@ resource "aws_cloudfront_origin_access_control" "oac" {
60
62
origin_access_control_origin_type = " s3"
61
63
signing_behavior = " always"
62
64
signing_protocol = " sigv4"
65
+ provider = aws. default
66
+
63
67
}
64
68
65
69
resource "aws_cloudfront_response_headers_policy" "cloudfront" {
@@ -87,4 +91,6 @@ resource "aws_cloudfront_response_headers_policy" "cloudfront" {
87
91
override = true
88
92
}
89
93
}
94
+
95
+ provider = aws. default
90
96
}
Original file line number Diff line number Diff line change @@ -7,15 +7,18 @@ resource "aws_iam_role" "deploy_web" {
7
7
name = var. role_name
8
8
assume_role_policy = data. aws_iam_policy_document . oidc . json
9
9
tags = var. tags
10
+ provider = aws. default
10
11
}
11
12
12
13
resource "aws_iam_policy" "deploy_web" {
13
- name = var. role_name
14
- policy = data. aws_iam_policy_document . deploy_web . json
15
- tags = var. tags
14
+ name = var. role_name
15
+ policy = data. aws_iam_policy_document . deploy_web . json
16
+ tags = var. tags
17
+ provider = aws. default
16
18
}
17
19
18
20
resource "aws_iam_role_policy_attachment" "deploy_web" {
19
21
role = aws_iam_role. deploy_web . name
20
22
policy_arn = aws_iam_policy. deploy_web . arn
23
+ provider = aws. default
21
24
}
Original file line number Diff line number Diff line change
1
+ provider "aws" {
2
+ alias = " acm"
3
+ }
4
+
5
+ provider "aws" {
6
+ alias = " default"
7
+ }
Original file line number Diff line number Diff line change @@ -12,4 +12,6 @@ resource "aws_route53_record" "static_site_a_record" {
12
12
zone_id = aws_cloudfront_distribution. static_site . hosted_zone_id
13
13
evaluate_target_health = false
14
14
}
15
+
16
+ provider = aws. default
15
17
}
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ resource "aws_s3_bucket" "static_site" {
2
2
bucket = var. bucket_name
3
3
force_destroy = true
4
4
tags = var. tags
5
+ provider = aws. default
5
6
}
6
7
7
8
resource "aws_s3_bucket_policy" "static_site_policy" {
8
- bucket = aws_s3_bucket. static_site . bucket
9
- policy = data. aws_iam_policy_document . static_site . json
9
+ bucket = aws_s3_bucket. static_site . bucket
10
+ policy = data. aws_iam_policy_document . static_site . json
11
+ provider = aws. default
10
12
}
Original file line number Diff line number Diff line change @@ -20,21 +20,21 @@ variable "minimum_protocol_version" {
20
20
}
21
21
22
22
variable "role_name" {
23
- type = string
23
+ type = string
24
24
description = " The name of the role and policy with the ability to deploy"
25
- default = " deploy-static-site"
25
+ default = " deploy-static-site"
26
26
}
27
27
28
28
variable "restriction_type" {
29
- type = string
29
+ type = string
30
30
description = " The restriction type for the CloudFront distribution"
31
- default = " none"
31
+ default = " none"
32
32
}
33
33
34
34
variable "locations" {
35
- type = list (string )
35
+ type = list (string )
36
36
description = " The locations for the restriction type"
37
- default = []
37
+ default = []
38
38
}
39
39
40
40
variable "tags" {
You can’t perform that action at this time.
0 commit comments