
Answer-first summary for fast verification
Answer: !GetAtt
Overall explanation Correct option: AWS CloudFormation provides several built-in functions that help you manage your stacks. Intrinsic functions are used in templates to assign values to properties that are not available until runtime. !GetAtt - The Fn::GetAtt intrinsic function returns the value of an attribute from a resource in the template. This example snippet returns a string containing the DNS name of the load balancer with the logical name myELB - YML : !GetAtt myELB.DNSName JSON : "Fn::GetAtt" : [ "myELB" , "DNSName" ] Incorrect options: !Sub - The intrinsic function Fn::Sub substitutes variables in an input string with values that you specify. In your templates, you can use this function to construct commands or outputs that include values that aren't available until you create or update a stack. !Ref - The intrinsic function Ref returns the value of the specified parameter or resource. !FindInMap - The intrinsic function Fn::FindInMap returns the value corresponding to keys in a two-level map that is declared in the Mappings section. For example, you can use this in the Mappings section that contains a single map, RegionMap, that associates AMIs with AWS regions.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
As an AWS Certified Developer Associate currently working on designing and deploying cloud infrastructure, you are tasked with writing a CloudFormation template using YAML. The specific requirement is to create an EC2 instance and an RDS (Relational Database Service) resource within this template. Upon successful creation of these resources, you also need to configure the template to output the connection endpoint of the RDS database.
Which intrinsic function should you use to return the necessary connection endpoint value?
A
!GetAtt
B
!Ref
C
!FindInMap
D
!Sub
No comments yet.