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.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
mrgraincommented, Aug 18, 2022

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

2reactions
rix0rrrcommented, 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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting common AWS CDK issues
This topic describes how to troubleshoot the following issues with the AWS CDK.
Read more >
AWS CDK Toolkit - npm
CDK Toolkit, the command line tool for CDK apps. Latest version: 2.56.1, last published: 2 days ago. Start using aws-cdk in your project...
Read more >
aws-cdk-lib · PyPI
This is how it works: DEPLOYMENT 1: break the relationship. Make sure stack2 no longer references bucket.bucketName (maybe the consumer stack now uses...
Read more >
AWS CDK Stack is deployed silently even if not explicitly ...
There is an option to exclude dependencies. Use cdk deploy tenant-a --exclusively to don't deploy dependencies.
Read more >
CDK tips, part 3 – how to unblock cross-stack references
In the case of changing the link, running cdk deploy --exclusively ConsumingStack would fail (as the changed CloudFormation export has not been ...
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