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://”, {“Ref” : “ElasticLoadBalancerDNSName”}]]
C.
“Fn::Join” : [“”. [ “http://”, {“Ref” : “ElasticLoadBalancerUrl”}]]
D.
“Fn::Join” : [“”. [ “http://”, {“Fn::GetAtr” : [ “ElasticLoadBalancer”,”Url”]}]]
Correct answer is D
Answer is A.. check this page
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html
Correct answer is A, and should be GetAtt not GetAtr
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/example-templates-autoscaling.html
exact code snippet:
“Outputs” : {
“URL” : {
“Description” : “The URL of the website”,
“Value” : { “Fn::Join” : [ “”, [ “http://”, { “Fn::GetAtt” : [ “ElasticLoadBalancer”, “DNSName” ]}]]}
}
}
I cant see any references to a “Url” attribute in the documentation so answer must be A.
a
A is also long but its should be GetAtt
D
A
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#aws-properties-ec2-elb-ref
A
It has to be A. URL by definition includes protocol too (http/https). The join operation in given options already concatenating “http” protocol so all is needed to attach a DNS name and hence answer A fulfills this request.
It’s always hilarious seeing people post what they think is the answer here and have no clue. Why on EARTH would you think that it’s D?
Have you never made a cloudformation template with a load balancer? Have you never looked at what properties are exposed by a load balancer?
If you are just guessing, don’t put it down in the comments as an answer. It’s just a waste of everyones time.
BTW, the answer is OBVIOUSLY A.
A