(Construct): (Removing reference in another stack, is causing removal in original stack)
See original GitHub issueDescribe the bug
I have a StringParameter in a Stack
RuleCreation = new StringParameter(this, "param-rule-creation", new StringParameterProps()
{
ParameterName = $"{DeploymentPrefix}-rulecreation",
Description = "Rule Creation Enabled",
StringValue = ruleCreation
});
This is being used in another Construct in a NetworkLoadBalancedTaskImageOptions()
like this
Secrets = new Dictionary<string, Secret> {
{ "Logging:LogLevel:Default" ,Secret.FromSsmParameter(props.BaseResources.LogLevel) },
{ "RuleCreation", Amazon.CDK.AWS.ECS.Secret.FromSsmParameter(props.BaseResources.RuleCreation) },
After it has been deployed, if I REMOVE the “RuleCreation” String Parameter from the “Secrets” dictionary and do a Cdk diff
It shows as it being removed from the Stack, even though it is still in the Stack. and hence I can not cdk deploy the change to remove, as the deploy of the Stack complains that I can not remove “RuleCreation” as it is used in the Construct.
Expected Behavior
I should be able to remove the “Secret” from the Construct, and it should remain in the Stack
Current Behavior
cdk diff/deploy attempts to remove the StringParameter from the Stack, when it should leave it
It should only have removed the reference in the Construct
Reproduction Steps
{
ParameterName = $"{DeploymentPrefix}-rulecreation",
Description = "Rule Creation Enabled",
StringValue = ruleCreation
});
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
cdk 2.2.26
Framework Version
core 3.1
Node.js Version
16.15.0
OS
Windows
Language
.NET
Language Version
.net 3.1
Other information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:16 (9 by maintainers)
Top GitHub Comments
All good, ill see if I can follow your tip above, otherwise ill just drop the stacks and recreate, as I cant just remove the reference as it complains. There’s something subtle going on that I just don’t understand 😦
Thanks for the help.
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.