CfnBranchProps

class aws_cdk.aws_amplify.CfnBranchProps(*, app_id, branch_name, basic_auth_config=None, build_spec=None, description=None, enable_auto_build=None, enable_performance_mode=None, enable_pull_request_preview=None, environment_variables=None, pull_request_environment_name=None, stage=None, tags=None)

Bases: object

Properties for defining a CfnBranch.

Parameters
  • app_id (str) – The unique ID for an Amplify app. Length Constraints: Minimum length of 1. Maximum length of 20. Pattern: d[a-z0-9]+

  • branch_name (str) – The name for the branch. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: (?s).+

  • basic_auth_config (Union[IResolvable, BasicAuthConfigProperty, Dict[str, Any], None]) – The basic authorization credentials for a branch of an Amplify app. You must base64-encode the authorization credentials and provide them in the format user:password .

  • build_spec (Optional[str]) – The build specification (build spec) for the branch. Length Constraints: Minimum length of 1. Maximum length of 25000. Pattern: (?s).+

  • description (Optional[str]) – The description for the branch that is part of an Amplify app. Length Constraints: Maximum length of 1000. Pattern: (?s).*

  • enable_auto_build (Union[bool, IResolvable, None]) – Enables auto building for the branch.

  • enable_performance_mode (Union[bool, IResolvable, None]) – Enables performance mode for the branch. Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.

  • enable_pull_request_preview (Union[bool, IResolvable, None]) – Sets whether the Amplify Console creates a preview for each pull request that is made for this branch. If this property is enabled, the Amplify Console deploys your app to a unique preview URL after each pull request is opened. Development and QA teams can use this preview to test the pull request before it’s merged into a production or integration branch. To provide backend support for your preview, the Amplify Console automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the PullRequestEnvironmentName property. For more information, see Web Previews in the AWS Amplify Hosting User Guide .

  • environment_variables (Union[IResolvable, Sequence[Union[IResolvable, EnvironmentVariableProperty, Dict[str, Any]]], None]) – The environment variables for the branch.

  • pull_request_environment_name (Optional[str]) – If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews. For example, you could specify an environment named prod , test , or dev that you initialized with the Amplify CLI and mapped to this branch. To enable pull request previews, set the EnablePullRequestPreview property to true . If you don’t specify an environment, the Amplify Console provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Console deletes this environment when the pull request is closed. For more information about creating backend environments, see Feature Branch Deployments and Team Workflows in the AWS Amplify Hosting User Guide . Length Constraints: Maximum length of 20. Pattern: (?s).*

  • stage (Optional[str]) – Describes the current stage for the branch. Valid Values: PRODUCTION | BETA | DEVELOPMENT | EXPERIMENTAL | PULL_REQUEST

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – The tag for the branch.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_amplify as amplify

cfn_branch_props = amplify.CfnBranchProps(
    app_id="appId",
    branch_name="branchName",

    # the properties below are optional
    basic_auth_config=amplify.CfnBranch.BasicAuthConfigProperty(
        password="password",
        username="username",

        # the properties below are optional
        enable_basic_auth=False
    ),
    build_spec="buildSpec",
    description="description",
    enable_auto_build=False,
    enable_performance_mode=False,
    enable_pull_request_preview=False,
    environment_variables=[amplify.CfnBranch.EnvironmentVariableProperty(
        name="name",
        value="value"
    )],
    pull_request_environment_name="pullRequestEnvironmentName",
    stage="stage",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

app_id

The unique ID for an Amplify app.

Length Constraints: Minimum length of 1. Maximum length of 20.

Pattern: d[a-z0-9]+

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-appid

Return type

str

basic_auth_config

The basic authorization credentials for a branch of an Amplify app.

You must base64-encode the authorization credentials and provide them in the format user:password .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-basicauthconfig

Return type

Union[IResolvable, BasicAuthConfigProperty, None]

branch_name

The name for the branch.

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: (?s).+

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-branchname

Return type

str

build_spec

The build specification (build spec) for the branch.

Length Constraints: Minimum length of 1. Maximum length of 25000.

Pattern: (?s).+

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-buildspec

Return type

Optional[str]

description

The description for the branch that is part of an Amplify app.

Length Constraints: Maximum length of 1000.

Pattern: (?s).*

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-description

Return type

Optional[str]

enable_auto_build

Enables auto building for the branch.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-enableautobuild

Return type

Union[bool, IResolvable, None]

enable_performance_mode

Enables performance mode for the branch.

Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-enableperformancemode

Return type

Union[bool, IResolvable, None]

enable_pull_request_preview

Sets whether the Amplify Console creates a preview for each pull request that is made for this branch.

If this property is enabled, the Amplify Console deploys your app to a unique preview URL after each pull request is opened. Development and QA teams can use this preview to test the pull request before it’s merged into a production or integration branch.

To provide backend support for your preview, the Amplify Console automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the PullRequestEnvironmentName property.

For more information, see Web Previews in the AWS Amplify Hosting User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-enablepullrequestpreview

Return type

Union[bool, IResolvable, None]

environment_variables

The environment variables for the branch.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-environmentvariables

Return type

Union[IResolvable, List[Union[IResolvable, EnvironmentVariableProperty]], None]

pull_request_environment_name

If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews.

For example, you could specify an environment named prod , test , or dev that you initialized with the Amplify CLI and mapped to this branch.

To enable pull request previews, set the EnablePullRequestPreview property to true .

If you don’t specify an environment, the Amplify Console provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Console deletes this environment when the pull request is closed.

For more information about creating backend environments, see Feature Branch Deployments and Team Workflows in the AWS Amplify Hosting User Guide .

Length Constraints: Maximum length of 20.

Pattern: (?s).*

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-pullrequestenvironmentname

Return type

Optional[str]

stage

Describes the current stage for the branch.

Valid Values: PRODUCTION | BETA | DEVELOPMENT | EXPERIMENTAL | PULL_REQUEST

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-stage

Return type

Optional[str]

tags

The tag for the branch.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-tags

Return type

Optional[List[CfnTag]]