Skip to content

(aws-cloudfront): WebACL validate throws error webAclId.startsWith is not a function #34099

@JustinLiang90

Description

@JustinLiang90

Describe the bug

The error is introduced by the PR: #32252

When doing validation, it only consider the value is type of string, but it could also be Token if pass as reference .

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

CDK should build and deploy successfully.

Current Behavior

CDK throws webAclId.startsWith is not a function error during build and deploy.

Image

Reproduction Steps

  1. Create a distribution with webAclId parameter.
  2. Passing token type value to webAclId, for example:
cfn.getNestedStack("WafStack").includedTemplate.getOutput("WebAclArn").value

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.188

Framework Version

No response

Node.js Version

18.20.4

OS

ubuntu

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cloudfrontRelated to Amazon CloudFrontbugThis issue is a bug.effort/mediumMedium work item – several days of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions