1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. amplify
  5. getBranch

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi

aws-native.amplify.getBranch

Explore with Pulumi AI

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi

The AWS::Amplify::Branch resource creates a new branch within an app.

Using getBranch

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getBranch(args: GetBranchArgs, opts?: InvokeOptions): Promise<GetBranchResult>
function getBranchOutput(args: GetBranchOutputArgs, opts?: InvokeOptions): Output<GetBranchResult>
Copy
def get_branch(arn: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetBranchResult
def get_branch_output(arn: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetBranchResult]
Copy
func LookupBranch(ctx *Context, args *LookupBranchArgs, opts ...InvokeOption) (*LookupBranchResult, error)
func LookupBranchOutput(ctx *Context, args *LookupBranchOutputArgs, opts ...InvokeOption) LookupBranchResultOutput
Copy

> Note: This function is named LookupBranch in the Go SDK.

public static class GetBranch 
{
    public static Task<GetBranchResult> InvokeAsync(GetBranchArgs args, InvokeOptions? opts = null)
    public static Output<GetBranchResult> Invoke(GetBranchInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetBranchResult> getBranch(GetBranchArgs args, InvokeOptions options)
public static Output<GetBranchResult> getBranch(GetBranchArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws-native:amplify:getBranch
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Arn This property is required. string
ARN for a branch, part of an Amplify App.
Arn This property is required. string
ARN for a branch, part of an Amplify App.
arn This property is required. String
ARN for a branch, part of an Amplify App.
arn This property is required. string
ARN for a branch, part of an Amplify App.
arn This property is required. str
ARN for a branch, part of an Amplify App.
arn This property is required. String
ARN for a branch, part of an Amplify App.

getBranch Result

The following output properties are available:

Arn string
ARN for a branch, part of an Amplify App.
Backend Pulumi.AwsNative.Amplify.Outputs.BranchBackend

The backend for a Branch of an Amplify app. Use for a backend created from an AWS CloudFormation stack.

This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.

BuildSpec string
The build specification (build spec) for the branch.
ComputeRoleArn string
The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide .
Description string
The description for the branch that is part of an Amplify app.
EnableAutoBuild bool
Enables auto building for the branch.
EnablePerformanceMode bool

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.

EnablePullRequestPreview bool

Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify 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, Amplify 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 .

EnableSkewProtection bool

Specifies whether the skew protection feature is enabled for the branch.

Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide .

EnvironmentVariables List<Pulumi.AwsNative.Amplify.Outputs.BranchEnvironmentVariable>
The environment variables for the branch.
Framework string
The framework for the branch.
PullRequestEnvironmentName string

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, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting 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 .

Stage Pulumi.AwsNative.Amplify.BranchStage
Describes the current stage for the branch.
Tags List<Pulumi.AwsNative.Outputs.Tag>
The tag for the branch.
Arn string
ARN for a branch, part of an Amplify App.
Backend BranchBackend

The backend for a Branch of an Amplify app. Use for a backend created from an AWS CloudFormation stack.

This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.

BuildSpec string
The build specification (build spec) for the branch.
ComputeRoleArn string
The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide .
Description string
The description for the branch that is part of an Amplify app.
EnableAutoBuild bool
Enables auto building for the branch.
EnablePerformanceMode bool

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.

EnablePullRequestPreview bool

Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify 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, Amplify 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 .

EnableSkewProtection bool

Specifies whether the skew protection feature is enabled for the branch.

Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide .

EnvironmentVariables []BranchEnvironmentVariable
The environment variables for the branch.
Framework string
The framework for the branch.
PullRequestEnvironmentName string

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, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting 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 .

Stage BranchStage
Describes the current stage for the branch.
Tags Tag
The tag for the branch.
arn String
ARN for a branch, part of an Amplify App.
backend BranchBackend

The backend for a Branch of an Amplify app. Use for a backend created from an AWS CloudFormation stack.

This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.

buildSpec String
The build specification (build spec) for the branch.
computeRoleArn String
The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide .
description String
The description for the branch that is part of an Amplify app.
enableAutoBuild Boolean
Enables auto building for the branch.
enablePerformanceMode Boolean

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.

enablePullRequestPreview Boolean

Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify 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, Amplify 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 .

enableSkewProtection Boolean

Specifies whether the skew protection feature is enabled for the branch.

Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide .

environmentVariables List<BranchEnvironmentVariable>
The environment variables for the branch.
framework String
The framework for the branch.
pullRequestEnvironmentName String

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, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting 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 .

stage BranchStage
Describes the current stage for the branch.
tags List<Tag>
The tag for the branch.
arn string
ARN for a branch, part of an Amplify App.
backend BranchBackend

The backend for a Branch of an Amplify app. Use for a backend created from an AWS CloudFormation stack.

This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.

buildSpec string
The build specification (build spec) for the branch.
computeRoleArn string
The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide .
description string
The description for the branch that is part of an Amplify app.
enableAutoBuild boolean
Enables auto building for the branch.
enablePerformanceMode boolean

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.

enablePullRequestPreview boolean

Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify 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, Amplify 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 .

enableSkewProtection boolean

Specifies whether the skew protection feature is enabled for the branch.

Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide .

environmentVariables BranchEnvironmentVariable[]
The environment variables for the branch.
framework string
The framework for the branch.
pullRequestEnvironmentName string

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, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting 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 .

stage BranchStage
Describes the current stage for the branch.
tags Tag[]
The tag for the branch.
arn str
ARN for a branch, part of an Amplify App.
backend BranchBackend

The backend for a Branch of an Amplify app. Use for a backend created from an AWS CloudFormation stack.

This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.

build_spec str
The build specification (build spec) for the branch.
compute_role_arn str
The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide .
description str
The description for the branch that is part of an Amplify app.
enable_auto_build bool
Enables auto building for the branch.
enable_performance_mode bool

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 bool

Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify 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, Amplify 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 .

enable_skew_protection bool

Specifies whether the skew protection feature is enabled for the branch.

Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide .

environment_variables Sequence[BranchEnvironmentVariable]
The environment variables for the branch.
framework str
The framework for the branch.
pull_request_environment_name 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, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting 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 .

stage BranchStage
Describes the current stage for the branch.
tags Sequence[root_Tag]
The tag for the branch.
arn String
ARN for a branch, part of an Amplify App.
backend Property Map

The backend for a Branch of an Amplify app. Use for a backend created from an AWS CloudFormation stack.

This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.

buildSpec String
The build specification (build spec) for the branch.
computeRoleArn String
The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide .
description String
The description for the branch that is part of an Amplify app.
enableAutoBuild Boolean
Enables auto building for the branch.
enablePerformanceMode Boolean

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.

enablePullRequestPreview Boolean

Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify 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, Amplify 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 .

enableSkewProtection Boolean

Specifies whether the skew protection feature is enabled for the branch.

Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide .

environmentVariables List<Property Map>
The environment variables for the branch.
framework String
The framework for the branch.
pullRequestEnvironmentName String

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, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting 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 .

stage "EXPERIMENTAL" | "BETA" | "PULL_REQUEST" | "PRODUCTION" | "DEVELOPMENT"
Describes the current stage for the branch.
tags List<Property Map>
The tag for the branch.

Supporting Types

BranchBackend

StackArn string
The Amazon Resource Name (ARN) for the AWS CloudFormation stack.
StackArn string
The Amazon Resource Name (ARN) for the AWS CloudFormation stack.
stackArn String
The Amazon Resource Name (ARN) for the AWS CloudFormation stack.
stackArn string
The Amazon Resource Name (ARN) for the AWS CloudFormation stack.
stack_arn str
The Amazon Resource Name (ARN) for the AWS CloudFormation stack.
stackArn String
The Amazon Resource Name (ARN) for the AWS CloudFormation stack.

BranchEnvironmentVariable

Name This property is required. string
The environment variable name.
Value This property is required. string
The environment variable value.
Name This property is required. string
The environment variable name.
Value This property is required. string
The environment variable value.
name This property is required. String
The environment variable name.
value This property is required. String
The environment variable value.
name This property is required. string
The environment variable name.
value This property is required. string
The environment variable value.
name This property is required. str
The environment variable name.
value This property is required. str
The environment variable value.
name This property is required. String
The environment variable name.
value This property is required. String
The environment variable value.

BranchStage

Tag

Key This property is required. string
The key name of the tag
Value This property is required. string
The value of the tag
Key This property is required. string
The key name of the tag
Value This property is required. string
The value of the tag
key This property is required. String
The key name of the tag
value This property is required. String
The value of the tag
key This property is required. string
The key name of the tag
value This property is required. string
The value of the tag
key This property is required. str
The key name of the tag
value This property is required. str
The value of the tag
key This property is required. String
The key name of the tag
value This property is required. String
The value of the tag

Package Details

Repository
AWS Native pulumi/pulumi-aws-native
License
Apache-2.0

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi