cdk-from-cfn icon indicating copy to clipboard operation
cdk-from-cfn copied to clipboard

Bug: IpAddressType unrecognized as a valid property of AWS::ApiGatewayV2::Api

Open fibert opened this issue 10 months ago • 1 comments

When trying to use cdk migrate with an IpAddressType attribute the migration fails with the following error:

 ❌  Migrate failed for `[Name]`: [Name]Stack could not be generated because IpAddressType is not a valid property for resource ApiGatewayV2Api of type AWS::ApiGatewayV2::Api

CDK's CfnApi supports IpAddressType.

When deleting this attribute, the migration is successful


My CloudFormation template was generate by CloudFormation IaC Generator, and contains the following:

  ApiGatewayV2Api:
    UpdateReplacePolicy: "Retain"
    Type: "AWS::ApiGatewayV2::Api"
    DeletionPolicy: "Retain"
    Properties:
      IpAddressType: "ipv4"
      RouteSelectionExpression: "$request.method $request.path"
      CorsConfiguration:
        MaxAge: 300
        AllowOrigins:
        - "*"
        AllowCredentials: false
        ExposeHeaders: []
        AllowMethods:
        - "OPTIONS"
        - "GET"
        AllowHeaders:
        - "content-type"
      ProtocolType: "HTTP"
      DisableExecuteApiEndpoint: false
      Tags:
        Project: "Resume-Site"
        Environment: "dev"
        ManagedBy: "Terraform"
      Name: "resume-site-dev-api"
  ApiGatewayV2Deployment:
    UpdateReplacePolicy: "Retain"
    Type: "AWS::ApiGatewayV2::Deployment"
    DeletionPolicy: "Retain"
    Properties:
      ApiId:
        Ref: "ApiGatewayV2Api"
      Description: "Automatic deployment triggered by changes to the Api configuration"

fibert avatar Apr 28 '25 11:04 fibert

Likely related to https://github.com/cdklabs/cdk-from-cfn/issues/771 and requiring update of cdk-from-cfn in the CLI.

mrgrain avatar Apr 29 '25 08:04 mrgrain