-
Notifications
You must be signed in to change notification settings - Fork 145
/
CFN_MGMT_ROLE.yml
48 lines (48 loc) · 1.7 KB
/
CFN_MGMT_ROLE.yml
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
AWSTemplateFormatVersion: "2010-09-09"
Description: Deploy Cross-Account Role for PHD access
Parameters:
OrgMemberAccountId:
Type: String
AllowedPattern: '^\d{12}$'
Description: AWS Account ID of the AWS Organizations Member Account that will run AWS Health Aware
Resources:
AWSHealthAwareRoleForPHDEvents:
Type: "AWS::IAM::Role"
Properties:
Description: "Grants access to PHD events"
Path: /
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Action:
- sts:AssumeRole
Effect: Allow
Principal:
AWS: !Sub 'arn:aws:iam::${OrgMemberAccountId}:root'
Policies:
- PolicyName: AllowHealthCalls
PolicyDocument:
Statement:
- Effect: Allow
Action:
- health:DescribeAffectedAccountsForOrganization
- health:DescribeAffectedEntitiesForOrganization
- health:DescribeEventDetailsForOrganization
- health:DescribeEventsForOrganization
- health:DescribeEventDetails
- health:DescribeEvents
- health:DescribeEventTypes
- health:DescribeAffectedEntities
Resource: "*"
- PolicyName: AllowsDescribeOrg
PolicyDocument:
Statement:
- Effect: Allow
Action:
- organizations:ListAccounts
- organizations:ListAWSServiceAccessForOrganization
- organizations:DescribeAccount
Resource: "*"
Outputs:
AWSHealthAwareRoleForPHDEventsArn:
Value: !GetAtt AWSHealthAwareRoleForPHDEvents.Arn