forked from awslabs/amazon-eks-irsa-cfn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
65 lines (60 loc) · 1.79 KB
/
template.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Runtime: nodejs18.x
Timeout: 900
Handler: index.handler
Description: CloudFormation Custom Resources to create EKS IAM Role for Service Account
Resources:
RoleCreationFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./role_handler
Policies:
- Statement:
- Sid: Default
Effect: Allow
Action:
- eks:DescribeCluster
- iam:AttachRolePolicy
- iam:CreateRole
- iam:DeleteRole
- iam:DeleteRolePolicy
- iam:DescribeRole
- iam:DetachRolePolicy
- iam:GetRole
- iam:ListAttachedRolePolicies
- iam:ListRoles
- iam:PutRolePermissionsBoundary
- iam:PutRolePolicy
- iam:TagRole
- iam:UntagRole
- iam:UpdateAssumeRolePolicy
- iam:UpdateRole
- sts:GetCallerIdentity
Resource: '*'
OIDCIdentityProviderCreationFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./identity_provider_handler
Policies:
- Statement:
- Sid: Default
Effect: Allow
Action:
- eks:DescribeCluster
- iam:CreateOpenIDConnectProvider
- iam:DeleteOpenIDConnectProvider
Resource: '*'
Outputs:
RoleCreationFunction:
Description: Role creation Lambda function ARN
Value: !GetAtt RoleCreationFunction.Arn
Export:
Name: EKSIRSARoleCreationFunction
OIDCIdentityProviderCreationFunction:
Description: OIDC identity provider creation Lambda function ARN
Value: !GetAtt OIDCIdentityProviderCreationFunction.Arn
Export:
Name: EKSIRSAOIDCIdentityProviderCreationFunction