-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfn.yaml
50 lines (50 loc) · 1.33 KB
/
cfn.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
FunctionName:
Type: String
FunctionAlias:
Type: String
DomainName:
Type: String
SubjectAlternativeNames:
Type: CommaDelimitedList
Resources:
Approve:
Type: Custom::AcmApproverLambda
DependsOn: Function
Version: 1.0
Properties:
ServiceToken: !GetAtt Function.Arn
DomainName: !Ref DomainName
SubjectAlternativeNames: !Join [ ",", !Ref SubjectAlternativeNames ]
Function:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Ref "FunctionName"
DeploymentPreference:
Type: AllAtOnce
AutoPublishAlias: !Ref "FunctionAlias"
Handler: main
Tracing: Active
Runtime: go1.x
CodeUri: ./handler.zip
Timeout: 30
Policies:
- AWSLambdaBasicExecutionRole
- AWSXrayWriteOnlyAccess
- Statement:
- Effect: Allow
Action:
- acm:DescribeCertificate
- acm:RequestCertificate
- acm:DeleteCertificate
- route53:ListHostedZones
- route53:ChangeResourceRecordSets
Resource: "*"
Tracing: Active
Outputs:
FunctionArn:
Value: !GetAtt Function.Arn
Export:
Name: !Sub "${AWS::StackName}-FunctionArn"