Skip to content

Detecting drift from the command line #24494

Open
@j4zzcat

Description

@j4zzcat

Describe the bug

Some of the stack names listed with cdk list cannot be fed into aws cloudformation <command> --stack-name <stack-name>.

Expected Behavior

The cloudformation module of the AWS CLI should accept the stack names listed in cdk list, or the other way around.

Current Behavior

Some of the stack names listed with cdk list cannot be fed into aws cloudformation <command> --stack-name <stack-name>.

Reproduction Steps

First, get a list of stacks:

$ cdk list
building... [omitted for clarity]

playground1
playground1-safetynet
playground1/es-hist-cluster1
playground1/es-rt-cluster1

Now, detect the drift:

$ aws cloudformation detect-stack-drift --stack-name "playground1/es-rt-cluster1"

An error occurred (ValidationError) when calling the DetectStackDrift operation: 
1 validation error detected: Value 'playground1/es-rt-cluster1' at 'stackName' failed to satisfy constraint: 
Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/._+]*

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.67.0 (build b6f7f39)

Framework Version

No response

Node.js Version

v19.6.1

OS

macOS 13.1

Language

Java

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions