Solution to Exercise
- One approach is to write six subnet resources
- Better way could be if we can use some kind of looping
- If there is a way to write loops it would simplify the resource creation.
- We can create multiple resources by using count meta-data Refer Here
resource "resource-type" "name-of-resource" {
count = <number-of-resources>
arg1 = val1
...
argn = valn
}
resource "aws_vpc" "my_vpc" {
count = 0
cidr_block = "192.168.0.0/16"
}
- We can also control the creation of resources based on conditional expressions Refer Here
- We should also understand deployment strategies
- red-green/blue-green
- canary deployment
Like this:
Like Loading...