Skip to content

sam deploy improperly handles whitespace in tags #1925

@zsabin

Description

@zsabin

Description

sam deploy fails to correctly handle whitespace in tag keys and values when passed using the --tags flag. AWS Cloudformation docs specify that whitespace is valid for both keys and values: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html.

Steps to reproduce

sam deploy
--debug
--profile <>
--template-file <>
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM
--parameter-overrides <>
--stack-name <>
--tags "key name=foo bar"

Observed result

The command above will tag resources as name=foo

Expected result

Should tag resources as key name=foo bar

The same tags specified using the aws cloudformation deploy command will produce the expected result.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: macOS
  2. sam --version:
    SAM CLI, version 0.47.0

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