aws-cloudformation / cloudformation-cli

The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.
Apache License 2.0
316 stars 157 forks source link

Unable to set stackId when testing with cfn invoke #998

Open chamcca opened 1 year ago

chamcca commented 1 year ago

When doing local testing of RESOURCEs, cfn invoke does not provide the ability to set a stackId on the request. This causes any handlers relying on the stackId to fail or incorporate special handling for missing stackId values.

Ideally, should be able to pass JSON like:

{
    "stackId": "test-stack",
    "desiredResourceState": {
        "Key1": "Value1",
        "Key2": "Value2"
    },
    "previousResourceState": {},
    "logicalResourceIdentifier": "SomeIdentifier"
}