-
Notifications
You must be signed in to change notification settings - Fork 7
/
org-master-cf-template.yaml
executable file
·39 lines (38 loc) · 1.26 KB
/
org-master-cf-template.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
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Role in AWS organizations master account'
Parameters:
OrgListAccountsViewerRoleName:
Type: String
Default: "OrgListAccountsViewer"
CentralAggregatorAwsAccountId:
Type: Number
Description: "Account Id of the central aggregator AWS account."
SupportAggregatorRoleName:
Type: String
Description: "Required role in central aggregator account."
Default: "SupportAggregator"
Resources:
OrgListAccountsViewer:
Type: AWS::IAM::Role
# Role assumed from support cases central aggregator account to get list of accounts
Properties:
RoleName: !Ref OrgListAccountsViewerRoleName
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Sid: TrustSupportAggregator
Effect: Allow
Principal:
AWS: !Sub "arn:aws:iam::${CentralAggregatorAwsAccountId}:role/${SupportAggregatorRoleName}"
Action:
- sts:AssumeRole
Path: "/"
Policies:
- PolicyName: "list-org-accounts"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Action:
- "organizations:ListAccounts"
Resource: "*"