-
Notifications
You must be signed in to change notification settings - Fork 5
/
iam-cloudformation.json
89 lines (89 loc) · 4.22 KB
/
iam-cloudformation.json
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "IAM role for serviceaccount \"nirmata-aws-adapter/nirmata-aws-adapter\"",
"Resources": {
"Role1": {
"Type": "AWS::IAM::Role",
"Properties": {
"RoleName": "nirmata-adapter-role",
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": [
"sts:AssumeRoleWithWebIdentity"
],
"Condition": {
"StringEquals": {
"oidc.eks.us-west-1.amazonaws.com/id/IDENTITY_PROVIDER_ID:aud": "sts.amazonaws.com",
"oidc.eks.us-west-1.amazonaws.com/id/IDENTITY_PROVIDER_ID:sub": "system:serviceaccount:nirmata-aws-adapter:nirmata-aws-adapter"
}
},
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::ACCOUNT_NUMBER:oidc-provider/oidc.eks.REGION.amazonaws.com/id/IDENTITY_PROVIDER_ID"
}
}
],
"Version": "2012-10-17"
},
"Policies": [
{
"PolicyName": "nirmata-aws-adapter-policy",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Statement0",
"Effect": "Allow",
"Action": [
"eks:AccessKubernetesApi",
"eks:DescribeAddon",
"eks:DescribeAddonVersions",
"eks:DescribeCluster",
"eks:DescribeFargateProfile",
"eks:DescribeIdentityProviderConfig",
"eks:DescribeNodegroup",
"eks:DescribeUpdate",
"eks:ListAddons",
"eks:ListClusters",
"eks:ListFargateProfiles",
"eks:ListIdentityProviderConfigs",
"eks:ListNodegroups",
"eks:ListTagsForResource",
"eks:ListUpdates"
],
"Resource": [
"arn:aws:eks:*:ACCOUNT_NUMBER:identityproviderconfig/*/*/*/*",
"arn:aws:eks:*:ACCOUNT_NUMBER:fargateprofile/*/*/*",
"arn:aws:eks:*:ACCOUNT_NUMBER:nodegroup/*/*/*",
"arn:aws:eks:*:ACCOUNT_NUMBER:cluster/*",
"arn:aws:eks:*:ACCOUNT_NUMBER:addon/*/*/*"
]
},
{
"Sid": "Statement1",
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeInstances",
"ec2:DescribeFlowLogs",
"ecr:DescribeRepositories",
"inspector2:BatchGetAccountStatus"
],
"Resource": "*"
}
]
}
}
]
}
}
},
"Outputs": {
"Role1": {
"Value": {
"Fn::GetAtt": "Role1.Arn"
}
}
}
}