- Conditional and Dynamic Resource Creation
- Automatic and Manual Branch Creation Support
- Automatic and Manual Branch Deletion Support
- Automatic Build for Branches Support
- Customizable Automatic Branch Creation Patterns Support
- Pull Request Previews Support
- CodeCommit, GitHub, GitLab support with examples
- Related workshop for deeper explanation
// This is a template file for a basic deployment.
// Modify the parameters below with actual values
module "sample-qs" {
// location of the module - can be local or git repo
source = "aws-ia/amplify-app/aws"
app_name = "my-app"
create_codecommit_repo = true
lookup_existing_codecommit_repo = false
// see /examples for sample_build_spec
path_to_build_spec = "/path/to/your/build/spec/file"
// Auto Branch Creation
enable_auto_branch_creation = true
enable_auto_branch_deletion = true
auto_branch_creation_patterns = ["main"]
enable_auto_build = true
enable_app_pr_preview = true
app_framework = "Something bloated and hard to maintain"
// - Custom Domain -
create_domain_associations = false
domain_name = "yourdomain.com"
domain_associations = {
core = {
branch_name = "main"
prefix = ""
},
www = {
branch_name = "main"
prefix = "www"
},
}
custom_rewrite_and_redirect = {
// Static website rewrite/redirect
static_site = {
source = "/<*>"
status = "404"
target = "/index.html"
},
// Rewrite/redirect for single page apps - default if you don't specify anything else
# single_page_app = {
# source = "</^[^.]+$|\\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>"
# status = "200"
# target = "/index.html"
# },
// Rewrite/redirect for `yourdomain.com/app2` to `yourotherdomain.com`
# app2 = {
# source = "/app2"
# status = "302"
# target = "https://yourotherdomain.com"
# },
}
}
- CodeCommit Repo with Auto Branch Creation
- CodeCommit Repo with Manual Branch Creation
- GitHub Repo with Auto Branch Creation
- GitHub Repo with Manual Branch Creation
- GitLab Repo with Auto Branch Creation
- GitLab Repo with Manual Branch Creation
See the CONTRIBUTING.md
file for information on how to contribute.
For more information, check out my workshop Automating Deployment of AWS Amplify Apps with Terraform