You are on page 1of 14

AWS Cloudformation

© Copyright 2018 –
TeamWork 1
Cloudformation

Cloudformation

• Tool used to make automatic resources deployment on AWS

• Template file in json or yaml à Infrastructure as Code

• + Very good documentation


https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui
de/aws-template-resource-type-ref.html

© Copyright 2018 –
TeamWork 2
Cloudformation

Cloudformation – When to use it ?

Usefull use cases :

• Deployment to multiple environment


• Deployment of the same application multiple time

• Can be used to deploy every part of your infrastructure, it is then


easier to manage what was deployed

© Copyright 2018 –
TeamWork 3
Cloudformation

Cloudformation - Syntax
Parameters :

• Used to custom your template by allowing you to have dynamic


values each time you deploy the template
• Parameters values are asked when you deploy the template

© Copyright 2018 –
TeamWork 4
Cloudformation

Cloudformation - Syntax
Parameters :

• You can use Specific AWS types for the parameters


• Supported types :
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserG
uide/parameters-section-structure.html

© Copyright 2018 –
TeamWork 5
Cloudformation

Cloudformation - Syntax

Resource deployment :

• Define the resource you want to deploy


• You can access you parameter’s value or another resource by using
the function Ref
• Other functions : GetAtt, GetAZs, join, sub…

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui
de/intrinsic-function-reference.html

© Copyright 2018 –
TeamWork 6
Cloudformation

© Copyright 2018 –
TeamWork 7
Cloudformation

Cloudformation – How to deploy ?

Go to create stack

© Copyright 2018 –
TeamWork 8
Cloudformation

Cloudformation – How to deploy ?

© Copyright 2018 –
TeamWork 9
Cloudformation

Cloudformation – How to deploy ?

Specify your stack name and parameters value

© Copyright 2018 –
TeamWork 10
Cloudformation

Cloudformation – Checking the deployed stack

© Copyright 2018 –
TeamWork 11
Cloudformation

Cloudformation – Checking the deployed stack

© Copyright 2018 –
TeamWork 12
Cloudformation

Cloudformation – Updating the stack

To update the stack, select the stack on the console and:

• Click update stack


• Upload the updated cloudformation stack
• Only the resources modified in the template will be modified
• If anything goes wrong during the update, the stack rollbacks to the
last stable state

© Copyright 2018 –
TeamWork 13
Cloudformation

Cloudformation – deleting the stack

To delete the stack, select the stack on the console and:

• Click delete stack


• Be aware that all of the resources that were created by the stack
will be deleted

© Copyright 2018 –
TeamWork 14

You might also like