Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack description not triggering a change to the stack when adding to existing stack #9638

Closed
jpSimkins opened this issue Aug 12, 2020 · 10 comments
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort needs-reproduction This issue needs reproduction. p2 package/tools Related to AWS CDK Tools or CLI

Comments

@jpSimkins
Copy link

❓ General Issue

The Question

I see that the description was added for a stack by this PR

I wanted to add a description to my existing stack, so I added the prop to the entry point:

#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from '@aws-cdk/core';
import { CodepipelineForEcrStack } from '../lib/codepipeline-for-ecr-stack';

const app = new cdk.App();
new CodepipelineForEcrStack(app, 'CodepipelineForEcrStack', {
  description: "Creates ECR repo and a pipeline for the repo."
});

but when I run cdk deploy I am presented with:

cdk deploy
CodepipelineForEcrStack: deploying...
[0%] start: Publishing afe12ee13b10f5531c1f6afc434951e2965d2ce674cd6131e0e18ce24003942f:current
[100%] success: Published afe12ee13b10f5531c1f6afc434951e2965d2ce674cd6131e0e18ce24003942f:current
CodepipelineForEcrStack: creating CloudFormation changeset...

 ✅  CodepipelineForEcrStack (no changes)

Environment

  • CDK CLI Version: 1.57.0 (build 2ccfc50)
  • Module Version: 1.57.0
  • Node.js Version: v12.18.3
  • OS: Linux Zeus 5.4.0-42-generic Reduce boilerplate for single stack apps #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Language (Version): typescript (3.7.5)

Other information

My stack code did not change, I only edited the entry point file to include the prop for the description.

My stack is:

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

    // All my code...
  }
}

I am new to the CDK (today is my second day using it) so please excuse any missed jargon that I am not using properly.

@jpSimkins jpSimkins added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Aug 12, 2020
@shivlaks
Copy link
Contributor

@jpSimkins - as a workaround, can you try supplying the --force flag. it should trigger a deployment regardless of whether the template itself has changed, which is what I think the deployment optimization is checking for.

@jpSimkins
Copy link
Author

@shivlaks Thanks for your suggestion. I used:

cdk deploy --force
CodepipelineForEcrStack: deploying...
[0%] start: Publishing afe12ee13b10f5531c1f6afc434951e2965d2ce674cd6131e0e18ce24003942f:current
[100%] success: Published afe12ee13b10f5531c1f6afc434951e2965d2ce674cd6131e0e18ce24003942f:current
CodepipelineForEcrStack: creating CloudFormation changeset...

 ✅  CodepipelineForEcrStack (no changes)

Still not working.

@jpSimkins
Copy link
Author

jpSimkins commented Aug 12, 2020

I destroyed the stack and re-deployed it. For now I have a description. I will leave this open for now as this should trigger a change event either way. Having to destroy a stack to add a description does not seem ideal or warranted.

@SomayaB SomayaB added package/tools Related to AWS CDK Tools or CLI and removed needs-triage This issue or PR still needs to be triaged. labels Aug 12, 2020
@NGL321 NGL321 added bug This issue is a bug. and removed guidance Question that needs advice or information. labels Sep 10, 2020
@shivlaks
Copy link
Contributor

@jpSimkins - I'm not able to reproduce this issue.

I created and deployed a stack.
I then went and added the description property

new MyFlyStack(app, 'MyFlyStack', {
    description: 'my stack description',
});
yarn build && cdk synth
yarn run v1.22.4
warning package.json: No license field
$ tsc
✨  Done in 6.85s.
Description: my stack description

and then when i run a diff

Stack MyFlyStack
Template
[+] Description Description: my stack description

This was on version 1.61.0 - what am I missing here?

@shivlaks shivlaks added needs-reproduction This issue needs reproduction. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Sep 15, 2020
@jpSimkins
Copy link
Author

Hello @shivlaks,

Thanks for your reply. I had this issue a while ago so I decided to see what would happen to my existing stack.

I currently have the description so I first attempted to remove it:

const app = new cdk.App();
const pipeline = new CodepipelineForEcrStack(app, 'CodepipelineForEcrStack', {
  // description: "Creates ECR repo and a pipeline for the repo.",
  env: {
		account: process.env.CDK_DEFAULT_ACCOUNT,
		region: process.env.CDK_DEFAULT_REGION,
	}
});

When I run a diff:

$ aws2-wrap --profile olympusat-development-dev cdk diff
Stack CodepipelineForEcrStack
Template
[-] Description Description: Creates ECR repo and a pipeline for the repo.

All looks good, once I deployed:

$ aws2-wrap --profile olympusat-development-dev cdk deploy
[Warning at /CodepipelineForEcrStack/CDKTestProject/sgForALB] Ignoring Egress rule since 'allowAllOutbound' is set to true; To add customize rules, set allowAllOutbound=false on the SecurityGroup
[Warning at /CodepipelineForEcrStack/CDKTestProject/sgForALB] Ignoring Egress rule since 'allowAllOutbound' is set to true; To add customize rules, set allowAllOutbound=false on the SecurityGroup
CodepipelineForEcrStack: deploying...
[0%] start: Publishing 499d69e679ca00943d0fd17e1d25fceffa83be64e47be8988e17e29497e3db4b:current
[50%] success: Published 499d69e679ca00943d0fd17e1d25fceffa83be64e47be8988e17e29497e3db4b:current
[50%] start: Publishing 60a3d2a732cd54a1cd58b64ceeaf26cbc65ec61ec9edd0df885e6cd4d0ac78dc:current
[100%] success: Published 60a3d2a732cd54a1cd58b64ceeaf26cbc65ec61ec9edd0df885e6cd4d0ac78dc:current
CodepipelineForEcrStack: creating CloudFormation changeset...

 ✅  CodepipelineForEcrStack (no changes)

Stack ARN:
arn:aws:cloudformation:us-east-1:311209486XXX:stack/CodepipelineForEcrStack/ba444d70-f49e-11ea-909d-XXXXXXXX

The description was not removed. This is similar to what happened to me when I first added the description. I can try with a new stack if you need better details.

My setup:
CLI Version : 1.62.0 (build 8c2d7fc)
Framework Version: 1.62.0
Node.js Version: v12.18.3
OS : Linux Zeus 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Language (Version): typescript (3.9.7)

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 16, 2020
@shivlaks
Copy link
Contributor

@jpSimkins - got it, I'll go off that. curious whether adding --force for your second deploy will update the description. I think our optimization which skips deployments if it determines that a template did not change might be missing changes that are made to the stack description.

Or rather, maybe it's specific to removal of a description.

@shivlaks shivlaks added the effort/small Small work item – less than a day of effort label Sep 29, 2020
@shivlaks shivlaks added the p2 label Nov 3, 2020
@jpSimkins
Copy link
Author

jpSimkins commented Nov 10, 2020

@shivlaks Ran into this issue again today using CDK: 1.72.0 (build c2f38e8)

I have an existing stack that I needed to update the description on.

When running a diff, I see the description change.

Stack SpotXLogsReplication
Template
[~] Description Description: Creates and S3 bucket for collecting SpotX logs and configures it for replication to Olympusat Security Account to Creates and S3 bucket for collecting SpotX logs and configures it for replication to OlyCloud PROD Account

When deploying, there are no changes.

SpotXLogsReplication: deploying...
SpotXLogsReplication: creating CloudFormation changeset...

 ✅  SpotXLogsReplication (no changes)

When trying with --force, I get the exact same as above for deploy.

Unfortunately, I am not able to resolve this one as I cannot destroy this stack as it is already in use. I just changed the replication destination so I wanted to update the stack description to reflect this.

@OzQu
Copy link

OzQu commented Nov 26, 2020

I've ran to this issue also. Using CDK version 1.74.0 (build e86602f).
I tried with --force, no help

@NGL321 NGL321 assigned rix0rrr and unassigned shivlaks Jan 25, 2021
@rix0rrr rix0rrr removed their assignment Jun 3, 2021
@github-actions
Copy link

github-actions bot commented Jun 3, 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.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 3, 2022
@github-actions github-actions bot closed this as completed Jun 8, 2022
@jpduckwo
Copy link

jpduckwo commented Apr 11, 2024

For anyone wondering - you need to make a change to the resources to force the description to propagate. Ie. add a dummy role then deploy then remove it then deploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort needs-reproduction This issue needs reproduction. p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

7 participants