Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Support load balancer config in x-aws-cloudformation overlay for private subnets #1319

Closed
dpca opened this issue Feb 18, 2021 · 4 comments
Closed
Labels
ecs stale Inactive issue

Comments

@dpca
Copy link

dpca commented Feb 18, 2021

Hello!

I'm trying to set up some internally-facing docker services using the docker ECS integration, and am currently creating my own load balancer within our private VPC and then defining it using x-aws-loadbalancer. I'm wondering if instead of this, could I put the CloudFormation into the x-aws-cloudformation overlay and maintain everything with the docker compose lifecycle? I think that would be very clean and simplify our setup quite a bit. I've tried using the x-aws-cloudformation overlay with a resource entry like the following to manually set the load balancer:

x-aws-cloudformation:
  Resources:
    LoadBalancer:
      Properties:
        Scheme: internal
        SecurityGroups:
          - sg-id
          - Ref: DefaultNetwork
        Subnets:
          - subnet-1
          - subnet-2
        Type: application
      Type: AWS::ElasticLoadBalancingV2::LoadBalancer

x-aws-vpc: vpc-id

but I get the error message:

VPC vpc-id should have at least 2 associated public subnets in different availability zones

Is there any possibility of supporting load balancer configuration in the overlay like this? Essentially I think this would require skipping the automated load balancer setup if LoadBalancer is present in the x-aws-cloudformation Resources entry. Alternatively, having private VPC support would also solve this issue because I wouldn't need to set up a custom LoadBalancer entry, although I saw #1064 so I assume this probably won't be supported.

Thanks for taking a look! I really appreciate docker and the ECS integration is awesome, so I'm hoping to see if I can find a nice way around this.

@gtardif gtardif added the ecs label Feb 22, 2021
@flaviostutz
Copy link
Contributor

I got this error some time ago when using a custom VPC (not the default VPC). Maybe you have something in this direction here...

@ndeloof
Copy link
Collaborator

ndeloof commented Mar 12, 2021

x-aws-cloudformation is an opaque attribute for ECS integration, to be applied as a patch to the compose->CF converted templated. So we can't use it to retrieve subnet information and change the conversion process.

#1411 could be a better option

@stale
Copy link

stale bot commented Sep 19, 2021

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 stale bot added the stale Inactive issue label Sep 19, 2021
@stale
Copy link

stale bot commented Sep 26, 2021

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

@stale stale bot closed this as completed Sep 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ecs stale Inactive issue
Projects
None yet
Development

No branches or pull requests

4 participants