Parameters, Mappings, and !Refs

Parameters:
  Environment:
    Description: Environment parameters
    Type: String
    Default: Development
    AllowedValues:
      - Production
      - Development
Mappings:
  AMIRegions_Map:
    eu-west-1:
      Development: ami-123456
      Production:  ami-654321
    eu-west-2:
      Development: ami-123321
      Production:  ami654456
    us-east-1:
      Development: ami-321123
      Production:  ami456456
Resources:
  WebEC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: !FindInMap [AMIRegions_Map, !Ref "AWS::Region", !Ref Environment]
      InstanceType: t2.micro
 
aws/aws-cloudformation-parameters-mappings-refs.txt · Last modified: 15/02/2024 10:19 by andrew