I would like to update SSM Parameter using AWS CDK.
My use case: In first stack I am creating SSM parameter. In the second stack want to update(change) it. One of solution that I came across was using lambda, and i would like to avoid it.
Is the a way updating existing parameter via CDK, maybe something along cfn_param.set_value
First stack:
class ParamSetupStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
ssm.StringParameter( self,
f'PIPELINE-PARAM-1',
parameter_name="parma-1",
string_value="SOME STRING VALUE",
description="Desctiption of ...."
)
Second stack:
class UpdateParamStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
template = cfn_inc.CfnInclude(self, "Template",
template_file="PATH/TO/ParamSetupStack.json",
preserve_logical_ids=False)
cfn_param = template.get_resource("PIPELINE-PARAM-1")
cfn_param.set_value("NEW VALUE")