Skip to content

AvailabilityZone parameters array marked as invalid #2809

Open
@stevbev

Description

@stevbev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    aws-documentsAWS-specific programming languages, DSLs, filetypes, LSP, JSON schemaaws-documents-sam-cfnLSP or JSON schema for CFN/SAM template yaml/json filesblockedwaiting on third party / upstream / externalbugWe can reproduce the issue and confirmed it is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions