Skip to content

[ssm] BucketName: "dummy-value-for-" results in unpredictable behavior #9138

@OlegBoulanov

Description

@OlegBoulanov

SystemsManager parameter lookup returns "dummy-value-for-XXXX" at first run.
But if used as a part of BucketName, this throws an exception on invalid bucket name

This results in unpredictable behavior

  • synth/deploy may work for several code changes in a row,
  • and fail miserably after cdk context --clear

Reproduction Steps

var bucketName = StringParameter.ValueFromLookup(stack, "/ssm/param/bucketName");
var bucketProps = new BucketProps { BucketName = bucketName, }

Error Log

Unhandled exception. Amazon.JSII.Runtime.JsiiException: Invalid S3 bucket name (value: logs.dummy-value-for-/ssm/param/bucketName)
Bucket name must be at least 3 and no more than 63 characters
Bucket name must only contain lowercase characters and the symbols, period (.) and dash (-) (offset: 21)

Environment

  • cdk --version 1.51.0 (build 8c2d53c)

  • Node.js Version: v12.7.0
  • OS: Windows
  • Language (Version): C#

Other

Can you please check for dummy and not throw from resource constructors?
You do check for tokens already, don't you?


This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ssmRelated to AWS Systems ManagerbugThis 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