aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.5k stars 3.84k forks source link

aws-ssm: CloudFormation failing to update custom resource that references ssm SendCommandCommand #27806

Open tdq132 opened 10 months ago

tdq132 commented 10 months ago

Describe the bug

When adding in a custom resource that calls SSM SendCommandCommand, somewhere, this is being translated to SendCommandCommandCommand (i.e. an extra Command is being appended to the SDK call).

In my cdk.out, I can see the custom resource with sendCommandCommand, as intended.

On CloudFormation deploy, the custom resource fails to deploy with error: Received response status [FAILED] from custom resource. Message returned: Unable to find command named: SendCommandCommandCommand for action: SendCommandCommand in service package @aws-sdk/client-ssm

Expected Behavior

I expect the custom resource to call SSM SendCommandCommand, which is the correct SDK call.

Current Behavior

Custom resource calling SSM SendCommandCommand is being rewritten to SendCommandCommandCommand which is nonexiestent in the AWS SDK JS v3 library.

Reproduction Steps

custom_resources.AwsSdkCall(
    action="sendCommandCommand",
    service="SSM",
    parameters=send_command_parameters,
    physical_resource_id=custom_resources.PhysicalResourceId.of(
        f"{document}{instance}"
    ),
    output_paths=["Command.CommandId"],
)

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.103.1 (build 3bb19ac)

Framework Version

No response

Node.js Version

v20.6.1

OS

Ubuntu 23.04

Language

Python

Language Version

Python 3.11.4

Other information

No response

pahud commented 10 months ago

According to the doc, have you tried this in the latest AWS CDK release?

service: 'ssm',
action: 'sendCommand',
github-actions[bot] commented 10 months ago

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

tdq132 commented 9 months ago

Yes, sendCommand works, but this does not explain why it has changed from sendCommand, to sendCommandCommand, and now back to sendCommand.