feat: Add --standalone flag for deployments without Amplify Hosting #3095
feat: Add --standalone flag for deployments without Amplify Hosting #3095adrianjoshua-strutt wants to merge 14 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 356f015 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
| // For 'sandbox' and 'custompipeline' deployments, we default to 'localhost' | ||
| // because there's no Amplify Hosting domain available. | ||
| // | ||
| // IMPORTANT: For production 'custompipeline' deployments using WebAuthn/passkeys, |
There was a problem hiding this comment.
Do we document these in our docs? It should be there for the customers to access easier.
There was a problem hiding this comment.
Good point. While this is now enforced via an Exception, we should explicitly mention it in our docs.
sarayev
left a comment
There was a problem hiding this comment.
Could you please add unit tests for this change? How do we plan to test this feature end-to-end?
ca1d19c to
9b4c529
Compare
Yes, I will add unit tests as soon as it is clear on how we will implement the feature. This branch is currently mostly there to demonstrate how we can bypass hosting and release a snapshot, that is used for demos. End-to-end testing could be done via integration tests, but would require significant effort. This is something that we would have to discuss as part of the feature release. It is not yet clear if we will release this flag in the near future. |
Introduces a new 'custompipeline' deployment type that enables Amplify Gen2 backend deployments without requiring Amplify Hosting. This allows teams to use alternative hosting solutions while maintaining full backend functionality. Key changes: - Added 'custompipeline' deployment type to type system - Added --custom-pipeline flag to pipeline-deploy command - Skip BranchLinker creation for custompipeline deployments - Added proper tagging and attribution for custompipeline stacks - Updated error messages and logging for custompipeline context - Added WebAuthn relying party ID documentation for custom pipelines Breaking changes: None (backward compatible)
484dba5 to
874c617
Compare
Add standalone deployment type for deploying Gen2 backends without Amplify Hosting
Today, deploying an Amplify Gen2 backend requires Amplify Hosting. This PR adds a standalone deployment type that lets you deploy Gen2 backends from any CI/CD system (GitHub Actions, Jenkins, CodePipeline, etc.) using ampx pipeline-deploy --standalone --stack-name .
Standalone deployments skip the BranchLinker (no Amplify app needed) and use the provided stack name as the CloudFormation namespace.
Corresponding docs PR, if applicable:
Validation
Unit Tests
auth-construct/src/construct.test.tsbackend/src/default_stack_factory.test.tsbackend/src/backend_factory.test.tscli/src/commands/pipeline-deploy/pipeline_deploy_command.test.tscli-core/src/loggers/cfn-deployment-progress/cfn_deployment_progress_logger.test.ts) covering nested stack name resolution for standalone/sandbox, progress tracking, failure display, and CDKMetadata filtering. This did not exist before and are not 100% related to this change. But they are required to verify this change does not break the CLI logging for other workflows.In-Memory Integration Tests
E2E Tests
Updated
test_project_base.tsdeploy()to routestandalonetype identifiers toampx pipeline-deploy --standalone --stack-name <namespace> --branch <name>Added
standalone_data_storage_auth.deployment.test.tsandstandalone_deployment.test.template.ts. A standalone deployments that deploys viaampx pipeline-deploy --standalone --stack-name <name>, verifies the CloudFormation stack reaches a successful state, and asserts no Amplify Hosting resources (AWS::Amplify::App,AWS::Amplify::Branch) are presentNote on comprehensive standalone E2E test: A standalone E2E test reusing
DataStorageAuthWithTriggerTestProjectCreator(the same project used by sandbox and branch deployment tests) is included but commented out. The currently published@aws-amplify/data-constructbundles@aws-amplify/backend-output-storage@1.1.5in its ownnode_modules, which throws on the new"standalone"deployment type context value. Becausedata-constructships with its own bundled copy ofbackend-output-storage, there is no way to override it at install time. Even though the local workspace has the updated version, npm resolves the bundled copy from withindata-construct's dependency tree. This creates a cross-repo sequencing issue:backend-output-storagemust be published first (via this PR), thendata-constructinamplify-category-apineeds to update its bundled dependency and publish a new version. Once that happens, this test can be uncommented to verify the full stack (data, storage, auth, lambdas, secrets) works identically via an E2E test under standalone deployment.Checklist
run-e2elabel set.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.