Open
Description
Getting Incorrect type. Expected "string".
for the parameter [ 0, !GetAZs '' ]
in the following:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
AvailabilityZone: !Select [ 0, !GetAZs '' ]
CidrBlock: !Ref PrivateSubnetRange1a
MapPublicIpOnLaunch: false
Tags:
- Key: Name
Value: !Sub ${EnvironmentName}-1a-private
The template works fine and creates the VPC and subnets as expected. The issue is the AWS Toolkit extension is marking the parameter as incorrect even though it is valid syntax.
I discovered that when the file first loads in VS Code, there are highlighted syntax errors throughout the template (the Amazon dynamic variables) and after the AWS Toolkit extension loads all of the syntax errors clear. After making any edit to the CloutFormation template, the segment in question becomes marked as invalid again.
- OS: MacOS 12.5
- Visual Studio Code version: 1.70.0
- AWS Toolkit version: 1.46.0