2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CloudFormation の 擬似パラメータについて整理しよう

Posted at

AWS::AccountId
AWS::NoValue
AWS::Region
は個人的によく使う。

AWS::AccountId

123456789012 のように、AWSアカウントが返される。

AWS::NoValue

組み込み関数 !If の戻り値として指定すると、対応するリソースのプロパティを削除します。

次の例では、IsBurstType
true の場合は、CPUCredits: standard を返し、
falseの場合は、CreditSpecification を削除します。

AWSTemplateFormatVersion: "2010-09-09"
Parameters:
  IsBurstType:
    Type: String
    AllowedValues: ['true', 'false']

Conditions:
  IsBurstType: 
    Fn::Equals: ['true', !Ref IsBurstType]

Resources:
  EC2Instance:
    Type: "AWS::EC2::Instance"
    Properties:
      CreditSpecification:
        Fn::If:
          - IsBurstType
          - CPUCredits: standard
          - !Ref "AWS::NoValue"

AWS::Region

ap-northeast-1 のように、AWSリージョンが返される。

AWS::NotificationARNs

現在のStackの通知に使われるARNのリストを返す。

myASGrpOne:
  Type: AWS::AutoScaling::AutoScalingGroup
  Version: '2009-05-15'
  Properties:
    NotificationConfigurations:
    - TopicARN:
        Fn::Select:
        - '0'
        - Ref: AWS::NotificationARNs 
      NotificationTypes:
      - autoscaling:EC2_INSTANCE_LAUNCH
      - autoscaling:EC2_INSTANCE_LAUNCH_ERROR

AWS::Partition

標準の AWS リージョンの場合、aws
他のパーティションのリソースの場合は aws-partitionname

AWS::StackId

arn:aws:cloudformation:us-west-2:ap-northeast-1:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123 のように、スタックの ID を返す。

AWS::StackName

スタックの名前が返される。

AWS::URLSuffix

通常 amazonaws.com です。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?