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
fix(cli): template created during import should be written to assets folder #29830
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
Thank you so much for this! I was able to get the integration test to run successfully, so I will test this change some more and push some of my changes to this branch :) |
@@ -1,6 +1,7 @@ | |||
import { promises as fs, existsSync } from 'fs'; | |||
import * as os from 'os'; | |||
import * as path from 'path'; | |||
import * as CFN from '@aws-sdk/client-cloudformation'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that fixture
has its own CFN client, so I should use that instead of this, probably.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
// Write a resource mapping file based on the ID from step one, then run an import | ||
const mappingFile = path.join(fixture.integTestDir, 'outputs', `${randomPrefix}Mapping.json`); | ||
const fullStackName = fixture.fullStackName('importable-stack'); | ||
const queueUrl = outputs[fullStackName].QueueUrl; | ||
const queueLogicalId = outputs[fullStackName].QueueLogicalId; | ||
queues[queueLogicalId] = { QueueUrl: queueUrl }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this comment is scoped makes it look like it's supposed to apply to the immediate block, which isn't the case. Can we move the comment outside the try
so it's clear that it applies to the entire block?
It would also be helpful if we numbered the steps, like
- Do something
- Do something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Issue # (if applicable)
Closes #22928 #22530
I'm reopening as the original was closed due to inactivity.
Reason for this change
When the template is synthesized, if it is larger than 50kb and cannot be inlined in the CFN request, CLI writes it to the filesystem to be uploaded to S3. Unlike regular deployments
import
overrides the template, when it does so the code responsible for writing the large template to the filesystem writes to the project root.This code reproduces the issue:
Deploy the stack, uncomment the queue, and try to import. This error happens:
The file is created, it's just in the project root not in cdk.out:
Description of changes
I've just added a path.join similar to how it is done in regular template generation.
Description of how you validated changes
I've added a test case but I believe tests are broken globally as per @TheRealAmazonKendra
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license