Skip to content

cli: an equals sign in a context value is dropped #5738

@jzj

Description

@jzj

If the value for a context contains an equals sign, the cli drops the equals sign.

cdk synth -c foo=bar=

Produces a value of "bar" for the context named "foo" instead of the expected value "bar=".

Reproduction Steps

  1. Synth the following stack with this context value -c foo=bar=:
export class FooStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const foo: string = this.node.tryGetContext('foo');
    new cdk.CfnOutput(this, 'foo', { value: foo });
  }
}
cdk synth -c foo=bar=

Expected Output

Outputs:
  foo:
    Value: bar=

Actual Output

Outputs:
  foo:
    Value: bar

Environment

  • CLI Version :1.19.0
  • Framework Version:1.19.0
  • OS :Linux
  • Language :TypeScript

Other


This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.in-progressThis issue is being actively worked on.p1package/toolsRelated to AWS CDK Tools or CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions