-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-template.yaml
More file actions
38 lines (33 loc) · 1.24 KB
/
Copy pathexample-template.yaml
File metadata and controls
38 lines (33 loc) · 1.24 KB
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
# ESTE TEMPLATE MOSTRA COMO UTILIZAR O LAMBDA DescribeElbEnvironment.go QUE É UM CLOUDFORMATION RESOURCE PROVIDER.
# MAS ESTE TEMPLATE NÃO PRECISA SER DEPLOYADO.
# Ver o arquivo README.MD para mais informações
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: 'lambda to OUTPUT the ARN of an elastic beanstalk load balancer'
Parameters:
AliasName:
Type: String
AllowedValues:
- dev
- hml
- prod
Resources:
DescribeElbEnvironment:
Type: AWS::Serverless::Function
Properties:
Handler: DescribeElbEnvironment.goex
CodeUri: main
Runtime: go1.x
Description: ''
AutoPublishAlias: !Ref AliasName
Policies:
- AWSLambdaBasicExecutionRole # write logs in cloudwatch
- AWSElasticBeanstalkReadOnlyAccess # read-only access to information from elastic beanstalk
GetLbArn:
Type: Custom::DescribeElbEnvironment
Properties:
ServiceToken: !GetAtt DescribeElbEnvironment.Arn
ElasticBeanstalkEnvironmentName: "SOME-ELASTIC-BEANSTALK-ENVIRONMENT-NAME"
Outputs:
ElasticBeanstalkLoadBalancerArn:
Value: !GetAtt GetLbArn.LoadBalancerArn