Intrinsic functions in AWS CloudFormation are powerful tools that allow you to manipulate and reference data within your templates at deployment time. Here's an overview of the core intrinsic functions, including !Ref, !GetAtt, !Sub, !Join, !Select, !FindInMap, and !If.
Core Intrinsic Functions
!Ref
-
Purpose: Returns a reference to a resource or parameter.
-
Usage:
- On a parameter: returns the value of the parameter.
- On a resource: returns the primary identifier (e.g., instance ID, bucket name).
yaml1InstanceType: !Ref InstanceTypeParam 2SubnetId: !Ref MySubnet
!GetAtt
-
Purpose: Returns an attribute of a resource.
-
Usage:
- Useful for retrieving specific attributes like ARNs, DNS names, etc.
yaml1FunctionArn: !GetAtt MyLambdaFunction.Arn 2LoadBalancerDNS: !GetAtt MyLoadBalancer.DNSName
!Sub
- Purpose: Substitutes variables in a string with values from parameters or
Read the full article at DEV Community
Want to create content about this topic? Use Nemati AI tools to generate articles, social posts, and more.

![[AINews] The Unreasonable Effectiveness of Closing the Loop](/_next/image?url=https%3A%2F%2Fmedia.nemati.ai%2Fmedia%2Fblog%2Fimages%2Farticles%2F600e22851bc7453b.webp&w=3840&q=75)



