branches
Creates, updates, deletes, gets or lists a branches resource.
Overview
| Name | branches |
| Type | Resource |
| Id | aws.amplify.branches |
Fields
The following fields are returned by SELECT queries:
- get_branch
- list_branches
| Name | Datatype | Description |
|---|---|---|
active_job_id | string | The ID of the active job for a branch of an Amplify app. |
associated_resources | array | A list of custom resources that are linked to this branch. |
backend | object | Describes the backend associated with an Amplify Branch. This property is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code. |
backend_environment_arn | string | The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app. This property is available to Amplify Gen 1 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code. (pattern: <code>(?s).*</code>) |
basic_auth_credentials | string | The basic authorization credentials for a branch of an Amplify app. You must base64-encode the authorization credentials and provide them in the format user:password. (pattern: <code>(?s).*</code>) |
branch_arn | string | The Amazon Resource Name (ARN) for a branch that is part of an Amplify app. (pattern: <code>(?s).*</code>) |
branch_name | string | The name for the branch that is part of an Amplify app. (pattern: <code>(?s).+</code>) |
build_spec | string | The build specification (build spec) file for an Amplify app build. (pattern: <code>(?s).+</code>) |
compute_role_arn | string | The Amazon Resource Name (ARN) of the IAM role for a branch of an SSR app. The Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide. (pattern: <code>(?s).*</code>) |
create_time | string (date-time) | A timestamp of when Amplify created the branch. |
custom_domains | array | The custom domains for a branch of an Amplify app. |
description | string | The description for the branch that is part of an Amplify app. (pattern: <code>(?s).*</code>) |
destination_branch | string | The destination branch if the branch is a pull request branch. (pattern: <code>(?s).+</code>) |
display_name | string | The display name for the branch. This is used as the default domain prefix. (pattern: <code>(?s).*</code>) |
enable_auto_build | boolean | Enables auto-building on push for a branch of an Amplify app. |
enable_basic_auth | boolean | Enables basic authorization for a branch of an Amplify app. |
enable_notification | boolean | Enables notifications for a branch that is part of an Amplify app. |
enable_performance_mode | boolean | Enables performance mode for the branch. Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out. |
enable_pull_request_preview | boolean | Enables pull request previews for the branch. |
enable_skew_protection | boolean | Specifies whether the skew protection feature is enabled for the branch. Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide. |
environment_variables | object | The environment variables specific to a branch of an Amplify app. |
framework | string | The framework for a branch of an Amplify app. (pattern: <code>(?s).*</code>) |
pull_request_environment_name | string | The Amplify environment name for the pull request. (pattern: <code>(?s).*</code>) |
source_branch | string | The source branch if the branch is a pull request branch. (pattern: <code>(?s).+</code>) |
stage | string | The current stage for the branch that is part of an Amplify app. (PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST) |
tags | object | The tag for the branch of an Amplify app. |
thumbnail_url | string | The thumbnail URL for the branch of an Amplify app. |
total_number_of_jobs | string | The total number of jobs that are part of an Amplify app. |
ttl | string | The content Time to Live (TTL) for the website in seconds. (pattern: <code>\d*</code>) |
update_time | string (date-time) | A timestamp for the last updated time for a branch. |
| Name | Datatype | Description |
|---|---|---|
active_job_id | string | The ID of the active job for a branch of an Amplify app. |
associated_resources | array | A list of custom resources that are linked to this branch. |
backend | object | Describes the backend associated with an Amplify Branch. This property is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code. |
backend_environment_arn | string | The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app. This property is available to Amplify Gen 1 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code. (pattern: <code>(?s).*</code>) |
basic_auth_credentials | string | The basic authorization credentials for a branch of an Amplify app. You must base64-encode the authorization credentials and provide them in the format user:password. (pattern: <code>(?s).*</code>) |
branch_arn | string | The Amazon Resource Name (ARN) for a branch that is part of an Amplify app. (pattern: <code>(?s).*</code>) |
branch_name | string | The name for the branch that is part of an Amplify app. (pattern: <code>(?s).+</code>) |
build_spec | string | The build specification (build spec) file for an Amplify app build. (pattern: <code>(?s).+</code>) |
compute_role_arn | string | The Amazon Resource Name (ARN) of the IAM role for a branch of an SSR app. The Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide. (pattern: <code>(?s).*</code>) |
create_time | string (date-time) | A timestamp of when Amplify created the branch. |
custom_domains | array | The custom domains for a branch of an Amplify app. |
description | string | The description for the branch that is part of an Amplify app. (pattern: <code>(?s).*</code>) |
destination_branch | string | The destination branch if the branch is a pull request branch. (pattern: <code>(?s).+</code>) |
display_name | string | The display name for the branch. This is used as the default domain prefix. (pattern: <code>(?s).*</code>) |
enable_auto_build | boolean | Enables auto-building on push for a branch of an Amplify app. |
enable_basic_auth | boolean | Enables basic authorization for a branch of an Amplify app. |
enable_notification | boolean | Enables notifications for a branch that is part of an Amplify app. |
enable_performance_mode | boolean | Enables performance mode for the branch. Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out. |
enable_pull_request_preview | boolean | Enables pull request previews for the branch. |
enable_skew_protection | boolean | Specifies whether the skew protection feature is enabled for the branch. Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide. |
environment_variables | object | The environment variables specific to a branch of an Amplify app. |
framework | string | The framework for a branch of an Amplify app. (pattern: <code>(?s).*</code>) |
pull_request_environment_name | string | The Amplify environment name for the pull request. (pattern: <code>(?s).*</code>) |
source_branch | string | The source branch if the branch is a pull request branch. (pattern: <code>(?s).+</code>) |
stage | string | The current stage for the branch that is part of an Amplify app. (PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST) |
tags | object | The tag for the branch of an Amplify app. |
thumbnail_url | string | The thumbnail URL for the branch of an Amplify app. |
total_number_of_jobs | string | The total number of jobs that are part of an Amplify app. |
ttl | string | The content Time to Live (TTL) for the website in seconds. (pattern: <code>\d*</code>) |
update_time | string (date-time) | A timestamp for the last updated time for a branch. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_branch | select | app_id, branch_name, region | Returns a branch for an Amplify app. | |
list_branches | select | app_id, region | nextToken, maxResults | Lists the branches of an Amplify app. |
create_branch | insert | app_id, region, branchName | Creates a new branch for an Amplify app. | |
create_deployment | insert | app_id, branch_name, region | Creates a deployment for a manually deployed Amplify app. Manually deployed apps are not connected to a Git repository. The maximum duration between the CreateDeployment call and the StartDeployment call cannot exceed 8 hours. If the duration exceeds 8 hours, the StartDeployment call and the associated Job will fail. | |
update_branch | update | app_id, branch_name, region | Updates a branch for an Amplify app. | |
delete_branch | delete | app_id, branch_name, region | Deletes a branch for an Amplify app. | |
start_job | exec | app_id, branch_name, region, jobType | Starts a new job for a branch of an Amplify app. | |
start_deployment | exec | app_id, branch_name, region | Starts a deployment for a manually deployed app. Manually deployed apps are not connected to a Git repository. The maximum duration between the CreateDeployment call and the StartDeployment call cannot exceed 8 hours. If the duration exceeds 8 hours, the StartDeployment call and the associated Job will fail. | |
stop_job | exec | app_id, branch_name, job_id, region | Stops a job that is in progress for a branch of an Amplify app. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
app_id | string | The unique ID for an Amplify app. |
branch_name | string | The name of the branch to use for the stop job request. |
job_id | string | The unique id for the job. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of records to list in a single response. |
nextToken | string | A pagination token. Set to null to start listing branches from the start. If a non-null pagination token is returned in a result, pass its value in here to list more branches. |
SELECT examples
- get_branch
- list_branches
Returns a branch for an Amplify app.
SELECT
active_job_id,
associated_resources,
backend,
backend_environment_arn,
basic_auth_credentials,
branch_arn,
branch_name,
build_spec,
compute_role_arn,
create_time,
custom_domains,
description,
destination_branch,
display_name,
enable_auto_build,
enable_basic_auth,
enable_notification,
enable_performance_mode,
enable_pull_request_preview,
enable_skew_protection,
environment_variables,
framework,
pull_request_environment_name,
source_branch,
stage,
tags,
thumbnail_url,
total_number_of_jobs,
ttl,
update_time
FROM aws.amplify.branches
WHERE app_id = '{{ app_id }}' -- required
AND branch_name = '{{ branch_name }}' -- required
AND region = '{{ region }}' -- required
;
Lists the branches of an Amplify app.
SELECT
active_job_id,
associated_resources,
backend,
backend_environment_arn,
basic_auth_credentials,
branch_arn,
branch_name,
build_spec,
compute_role_arn,
create_time,
custom_domains,
description,
destination_branch,
display_name,
enable_auto_build,
enable_basic_auth,
enable_notification,
enable_performance_mode,
enable_pull_request_preview,
enable_skew_protection,
environment_variables,
framework,
pull_request_environment_name,
source_branch,
stage,
tags,
thumbnail_url,
total_number_of_jobs,
ttl,
update_time
FROM aws.amplify.branches
WHERE app_id = '{{ app_id }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_branch
- create_deployment
- Manifest
Creates a new branch for an Amplify app.
INSERT INTO aws.amplify.branches (
branchName,
description,
stage,
framework,
enableNotification,
enableAutoBuild,
enableSkewProtection,
environmentVariables,
basicAuthCredentials,
enableBasicAuth,
enablePerformanceMode,
tags,
buildSpec,
ttl,
displayName,
enablePullRequestPreview,
pullRequestEnvironmentName,
backendEnvironmentArn,
backend,
computeRoleArn,
app_id,
region
)
SELECT
'{{ branchName }}' /* required */,
'{{ description }}',
'{{ stage }}',
'{{ framework }}',
{{ enableNotification }},
{{ enableAutoBuild }},
{{ enableSkewProtection }},
'{{ environmentVariables }}',
'{{ basicAuthCredentials }}',
{{ enableBasicAuth }},
{{ enablePerformanceMode }},
'{{ tags }}',
'{{ buildSpec }}',
'{{ ttl }}',
'{{ displayName }}',
{{ enablePullRequestPreview }},
'{{ pullRequestEnvironmentName }}',
'{{ backendEnvironmentArn }}',
'{{ backend }}',
'{{ computeRoleArn }}',
'{{ app_id }}',
'{{ region }}'
RETURNING
branch
;
Creates a deployment for a manually deployed Amplify app. Manually deployed apps are not connected to a Git repository. The maximum duration between the CreateDeployment call and the StartDeployment call cannot exceed 8 hours. If the duration exceeds 8 hours, the StartDeployment call and the associated Job will fail.
INSERT INTO aws.amplify.branches (
fileMap,
app_id,
branch_name,
region
)
SELECT
'{{ fileMap }}',
'{{ app_id }}',
'{{ branch_name }}',
'{{ region }}'
RETURNING
file_upload_urls,
job_id,
zip_upload_url
;
# Description fields are for documentation purposes
- name: branches
props:
- name: app_id
value: "{{ app_id }}"
description: Required parameter for the branches resource.
- name: region
value: "{{ region }}"
description: Required parameter for the branches resource.
- name: branch_name
value: "{{ branch_name }}"
description: Required parameter for the branches resource.
- name: branchName
value: "{{ branchName }}"
- name: description
value: "{{ description }}"
- name: stage
value: "{{ stage }}"
valid_values: ['PRODUCTION', 'BETA', 'DEVELOPMENT', 'EXPERIMENTAL', 'PULL_REQUEST']
- name: framework
value: "{{ framework }}"
- name: enableNotification
value: {{ enableNotification }}
- name: enableAutoBuild
value: {{ enableAutoBuild }}
- name: enableSkewProtection
value: {{ enableSkewProtection }}
- name: environmentVariables
value: "{{ environmentVariables }}"
- name: basicAuthCredentials
value: "{{ basicAuthCredentials }}"
- name: enableBasicAuth
value: {{ enableBasicAuth }}
- name: enablePerformanceMode
value: {{ enablePerformanceMode }}
- name: tags
value: "{{ tags }}"
- name: buildSpec
value: "{{ buildSpec }}"
description: |
The build specification (build spec) file for an Amplify app build.
- name: ttl
value: "{{ ttl }}"
description: |
The content Time to Live (TTL) for the website in seconds.
- name: displayName
value: "{{ displayName }}"
- name: enablePullRequestPreview
value: {{ enablePullRequestPreview }}
- name: pullRequestEnvironmentName
value: "{{ pullRequestEnvironmentName }}"
- name: backendEnvironmentArn
value: "{{ backendEnvironmentArn }}"
- name: backend
description: |
Describes the backend associated with an Amplify Branch. This property is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.
value:
stackArn: "{{ stackArn }}"
- name: computeRoleArn
value: "{{ computeRoleArn }}"
- name: fileMap
value: "{{ fileMap }}"
UPDATE examples
- update_branch
Updates a branch for an Amplify app.
UPDATE aws.amplify.branches
SET
description = '{{ description }}',
framework = '{{ framework }}',
stage = '{{ stage }}',
enableNotification = {{ enableNotification }},
enableAutoBuild = {{ enableAutoBuild }},
enableSkewProtection = {{ enableSkewProtection }},
environmentVariables = '{{ environmentVariables }}',
basicAuthCredentials = '{{ basicAuthCredentials }}',
enableBasicAuth = {{ enableBasicAuth }},
enablePerformanceMode = {{ enablePerformanceMode }},
buildSpec = '{{ buildSpec }}',
ttl = '{{ ttl }}',
displayName = '{{ displayName }}',
enablePullRequestPreview = {{ enablePullRequestPreview }},
pullRequestEnvironmentName = '{{ pullRequestEnvironmentName }}',
backendEnvironmentArn = '{{ backendEnvironmentArn }}',
backend = '{{ backend }}',
computeRoleArn = '{{ computeRoleArn }}'
WHERE
app_id = '{{ app_id }}' --required
AND branch_name = '{{ branch_name }}' --required
AND region = '{{ region }}' --required
RETURNING
branch;
DELETE examples
- delete_branch
Deletes a branch for an Amplify app.
DELETE FROM aws.amplify.branches
WHERE app_id = '{{ app_id }}' --required
AND branch_name = '{{ branch_name }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- start_job
- start_deployment
- stop_job
Starts a new job for a branch of an Amplify app.
EXEC aws.amplify.branches.start_job
@app_id='{{ app_id }}' --required,
@branch_name='{{ branch_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"jobId": "{{ jobId }}",
"jobType": "{{ jobType }}",
"jobReason": "{{ jobReason }}",
"commitId": "{{ commitId }}",
"commitMessage": "{{ commitMessage }}",
"commitTime": "{{ commitTime }}"
}'
;
Starts a deployment for a manually deployed app. Manually deployed apps are not connected to a Git repository. The maximum duration between the CreateDeployment call and the StartDeployment call cannot exceed 8 hours. If the duration exceeds 8 hours, the StartDeployment call and the associated Job will fail.
EXEC aws.amplify.branches.start_deployment
@app_id='{{ app_id }}' --required,
@branch_name='{{ branch_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"jobId": "{{ jobId }}",
"sourceUrl": "{{ sourceUrl }}",
"sourceUrlType": "{{ sourceUrlType }}"
}'
;
Stops a job that is in progress for a branch of an Amplify app.
EXEC aws.amplify.branches.stop_job
@app_id='{{ app_id }}' --required,
@branch_name='{{ branch_name }}' --required,
@job_id='{{ job_id }}' --required,
@region='{{ region }}' --required
;