Branch

class aws_cdk.aws_amplify.Branch(scope, id, *, app, auto_build=None, basic_auth=None, branch_name=None, build_spec=None, description=None, environment_variables=None, pull_request_environment_name=None, pull_request_preview=None, stage=None)

Bases: aws_cdk.core.Resource

(experimental) An Amplify Console branch.

Stability

experimental

Parameters
  • scope (Construct) –

  • id (str) –

  • app (IApp) – (experimental) The application within which the branch must be created.

  • auto_build (Optional[bool]) – (experimental) Whether to enable auto building for the branch. Default: true

  • basic_auth (Optional[BasicAuth]) – (experimental) The Basic Auth configuration. Use this to set password protection for the branch Default: - no password protection

  • branch_name (Optional[str]) – (experimental) The name of the branch. Default: - the construct’s id

  • build_spec (Optional[BuildSpec]) – (experimental) BuildSpec for the branch. Default: - no build spec

  • description (Optional[str]) – (experimental) A description for the branch. Default: - no description

  • environment_variables (Optional[Mapping[str, str]]) – (experimental) Environment variables for the branch. All environment variables that you add are encrypted to prevent rogue access so you can use them to store secret information. Default: - application environment variables

  • pull_request_environment_name (Optional[str]) – (experimental) The dedicated backend environment for the pull request previews. Default: - automatically provision a temporary backend

  • pull_request_preview (Optional[bool]) – (experimental) Whether to enable pull request preview for the branch. Default: true

  • stage (Optional[str]) – (experimental) Stage for the branch. Default: - no stage

Stability

experimental

Methods

add_environment(name, value)

(experimental) Adds an environment variable to this branch.

All environment variables that you add are encrypted to prevent rogue access so you can use them to store secret information.

Parameters
  • name (str) –

  • value (str) –

Stability

experimental

Return type

Branch

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

arn

(experimental) The ARN of the branch.

Stability

experimental

Attribute

true

Return type

str

branch_name

(experimental) The name of the branch.

Stability

experimental

Return type

str

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_branch_name(scope, id, branch_name)

(experimental) Import an existing branch.

Parameters
  • scope (Construct) –

  • id (str) –

  • branch_name (str) –

Stability

experimental

Return type

IBranch

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool