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

fix(ec2): onePerAz does not work for looked-up VPCs #6265

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Feb 13, 2020

Fix the use of onePerAz for VPCs obtained through Vpc.fromLookup().

Fixes #3126.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Fix the use of `onePerAz` for VPCs obtained through `Vpc.fromLookup()`.

Fixes #3126.
@rix0rrr rix0rrr self-assigned this Feb 13, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 13, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 3332d06
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Feb 13, 2020

Thank you for contributing! Your pull request is now being automatically merged.

@rix0rrr rix0rrr merged commit 44ed2e6 into master Feb 13, 2020
@rix0rrr rix0rrr deleted the huijbers/lookup-oneperaz branch February 13, 2020 14:43
@hardcode83
Copy link

hardcode83 commented Aug 25, 2022

Hi guys, @rix0rrr

I am using ecsPatterns.NetworkLoadBalancedFargateService with a vpc imported with vpc lookup and I am having the same problem yet.

PS C:\pod\repos\cdk-ecs-networkloadbalancer> cdk --version
2.38.1 (build a5ced21)

export class EcsNetworkFargate extends Construct {
constructor(scope: Construct, id: string, props: EcsNetworkFargateProps) {
super(scope, id);
const repo = Repository.fromRepositoryArn(this, "repo", props.arnRepo)
const vpc = ec2.Vpc.fromLookup(this, "VPC", {
vpcId: props.vpcId
})
const hostedZone = route53.HostedZone.fromLookup(this, 'hosted_zone', {
domainName: props.domainZone
});

const loadBalancedFargateService = new ecsPatterns.NetworkLoadBalancedFargateService(this, 'gd-billing', {
  vpc: vpc,

  assignPublicIp: props.assignPublicIp,
  taskSubnets:
  {subnetType: ec2.SubnetType.PUBLIC,
    onePerAz: true,
  
  }

}
}

**I am tryng filter with the several options of taskSubnets but always get the same error:

AWS::ElasticLoadBalancingV2::LoadBalancer | staging/sdf/LB (asdfLB6A0E60DF) A load balancer cannot be attached to multiple subnets in the same Availability Zone (Service: AmazonElasticLoadBalancing; Status Code: 400; Error Code: InvalidConfigurationRequest; Request ID: 303a030b-0ec7-4dbd-afe1-195b3089c529; Proxy: null)

Thx you su much in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subnet selection returns more than one per AZ
4 participants