aws / aws/aws-cdk

Core: CfnCodeDeployBlueGreenHook TestTrafficRoute LogicalID cant be empty or undefined.

Open
#33,020 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-codedeploy bug effort/medium p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

The [documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/about-blue-green-deployments.html) for the CfnCodeDeployBlueGreenHook states that the test listener for the TrafficRoutingConfig object is optional. Furthermore the [blue-green-hook-syntax example](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/blue-green-hook-syntax.html) states the LogicalID for the TestTrafficRoute is not required.

However, the testTrafficRoute type does not allow undefined as a value, and when I provide an empty string I get the following error in my AWS CloudFormation stack:

`Invalid CloudFormation template: Logical Resource ID cannot be empty`

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Version

_No response_

### Expected Behavior

I can specify `undefined` or `“”` for the TestTrafficRoute LogicalID, when no aws::ElasticLoadBalancingV2::Listener test listener Is required.

### Current Behavior

I get the following error in my AWS CloudFormation stack:

`Invalid CloudFormation template: Logical Resource ID cannot be empty`

### Reproduction Steps

Recreate the CfnCodeDeployBlueGreenHook template example in cdk, and try to specify ”” for the testTrafficRoute LogicalID

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.164.1

### Framework Version

_No response_

### Node.js Version

v20.18.0

### OS

MacOS

### Language

TypeScript

### Language Version

TypeScript (4.9.4)

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the CfnCodeDeployBlueGreenHook implementation and the testTrafficRoute type, then reproduce the issue using the blue-green-hook-syntax example with an omitted or empty TestTrafficRoute LogicalID. Done means the optional test listener can be omitted without producing an empty Logical Resource ID in the generated CloudFormation template.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.