Question about error in my cloudformation template

0

Hello,

We have an ongoing project for which we had created some yaml templates about a year or so ago to create a cluster, service, and push a docker image to the ecr. We had to backtrack and work on other parts of the project, but at the time we did the testing, our yaml templates were working and our script files were running the templates and creating the cluster and service properly.

We recently went back to test the templates and try to create our cluster and services, but are getting a new error. One of the templates attempts to create a network load balancer in the us-west-1 zone. The error returned by amazon is:

"The following Availability Zones us-west-1a cannot be associated with a load balancer. Please try a different Availability Zone. (Service: AmazonElasticLoadBalancing; Status Code: 400; Error Code: ValidationError;"

This is the section in my Yaml that has the network load balancer, which has previously worked.

An internal load balancer, this would be used for a service that is not

directly accessible to the public, but instead should only receive traffic

from your other services.

PublicLoadBalancer: Type: AWS::ElasticLoadBalancingV2::LoadBalancer Properties: Name: 'grpc-public-small' Subnets: - !Ref PublicSubnetOne - !Ref PublicSubnetTwo Tags: - Key: Name Value: grpc-public-small Type: network LoadBalancerAttributes: - Key: load_balancing.cross_zone.enabled Value: 'true'

Please assist in how to fix this. Thank you very much.

Mary

1 Answer
0

Hi There

AWS maps the physical Availability Zones randomly to the Availability Zone names for each AWS account. [1] So us-west-1a in AccountA might not map to the same physical AZ in AccountB. And all AZ's support load balancers.

One thing you can do is reference the AZ ID in cloudformation [2] when selecting your Subnets to ensure you are being consistent

[1] https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html

[2] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-availabilityzoneid

profile pictureAWS
EXPERT
Matt-B
answered a year ago
  • Thank you for your reply. I am not too well versed with cloud formation, I had someone help me create this one a while back, but can you look at my template and suggest how to fix please. I cannot post the entire template due to the only 600 allowed characters in this message.

    Thank you.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions

Relevant content