User Tools

Site Tools


aws:aws-cloudformation-parameters-mappings-refs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

aws:aws-cloudformation-parameters-mappings-refs [06/08/2024 09:29] – created - external edit 127.0.0.1aws:aws-cloudformation-parameters-mappings-refs [30/05/2025 09:39] (current) – removed andrew
Line 1: Line 1:
-===== Parameters, Mappings, and !Refs ===== 
- 
- 
-==== Parameters ==== 
- 
-<code yaml> 
---- 
-Parameters: 
-    ParameterTest: 
-        Type: String 
-        Description: Enter t2.micro, m1.small, or m1.large. Default is t2.micro. 
- 
-Resources: 
-  BasicParameter: 
-    Type: AWS::SSM::Parameter 
-    Properties: 
-      Name: AJS-testPara 
-      Type: String 
-      Value: !Ref ParameterTest 
-      Description: SSM Parameter test. 
-      Tags: 
-        Environment: DEV 
- 
-</code> 
- 
- 
-==== Mappings ==== 
- 
-<code yaml> 
---- 
-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 
-</code> 
- 
- 
-==== Passing parameters in to a cloudformation file ==== 
- 
- 
-Declare Variables in Parameters section of CF script 
- 
-<code yaml> 
---- 
-Parameters: 
-    VPCName: 
-        Type: String 
-        Description: VPC Name for test. 
- 
-Resources: 
-  BasicParameter: 
-    Type: AWS::SSM::Parameter 
-    Properties: 
-      Name: AJS-test-VPC-Name 
-      Type: String 
-      Value: !Ref VPCName 
-      Description: SSM Parameter test. 
-      Tags: 
-        Environment: Test 
-</code> 
- 
-<code bash> 
-#!/bin/bash 
- 
-aws cloudformation create-stack \ 
-        --stack-name Stack1 \ 
-        --template-body file://stack1.yaml \ 
-        --capabilities CAPABILITY_NAMED_IAM \ 
-        --parameters \ 
-                ParameterKey=VPCName,ParameterValue=MyVPC 
-</code> 
- 
-This page has been accessed for:- \\ 
-Today: {{counter|today}} \\ 
-Yesterday: {{counter|yesterday}} \\ 
-Until now: {{counter|total}} \\ 
  
aws/aws-cloudformation-parameters-mappings-refs.1722936542.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki