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

‼️ cdk deploy --exclusively (-e) no longer working in 2.38.0 #21661

Closed
mrdanp opened this issue Aug 18, 2022 · 8 comments
Closed

‼️ cdk deploy --exclusively (-e) no longer working in 2.38.0 #21661

mrdanp opened this issue Aug 18, 2022 · 8 comments
Assignees
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. management/tracking Issues that track a subject or multiple issues p0

Comments

@mrdanp
Copy link

mrdanp commented Aug 18, 2022

Status: RESOLVED in 2.38.1

Overview:

The --exclusively flag does not work with the v2.38.0 release.

When the --exclusively flag is used to select stacks with
dependencies, instead no stacks are deployed at all and the
deployment silently no-ops.

Solution:

Upgrade to 2.38.1

Workaround:

Do not upgrade to 2.38.0, downgrade if necessary


Describe the bug

Upgraded to aws-cdk v 2.38.0 today and noticed that deploying with the --exclusively flag no longer works. My aws pipelines also stopped working since i was installing the latest cdk version in the buildspecs.

This is a command that works with v 2.37.1

cdk deploy StaticAssetDeploymentStack -e

However, after upgrading to 2.38.0, it stops automatically after the synthesis.

The logs show

Synthesis time: 3.53s

then nothing else.

If i remove the -e flags, it works as expected, but will of course deploy dependencies first.

Expected Behavior

the -e flag should deploy the stack without dependencies

Current Behavior

it stops automatically after synthesis and the stack is not deployed.

Reproduction Steps

this is a sample stack. But the issue is not unique to this stack. I have others that fail as well

import * as cdk from "aws-cdk-lib";
import * as path from "path";
import * as s3deploy from "aws-cdk-lib/aws-s3-deployment";

import { Bucket } from "aws-cdk-lib/aws-s3";
import { Construct } from "constructs";
import { Distribution } from "aws-cdk-lib/aws-cloudfront";

export interface StaticAssetDeploymentStackProps {
  staticAssetBucket: Bucket;
  distribution: Distribution;
  env:any;
}

export class StaticAssetDeploymentStack extends cdk.Stack {
  constructor(
    scope: Construct,
    id: string,
    props: StaticAssetDeploymentStackProps,
  ) {
    super(scope, id, props);

    new s3deploy.BucketDeployment(this, "deployWeb", {
      sources: [
        s3deploy.Source.asset(
          path.join(__dirname, "..", "testApp", "dist")
        ),
      ],
      destinationBucket: props.staticAssetBucket,
      distribution: props.distribution,
      distributionPaths: ["/*"],
      memoryLimit: 512,
    });
  }
}

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.7.20

Framework Version

No response

Node.js Version

16.17.0

OS

macOs Monterey

Language

Typescript

Language Version

No response

Other information

No response

@mrdanp mrdanp added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 18, 2022
@github-actions github-actions bot added the @aws-cdk/aws-cloudfront Related to Amazon CloudFront label Aug 18, 2022
@urikkiru
Copy link

I also had this same issue occur. The work around was indeed to revert to any version before 2.38.0.

Personally and professionally I use layered deployments, and the '-e' flag is critical for that usage. Without it I would have to abandon CDK entirely. This is a critical bug for me, and I'm sure others as well.

@mrgrain mrgrain added p0 and removed needs-triage This issue or PR still needs to be triaged. labels Aug 18, 2022
@mrgrain
Copy link
Contributor

mrgrain commented Aug 18, 2022

@mrdanp @urikkiru Thanks for raising this. We are aware of the issue now.

@Naumel Naumel added the management/tracking Issues that track a subject or multiple issues label Aug 18, 2022
@rix0rrr
Copy link
Contributor

rix0rrr commented Aug 18, 2022

I cannot reproduce with a trivial stack deployment, so more must be going on:

$ npx cdk deploy -e Testv2Stack

✨  Synthesis time: 4.7s

Testv2Stack: deploying...
[0%] start: Publishing 3e2638471f1b391751079818580e441eedaf798e08616812081d086d8d4561b8:current_account-current_region
[100%] success: Published 3e2638471f1b391751079818580e441eedaf798e08616812081d086d8d4561b8:current_account-current_region
Testv2Stack: creating CloudFormation changeset...
  • Does it fail exclusively in CI/CD deployments?
  • Does it only fail for stacks with dependencies? confirmed only happens for stacks with dependencies

@Naumel Naumel pinned this issue Aug 18, 2022
Naumel added a commit to cdklabs/aws-cdk-notices that referenced this issue Aug 18, 2022
@mrgrain mrgrain changed the title aws cdk deploy -e (exclusively) no longer working in 2.38.0 ‼️ cdk deploy --exclusively (-e) no longer working in 2.38.0 Aug 18, 2022
mrgrain added a commit to cdklabs/aws-cdk-notices that referenced this issue Aug 18, 2022
Co-authored-by: Rico Huijbers <rix0rrr@gmail.com>
Co-authored-by: Momo Kornher <mail@moritzkornher.de>
mergify bot pushed a commit that referenced this issue Aug 18, 2022
mergify bot pushed a commit that referenced this issue Aug 18, 2022
Naumel added a commit that referenced this issue Aug 18, 2022
Naumel added a commit that referenced this issue Aug 18, 2022
@higgsmass
Copy link

NOTICES

21661 cli: no stacks are deployed if the --exclusively (-e) flag is used

Overview: When the `--exclusively` flag is used to select stacks with
          dependencies, instead no stacks are deployed at all and the
          deployment silently no-ops.

Affected versions: cli: 2.38.0

More information at: https://github.com/aws/aws-cdk/issues/21661

If you don’t want to see a notice anymore, use "cdk acknowledge ". For example, "cdk acknowledge 21661".
--app is required either in command-line, in cdk.json or in ~/.cdk.json

@Naumel
Copy link
Contributor

Naumel commented Aug 19, 2022

Version 2.38.1 has been released.

@nomike
Copy link

nomike commented Aug 19, 2022

So if the --exclusively flag no longer deploys stacks with dependencies, what's the process now for doing that?
For the moment I've downgraded back to v. 2.37.1 as it still works there, but I can't stay there forever.

I need this for two main reasons:

  1. I've written a wrapper script called pcdk which does parallel deployments by synthing the code and then doing --exclusively deployments in multiple threads, after building a dependency graph. I know there is a --concurrency option in the making, but it's not there yet AFAIK, or is it? What's the status on that?

  2. I built in a --no-deps flag into pcdk which allows for even faster deployments when you know that all the dependend stacks don't have any changes. This is important in case of emergencies where you e.g. quickly need to point a DNS record to some other target in case of a system outage and you know that the target it should point to and all the dependent stacks are OK and there are no changes. How can I do this now?

@mrgrain
Copy link
Contributor

mrgrain commented Aug 19, 2022

So if the --exclusively flag no longer deploys stacks with dependencies, what's the process now for doing that? For the moment I've downgraded back to v. 2.37.1 as it still works there, but I can't stay there forever.

Hi @nomike This has been resolved in v2.38.1

josephedward pushed a commit to josephedward/aws-cdk that referenced this issue Aug 30, 2022
josephedward pushed a commit to josephedward/aws-cdk that referenced this issue Aug 30, 2022
@Naumel Naumel unpinned this issue Aug 31, 2022
@rix0rrr rix0rrr closed this as completed Oct 10, 2022
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. management/tracking Issues that track a subject or multiple issues p0
Projects
None yet
Development

No branches or pull requests

8 participants