Skip to main content

branches

Creates, updates, deletes or gets a branch resource or lists branches in a region

Overview

Namebranches
TypeResource
DescriptionThe AWS::Amplify::Branch resource creates a new branch within an app.
Idawscc.amplify.branches

Fields

NameDatatypeDescription
app_idstring
arnstring
basic_auth_configobject
backendobject
branch_namestring
build_specstring
compute_role_arnstring
descriptionstring
enable_auto_buildboolean
enable_performance_modeboolean
enable_pull_request_previewboolean
enable_skew_protectionboolean
environment_variablesarray
frameworkstring
pull_request_environment_namestring
stagestring
tagsarray
regionstringAWS region.

For more information, see AWS::Amplify::Branch.

Methods

NameResourceAccessible byRequired Params
create_resourcebranchesINSERTAppId, BranchName, region
delete_resourcebranchesDELETEIdentifier, region
update_resourcebranchesUPDATEIdentifier, PatchDocument, region
list_resourcesbranches_list_onlySELECTregion
get_resourcebranchesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual branch.

SELECT
region,
app_id,
arn,
basic_auth_config,
backend,
branch_name,
build_spec,
compute_role_arn,
description,
enable_auto_build,
enable_performance_mode,
enable_pull_request_preview,
enable_skew_protection,
environment_variables,
framework,
pull_request_environment_name,
stage,
tags
FROM awscc.amplify.branches
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new branch resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.amplify.branches (
AppId,
BranchName,
region
)
SELECT
'{{ app_id }}',
'{{ branch_name }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a branch resource, using stack-deploy.

/*+ update */
UPDATE awscc.amplify.branches
SET PatchDocument = string('{{ {
"BasicAuthConfig": basic_auth_config,
"Backend": backend,
"BuildSpec": build_spec,
"ComputeRoleArn": compute_role_arn,
"Description": description,
"EnableAutoBuild": enable_auto_build,
"EnablePerformanceMode": enable_performance_mode,
"EnablePullRequestPreview": enable_pull_request_preview,
"EnableSkewProtection": enable_skew_protection,
"EnvironmentVariables": environment_variables,
"Framework": framework,
"PullRequestEnvironmentName": pull_request_environment_name,
"Stage": stage,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.amplify.branches
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';

Permissions

To operate on the branches resource, the following permissions are required:

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