W3010 AWS::EC2::Volume requires hardcoded AvailabilityZone
See original GitHub issuecfn-lint version: (cfn-lint --version
)
0.20.0
Description of issue. Creating additional volumes require AvailabilityZone as a mandatory property.
Please provide as much information as possible: When creating additional volumes to be associated with an instance, there is a requirement to add the AvailabilityZone as a mandatory property.
AvailabilityZone The Availability Zone in which to create the new volume. Required: Yes Type: String
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html
Cfn-lint uses the CloudFormation Resource Specifications as the base to do validation. These files are included as part of the application version. Please update to the latest version of cfn-lint
or update the spec files manually (cfn-lint -u
)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
If you are associating to an instance you can use the instance attribute too.
The rule is there to prevent you from hardcoding AZ’s, making going multi-region more complex.
In this an AZ is indeed needed, but it’s about how to specify this. Never “lock” it to a region/AZ in the template itself, but use parameters or intrinsic function (or something else) so the template can be deployed to other regions.
Example
In this template, only the first one (hardcoded one) generated an error (The
W3010
warning in this case). The other 2 are “dynamic” ways of specifying the AZ.