Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use only one target group for the listeners to fix sticky sessions #46

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

jvisker
Copy link
Contributor

@jvisker jvisker commented Oct 31, 2023

From https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html:
"If you have a forward action with multiple target groups, and sticky sessions are enabled for one or more of the target groups, you must enable stickiness at the target group level."

When we added a second target group to the listeners it broke because it would require their to get stickiness to the target group set on the listener. I considered setting the group sticky session, but that would mess up blue green deployments because traffic would stick to the target groups which doesn't make sense with blue green deployments.

Copy link

github-actions bot commented Oct 31, 2023

Terraform Plan:

will create 26 resources:

  • aws_efs_file_system - my_efs
  • aws_alb - alb
  • aws_alb_listener - http_to_https
  • aws_alb_listener - https
  • aws_alb_listener - test_listener
  • aws_alb_target_group - blue
  • aws_alb_target_group - green
  • aws_cloudwatch_log_group - container_log_group
  • aws_cloudwatch_log_group - xray_log_group
  • aws_codedeploy_app - app
  • aws_codedeploy_deployment_group - deploymentgroup
  • aws_ecs_cluster - new_cluster
  • aws_ecs_service - service
  • aws_ecs_task_definition - task_def
  • aws_iam_policy - secrets_access
  • aws_iam_role - task_execution_role
  • aws_iam_role - task_role
  • aws_iam_role_policy_attachment - secret_task_policy_attach
  • aws_iam_role_policy_attachment - secrets_policy_attach
  • aws_iam_role_policy_attachment - task_execution_policy_attach
  • aws_iam_role_policy_attachment - xray_task_policy_attach
  • aws_route53_record - a_record
  • aws_route53_record - aaaa_record
  • aws_security_group - alb-sg
  • aws_security_group - fargate_service_sg
  • local_file - appspec_json

see details

Copy link
Contributor

@yoshutch yoshutch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as it looks like it works 😅

@jvisker jvisker merged commit 500f93d into main Oct 31, 2023
2 checks passed
@jvisker jvisker deleted the sticky branch October 31, 2023 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants