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

Allow SSL cert and port 443 setup 🔒 #9

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Allow SSL cert and port 443 setup 🔒 #9

merged 1 commit into from
Nov 21, 2024

Conversation

alismx
Copy link
Collaborator

@alismx alismx commented Nov 20, 2024

DEVOPS PULL REQUEST

Related Issue

Changes Proposed

  • Output Changes:
    • Renamed alb_listener_rules_arns to http_alb_listener_rules_arns.
    • Added a new output https_alb_listener_rules_arns for HTTPS listener rules.
  • Variable Changes:
    • Added a new variable certificate_arn to manage SSL certificate for ALB.
  • ALB Listener and Rules:
    • Split aws_alb_listener_rule.this into aws_alb_listener_rule.http and aws_alb_listener_rule.https.
    • Added conditional logic for redirect actions based on the presence of certificate_arn.
    • Created a new aws_alb_listener.https resource with appropriate SSL settings and default action.
  • Dynamic Actions:
    • Introduced dynamic forward and redirect actions based on the presence of certificate_arn.
  • New HTTPS Listener Rule:
    • Added aws_alb_listener_rule.https for handling HTTPS paths with SSL termination.

@alismx alismx changed the title allow for ssl cert to be passed in for proper ssl and port 443 setup Allow SSL cert and port 443 setup 🔒 Nov 20, 2024
@alismx alismx self-assigned this Nov 21, 2024
content {
type = "forward"
target_group_arn = each.value.arn
# terraform will complain that we have a redirect action and a forward action but the issue disappears on a subsequent apply
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you elaborate on this terraform complaint?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's a deprecation warning saying we shouldn't have a redirect action, not anything that throws.

This happens when I create the infra with a cert and then run it without the cert (destroying all the ssl/443/cert related infra). That shouldn't be a typical case.

The resource doesn't explicitly delete the redirect part of the action, but it does implicitly because AWS doesn't allow it, which is why we don't see it on the follow-up run.

@alismx alismx marked this pull request as ready for review November 21, 2024 16:35
@rin-skylight rin-skylight self-requested a review November 21, 2024 16:38
Copy link
Collaborator

@rin-skylight rin-skylight left a comment

Choose a reason for hiding this comment

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

Found a possible solution to the trivy issue.

@@ -23,7 +23,7 @@ jobs:
with:
scan-type: 'fs'
scan-ref: .
Copy link
Collaborator

Choose a reason for hiding this comment

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

This scan-ref block is likely causing the false failures. Normally, we would isolate this to an operations directory, but we don't have that luxury here. Consider implementing skip-dirs to exclude the .cache directory: https://trivy.dev/v0.56/docs/configuration/skipping/

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.

Optional cert for setting up ssl and port 443
3 participants