CyberKeeda In Social Media

AWS CloudFormation Psuedo Parameters

AWS Cloud Formation Pseudo Parameters.

Parameters section within CloudFormation template is way to gather inputs from user, which can be used within other sections of entire cloudformation script.

Pseudo Parameter
  • Type of parameters that are predefined by AWS Cloudformation.
  • We don't need to declare it within our template section.
  • Can be used the same way normal parameters are used via !Ref as an argument.
Usage Examples.

"AWS::Region" is one of the widely used Pseudo parameters, so below is the way we can use it under our CFN template.

CFN Output Section
    Value: !Ref "AWS::Region"

CFN Mappings Section
    Type: "AWS::EC2::Instance"
      ImageId: !FindInMap
      - ImageIdMap
      - !Ref !Ref "AWS::Region"
      - defaultAMI

So in the same there are few more pseudo parameters enlisted below.

  • Returns the account id from where the stack is being created.
  • Returns the list of notification Amazon Resource Names (ARNs) for the current stack
  • Removes the corresponding resource property when specified as a return value in the Fn::If intrinsic function.
  • Returns the partition that the resource is in. For standard AWS regions, the partition is aws. For resources in other partitions, the partition is aws-partitionname
  • Return where the stack is being created, example ap-south-1
  • Returns the ID of the stack as specified with the aws cloudformation create-stack command, such as arn:aws:cloudformation:ap-south-1:123456789987:stack/cyberkeedastack/90af3dc0-d9a7-01e4-972e-1234567se123.
  • Returns the name of the stack as specified with the aws cloudformation create-stack command, such as cyberkeedastack.
  • Returns the suffix for a domain. The suffix is typically, but might differ by region.

No comments:

Post a Comment

Designed By Jackuna