File tree Expand file tree Collapse file tree 4 files changed +47
-15
lines changed
modules/aws-backup-source
scripts/infrastructure/policies Expand file tree Collapse file tree 4 files changed +47
-15
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,26 @@ resource "aws_iam_role_policy_attachment" "s3_backup" {
3535 policy_arn = " arn:aws:iam::aws:policy/AWSBackupServiceRolePolicyForS3Backup"
3636 role = aws_iam_role. backup . name
3737}
38+
39+
40+ resource "aws_iam_policy" "restore_testing_selection_permissions" {
41+ name = " ${ local . resource_name_prefix } -source-account-backup-permissions"
42+ policy = jsonencode ({
43+ Version = " 2012-10-17" ,
44+ Statement = [
45+ {
46+ Effect = " Allow" ,
47+ Action = [
48+ " backup:*" ,
49+ " cloudformation:*"
50+ ],
51+ Resource = " *"
52+ }
53+ ]
54+ })
55+ }
56+
57+ resource "aws_iam_role_policy_attachment" "source_account_backup_permissions" {
58+ policy_arn = aws_iam_policy. restore_testing_selection_permissions . arn
59+ role = aws_iam_role. backup . name
60+ }
Original file line number Diff line number Diff line change @@ -102,15 +102,4 @@ module "source" {
102102 ],
103103 " selection_tag" : " NHSE-Enable-Backup"
104104 }
105- # # Note here that we need to explicitly disable DynamoDB backups in the source account.
106- # # The default config in the module enables backups for all resource types.
107- # backup_plan_config_dynamodb = {
108- # "compliance_resource_types" : [
109- # "DynamoDB"
110- # ],
111- # "rules" : [
112- # ],
113- # "enable" : false,
114- # "selection_tag" : "NHSE-Enable-Backup"
115- # }
116105}
Original file line number Diff line number Diff line change @@ -36,7 +36,11 @@ resource "aws_iam_policy" "source_account_backup_permissions" {
3636 " backup:DeleteRestoreTestingPlan" ,
3737 " backup:GetRestoreTestingPlan" ,
3838 " backup:ListRestoreTestingPlans" ,
39- " backup:UpdateRestoreTestingPlan"
39+ " backup:UpdateRestoreTestingPlan" ,
40+ " backup:CreateRestoreTestingSelection" ,
41+ " backup:DescribeRestoreTestingSelection" ,
42+ " backup:UpdateRestoreTestingSelection" ,
43+ " backup:DeleteRestoreTestingSelection" ,
4044 ],
4145 Resource = " *"
4246 },
@@ -59,6 +63,24 @@ resource "aws_iam_policy" "source_account_backup_permissions" {
5963 " kms:TagResource"
6064 ],
6165 Resource = " *"
66+ },
67+ {
68+ Effect = " Allow" ,
69+ Action = [
70+ " secretsmanager:GetSecretValue"
71+ ],
72+ Resource = [
73+ " arn:aws:secretsmanager:*:${ var . assume_account } :secret:destination_vault_arn-*" ,
74+ " arn:aws:secretsmanager:*:${ var . assume_account } :secret:destination_account_id-*"
75+ ]
76+ },
77+ {
78+ Effect = " Allow" ,
79+ Action = [
80+ " backup:*" ,
81+ " cloudformation:*"
82+ ],
83+ Resource = " *"
6284 }
6385 ]
6486 })
Original file line number Diff line number Diff line change 169169 " arn:aws:secretsmanager:*:${ACCOUNT_ID}:secret:*-apigee-credentials-*" ,
170170 " arn:aws:secretsmanager:*:${ACCOUNT_ID}:secret:*-apigee-cpm-apikey-*" ,
171171 " arn:aws:secretsmanager:*:${ACCOUNT_ID}:secret:*-apigee-app-key-*" ,
172- " arn:aws:secretsmanager:*:${ACCOUNT_ID}:secret:*-etl-notify-slack-webhook-url-*" ,
173- " arn:aws:secretsmanager:*:${ACCOUNT_ID}:secret:destination_vault_arn-*" ,
174- " arn:aws:secretsmanager:*:${ACCOUNT_ID}:secret:destination_account_id-*"
172+ " arn:aws:secretsmanager:*:${ACCOUNT_ID}:secret:*-etl-notify-slack-webhook-url-*"
175173 ]
176174 },
177175 {
You can’t perform that action at this time.
0 commit comments