-
Notifications
You must be signed in to change notification settings - Fork 92
[DRAFT] feat: Phase 1 - create standalone storage-construct package with grantAccess method #2870
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
Draft
rozaychen
wants to merge
11
commits into
main
Choose a base branch
from
storage-L3-construct-new-package
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add new storage-construct package with AmplifyConstruct implementation and test suite
- Add api-extractor.json configuration - Add build and clean scripts to package.json - Generate required TypeScript declaration files
…t package - Create new @aws-amplify/storage-construct package with standalone L3 construct - Migrate AmplifyStorage class from backend-storage with CDK-native trigger support - Replace factory-based triggers with direct IFunction references - Add comprehensive test suite with all original test coverage - Configure package build, API extraction, and TypeScript compilation - Maintain full backward compatibility with existing backend-storage package
- Replace constructor-based access control with grantAccess method pattern - Add StorageAccessDefinition type for access configuration - Update API to support storage.grantAccess(auth, accessDefinition) pattern - Add test coverage for new grantAccess method - Update exports to include StorageAccessDefinition type Copy
🦋 Changeset detectedLatest commit: 74f3f80 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
- Bump version from 0.1.0 to 1.0.0 for major release - Update aws-cdk-lib peer dependency from ^2.158.0 to ^2.189.1 for consistency - Add missing main field to package.json for lint compliance - Update changeset with detailed breaking change description - Update package-lock.json with new version and dependency changes
- Set initial version to 0.1.0 for new package (changeset will bump to 1.0.0) - Add storage-construct to version check exceptions for 0.x.x versions - Update changeset description to reflect initial release rather than breaking change - Update package-lock.json with corrected version - Fix husky hooks with proper PATH configuration
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently, the AmplifyStorage construct is tightly coupled to the Gen2 backend system and cannot be used as a standalone CDK L3 construct. This limits developers who want to use Amplify's storage capabilities in pure CDK applications or integrate with existing CDK infrastructure.
Issue number, if available: Part of the AmplifyStorage L3 construct migration project
Changes
@aws-amplify/storage-construct
as a standalone CDK L3 construct packagebackend-storage
to new packageIFunction
references for better CDK integrationstorage.grantAccess(auth, accessDefinition)
method pattern for access controlKey Technical Changes:
AmplifyStorageProps
to support direct CDK usage without access in constructorgrantAccess(auth, accessDefinition)
method for post-construction access controlStorageAccessDefinition
type for structured access configurationNew Usage Pattern:
Corresponding docs PR, if applicable: N/A (internal infrastructure change)
Validation
storage-construct
package (including new grantAccess test)backend-storage
packageTest Coverage:
Checklist
run-e2e
label set.Note: This is a foundational PR for the AmplifyStorage L3 construct migration project. The implementation follows a phased approach across multiple PRs:
Phase 1 ✅ Create standalone storage-construct package(this PR)
@aws-amplify/storage-construct
packagegrantAccess(auth, accessDefinition)
method patternbackend-storage
Phase 2 🔄 Implement access control logic in grantAccess method
Phase 3 🔄 Add path-based permission system
photos/*
)Phase 4 🔄 Add function resource access support
StorageAccessRule
type to support'resource'
typegrantAccess(functionConstruct, accessConfig)
overload{ type: 'resource', actions: ['read'] }
patternPhase 5 🔄 Add granular action support
['get', 'list', 'write', 'delete']
'read'
→['get', 'list']
expansionPhase 6 🔄 Add multi-storage validation
isDefault
flag validation across multiple constructsPhase 7 🔄 Enhance auth construct discovery
Phase 8 🔄 Update documentation and examples
This PR establishes the foundation for standalone CDK usage while the
grantAccess
method currently contains placeholder implementation that will be completed in subsequent phases.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.