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

[ecs-patterns] ApplicationLoadBalancedEc2Service with httpToHttps mechanics #8775

Closed
2 tasks
logemann opened this issue Jun 28, 2020 · 3 comments
Closed
2 tasks
Assignees
Labels
@aws-cdk/aws-ecs-patterns Related to ecs-patterns library feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@logemann
Copy link

In the vein of having useful patterns for every day problems, i wonder if it wouldnt be useful to have a property like redirectToHttps: true|false in the properties of ApplicationLoadBalancedEc2Service.

Use Case

I think that most of the usage patterns of ApplicationLoadBalancedEc2Service is having a internet facing LoadBalancer for something like web applications. For that, you definitely need a redirect http to https feature.

Proposed Solution

enhance ApplicationLoadBalancedEc2Service with the mentioned property like this:

ApplicationLoadBalancedEc2Service(this, "id", {
   ...
   certificate: someCert,
   redirectToHttps: true|false
});

With that property set, the ApplicationLoadBalancedEc2Service would also create a HTTP Listener (besides the HTTPS listener) with a RedirectAction ascociated which looks basically like this:

    private createEverythingElseTo443Action(): RedirectOptions {
        return {
            protocol: "HTTPS",
            host: "#{host}",
            port: "443",
            path: "/#{path}",
            query: "#{query}"
        }
    }
  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@logemann logemann added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2020
@SomayaB SomayaB added the @aws-cdk/aws-ecs-patterns Related to ecs-patterns library label Jun 29, 2020
@MrArnoldPalmer
Copy link
Contributor

MrArnoldPalmer commented Jun 29, 2020

Hey there, this has been discussed a lot in a few other issues.

#5583 - discusses how users can accomplish this today creating their own listener.

#8488 - tracks the implementation of some convenience property like forceHttps similar to what you're describing.

Gonna close this as a duplicate of #8488. Feel free to reopen if you think this includes something else.

@logemann
Copy link
Author

sorry for not checking if related issue exist

@MrArnoldPalmer
Copy link
Contributor

No worries, good to know others are wanting this! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs-patterns Related to ecs-patterns library feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants