compose-cli icon indicating copy to clipboard operation
compose-cli copied to clipboard

Allows flexible setting of AssignPublicIp (Fargate)

Open nobiit opened this issue 3 years ago • 2 comments

Description I don't want clients to be able to directly access my service via public ip in any way.

Describe the results you received: Currently there is no way to disable flexible public ip

Describe the results you expected: I expected to be able to set up assignPublicIP simply via ecs-compo.yml

Additional environment details (AWS ECS, Azure ACI, local, etc.): https://github.com/docker/compose-cli/blob/main/ecs/cloudformation.go#L238-L245

nobiit avatar Feb 23 '22 13:02 nobiit

In the meantime, you can try

x-aws-cloudformation:
  Resources:
    <Service>Service:
      Properties:
        NetworkConfiguration:
          AwsvpcConfiguration:
            AssignPublicIp: DISABLED

nobiit avatar Feb 23 '22 13:02 nobiit

Hello @nobiit If you want to give it a spin, you can do just that using ECS Compose-X. AssignPublicIp, in combination to putting your service in a subnet that has the internet gateway as default gateway, and you are good to go.

Instead of using x-aws-cloudformation, you define a "service level extension" that will allow to define extra settings. Here, with x-network you can set AssignPublicIp which will automatically take care of the rest for the final cloudformation template.

See this Deploy services with EIP on public subnets example.

Hope this helps :)

JohnPreston avatar May 05 '22 16:05 JohnPreston

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 02 '22 02:11 stale[bot]

This issue has been automatically closed because it had not recent activity during the stale period.

stale[bot] avatar Nov 12 '22 12:11 stale[bot]