forked from maintux/quickstart-kubernetes-resource-provider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.template.yml
93 lines (93 loc) · 3.14 KB
/
deploy.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
AWSTemplateFormatVersion: "2010-09-09"
Description: "Deploy the AWSQS::Kubernetes::Resource resource into CloudFormation registry - Which is Deprecated."
Parameters:
HandlerPackage:
Type: String
Description: S3 path for handler package
Default: s3://aws-quickstart/quickstart-kubernetes-resource-provider/awsqs-kubernetes-resource.zip
Resources:
ExecutionRole:
Type: AWS::IAM::Role
Properties:
MaxSessionDuration: 8400
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- "lambda.amazonaws.com"
- "resources.cloudformation.amazonaws.com"
Action: sts:AssumeRole
Path: "/"
Policies:
- PolicyName: ResourceTypePolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- "kms:Decrypt"
- "eks:DescribeCluster"
- "s3:GetObject"
- "sts:AssumeRole"
- "iam:PassRole"
- "iam:ListRolePolicies"
- "iam:ListAttachedRolePolicies"
- "iam:GetRole"
- "iam:GetPolicy"
- "iam:GetPolicyVersion"
- "logs:CreateLogGroup"
- "logs:CreateLogStream"
- "logs:PutLogEvents"
- "lambda:UpdateFunctionConfiguration"
- "lambda:DeleteFunction"
- "lambda:GetFunction"
- "lambda:InvokeFunction"
- "lambda:CreateFunction"
- "lambda:UpdateFunctionCode"
Resource: "*"
LogDeliveryRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- cloudformation.amazonaws.com
- resources.cloudformation.amazonaws.com
Action: sts:AssumeRole
Path: "/"
Policies:
- PolicyName: ResourceTypePolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- "logs:CreateLogGroup"
- "logs:CreateLogStream"
- "logs:DescribeLogGroups"
- "logs:DescribeLogStreams"
- "logs:PutLogEvents"
- "cloudwatch:ListMetrics"
- "cloudwatch:PutMetricData"
Resource: "*"
ResourceVersion:
Type: AWS::CloudFormation::ResourceVersion
Properties:
TypeName: AWSQS::Kubernetes::Resource
LoggingConfig:
LogGroupName: awsqs-kubernetes-resource-logs
LogRoleArn: !GetAtt LogDeliveryRole.Arn
SchemaHandlerPackage: !Ref HandlerPackage
ExecutionRoleArn: !GetAtt ExecutionRole.Arn
ResourceDefaultVersion:
Type: AWS::CloudFormation::ResourceDefaultVersion
Properties:
TypeVersionArn: !Ref ResourceVersion
Outputs:
ExecutionRoleArn:
Value: !GetAtt ExecutionRole.Arn