-
Notifications
You must be signed in to change notification settings - Fork 232
/
serverless-domain-manager-deploy-policy.yaml
61 lines (58 loc) · 2.08 KB
/
serverless-domain-manager-deploy-policy.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
60
61
AWSTemplateFormatVersion: "2010-09-09"
Description: Template to generate minimum required permissions to run serverless domain manager plugin
Outputs:
ServerlessDomainManagerDeployPolicyArn:
Description: Serverless domain manager deployment iam policy arn
Value:
Ref: ServerlessDomainManagerDeployPolicy
Parameters:
HostedZoneId:
AllowedPattern: '[A-Za-z0-9]+'
Description: ID of the hosted zone to grant permissions to
Type: String
Resources:
ServerlessDomainManagerDeployPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- apigateway:AddCertificateToDomain
- apigateway:RemoveCertificateFromDomain
Resource: !Sub arn:aws:apigateway:${AWS::Region}::/domainnames*
- Effect: Allow
Action:
- apigateway:DELETE
- apigateway:GET
- apigateway:PATCH
- apigateway:POST
Resource:
!Sub arn:aws:apigateway:${AWS::Region}::/apis*
!Sub arn:aws:apigateway:${AWS::Region}::/domainnames*
!Sub arn:aws:apigateway:${AWS::Region}::/restapis*
- Effect: Allow
Action:
- cloudfront:UpdateDistribution
Resource: '*'
- Effect: Allow
Action:
- route53:ListHostedZones
Resource: '*'
- Effect: Allow
Action:
- acm:ListCertificates
- acm:DescribeCertificate
Resource: '*'
- Effect: Allow
Action:
- route53:ChangeResourceRecordSets
- route53:GetHostedZone
- route53:ListResourceRecordSets
Resource: !Sub arn:aws:route53:::hostedzone/${HostedZoneId}
- Effect: Allow
Action:
- iam:CreateServiceLinkedRole
Resource:
- !Sub arn:aws:iam::${AWS::AccountId}:role/aws-service-role/ops.apigateway.amazonaws.com/AWSServiceRoleForAPIGateway