Which code snippet below returns the URL of a load balanced web site created in CloudFormation with an
AWS::ElasticLoadBalancing::LoadBalancer resource name “ElasticLoad Balancer”?
A.
“Fn::Join” : [“”. [ “http://”, {“Fn::GetAtr” : [ “ElasticLoadBalancer”,”DNSName”]}]]
B.
“Fn::Join” : [“”. [ “http://”, {“Fn::GetAtr” : [ “ElasticLoadBalancer”,”Url”]}]]
C.
“Fn::Join” : [“”. [ “http://”, {“Ref” : “ElasticLoadBalancerUrl”}]]
D.
“Fn::Join” : [“.”, [ “http://”, {“Ref” : “ElasticLoadBalancerDNSName”}]]
Actual answer is A. AWS::ElasticLoadBalancing::LoadBalancer doesn’t have Url property. Event if you don’t know this it is useless to join “http://” to URL.
A
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/example-templates-autoscaling.html
A
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html
A is the correct answer as mentioned above.
See : https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html
{code}
my-load-balancer-424835706.us-west-2.elb.amazonaws.com
…..
{code}
Regards,
Frank
A