Description
Creating a CloudFormation stack requires a template that defines the resources to deploy. Terraform supplies it through template_body or template_url.
Potential impact
Creation of a new stack fails if its template is missing or inaccessible.
Remediation
Provide a valid template body or an accessible S3 template URL. Match supplied parameter values to the template and validate its contents before deployment.
Examples
The examples add a template URL. The URL is illustrative; the actual template must define the VPCCidr parameter and the resources to deploy.
Before
hcl
resource "aws_cloudformation_stack" "example" {
name = "networking-stack"
parameters = {
VPCCidr = "10.0.0.0/16"
}
}
After
hcl
resource "aws_cloudformation_stack" "example" {
name = "networking-stack"
parameters = {
VPCCidr = "10.0.0.0/16"
}
template_url = "https://example-bucket.s3.amazonaws.com/networking-stack.yaml"
}