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

Exposing stack parameter at higher level for backend and related resources #2021

Merged
merged 41 commits into from
Sep 20, 2024

Conversation

ShadowCat567
Copy link
Contributor

@ShadowCat567 ShadowCat567 commented Sep 18, 2024

Problem

Users would like to be able to easily access the root stack and the stacks of their resources. Helpful for adding tags.

Issue number, if available: #1535 #1242

Changes

  • lifted stack parameter for backend and auth, function, and storage resources

Corresponding docs PR, if applicable:

Validation

  • In test project able to utilize new stack parameters without error
image
  • added tests to ensure that expected values were coming from each of the stack parameters

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

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

Copy link

changeset-bot bot commented Sep 18, 2024

🦋 Changeset detected

Latest commit: 24eff8a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@aws-amplify/backend-function Minor
@aws-amplify/backend-auth Minor
@aws-amplify/backend Minor
@aws-amplify/backend-storage Minor
@aws-amplify/plugin-types Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@sobolk sobolk left a comment

Choose a reason for hiding this comment

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

Looks good.

.changeset/chatty-beans-begin.md Outdated Show resolved Hide resolved
Comment on lines 1 to 7
---
'@aws-amplify/integration-tests': minor
'@aws-amplify/backend-storage': minor
'@aws-amplify/plugin-types': minor
---

add new type to handle exposing stack, expose stack in storage
Copy link
Member

Choose a reason for hiding this comment

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

We can remove integration-tests from changesets.
I'd move storage from this changeset to the other one. and keep this one for plugin types only.
It'll generate more coherent changelogs.

@@ -157,5 +159,6 @@ export const defineBackend = <T extends DefineBackendProps>(
...backend.resources,
createStack: backend.createStack,
addOutput: backend.addOutput,
stack: backend.mainStack,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
stack: backend.mainStack,
stack: backend.stack,

if we're going with just stack let's keep naming consistent on backend factory as well.

sobolk
sobolk previously approved these changes Sep 19, 2024
@ShadowCat567 ShadowCat567 marked this pull request as ready for review September 19, 2024 22:33
@ShadowCat567 ShadowCat567 requested review from a team as code owners September 19, 2024 22:33
Amplifiyer
Amplifiyer previously approved these changes Sep 20, 2024
Comment on lines 512 to 514
const functionStack = Stack.of(
functionFactory.getInstance(getInstanceProps).resources.lambda
functionFactory.getInstance(getInstanceProps).stack
);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: do we need Stack.of here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, we don't, that would be a quick thing for me to fix since that looks like the only instance where I didn't properly remove Stack.of

@ShadowCat567 ShadowCat567 dismissed stale reviews from Amplifiyer and sobolk via 24eff8a September 20, 2024 16:02
@ShadowCat567 ShadowCat567 merged commit 87dbf41 into aws-amplify:main Sep 20, 2024
37 of 38 checks passed
@ShadowCat567 ShadowCat567 deleted the resource-tags branch September 20, 2024 19:32
@Amplifiyer
Copy link
Contributor

Any reason the data category was not included in this PR for lifting the stack parameter?

@sobolk
Copy link
Member

sobolk commented Sep 30, 2024

Any reason the data category was not included in this PR for lifting the stack parameter?

@Amplifiyer It's coming . See aws-amplify/amplify-category-api#2899

We typed the factory with full AmplifyData instead of interfaces here. Therefore, it was not possible to handle that property in factory alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants