Skip to content

RuntimeValue code uses invalid '@' char #151

@fulghum

Description

@fulghum

The CDK User Guide includes a sample for using RuntimeValues:

const topic = new Topic(this, 'MySnsTopic', {
  topicName: 'MyTopic'
});

const RTV_PACKAGE = 'com.amazonaws.rtvtest';

const runtimeValues = [
  new RuntimeValue(this, 'MyRuntimeValue', {
    package: RTV_PACKAGE,
    value: topic.topicArn
})];

This generates a 4xx error from CFN:

[5/7] Wed Jun 20 2018 10:09:10 GMT-0700 (PDT)  CREATE_FAILED       [AWS::SSM::Parameter] MyRuntimeValueParameterDF736969 Parameter name: can't be prefixed with "ssm" (case-insensitive). If formed as a path, it can consist of sub-paths divided by slash symbol; each sub-path can be formed as a mix of letters, numbers and the following 3 symbols .-_ (Service: AWSSimpleSystemsManagement; Status Code: 400; Error Code: ValidationException; Request ID: 6b273d3d-3519-400d-a2d7-953a61891913)
MyRuntimeValueParameterDF736969 was created at: /CdkPrivateBetaTestDrive7Stack/MyRuntimeValue/Parameter
        new RuntimeValue (/Users/fulghum/Projects/CDK-PrivateBeta-TestDrive7/node_modules/@aws-cdk/rtv/lib/rtv.js:9:9)
        \_ new CdkPrivateBetaTestDrive7Stack (/Users/fulghum/Projects/CDK-PrivateBeta-TestDrive7/bin/cdk-private_beta-test_drive7.js:26:9)

Here's what CDK is synthesizing for the CFN template:

    MyRuntimeValueParameterDF736969:
        Type: 'AWS::SSM::Parameter'
        Properties:
            Type: String
            Value:
                Ref: CdkPrivateBetaTestDrive7Topic0A32D738
            Name:
                'Fn::Join':
                    - ""
                    -
                        - /rtv/
                        -
                            Ref: 'AWS::StackName'
                        - /
                        - com.amazonaws.rtvtest
                        - '@'
                        - MyRuntimeValue

The '@' char doesn't seem to be valid for SSM property names.

Source line:
https://github.com/awslabs/aws-cdk/blob/master/packages/%40aws-cdk/rtv/lib/rtv.ts#L25

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions