-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.yaml
59 lines (53 loc) · 1.53 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
AWSTemplateFormatVersion: 2010-09-09
Description: Template definine IAM Roles Anywhere sample resources to experiment with IAM credentials outside AWS. This is an example for learning purposes.
Parameters:
X509CertificateData:
Type: String
Description: The root CA PEM data
OU:
Type: String
Description: Organization Unit for certificate subjects
Resources:
Role:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
Effect: Allow
Principal:
Service: rolesanywhere.amazonaws.com
Action:
- sts:AssumeRole
- sts:TagSession
- sts:SetSourceIdentity
Condition:
StringEquals:
"aws:PrincipalTag/x509Subject/OU": !Ref OU
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonSQSReadOnlyAccess
RoleName: demo-roles-anywhere-role
Profile:
Type: AWS::RolesAnywhere::Profile
Properties:
DurationSeconds: 3600
Enabled: true
Name: demo-roles-anywhere-profile
RoleArns:
- !GetAtt Role.Arn
TrustAnchor:
Type: AWS::RolesAnywhere::TrustAnchor
Properties:
Enabled: true
Name: demo-trust-anchor
Source:
SourceType: CERTIFICATE_BUNDLE
SourceData:
X509CertificateData: !Ref X509CertificateData
Outputs:
TrustAnchorArn:
Value: !GetAtt TrustAnchor.TrustAnchorArn
ProfileArn:
Value: !GetAtt Profile.ProfileArn
RoleArn:
Value: !GetAtt Role.Arn