@@ -13,7 +13,8 @@ resource "aws_iam_policy" "terraform_state" {
1313 " s3:ListBucket" ,
1414 " s3:GetObject" ,
1515 " s3:PutObject" ,
16- " s3:DeleteObject"
16+ " s3:DeleteObject" ,
17+ " s3:GetObject"
1718 ],
1819 Resource = [
1920 " ${ local . terraform_state_bucket_arn } " ,
@@ -147,6 +148,7 @@ resource "aws_iam_policy" "s3_management" {
147148 " s3:PutBucketLogging" ,
148149 " s3:GetObjectTagging" ,
149150 " s3:PutObjectTagging" ,
151+ " s3:GetObjectVersion"
150152 ],
151153 Resource = [
152154 " arn:aws:s3:::*eligibility-signposting-api-${ var . environment } -eli-rules" ,
@@ -295,30 +297,41 @@ resource "aws_iam_policy" "kms_creation" {
295297 {
296298 Effect = " Allow" ,
297299 Action = [
298- " kms:CreateKey" ,
299- " kms:CreateAlias" ,
300- " kms:List*" ,
300+ " kms:Decrypt" ,
301+ " kms:Encrypt" ,
302+ " kms:ReEncrypt*" ,
303+ " kms:GenerateDataKey*" ,
304+ " kms:DescribeKey" ,
301305 " kms:ListAliases" ,
306+ " kms:CreateKey" ,
302307 ],
303308 Resource = " *"
304309 },
305310 {
306311 Effect = " Allow" ,
307312 Action = [
313+ " kms:Create*" ,
314+ " kms:PutKeyPolicy" ,
315+ " kms:GetKeyPolicy" ,
308316 " kms:Describe*" ,
309- " kms:GetKeyPolicy*" ,
310- " kms:GetKeyRotationStatus" ,
311- " kms:Decrypt*" ,
312- " kms:DeleteAlias" ,
313- " kms:UpdateKeyDescription" ,
314- " kms:CreateGrant" ,
315- " kms:TagResource" ,
317+ " kms:List*" ,
318+ " kms:Encrypt" ,
319+ " kms:Decrypt" ,
320+ " kms:ReEncrypt*" ,
321+ " kms:GenerateDataKey*" ,
316322 " kms:EnableKeyRotation" ,
323+ " kms:DisableKeyRotation" ,
317324 " kms:ScheduleKeyDeletion" ,
318- " kms:PutKeyPolicy" ,
319- " kms:Encrypt" ,
325+ " kms:CancelKeyDeletion" ,
320326 " kms:TagResource" ,
321- " kms:GenerateDataKey" ,
327+ " kms:UntagResource" ,
328+ " kms:CreateAlias" ,
329+ " kms:DeleteAlias" ,
330+ " kms:UpdateAlias" ,
331+ " kms:ListAliases" ,
332+ " kms:UpdateKeyDescription" ,
333+ " kms:CreateGrant" ,
334+ " kms:GetKeyRotationStatus"
322335 ],
323336 Resource = [
324337 " arn:aws:kms:${ var . default_aws_region } :${ data . aws_caller_identity . current . account_id } :key/*" ,
@@ -389,8 +402,8 @@ resource "aws_iam_policy" "iam_management" {
389402# Assume role policy document for GitHub Actions
390403data "aws_iam_policy_document" "github_actions_assume_role" {
391404 statement {
392- sid = " OidcAssumeRoleWithWebIdentity"
393- effect = " Allow"
405+ sid = " OidcAssumeRoleWithWebIdentity"
406+ effect = " Allow"
394407 actions = [" sts:AssumeRoleWithWebIdentity" ]
395408
396409 principals {
@@ -403,13 +416,13 @@ data "aws_iam_policy_document" "github_actions_assume_role" {
403416 condition {
404417 test = " StringLike"
405418 variable = " token.actions.githubusercontent.com:sub"
406- values = [" repo:${ var . github_org } /${ var . github_repo } :*" ]
419+ values = [" repo:${ var . github_org } /${ var . github_repo } :*" ]
407420 }
408421
409422 condition {
410423 test = " StringEquals"
411424 variable = " token.actions.githubusercontent.com:aud"
412- values = [" sts.amazonaws.com" ]
425+ values = [" sts.amazonaws.com" ]
413426 }
414427 }
415428}
0 commit comments