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

chore(app-staging-synthesizer-alpha): app staging stack description #28817

Merged
merged 6 commits into from
Jan 23, 2024

Conversation

blimmer
Copy link
Contributor

@blimmer blimmer commented Jan 22, 2024

This PR adds a small improvement for the experimental AppStagingSynthesizer. Currently, there is no description on the app support stack:

Screenshot_2024-01-22_at_14_11_13

However, the default bootstrap stack does have a helpful description:

Screenshot_2024-01-22_at_14_12_04

So, this PR adds a description to support stacks so people know what they are.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the admired-contributor [Pilot] contributed between 13-24 PRs to the CDK label Jan 22, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team January 22, 2024 21:13
@github-actions github-actions bot added the p2 label Jan 22, 2024
@@ -242,6 +242,7 @@ export class DefaultStagingStack extends Stack implements IStagingResources {
super(scope, id, {
...props,
synthesizer: new BootstraplessSynthesizer(),
description: `This stack includes resources needed to deploy the AWS CDK app ${props.appId} into this environment`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback on this description is welcome.

I based this on the default CDKToolkit stack description:

This stack includes resources needed to deploy AWS CDK apps into this environment

Do we want to include the term AppStagingSynthesizer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current description is probably fine as is. Users will be able to easily check that resources are being created by checking the Resources tab anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that we're not considering. The support stack (since it cannot be bootstrapped) must be uploaded to CFN directly, and CFN supports a max size of 51,200 bytes. The app support stack is dynamic because it entirely depends on how many ECR/S3 resources you want. So the description cuts into that.

Somewhere we are promising a number of ECR resources allowed per staging stack. That number could go down as a result of this.

That being said, we probably are ok with this.

Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@blimmer blimmer changed the title feat(app-staging-synthesizer-alpha): add support stack description docs(app-staging-synthesizer-alpha): add support stack description Jan 22, 2024
@blimmer
Copy link
Contributor Author

blimmer commented Jan 22, 2024

Renaming to docs - adding a test for this feels like overkill, but I can if people feel strongly.

@aws-cdk-automation aws-cdk-automation dismissed their stale review January 22, 2024 21:27

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link
Contributor

@paulhcsun paulhcsun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like one of the snapshots changed causing the app-staging-synthesizer-alpha/test/integ.synth-default-resources.js integ test to fail. Should be fixed if you run the integ test and include the updated snapshot.

@mergify mergify bot dismissed paulhcsun’s stale review January 22, 2024 21:53

Pull request has been modified.

@blimmer
Copy link
Contributor Author

blimmer commented Jan 22, 2024

Fixed!

@paulhcsun
Copy link
Contributor

I think you'll need to run the integ test with the --update-on-failed flag and then add all of the snapshot files to the PR @blimmer

@blimmer
Copy link
Contributor Author

blimmer commented Jan 23, 2024

I tried doing that, but it's giving me an error, like it wants to connect to my actual AWS account:

 yarn integ --update-on-failed
yarn run v1.22.21
$ integ-runner --update-on-failed

Verifying integration test snapshots...

  CHANGED    integ.synth-default-resources 7.81s
      Template
[+] Description Description: This stack includes resources needed to deploy the AWS CDK app default-resourcesmax into this environment



Snapshot Results:

Tests:    1 failed, 1 total
Failed: /Users/blimmer/code/aws-cdk/packages/@aws-cdk/app-staging-synthesizer-alpha/test/integ.synth-default-resources.ts

Running integration tests for failed tests...

Running in parallel across regions: us-east-1, us-east-2, us-west-2
Running test /Users/blimmer/code/aws-cdk/packages/@aws-cdk/app-staging-synthesizer-alpha/test/integ.synth-default-resources.ts in us-east-1

✨  Synthesis time: 0.01s


 ❌ Deployment failed: Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment
    at SdkProvider.resolveEnvironment (/Users/blimmer/code/aws-cdk/packages/aws-cdk/lib/api/aws-auth/sdk-provider.js:159:19)

Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment
  FAILED     integ.synth-default-resources-integ-tests/DefaultTest (undefined/us-east-1) 10.509s
      Integration test failed: Error: Command exited with status 1

Test Results:

Tests:    1 failed, 1 total
Error: Some integration tests failed!
    at main (/Users/blimmer/code/aws-cdk/packages/@aws-cdk/integ-runner/lib/cli.js:165:23)
integ-tests/DefaultTest/DeployAssert: destroying... [1/3]

 ❌  integ-tests/DefaultTest/DeployAssert: destroy failed Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment
    at SdkProvider.resolveEnvironment (/Users/blimmer/code/aws-cdk/packages/aws-cdk/lib/api/aws-auth/sdk-provider.js:159:19)

Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

So I tried to cheat and just surgically update the single file. Clearly I missed something - let me run through the docs again and try to figure out how to get integration test updates working locally.

Or I'll surgically update the .js flavor too 😄

@paulhcsun
Copy link
Contributor

If you already have an AWS account then you may just need to run aws configure and get that set up so that the integ test and run the deployment: https://cdkworkshop.com/15-prerequisites/200-account.html#configure-your-credentials. I don't think the integ tests will pass unless you're able to submit those snapshots. Give that a try if let me know if it helps. If not I can probably go in and run that integ test for you on your branch.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 23, 2024
@blimmer
Copy link
Contributor Author

blimmer commented Jan 23, 2024

Thanks for the detailed instructions! I was able to get it working.

@kaizencc kaizencc changed the title docs(app-staging-synthesizer-alpha): add support stack description chore(app-staging-synthesizer-alpha): app staging stack description Jan 23, 2024
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 23, 2024
Copy link
Contributor

mergify bot commented Jan 23, 2024

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ef73f8c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 1b69f2a into aws:main Jan 23, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Jan 23, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants