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

ApplicationLoadBalancedFargateService does not allow targetGroup to have protocol/port other than HTTPS/80 #7989

Closed
jackm-ts opened this issue May 14, 2020 · 6 comments
Labels
@aws-cdk/aws-ecs-patterns Related to ecs-patterns library closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort feature/pattern Feature requests related to high level L3 pattern libraries feature-request A feature should be added or improved. p2

Comments

@jackm-ts
Copy link

The target group props listed here should be configurable by the ApplicationLoadBalancedFargateServiceProps. We have use cases where our containers are accepting traffic on HTTPS.

@SomayaB SomayaB added feature-request A feature should be added or improved. @aws-cdk/aws-ecs-patterns Related to ecs-patterns library labels May 18, 2020
@SomayaB SomayaB added needs-triage This issue or PR still needs to be triaged. and removed needs-triage This issue or PR still needs to be triaged. labels May 18, 2020
@SoManyHs
Copy link
Contributor

SoManyHs commented May 18, 2020

I believe this can be addressed by #7417

@justin-ad
Copy link

justin-ad commented Nov 20, 2020

Ran into this as well. My ApplicationLoadBalancedFargateService has the following definition:

    ecs_patterns.ApplicationLoadBalancedFargateService(
            self,
            "MyService",
            service_name=f"my-service-{env}",
            cluster=cluster,
            memory_limit_mib=1024,
            cpu=512,
            task_image_options=ecs_patterns.ApplicationLoadBalancedTaskImageOptions(
                image=ecs.ContainerImage.from_ecr_repository(
                    my_service_repo, tag=env
                ),
                container_port=443,
            ),
            domain_name="my-domain-name.com",
            domain_zone=route53.HostedZone.from_hosted_zone_attributes(
                self,
                "MyZone",
                hosted_zone_id=config["HOSTED_ZONE_ID"],
                zone_name=config["ROOT_DOMAIN"],
            ),
            security_groups=[ecs_sg],
            certificate=my_certificate,
            listener_port=443,
            protocol=elasticloadbalancingv2.ApplicationProtocol.HTTPS,
            redirect_http=True,
        )

When I synth this, I get a Target Group with Protocol: "HTTP" and Port: 80 as follows:

    "MyServiceLBPublicListenerECSGroup29B5BAF2": {
      "Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
      "Properties": {
        "HealthCheckPath": "/",
        "HealthCheckProtocol": "HTTPS",
        "Matcher": {
          "HttpCode": "200,204"
        },
        "Port": 80,
        "Protocol": "HTTP",
        "TargetType": "ip",
        "VpcId": {
          "Fn::ImportValue": "my-vpc:ExportsOutputRefmihiniosvpcdevB1F54EAE4F14EF21"
        }
      },
      "Metadata": {
        "aws:cdk:path": "my-stack/MyService/LB/PublicListener/ECSGroup/Resource"
      }
    },

I can't seem to find any way to set the Target Group Port and Protocol to 443/HTTPS...

@justin-ad
Copy link

@MrArnoldPalmer @uttarasridhar Also, can we please change the issue title? I think @jackm-ts intended "HTTP/80" rather than "HTTPS/80".

@justin-ad
Copy link

#7417 Does not seem to relate to this: 7417 is related to the container listener not the Target Group listener, which this issue specifically pertains to.

@hoegertn
Copy link
Contributor

Also #11381

@MrArnoldPalmer MrArnoldPalmer added effort/small Small work item – less than a day of effort p2 labels Dec 7, 2020
@ericzbeard ericzbeard added the feature/pattern Feature requests related to high level L3 pattern libraries label Apr 2, 2021
@github-actions
Copy link

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels May 13, 2022
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 closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort feature/pattern Feature requests related to high level L3 pattern libraries feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

8 participants