Created
May 5, 2020 18:58
-
-
Save sk-t3ch/f04f2d610aa198f6caf41363d29b24eb to your computer and use it in GitHub Desktop.
Hello World API CloudFormation - Application Load Balancer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadBalancerSecGroup: | |
Type: AWS::EC2::SecurityGroup | |
Properties: | |
GroupDescription: Load balance allow port 80 traffic | |
VpcId: !ImportValue VPCID | |
SecurityGroupIngress: | |
CidrIp: 0.0.0.0/0 | |
FromPort: 80 | |
IpProtocol: TCP | |
ToPort: 80 | |
LoadBalancer: | |
Type: AWS::ElasticLoadBalancingV2::LoadBalancer | |
Properties: | |
SecurityGroups: | |
- !Ref LoadBalancerSecGroup | |
Subnets: | |
- !ImportValue PublicSubnetA | |
- !ImportValue PublicSubnetB | |
LoadBalancerListener: | |
Type: AWS::ElasticLoadBalancingV2::Listener | |
Properties: | |
Protocol: HTTP | |
LoadBalancerArn: !Ref LoadBalancer | |
DefaultActions: | |
- Type: forward | |
TargetGroupArn: !Ref LoadBalancerTargetGroup | |
Port: 80 | |
LoadBalancerTargetGroup: | |
Type: AWS::ElasticLoadBalancingV2::TargetGroup | |
Properties: | |
TargetType: lambda | |
Targets: | |
- AvailabilityZone: all | |
Id: !GetAtt Lambda.Arn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment