-
Notifications
You must be signed in to change notification settings - Fork 14
/
aws-backup-org-resource-policy-delegate-backup-policy-mgmt.yaml
64 lines (59 loc) · 2.26 KB
/
aws-backup-org-resource-policy-delegate-backup-policy-mgmt.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
AWSTemplateFormatVersion: '2010-09-09'
Description: This template should be deployed in the AWS Organizations management account to delegate backup policy management to the solution account.
Parameters:
SolutionHomeAccountId:
Description: The solution home AWS Account ID where CodePipeline is deployed
Type: String
Resources:
DelegateBackupPolicyMgmt:
Type: AWS::Organizations::ResourcePolicy
Properties:
Content:
Version: '2012-10-17'
Statement:
- Sid: AllowOrganizationsRead
Effect: Allow
Principal:
AWS: !Ref SolutionHomeAccountId
Action:
- organizations:Describe*
- organizations:List*
Resource: "*"
- Sid: AllowBackupPoliciesCreation
Effect: Allow
Principal:
AWS: !Ref SolutionHomeAccountId
Action:
- organizations:CreatePolicy
Resource: "*"
Condition:
StringEquals:
organizations:PolicyType: BACKUP_POLICY
- Sid: AllowBackupPoliciesModification
Effect: Allow
Principal:
AWS: !Ref SolutionHomeAccountId
Action:
- organizations:DescribePolicy
- organizations:UpdatePolicy
- organizations:DeletePolicy
Resource:
- !Sub "arn:aws:organizations::${AWS::AccountId}:policy/*/backup_policy/*"
Condition:
StringEquals:
organizations:PolicyType: BACKUP_POLICY
- Sid: AllowBackupPoliciesAttachmentAndDetachmentToAllAccountsAndOUs
Effect: Allow
Principal:
AWS: !Ref SolutionHomeAccountId
Action:
- organizations:AttachPolicy
- organizations:DetachPolicy
Resource:
- !Sub "arn:aws:organizations::${AWS::AccountId}:root/*"
- !Sub "arn:aws:organizations::${AWS::AccountId}:ou/*"
- !Sub "arn:aws:organizations::${AWS::AccountId}:account/*"
- !Sub "arn:aws:organizations::${AWS::AccountId}:policy/*/backup_policy/*"
Condition:
StringEquals:
organizations:PolicyType: BACKUP_POLICY