Skip to content

Hotswap doesn't update SSM parameter environment variables properly #25387

@fongchinghinunsw

Description

@fongchinghinunsw

Describe the bug

My lambda function is like the following.
new NodejsFunction(this, "some-id", { environment: { VAR1: StringParameter.valueForStringParameter(this, "/au/parameter/cool-parameter") } })

If I deploy the function before and apply hotswap, the deployment works fine. However, if I add a new environment variable to the function and use hotswap to deploy it. The value of the variable VAR1 is resolved to the path (i.e. /au/parameter/cool-parameter) instead of the true value in the parameter store.

Expected Behavior

CDK should be able to resolve the right SSM parameter value.

Current Behavior

The value of the variable VAR1 is resolved to the path (i.e. /au/parameter/cool-parameter) instead of the true value in the parameter store.

Reproduction Steps

new NodejsFunction(this, "some-id", { environment: { VAR1: StringParameter.valueForStringParameter(this, "/au/parameter/cool-parameter") } })

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.69.0

Framework Version

No response

Node.js Version

16

OS

macOS Ventura 13.2.1

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ssmRelated to AWS Systems Managereffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.hotswapp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions