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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.amplify.branches
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

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