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.
Idaws.amplify.branches

Fields

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

Methods

NameAccessible byRequired Params
create_resourceINSERTAppId, BranchName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

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

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