-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
36 lines (28 loc) · 1.49 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Identation is important while writing in yml file
subnet calculation: http://www.davidc.net/sites/default/subnets/subnets.html?network=10.0.0.0&mask=19&division=1.0
[] !Join ['', [!Ref "AWS::StackName", "-VPC" ]]
!Join: glueing text strings.
first '' identifies words to be glued.
!Ref: references something defined somewhere in template
AWS::StackName: stack name. todo: importance??
-VPC: suffix name for vpc. SO it will start something with "stackname-VPC"
[] !Select [ 0, !GetAZs]
!GetAZs: returns list of all the AZ in current regions.
!Select: selects specified index from the specified list. 0 is the first AZ in the list
[] !Sub ${AWS::StackName}-Public-A
!Sub: substitute function. renders and substitute values within ${} as specified.
[] DependsOn: AttachGateway todo: ??
[] AllocationId: !GetAtt ElasticIPAddress.AllocationId
AllocationId: Allocating Fixed IP address... i.e. and elastic IP. Which remains constant irrespective
!GetAtt: get that elastic IP
CLI:
> aws cloudformation create-stack --stack-name <name>> --template-body file://./<filename>.yml --profile <>
> aws cloudformation wait stack-create-complete --stack-name <> todo:??
> aws cloudformation update-stack --stack-name <name> --template-body file://<name>>.yml
To update stack
> aws cloudformation wait stack-update-complete --stack-name <name>
To monitor progress
> aws cloudformation delete-stack --stack-name <name>
To delete
#gotchas
- any errors encountered while creating stack, entire resource creation will be rolled back.