-
Notifications
You must be signed in to change notification settings - Fork 4k
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
VpcPlacement: allow picking subset of subnets #1577
Comments
Can you explain the situation a bit more? If you have more than 1 type of private subnet, you can give each of them a In other words, from a set of 2 private subnets in 3 availability zones, are you trying to select this:
Or this:
? The former is currently supported (by selecting based on "name"), the latter is not. |
Is it possible to give them a name when using
Yes this is the case. I would like to place in a subset of the AZs because there are specific AZs where we are running ECS cluster. Our VPC initially started with only 2 AZs but was expanded some time ago to cover 5 AZs, but this ECS cluster is still running in the original subset of two AZs. So I think I have two separate issues.
I was able to work around this particular issue by using const vpc = ec2.VpcNetwork.import(this, 'vpc', {
vpcId: "vpc-123",
availabilityZones: ['us-east-1a', 'us-east-1b'],
privateSubnetIds: ['subnet-1', 'subnet-2']
}); |
@chris-smith-zocdoc - can you share the tags on your subnets? I'm thinking if you look at the code in the context provider for VPC, you should be able to add a couple of tags and make this work. (I'm looking here https://github.com/awslabs/aws-cdk/blob/master/packages/aws-cdk/lib/context-providers/vpcs.ts#L58-L82) So what I might try, and I haven't done this, is adding a tag like @rix0rrr - is there a reason this shouldn't work? I'm not sure how we feel about asking existing VPC users to add tags to support our import? |
Resolved recently. |
Is there a way to control which subnets are used by the ApplicationLoadBalancer from the provided vpc?
I have a vpc defined outside of CDK which has many private subnets, I would like to place the AmazonElasticLoadBalancingV2 into two of the private subnets. Because the vpc has more than two private subnets I'm getting this error while deploying.
Here's the relevant code
I see
vpcPlacement
onBaseLoadBalancerProps
but I don't believe its flexible enough for my needs. It can only select all private subnets or a single subnet.The text was updated successfully, but these errors were encountered: