May 2019
Intermediate to advanced
308 pages
8h 5m
English
The DependsOn attribute allows us to control the order in which the resources will be deployed. By default, CloudFormation performs all resource deployments in parallel. We need to serialize deployment, for example, when a resource needs to be created before another resource can be deployed on top of it. Think of a VPC and its subnets. We cannot deploy those in parallel as we need to have the VPC created before we can create subnets.
Here is an example of a DependsOn attribute:
{ "Resources" : { "myEC2" : { "Type" : "AWS::EC2::Instance", "Properties" : { "ImageId": "ami-1234wxyz", } }, "DependsOn" : "myDB" } } }
Read now
Unlock full access