branches
Creates, updates, deletes or gets a branch
resource or lists branches
in a region
Overview
Name | branches |
Type | Resource |
Description | The AWS::Amplify::Branch resource creates a new branch within an app. |
Id | aws.amplify.branches |
Fields
Name | Datatype | Description |
---|---|---|
app_id | string | |
arn | string | |
basic_auth_config | object | |
backend | object | |
branch_name | string | |
build_spec | string | |
description | string | |
enable_auto_build | boolean | |
enable_performance_mode | boolean | |
enable_pull_request_preview | boolean | |
environment_variables | array | |
framework | string | |
pull_request_environment_name | string | |
stage | string | |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AppId, BranchName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all branches
in a region.
SELECT
region,
app_id,
arn,
basic_auth_config,
backend,
branch_name,
build_spec,
description,
enable_auto_build,
enable_performance_mode,
enable_pull_request_preview,
environment_variables,
framework,
pull_request_environment_name,
stage,
tags
FROM aws.amplify.branches
WHERE region = 'us-east-1';
Gets all properties from an individual branch
.
SELECT
region,
app_id,
arn,
basic_auth_config,
backend,
branch_name,
build_spec,
description,
enable_auto_build,
enable_performance_mode,
enable_pull_request_preview,
environment_variables,
framework,
pull_request_environment_name,
stage,
tags
FROM aws.amplify.branches
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
INSERT
example
Use the following StackQL query and manifest file to create a new branch
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.amplify.branches (
AppId,
BranchName,
region
)
SELECT
'{{ AppId }}',
'{{ BranchName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.amplify.branches (
AppId,
BasicAuthConfig,
Backend,
BranchName,
BuildSpec,
Description,
EnableAutoBuild,
EnablePerformanceMode,
EnablePullRequestPreview,
EnvironmentVariables,
Framework,
PullRequestEnvironmentName,
Stage,
Tags,
region
)
SELECT
'{{ AppId }}',
'{{ BasicAuthConfig }}',
'{{ Backend }}',
'{{ BranchName }}',
'{{ BuildSpec }}',
'{{ Description }}',
'{{ EnableAutoBuild }}',
'{{ EnablePerformanceMode }}',
'{{ EnablePullRequestPreview }}',
'{{ EnvironmentVariables }}',
'{{ Framework }}',
'{{ PullRequestEnvironmentName }}',
'{{ Stage }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: branch
props:
- name: AppId
value: '{{ AppId }}'
- name: BasicAuthConfig
value:
EnableBasicAuth: '{{ EnableBasicAuth }}'
Username: '{{ Username }}'
Password: '{{ Password }}'
- name: Backend
value:
StackArn: '{{ StackArn }}'
- name: BranchName
value: '{{ BranchName }}'
- name: BuildSpec
value: '{{ BuildSpec }}'
- name: Description
value: '{{ Description }}'
- name: EnableAutoBuild
value: '{{ EnableAutoBuild }}'
- name: EnablePerformanceMode
value: '{{ EnablePerformanceMode }}'
- name: EnablePullRequestPreview
value: '{{ EnablePullRequestPreview }}'
- name: EnvironmentVariables
value:
- Name: '{{ Name }}'
Value: '{{ Value }}'
- name: Framework
value: '{{ Framework }}'
- name: PullRequestEnvironmentName
value: '{{ PullRequestEnvironmentName }}'
- name: Stage
value: '{{ Stage }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.amplify.branches
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the branches
resource, the following permissions are required:
Create
amplify:GetBranch,
amplify:CreateBranch,
amplify:TagResource,
codecommit:GetRepository,
codecommit:PutRepositoryTriggers,
codecommit:GetRepositoryTriggers,
s3:GetObject,
s3:GetObjectAcl,
s3:PutObject,
s3:PutObjectAcl,
sns:CreateTopic,
sns:Subscribe,
iam:PassRole
Delete
amplify:GetBranch,
amplify:DeleteBranch,
codecommit:GetRepository,
codecommit:GetRepositoryTriggers,
sns:Unsubscribe,
iam:PassRole
List
amplify:GetBranch,
amplify:ListBranches,
amplify:ListTagsForResource,
iam:PassRole
Read
amplify:GetBranch,
amplify:ListTagsForResource,
codecommit:GetRepository,
codecommit:GetRepositoryTriggers,
s3:GetObject,
s3:GetObjectAcl,
iam:PassRole
Update
amplify:GetBranch,
amplify:UpdateBranch,
amplify:ListTagsForResource,
amplify:TagResource,
amplify:UntagResource,
codecommit:GetRepository,
codecommit:PutRepositoryTriggers,
codecommit:GetRepositoryTriggers,
s3:GetObject,
s3:GetObjectAcl,
s3:PutObject,
s3:PutObjectAcl,
sns:CreateTopic,
sns:Subscribe,
sns:Unsubscribe,
iam:PassRole