Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions elb/elb.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
AWSTemplateFormatVersion: 2010-09-09
AWSTemplateFormatVersion: '2010-09-09'
Description: Elastic Load Balancer
Parameters:
VPC:
Type: 'AWS::EC2::VPC::Id'
Description: Choose which VPC the Application Load Balancer should be deployed to
Type: AWS::EC2::VPC::Id
Description: Choose which VPC the Application Load Balancer should be deployed
to
Subnets:
Description: Choose which subnets the Application Load Balancer should be deployed to
Type: 'List<AWS::EC2::Subnet::Id>'
Description: Choose which subnets the Application Load Balancer should be deployed
to
Type: List<AWS::EC2::Subnet::Id>
Resources:
S3BUCKET:
Type: 'AWS::S3::Bucket'
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
VersioningConfiguration:
Status: Enabled
MyLoadBalancer:
Type: 'AWS::ElasticLoadBalancing::LoadBalancer'
Type: AWS::ElasticLoadBalancing::LoadBalancer
Properties:
AccessLoggingPolicy:
Enabled: false
S3BucketName: !Ref S3BUCKET
S3BucketName: !Ref 'S3BUCKET'
CrossZone: false
Subnets: !Ref Subnets
Subnets: !Ref 'Subnets'
ConnectionDrainingPolicy:
Enabled: false
Listeners:
Expand All @@ -31,7 +33,7 @@ Resources:
Protocol: HTTPS
PolicyNames:
- My-SSLNegotiation-Policy
SSLCertificateId: 'arn:aws:iam::123456789012:server-certificate/my-server-certificate'
SSLCertificateId: arn:aws:iam::123456789012:server-certificate/my-server-certificate
Policies:
- PolicyName: My-SSLNegotiation-Policy
PolicyType: SSLNegotiationPolicyType
Expand Down Expand Up @@ -177,46 +179,46 @@ Resources:
- Name: EXP-KRB5-RC4-MD5
Value: 'true'
- Name: Protocol-SSLv3
Value: 'true'
Value: 'false'
- Name: Protocol-TLSv1
Value: 'true'
Value: 'false'
- Name: Protocol-TLSv1.1
Value: 'true'
Value: 'false'
MyLoadBalancerV2:
Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
LoadBalancerAttributes:
- Key: access_logs.s3.enabled
Value: false
Subnets: !Ref Subnets
Subnets: !Ref 'Subnets'
DummyTargetGroupPublic:
Type: 'AWS::ElasticLoadBalancingV2::TargetGroup'
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
HealthCheckIntervalSeconds: 6
HealthCheckPath: /
HealthCheckProtocol: HTTP
HealthCheckTimeoutSeconds: 5
HealthyThresholdCount: 2
Name: !Join
Name: !Join
- '-'
- - !Ref 'AWS::StackName'
- drop-1
Port: 80
Protocol: HTTP
UnhealthyThresholdCount: 2
VpcId: !Ref VPC
VpcId: !Ref 'VPC'
PublicLoadBalancerListener:
Type: 'AWS::ElasticLoadBalancingV2::Listener'
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- MyLoadBalancerV2
Properties:
DefaultActions:
- TargetGroupArn: !Ref DummyTargetGroupPublic
- TargetGroupArn: !Ref 'DummyTargetGroupPublic'
Type: redirect
RedirectConfig:
Protocol: http
- TargetGroupArn: !Ref DummyTargetGroupPublic
- TargetGroupArn: !Ref 'DummyTargetGroupPublic'
Type: authenticate-cognito
LoadBalancerArn: !Ref MyLoadBalancerV2
LoadBalancerArn: !Ref 'MyLoadBalancerV2'
Port: 80
Protocol: HTTP