question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CLI] Parameters are ignored for all subsequent deployments

See original GitHub issue

❓ General Issue

The Question

When deploying a stack using parameters, changes are not detected for any deployment after the initial one. Using this simple stack :

import * as cdk from '@aws-cdk/core';
import { CfnParameter, Fn } from '@aws-cdk/core';
import { CfnBucket } from '@aws-cdk/aws-s3';

export class CdkStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const parameter = new CfnParameter(this, "parameter",
    {
      type: 'String'
    });

    const bucket = new CfnBucket(this, "bucket", {
        tags: [
            {key: 'tag', value: Fn.ref(parameter.logicalId)}
        ]
    });
    
  }
}

The tag is set to “value” using this deployment code : cdk deploy --parameters CdkStack:parameter=value

But for any subsequent deployments changes are not detected when using a different parameter: cdk deploy --parameters CdkStack:parameter=newvalue

Using the previous-parameters flag result to the same output:

cdk deploy --previous-parameters false --parameters CdkStack:parameter=newvalue
CdkStack: deploying...

 ✅  CdkStack (no changes)

Environment

  • CDK CLI Version: 1.46.0 (build 63860b2)
  • Node.js Version: v12.15.0
  • OS: Windows 10
  • Language: Tested with TypeScript & C#

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Pomdapcommented, Jul 16, 2020

@shivlaks Yes this is working using --force As a result for my example :

cdk deploy --previous-parameters false --parameters CdkStack:parameter=newvalue --force
CdkStack: deploying...
CdkStack: creating CloudFormation changeset...
 0/2 | 11:55:31 | UPDATE_IN_PROGRESS   | AWS::S3::Bucket    | bucket
 1/2 | 11:55:51 | UPDATE_COMPLETE      | AWS::S3::Bucket    | bucket
 2/2 | 11:55:52 | UPDATE_COMPLETE_CLEA | AWS::CloudFormation::Stack | CdkStack
 2/2 | 11:55:53 | UPDATE_COMPLETE      | AWS::CloudFormation::Stack | CdkStack

 ✅  CdkStack
0reactions
github-actions[bot]commented, Jun 17, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

deploy — AWS CLI 1.27.37 Command Reference
Deploys the specified AWS CloudFormation template by creating and then executing a change set. The command terminates after AWS CloudFormation executes the ...
Read more >
How do I use the "Ignored Build Step" field on Vercel?
An example Ignored Build Step command where only commits made from the branches "main" and "staging" are allowed to be deployed.
Read more >
Use command-line parameters to install Visual Studio
The subsequent optional command line parameters, which are all prefixed ... This is required for the install command, and ignored for other ...
Read more >
A weblogic.Deployer Command-Line Reference
Deployer should ignore all version related code paths on the Administration Server. This behavior is useful when deployment source files are located on...
Read more >
Compose file version 3 reference - Docker Documentation
This section contains a list of all configuration options supported by a service ... The build option is ignored when deploying a stack...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found