File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed
Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,40 @@ data "aws_iam_policy_document" "eks_list_and_describe" {
5454}
5555
5656resource "aws_iam_policy" "eks_list_and_describe_policy" {
57- name = " eks_list_and_describe "
57+ name = " ${ var . project } _eks_list_and_describe "
5858 policy = data. aws_iam_policy_document . eks_list_and_describe . json
5959}
6060
61- resource "aws_iam_user_policy_attachment" "ci_user_list_and_describe_access " {
61+ resource "aws_iam_user_policy_attachment" "ci_user_list_and_describe_policy " {
6262 user = data. aws_iam_user . ci_user . user_name
6363 policy_arn = aws_iam_policy. eks_list_and_describe_policy . arn
6464}
6565
66+ # Allow the CI user read/write access to the frontend assets bucket
67+ data "aws_iam_policy_document" "read_write_s3_policy" {
68+ statement {
69+ actions = [
70+ " s3:ListBucket" ,
71+ ]
72+
73+ resources = formatlist (" arn:aws:s3:::%s" , var. s3_hosting_buckets )
74+ }
75+
76+ statement {
77+ actions = [
78+ " s3:*Object" ,
79+ ]
80+
81+ resources = formatlist (" arn:aws:s3:::%s/*" , var. s3_hosting_buckets )
82+ }
83+ }
84+
85+ resource "aws_iam_policy" "read_write_s3_policy" {
86+ name = " ${ var . project } _ci_s3_policy"
87+ policy = data. aws_iam_policy_document . read_write_s3_policy . json
88+ }
89+
90+ resource "aws_iam_user_policy_attachment" "ci_s3_policy" {
91+ user = data. aws_iam_user . ci_user . user_name
92+ policy_arn = aws_iam_policy. read_write_s3_policy . arn
93+ }
Original file line number Diff line number Diff line change @@ -126,6 +126,10 @@ resource "aws_cloudfront_distribution" "client_assets_distribution" {
126126 ssl_support_method = " sni-only"
127127 }
128128
129+ # Reference the cert validations only so it becomes a dependency
130+ tags = {
131+ " certs-validated" = join (" ," , var. certificate_validations )
132+ }
129133}
130134
131135# Subdomain to point at CF
You can’t perform that action at this time.
0 commit comments