Skip to content

updating asg role #1900

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

Open
wants to merge 4 commits into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions roles/aws/aws_ec2_autoscale_cluster/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,24 @@ aws_ec2_autoscale_cluster:
create_cert: false
create_distribution: false
cf_certificate_ARN: "" # Certificate must be in us-east-1 for CloudFront. Define a certificate to build a distribution.
listeners_http:
rules:
- Conditions:
- Field: host-header
Values:
- "example-redirect.com"
Priority: '4'
Actions:
- Type: redirect
RedirectConfig:
Host: "codeenigma.com"
Port: "#{port}"
Protocol: "HTTPS"
Path: "/#{path}"
Query: "#{query}"
StatusCode: "HTTP_301"
listeners_https:
rules: []
# Add custom listeners. See https://docs.ansible.com/ansible/latest/collections/community/aws/elb_application_lb_module.html
listeners: []
alb_ssl_policy: "ELBSecurityPolicy-TLS-1-2-2017-01" # Sets the ALB SSL policy to only accect TLSv1.2 and apply more secure ciphers.
Expand Down
2 changes: 2 additions & 0 deletions roles/aws/aws_ec2_autoscale_cluster/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
DefaultActions:
- Type: forward
TargetGroupName: "{{ aws_ec2_autoscale_cluster.name }}"
Rules: "{{ aws_ec2_autoscale_cluster.listeners_http.rules }}"
_aws_ec2_autoscale_cluster_listeners_redirect:
Protocol: HTTP
Port: "{{ aws_ec2_autoscale_cluster.alb_http_port }}"
Expand All @@ -370,6 +371,7 @@
DefaultActions:
- Type: forward
TargetGroupName: "{{ aws_ec2_autoscale_cluster.name }}"
Rules: "{{ aws_ec2_autoscale_cluster.listeners_https.rules }}"
when: aws_ec2_autoscale_cluster.create_elb

# @TODO - we can use the aws_acm_obsolete_certificate_arn variable to tidy up previous ACM certs, if it is defined.
Expand Down
Loading