aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 78 forks source link

New-EC2IBComponent throws an error about tags when a component exists #151

Closed indented-automation closed 3 years ago

indented-automation commented 4 years ago

New-EC2IBComponent throws an error about tags when the component of the specified version already exists.

Expected Behavior

The command should tell you something about what's wrong. The error message is incredibly misleading.

Current Behavior

Attempting to create the same component of the same version twice raises the error:

New-EC2IBComponent: Invalid tag key/value. Tag keys may only contain unicode letters, digits, whitespace, or one of these symbols: _ . : / = + -. Tag key can be up to 128 characters. Tag value can be up to 256 characters.

Steps to Reproduce (for bugs)

$params = @{
    Name            = 'someComponent'
    Description     = 'someComponent'
    Platform        = 'Windows'
    SemanticVersion = '1.1.0'
    Tag             = @{
        Name = 'someTag'
    }
    Data            = @'
name: someComponent
description: someComponent
schemaVersion: 1.0

phases:
  - name: build
    steps:
      - name: install
        action: ExecutePowerShell
        inputs:
          commands:
            - someComponent
'@
}
New-EC2IBComponent @params
New-EC2IBComponent @params

Context

Trying to manage EC2 Image Builder configuration in code.

Your Environment

ashishdhingra commented 3 years ago

Hi @indented-automation,

Good afternoon.

This appears to be fixed in the version 4.1.0.0 for AWS Tools for Powershell:

Screen Shot 2020-09-29 at 1 31 48 PM
AWS Tools for PowerShell
Version 4.1.0.0
Copyright 2012-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Amazon Web Services SDK for .NET
Core Runtime Version 3.3.107.39
Copyright 2009-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Please verify the same and confirm if this issue could be closed.

Thanks, Ashish

github-actions[bot] commented 3 years ago

This issue has not recieved a response in 2 weeks. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.