-
Notifications
You must be signed in to change notification settings - Fork 1
/
crossaccountiamrole.yaml
38 lines (36 loc) · 1014 Bytes
/
crossaccountiamrole.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
---
AWSTemplateFormatVersion: '2010-09-09'
Description: S3Insights crossaccount IAM role stack
Parameters:
DeploymentName:
Type: String
Default: s3-insights
HostAccountID:
Type: String
MinLength: '12'
Resources:
S3InsightsCrossAccountRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub ${DeploymentName}-cross-account-iam-role
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
AWS: !Sub arn:aws:iam::${HostAccountID}:root
Action: sts:AssumeRole
Path: "/"
Policies:
- PolicyName: 'CorePermissions'
PolicyDocument:
Version: '2012-10-17'
Statement:
- Action:
- s3:ListAllMyBuckets
- s3:ListBucket
- s3:GetBucketLocation
- s3:PutInventoryConfiguration
- s3:GetInventoryConfiguration
Effect: Allow
Resource: "*"