The AWS::Amplify::Branch resource creates a new branch within an app.
To use awscc_amplify_branch to create a single branch:
resource "awscc_amplify_app" "example" {
name = "app"
}
resource "awscc_amplify_branch" "main" {
app_id = awscc_amplify_app.example.app_id
branch_name = "main"
framework = "React"
stage = "PRODUCTION"
environment_variables = [
{
name = "REACT_APP_API_SERVER"
value = "https://api.example.com"
},
{
name = "Environment"
value = "PROD"
},
]
}
To use awscc_amplify_branch to create multiple branches:
resource "awscc_amplify_app" "example" {
name = "app"
}
resource "awscc_amplify_branch" "main" {
app_id = awscc_amplify_app.example.app_id
branch_name = "main"
framework = "React"
stage = "PRODUCTION"
environment_variables = [
{
name = "REACT_APP_API_SERVER"
value = "https://api.example.com"
},
{
name = "Environment"
value = "PROD"
},
]
}
resource "awscc_amplify_branch" "dev" {
app_id = awscc_amplify_app.example.app_id
branch_name = "dev"
framework = "React"
stage = "DEVELOPMENT"
environment_variables = [
{
name = "REACT_APP_API_SERVER"
value = "https://dev.api.example.com"
},
{
name = "Environment"
value = "DEV"
},
]
}
resource "awscc_amplify_app" "example" {
name = "app"
}
resource "awscc_amplify_branch" "main" {
app_id = awscc_amplify_app.example.app_id
branch_name = "main"
# Used to restrict access to your branches with a username and password
basic_auth_config = {
enable_basic_auth = true
username = "your-username"
password = "your-password"
}
}
app_id
(String)branch_name
(String)backend
(Attributes) (see below for nested schema)basic_auth_config
(Attributes) (see below for nested schema)build_spec
(String)description
(String)enable_auto_build
(Boolean)enable_performance_mode
(Boolean)enable_pull_request_preview
(Boolean)environment_variables
(Attributes List) (see below for nested schema)framework
(String)pull_request_environment_name
(String)stage
(String)tags
(Attributes List) (see below for nested schema)arn
(String)id
(String) Uniquely identifies the resource.backend
Optional:
stack_arn
(String)basic_auth_config
Required:
password
(String)username
(String)Optional:
enable_basic_auth
(Boolean)environment_variables
Required:
name
(String)value
(String)tags
Required:
key
(String)value
(String)Import is supported using the following syntax:
$ terraform import awscc_amplify_branch.example <resource ID>