-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws-lambda: cdk destroy
requires the deployment asset
#20060
Comments
any updates on this? |
👀 |
1 similar comment
👀 |
Labeling this as |
This also affects aws_s3_deployment.BucketDeployment |
I just got the error as well for the bucket deployment construct. Happy to contribute if I'm pointed to the relevant code! |
I have the following working for BucketDeployment (TypeScript): if (Stack.of(this).bundlingRequired) {
new BucketDeployment(this, "DeployWebsite", {
sources: [Source.asset(path.join(__dirname, "../../dist"))],
destinationBucket: bucket,
});
} This seems to get around the issue for that, but Functions are more awkward as the deployment and resource are in one item. |
Hmm the following is awful but seems to work: const createFunction = new Function(this, "CreateFunction", {
functionName: `CoolNameForFunction`,
code: Stack.of(this).bundlingRequired
? Code.fromAsset(path.join(__dirname, "../../dist"))
: Code.fromInline(";"), // Can't put an empty string
runtime: Runtime.NODEJS_18_X,
handler: "create-func.handler",
}); |
This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue. |
Any updates on this one? |
Describe the bug
Running
cdk destroy
with a Lambda function asset requires the deployment asset to be present. This seems counterintuitive at best and problematic in a variety of situations.Expected Behavior
cdk destroy
should succeed, tear down the CF stack, undeploy the Lambda, etc. - no deployment asset should be needed.Current Behavior
Reproduction Steps
cdk deploy
a stack that uses a Lambda assetcdk destroy
the stackPossible Solution
Don't look for the asset when destroying.
Additional Information/Context
Using CDK TypeScript to deploy a Java Lambda asset
CDK CLI Version
2.20.0 (build 738ef49)
Framework Version
?
Node.js Version
v16.14.2
OS
Ubuntu 20.04.4 LTS
Language
Typescript
Language Version
TypeScript (~3.9.7)
Other information
No response
The text was updated successfully, but these errors were encountered: