Skip to content

Commit

Permalink
Migrated load balancer from classic to application load balancer
Browse files Browse the repository at this point in the history
  • Loading branch information
mluypaert committed Aug 4, 2023
1 parent 23eacfe commit 8a9e592
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 deletions.
25 changes: 25 additions & 0 deletions .ebextensions/application-load-balancer.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
option_settings:
# As noted in the AWS docs, the following option cannot be set through the .ebextensions configuration files,
# and thus has to be defines through EB CLI arguments on environment creation.
#
# aws:elasticbeanstalk:environment:
# LoadBalancerType: application
#
# https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-alb.html#environments-cfg-alb-namespaces
aws:elasticbeanstalk:environment:
EnvironmentType: LoadBalanced
ServiceRole: aws-elasticbeanstalk-service-role
#Processors
aws:elasticbeanstalk:environment:process:default:
HealthCheckPath: '/index.html'
Port: '80'
Protocol: HTTP
StickinessEnabled: 'true'
StickinessLBCookieDuration: '43200'
#Listeners
aws:elbv2:listener:80:
ListenerEnabled: false
aws:elbv2:listener:443:
SSLCertificateArns: arn:aws:acm:us-east-1:357210185381:certificate/bdb39bca-9a70-491d-adb0-b500a1b71bde
Protocol: HTTPS
DefaultProcess: default
2 changes: 2 additions & 0 deletions .ebextensions/aws-ec2-vpc.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ option_settings:
ELBScheme: public
ELBSubnets:
- subnet-a33a2bd5
- subnet-1ce4c744
Subnets:
- subnet-a33a2bd5
- subnet-1ce4c744
VPCId: vpc-8e0087e9
13 changes: 0 additions & 13 deletions .ebextensions/elasticbeanstalk-environment.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ option_settings:
DeleteOnTerminate: 'false'
RetentionInDays: '14'
StreamLogs: 'true'
aws:elasticbeanstalk:environment:
EnvironmentType: LoadBalanced
ServiceRole: aws-elasticbeanstalk-service-role
aws:elasticbeanstalk:environment:process:default:
DeregistrationDelay: '20' #Default?
HealthCheckInterval: '15' #Default?
HealthCheckPath: '/index.html'
HealthCheckTimeout: '5' #Default?
MatcherHttpCode: '200' #Default?
Port: '80' #Default?
Protocol: HTTP #Default?
StickinessEnabled: 'true'
StickinessLBCookieDuration: '43200'
aws:elasticbeanstalk:hostmanager:
LogPublicationControl: 'true'
aws:elasticbeanstalk:managedactions:
Expand Down
7 changes: 0 additions & 7 deletions .ebextensions/securelistener-clb.config

This file was deleted.

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ eb-create: eb-def-app-env \
--region=us-east-1 \
--tags="CreatedBy=${AWS_IAM_UNAME},Role=RestAPI" \
--cname="${PROJ_NAME}" \
-p docker
-p docker \
--elb-type application \
--vpc.id vpc-8e0087e9 --vpc.ec2subnets subnet-1ce4c744,subnet-a33a2bd5 --vpc.elbsubnets subnet-1ce4c744,subnet-a33a2bd5 \
--vpc.elbpublic --vpc.publicip

.PHONY: eb-deploy
eb-deploy: eb-def-app-env \
Expand Down

0 comments on commit 8a9e592

Please sign in to comment.