AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

Branch

Provides an Amplify Branch resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Amplify.App("example", new Aws.Amplify.AppArgs
        {
        });
        var master = new Aws.Amplify.Branch("master", new Aws.Amplify.BranchArgs
        {
            AppId = example.Id,
            BranchName = "master",
            Framework = "React",
            Stage = "PRODUCTION",
            EnvironmentVariables = 
            {
                { "REACT_APP_API_SERVER", "https://api.example.com" },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/amplify"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := amplify.NewApp(ctx, "example", nil)
		if err != nil {
			return err
		}
		_, err = amplify.NewBranch(ctx, "master", &amplify.BranchArgs{
			AppId:      example.ID(),
			BranchName: pulumi.String("master"),
			Framework:  pulumi.String("React"),
			Stage:      pulumi.String("PRODUCTION"),
			EnvironmentVariables: pulumi.StringMap{
				"REACT_APP_API_SERVER": pulumi.String("https://api.example.com"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new App("example");

        var master = new Branch("master", BranchArgs.builder()        
            .appId(example.id())
            .branchName("master")
            .framework("React")
            .stage("PRODUCTION")
            .environmentVariables(Map.of("REACT_APP_API_SERVER", "https://api.example.com"))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.amplify.App("example")
master = aws.amplify.Branch("master",
    app_id=example.id,
    branch_name="master",
    framework="React",
    stage="PRODUCTION",
    environment_variables={
        "REACT_APP_API_SERVER": "https://api.example.com",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.amplify.App("example", {});
const master = new aws.amplify.Branch("master", {
    appId: example.id,
    branchName: "master",
    framework: "React",
    stage: "PRODUCTION",
    environmentVariables: {
        REACT_APP_API_SERVER: "https://api.example.com",
    },
});
resources:
  example:
    type: aws:amplify:App
  master:
    type: aws:amplify:Branch
    properties:
      appId: ${example.id}
      branchName: master
      framework: React
      stage: PRODUCTION
      environmentVariables:
        REACT_APP_API_SERVER: https://api.example.com

Basic Authentication

Coming soon!

Coming soon!

package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new App("example");

        var master = new Branch("master", BranchArgs.builder()        
            .appId(example.id())
            .branchName("master")
            .basicAuthConfig(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
            .build());

    }
}

Coming soon!

Coming soon!

resources:
  example:
    type: aws:amplify:App
  master:
    type: aws:amplify:Branch
    properties:
      appId: ${example.id}
      branchName: master
      basicAuthConfig:
        - enableBasicAuth: true
          username: username
          password: password

Notifications

using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Amplify.App("example", new Aws.Amplify.AppArgs
        {
        });
        var master = new Aws.Amplify.Branch("master", new Aws.Amplify.BranchArgs
        {
            AppId = example.Id,
            BranchName = "master",
            EnableNotification = true,
        });
        // EventBridge Rule for Amplify notifications
        var amplifyAppMasterEventRule = new Aws.CloudWatch.EventRule("amplifyAppMasterEventRule", new Aws.CloudWatch.EventRuleArgs
        {
            Description = master.BranchName.Apply(branchName => $"AWS Amplify build notifications for :  App: {aws_amplify_app.App.Id} Branch: {branchName}"),
            EventPattern = Output.Tuple(example.Id, master.BranchName).Apply(values =>
            {
                var id = values.Item1;
                var branchName = values.Item2;
                return JsonSerializer.Serialize(new Dictionary<string, object?>
                {
                    { "detail", new Dictionary<string, object?>
                    {
                        { "appId", new[]
                            {
                                id,
                            }
                         },
                        { "branchName", new[]
                            {
                                branchName,
                            }
                         },
                        { "jobStatus", new[]
                            {
                                "SUCCEED",
                                "FAILED",
                                "STARTED",
                            }
                         },
                    } },
                    { "detail-type", new[]
                        {
                            "Amplify Deployment Status Change",
                        }
                     },
                    { "source", new[]
                        {
                            "aws.amplify",
                        }
                     },
                });
            }),
        });
        var amplifyAppMasterTopic = new Aws.Sns.Topic("amplifyAppMasterTopic", new Aws.Sns.TopicArgs
        {
        });
        var amplifyAppMasterEventTarget = new Aws.CloudWatch.EventTarget("amplifyAppMasterEventTarget", new Aws.CloudWatch.EventTargetArgs
        {
            Rule = amplifyAppMasterEventRule.Name,
            Arn = amplifyAppMasterTopic.Arn,
            InputTransformer = new Aws.CloudWatch.Inputs.EventTargetInputTransformerArgs
            {
                InputPaths = 
                {
                    { "jobId", "$.detail.jobId" },
                    { "appId", "$.detail.appId" },
                    { "region", "$.region" },
                    { "branch", "$.detail.branchName" },
                    { "status", "$.detail.jobStatus" },
                },
                InputTemplate = "\"Build notification from the AWS Amplify Console for app: https://<branch>.<appId>.amplifyapp.com/. Your build status is <status>. Go to https://console.aws.amazon.com/amplify/home?region=<region>#<appId>/<branch>/<jobId> to view details on your build. \"",
            },
        });
        // SNS Topic for Amplify notifications
        var amplifyAppMasterPolicyDocument = Output.Tuple(master.Arn, amplifyAppMasterTopic.Arn).Apply(values =>
        {
            var masterArn = values.Item1;
            var amplifyAppMasterTopicArn = values.Item2;
            return Aws.Iam.GetPolicyDocument.Invoke(new Aws.Iam.GetPolicyDocumentInvokeArgs
            {
                Statements = 
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
                    {
                        Sid = $"Allow_Publish_Events {masterArn}",
                        Effect = "Allow",
                        Actions = 
                        {
                            "SNS:Publish",
                        },
                        Principals = 
                        {
                            new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                            {
                                Type = "Service",
                                Identifiers = 
                                {
                                    "events.amazonaws.com",
                                },
                            },
                        },
                        Resources = 
                        {
                            amplifyAppMasterTopicArn,
                        },
                    },
                },
            });
        });
        var amplifyAppMasterTopicPolicy = new Aws.Sns.TopicPolicy("amplifyAppMasterTopicPolicy", new Aws.Sns.TopicPolicyArgs
        {
            Arn = amplifyAppMasterTopic.Arn,
            Policy = amplifyAppMasterPolicyDocument.Apply(amplifyAppMasterPolicyDocument => amplifyAppMasterPolicyDocument.Json),
        });
    }

}

Coming soon!

package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
import static com.pulumi.codegen.internal.Serialization.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new App("example");

        var master = new Branch("master", BranchArgs.builder()        
            .appId(example.id())
            .branchName("master")
            .enableNotification(true)
            .build());

        var amplifyAppMasterEventRule = new EventRule("amplifyAppMasterEventRule", EventRuleArgs.builder()        
            .description(master.branchName().apply(branchName -> String.format("AWS Amplify build notifications for :  App: %s Branch: %s", aws_amplify_app.app().id(),branchName)))
            .eventPattern(Output.tuple(example.id(), master.branchName()).apply(values -> {
                var id = values.t1;
                var branchName = values.t2;
                return serializeJson(
                    jsonObject(
                        jsonProperty("detail", jsonObject(
                            jsonProperty("appId", jsonArray(id)),
                            jsonProperty("branchName", jsonArray(branchName)),
                            jsonProperty("jobStatus", jsonArray(
                                "SUCCEED", 
                                "FAILED", 
                                "STARTED"
                            ))
                        )),
                        jsonProperty("detail-type", jsonArray("Amplify Deployment Status Change")),
                        jsonProperty("source", jsonArray("aws.amplify"))
                    ));
            }))
            .build());

        var amplifyAppMasterTopic = new Topic("amplifyAppMasterTopic");

        var amplifyAppMasterEventTarget = new EventTarget("amplifyAppMasterEventTarget", EventTargetArgs.builder()        
            .rule(amplifyAppMasterEventRule.name())
            .arn(amplifyAppMasterTopic.arn())
            .inputTransformer(EventTargetInputTransformerArgs.builder()
                .inputPaths(Map.ofEntries(
                    Map.entry("jobId", "$.detail.jobId"),
                    Map.entry("appId", "$.detail.appId"),
                    Map.entry("region", "$.region"),
                    Map.entry("branch", "$.detail.branchName"),
                    Map.entry("status", "$.detail.jobStatus")
                ))
                .inputTemplate("\"Build notification from the AWS Amplify Console for app: https://<branch>.<appId>.amplifyapp.com/. Your build status is <status>. Go to https://console.aws.amazon.com/amplify/home?region=<region>#<appId>/<branch>/<jobId> to view details on your build. \"")
                .build())
            .build());

        final var amplifyAppMasterPolicyDocument = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .sid(master.arn().apply(arn -> String.format("Allow_Publish_Events %s", arn)))
                .effect("Allow")
                .actions("SNS:Publish")
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("Service")
                    .identifiers("events.amazonaws.com")
                    .build())
                .resources(amplifyAppMasterTopic.arn())
                .build())
            .build());

        var amplifyAppMasterTopicPolicy = new TopicPolicy("amplifyAppMasterTopicPolicy", TopicPolicyArgs.builder()        
            .arn(amplifyAppMasterTopic.arn())
            .policy(amplifyAppMasterPolicyDocument.apply(getPolicyDocumentResult -> getPolicyDocumentResult).apply(amplifyAppMasterPolicyDocument -> amplifyAppMasterPolicyDocument.apply(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
            .build());

    }
}
import pulumi
import json
import pulumi_aws as aws

example = aws.amplify.App("example")
master = aws.amplify.Branch("master",
    app_id=example.id,
    branch_name="master",
    enable_notification=True)
# EventBridge Rule for Amplify notifications
amplify_app_master_event_rule = aws.cloudwatch.EventRule("amplifyAppMasterEventRule",
    description=master.branch_name.apply(lambda branch_name: f"AWS Amplify build notifications for :  App: {aws_amplify_app['app']['id']} Branch: {branch_name}"),
    event_pattern=pulumi.Output.all(example.id, master.branch_name).apply(lambda id, branch_name: json.dumps({
        "detail": {
            "appId": [id],
            "branchName": [branch_name],
            "jobStatus": [
                "SUCCEED",
                "FAILED",
                "STARTED",
            ],
        },
        "detail-type": ["Amplify Deployment Status Change"],
        "source": ["aws.amplify"],
    })))
amplify_app_master_topic = aws.sns.Topic("amplifyAppMasterTopic")
amplify_app_master_event_target = aws.cloudwatch.EventTarget("amplifyAppMasterEventTarget",
    rule=amplify_app_master_event_rule.name,
    arn=amplify_app_master_topic.arn,
    input_transformer=aws.cloudwatch.EventTargetInputTransformerArgs(
        input_paths={
            "jobId": "$.detail.jobId",
            "appId": "$.detail.appId",
            "region": "$.region",
            "branch": "$.detail.branchName",
            "status": "$.detail.jobStatus",
        },
        input_template="\"Build notification from the AWS Amplify Console for app: https://<branch>.<appId>.amplifyapp.com/. Your build status is <status>. Go to https://console.aws.amazon.com/amplify/home?region=<region>#<appId>/<branch>/<jobId> to view details on your build. \"",
    ))
# SNS Topic for Amplify notifications
amplify_app_master_policy_document = pulumi.Output.all(master.arn, amplify_app_master_topic.arn).apply(lambda masterArn, amplifyAppMasterTopicArn: aws.iam.get_policy_document_output(statements=[aws.iam.GetPolicyDocumentStatementArgs(
    sid=f"Allow_Publish_Events {master_arn}",
    effect="Allow",
    actions=["SNS:Publish"],
    principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
        type="Service",
        identifiers=["events.amazonaws.com"],
    )],
    resources=[amplify_app_master_topic_arn],
)]))
amplify_app_master_topic_policy = aws.sns.TopicPolicy("amplifyAppMasterTopicPolicy",
    arn=amplify_app_master_topic.arn,
    policy=amplify_app_master_policy_document.json)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.amplify.App("example", {});
const master = new aws.amplify.Branch("master", {
    appId: example.id,
    branchName: "master",
    enableNotification: true,
});
// EventBridge Rule for Amplify notifications
const amplifyAppMasterEventRule = new aws.cloudwatch.EventRule("amplifyAppMasterEventRule", {
    description: pulumi.interpolate`AWS Amplify build notifications for :  App: ${aws_amplify_app.app.id} Branch: ${master.branchName}`,
    eventPattern: pulumi.all([example.id, master.branchName]).apply(([id, branchName]) => JSON.stringify({
        detail: {
            appId: [id],
            branchName: [branchName],
            jobStatus: [
                "SUCCEED",
                "FAILED",
                "STARTED",
            ],
        },
        "detail-type": ["Amplify Deployment Status Change"],
        source: ["aws.amplify"],
    })),
});
const amplifyAppMasterTopic = new aws.sns.Topic("amplifyAppMasterTopic", {});
const amplifyAppMasterEventTarget = new aws.cloudwatch.EventTarget("amplifyAppMasterEventTarget", {
    rule: amplifyAppMasterEventRule.name,
    arn: amplifyAppMasterTopic.arn,
    inputTransformer: {
        inputPaths: {
            jobId: `$.detail.jobId`,
            appId: `$.detail.appId`,
            region: `$.region`,
            branch: `$.detail.branchName`,
            status: `$.detail.jobStatus`,
        },
        inputTemplate: "\"Build notification from the AWS Amplify Console for app: https://<branch>.<appId>.amplifyapp.com/. Your build status is <status>. Go to https://console.aws.amazon.com/amplify/home?region=<region>#<appId>/<branch>/<jobId> to view details on your build. \"",
    },
});
// SNS Topic for Amplify notifications
const amplifyAppMasterPolicyDocument = pulumi.all([master.arn, amplifyAppMasterTopic.arn]).apply(([masterArn, amplifyAppMasterTopicArn]) => aws.iam.getPolicyDocumentOutput({
    statements: [{
        sid: `Allow_Publish_Events ${masterArn}`,
        effect: "Allow",
        actions: ["SNS:Publish"],
        principals: [{
            type: "Service",
            identifiers: ["events.amazonaws.com"],
        }],
        resources: [amplifyAppMasterTopicArn],
    }],
}));
const amplifyAppMasterTopicPolicy = new aws.sns.TopicPolicy("amplifyAppMasterTopicPolicy", {
    arn: amplifyAppMasterTopic.arn,
    policy: amplifyAppMasterPolicyDocument.apply(amplifyAppMasterPolicyDocument => amplifyAppMasterPolicyDocument.json),
});
resources:
  example:
    type: aws:amplify:App
  master:
    type: aws:amplify:Branch
    properties:
      appId: ${example.id}
      branchName: master
      enableNotification: true
  amplifyAppMasterEventRule:
    type: aws:cloudwatch:EventRule
    properties:
      description: 'AWS Amplify build notifications for :  App: ${aws_amplify_app.app.id} Branch: ${master.branchName}'
      eventPattern:
        Fn::ToJSON:
          detail:
            appId:
              - ${example.id}
            branchName:
              - ${master.branchName}
            jobStatus:
              - SUCCEED
              - FAILED
              - STARTED
          detail-type:
            - Amplify Deployment Status Change
          source:
            - aws.amplify
  amplifyAppMasterEventTarget:
    type: aws:cloudwatch:EventTarget
    properties:
      rule: ${amplifyAppMasterEventRule.name}
      arn: ${amplifyAppMasterTopic.arn}
      inputTransformer:
        inputPaths:
          jobId: $.detail.jobId
          appId: $.detail.appId
          region: $.region
          branch: $.detail.branchName
          status: $.detail.jobStatus
        inputTemplate: '"Build notification from the AWS Amplify Console for app: https://<branch>.<appId>.amplifyapp.com/. Your build status is <status>. Go to https://console.aws.amazon.com/amplify/home?region=<region>#<appId>/<branch>/<jobId> to view details on your build. "'
  amplifyAppMasterTopic:
    type: aws:sns:Topic
  amplifyAppMasterTopicPolicy:
    type: aws:sns:TopicPolicy
    properties:
      arn: ${amplifyAppMasterTopic.arn}
      policy: ${amplifyAppMasterPolicyDocument.json}
variables:
  amplifyAppMasterPolicyDocument:
    Fn::Invoke:
      Function: aws:iam:getPolicyDocument
      Arguments:
        statements:
          - sid: Allow_Publish_Events ${master.arn}
            effect: Allow
            actions:
              - SNS:Publish
            principals:
              - type: Service
                identifiers:
                  - events.amazonaws.com
            resources:
              - ${amplifyAppMasterTopic.arn}

Create a Branch Resource

new Branch(name: string, args: BranchArgs, opts?: CustomResourceOptions);
@overload
def Branch(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           app_id: Optional[str] = None,
           backend_environment_arn: Optional[str] = None,
           basic_auth_credentials: Optional[str] = None,
           branch_name: Optional[str] = None,
           description: Optional[str] = None,
           display_name: Optional[str] = None,
           enable_auto_build: Optional[bool] = None,
           enable_basic_auth: Optional[bool] = None,
           enable_notification: Optional[bool] = None,
           enable_performance_mode: Optional[bool] = None,
           enable_pull_request_preview: Optional[bool] = None,
           environment_variables: Optional[Mapping[str, str]] = None,
           framework: Optional[str] = None,
           pull_request_environment_name: Optional[str] = None,
           stage: Optional[str] = None,
           tags: Optional[Mapping[str, str]] = None,
           ttl: Optional[str] = None)
@overload
def Branch(resource_name: str,
           args: BranchArgs,
           opts: Optional[ResourceOptions] = None)
func NewBranch(ctx *Context, name string, args BranchArgs, opts ...ResourceOption) (*Branch, error)
public Branch(string name, BranchArgs args, CustomResourceOptions? opts = null)
public Branch(String name, BranchArgs args)
public Branch(String name, BranchArgs args, CustomResourceOptions options)
type: aws:amplify:Branch
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args BranchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args BranchArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BranchArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BranchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args BranchArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Branch Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Branch resource accepts the following input properties:

AppId string

The unique ID for an Amplify app.

BranchName string

The name for the branch.

BackendEnvironmentArn string

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

BasicAuthCredentials string

The basic authorization credentials for the branch.

Description string

The description for the branch.

DisplayName string

The display name for a branch. This is used as the default domain prefix.

EnableAutoBuild bool

Enables auto building for the branch.

EnableBasicAuth bool

Enables basic authorization for the branch.

EnableNotification bool

Enables notifications for the branch.

EnablePerformanceMode bool

Enables performance mode for the branch.

EnablePullRequestPreview bool

Enables pull request previews for this branch.

EnvironmentVariables Dictionary<string, string>

The environment variables for the branch.

Framework string

The framework for the branch.

PullRequestEnvironmentName string

The Amplify environment name for the pull request.

Stage string

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

Tags Dictionary<string, string>

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Ttl string

The content Time To Live (TTL) for the website in seconds.

AppId string

The unique ID for an Amplify app.

BranchName string

The name for the branch.

BackendEnvironmentArn string

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

BasicAuthCredentials string

The basic authorization credentials for the branch.

Description string

The description for the branch.

DisplayName string

The display name for a branch. This is used as the default domain prefix.

EnableAutoBuild bool

Enables auto building for the branch.

EnableBasicAuth bool

Enables basic authorization for the branch.

EnableNotification bool

Enables notifications for the branch.

EnablePerformanceMode bool

Enables performance mode for the branch.

EnablePullRequestPreview bool

Enables pull request previews for this branch.

EnvironmentVariables map[string]string

The environment variables for the branch.

Framework string

The framework for the branch.

PullRequestEnvironmentName string

The Amplify environment name for the pull request.

Stage string

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

Tags map[string]string

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Ttl string

The content Time To Live (TTL) for the website in seconds.

appId String

The unique ID for an Amplify app.

branchName String

The name for the branch.

backendEnvironmentArn String

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

basicAuthCredentials String

The basic authorization credentials for the branch.

description String

The description for the branch.

displayName String

The display name for a branch. This is used as the default domain prefix.

enableAutoBuild Boolean

Enables auto building for the branch.

enableBasicAuth Boolean

Enables basic authorization for the branch.

enableNotification Boolean

Enables notifications for the branch.

enablePerformanceMode Boolean

Enables performance mode for the branch.

enablePullRequestPreview Boolean

Enables pull request previews for this branch.

environmentVariables Map<String,String>

The environment variables for the branch.

framework String

The framework for the branch.

pullRequestEnvironmentName String

The Amplify environment name for the pull request.

stage String

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

tags Map<String,String>

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

ttl String

The content Time To Live (TTL) for the website in seconds.

appId string

The unique ID for an Amplify app.

branchName string

The name for the branch.

backendEnvironmentArn string

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

basicAuthCredentials string

The basic authorization credentials for the branch.

description string

The description for the branch.

displayName string

The display name for a branch. This is used as the default domain prefix.

enableAutoBuild boolean

Enables auto building for the branch.

enableBasicAuth boolean

Enables basic authorization for the branch.

enableNotification boolean

Enables notifications for the branch.

enablePerformanceMode boolean

Enables performance mode for the branch.

enablePullRequestPreview boolean

Enables pull request previews for this branch.

environmentVariables {[key: string]: string}

The environment variables for the branch.

framework string

The framework for the branch.

pullRequestEnvironmentName string

The Amplify environment name for the pull request.

stage string

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

tags {[key: string]: string}

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

ttl string

The content Time To Live (TTL) for the website in seconds.

app_id str

The unique ID for an Amplify app.

branch_name str

The name for the branch.

backend_environment_arn str

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

basic_auth_credentials str

The basic authorization credentials for the branch.

description str

The description for the branch.

display_name str

The display name for a branch. This is used as the default domain prefix.

enable_auto_build bool

Enables auto building for the branch.

enable_basic_auth bool

Enables basic authorization for the branch.

enable_notification bool

Enables notifications for the branch.

enable_performance_mode bool

Enables performance mode for the branch.

enable_pull_request_preview bool

Enables pull request previews for this branch.

environment_variables Mapping[str, str]

The environment variables for the branch.

framework str

The framework for the branch.

pull_request_environment_name str

The Amplify environment name for the pull request.

stage str

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

tags Mapping[str, str]

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

ttl str

The content Time To Live (TTL) for the website in seconds.

appId String

The unique ID for an Amplify app.

branchName String

The name for the branch.

backendEnvironmentArn String

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

basicAuthCredentials String

The basic authorization credentials for the branch.

description String

The description for the branch.

displayName String

The display name for a branch. This is used as the default domain prefix.

enableAutoBuild Boolean

Enables auto building for the branch.

enableBasicAuth Boolean

Enables basic authorization for the branch.

enableNotification Boolean

Enables notifications for the branch.

enablePerformanceMode Boolean

Enables performance mode for the branch.

enablePullRequestPreview Boolean

Enables pull request previews for this branch.

environmentVariables Map<String>

The environment variables for the branch.

framework String

The framework for the branch.

pullRequestEnvironmentName String

The Amplify environment name for the pull request.

stage String

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

tags Map<String>

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

ttl String

The content Time To Live (TTL) for the website in seconds.

Outputs

All input properties are implicitly available as output properties. Additionally, the Branch resource produces the following output properties:

Arn string

The Amazon Resource Name (ARN) for the branch.

AssociatedResources List<string>

A list of custom resources that are linked to this branch.

CustomDomains List<string>

The custom domains for the branch.

DestinationBranch string

The destination branch if the branch is a pull request branch.

Id string

The provider-assigned unique ID for this managed resource.

SourceBranch string

The source branch if the branch is a pull request branch.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The Amazon Resource Name (ARN) for the branch.

AssociatedResources []string

A list of custom resources that are linked to this branch.

CustomDomains []string

The custom domains for the branch.

DestinationBranch string

The destination branch if the branch is a pull request branch.

Id string

The provider-assigned unique ID for this managed resource.

SourceBranch string

The source branch if the branch is a pull request branch.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name (ARN) for the branch.

associatedResources List<String>

A list of custom resources that are linked to this branch.

customDomains List<String>

The custom domains for the branch.

destinationBranch String

The destination branch if the branch is a pull request branch.

id String

The provider-assigned unique ID for this managed resource.

sourceBranch String

The source branch if the branch is a pull request branch.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The Amazon Resource Name (ARN) for the branch.

associatedResources string[]

A list of custom resources that are linked to this branch.

customDomains string[]

The custom domains for the branch.

destinationBranch string

The destination branch if the branch is a pull request branch.

id string

The provider-assigned unique ID for this managed resource.

sourceBranch string

The source branch if the branch is a pull request branch.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The Amazon Resource Name (ARN) for the branch.

associated_resources Sequence[str]

A list of custom resources that are linked to this branch.

custom_domains Sequence[str]

The custom domains for the branch.

destination_branch str

The destination branch if the branch is a pull request branch.

id str

The provider-assigned unique ID for this managed resource.

source_branch str

The source branch if the branch is a pull request branch.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name (ARN) for the branch.

associatedResources List<String>

A list of custom resources that are linked to this branch.

customDomains List<String>

The custom domains for the branch.

destinationBranch String

The destination branch if the branch is a pull request branch.

id String

The provider-assigned unique ID for this managed resource.

sourceBranch String

The source branch if the branch is a pull request branch.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up an Existing Branch Resource

Get an existing Branch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BranchState, opts?: CustomResourceOptions): Branch
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_id: Optional[str] = None,
        arn: Optional[str] = None,
        associated_resources: Optional[Sequence[str]] = None,
        backend_environment_arn: Optional[str] = None,
        basic_auth_credentials: Optional[str] = None,
        branch_name: Optional[str] = None,
        custom_domains: Optional[Sequence[str]] = None,
        description: Optional[str] = None,
        destination_branch: Optional[str] = None,
        display_name: Optional[str] = None,
        enable_auto_build: Optional[bool] = None,
        enable_basic_auth: Optional[bool] = None,
        enable_notification: Optional[bool] = None,
        enable_performance_mode: Optional[bool] = None,
        enable_pull_request_preview: Optional[bool] = None,
        environment_variables: Optional[Mapping[str, str]] = None,
        framework: Optional[str] = None,
        pull_request_environment_name: Optional[str] = None,
        source_branch: Optional[str] = None,
        stage: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        ttl: Optional[str] = None) -> Branch
func GetBranch(ctx *Context, name string, id IDInput, state *BranchState, opts ...ResourceOption) (*Branch, error)
public static Branch Get(string name, Input<string> id, BranchState? state, CustomResourceOptions? opts = null)
public static Branch get(String name, Output<String> id, BranchState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AppId string

The unique ID for an Amplify app.

Arn string

The Amazon Resource Name (ARN) for the branch.

AssociatedResources List<string>

A list of custom resources that are linked to this branch.

BackendEnvironmentArn string

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

BasicAuthCredentials string

The basic authorization credentials for the branch.

BranchName string

The name for the branch.

CustomDomains List<string>

The custom domains for the branch.

Description string

The description for the branch.

DestinationBranch string

The destination branch if the branch is a pull request branch.

DisplayName string

The display name for a branch. This is used as the default domain prefix.

EnableAutoBuild bool

Enables auto building for the branch.

EnableBasicAuth bool

Enables basic authorization for the branch.

EnableNotification bool

Enables notifications for the branch.

EnablePerformanceMode bool

Enables performance mode for the branch.

EnablePullRequestPreview bool

Enables pull request previews for this branch.

EnvironmentVariables Dictionary<string, string>

The environment variables for the branch.

Framework string

The framework for the branch.

PullRequestEnvironmentName string

The Amplify environment name for the pull request.

SourceBranch string

The source branch if the branch is a pull request branch.

Stage string

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

Tags Dictionary<string, string>

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Ttl string

The content Time To Live (TTL) for the website in seconds.

AppId string

The unique ID for an Amplify app.

Arn string

The Amazon Resource Name (ARN) for the branch.

AssociatedResources []string

A list of custom resources that are linked to this branch.

BackendEnvironmentArn string

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

BasicAuthCredentials string

The basic authorization credentials for the branch.

BranchName string

The name for the branch.

CustomDomains []string

The custom domains for the branch.

Description string

The description for the branch.

DestinationBranch string

The destination branch if the branch is a pull request branch.

DisplayName string

The display name for a branch. This is used as the default domain prefix.

EnableAutoBuild bool

Enables auto building for the branch.

EnableBasicAuth bool

Enables basic authorization for the branch.

EnableNotification bool

Enables notifications for the branch.

EnablePerformanceMode bool

Enables performance mode for the branch.

EnablePullRequestPreview bool

Enables pull request previews for this branch.

EnvironmentVariables map[string]string

The environment variables for the branch.

Framework string

The framework for the branch.

PullRequestEnvironmentName string

The Amplify environment name for the pull request.

SourceBranch string

The source branch if the branch is a pull request branch.

Stage string

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

Tags map[string]string

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Ttl string

The content Time To Live (TTL) for the website in seconds.

appId String

The unique ID for an Amplify app.

arn String

The Amazon Resource Name (ARN) for the branch.

associatedResources List<String>

A list of custom resources that are linked to this branch.

backendEnvironmentArn String

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

basicAuthCredentials String

The basic authorization credentials for the branch.

branchName String

The name for the branch.

customDomains List<String>

The custom domains for the branch.

description String

The description for the branch.

destinationBranch String

The destination branch if the branch is a pull request branch.

displayName String

The display name for a branch. This is used as the default domain prefix.

enableAutoBuild Boolean

Enables auto building for the branch.

enableBasicAuth Boolean

Enables basic authorization for the branch.

enableNotification Boolean

Enables notifications for the branch.

enablePerformanceMode Boolean

Enables performance mode for the branch.

enablePullRequestPreview Boolean

Enables pull request previews for this branch.

environmentVariables Map<String,String>

The environment variables for the branch.

framework String

The framework for the branch.

pullRequestEnvironmentName String

The Amplify environment name for the pull request.

sourceBranch String

The source branch if the branch is a pull request branch.

stage String

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

tags Map<String,String>

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

ttl String

The content Time To Live (TTL) for the website in seconds.

appId string

The unique ID for an Amplify app.

arn string

The Amazon Resource Name (ARN) for the branch.

associatedResources string[]

A list of custom resources that are linked to this branch.

backendEnvironmentArn string

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

basicAuthCredentials string

The basic authorization credentials for the branch.

branchName string

The name for the branch.

customDomains string[]

The custom domains for the branch.

description string

The description for the branch.

destinationBranch string

The destination branch if the branch is a pull request branch.

displayName string

The display name for a branch. This is used as the default domain prefix.

enableAutoBuild boolean

Enables auto building for the branch.

enableBasicAuth boolean

Enables basic authorization for the branch.

enableNotification boolean

Enables notifications for the branch.

enablePerformanceMode boolean

Enables performance mode for the branch.

enablePullRequestPreview boolean

Enables pull request previews for this branch.

environmentVariables {[key: string]: string}

The environment variables for the branch.

framework string

The framework for the branch.

pullRequestEnvironmentName string

The Amplify environment name for the pull request.

sourceBranch string

The source branch if the branch is a pull request branch.

stage string

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

tags {[key: string]: string}

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

ttl string

The content Time To Live (TTL) for the website in seconds.

app_id str

The unique ID for an Amplify app.

arn str

The Amazon Resource Name (ARN) for the branch.

associated_resources Sequence[str]

A list of custom resources that are linked to this branch.

backend_environment_arn str

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

basic_auth_credentials str

The basic authorization credentials for the branch.

branch_name str

The name for the branch.

custom_domains Sequence[str]

The custom domains for the branch.

description str

The description for the branch.

destination_branch str

The destination branch if the branch is a pull request branch.

display_name str

The display name for a branch. This is used as the default domain prefix.

enable_auto_build bool

Enables auto building for the branch.

enable_basic_auth bool

Enables basic authorization for the branch.

enable_notification bool

Enables notifications for the branch.

enable_performance_mode bool

Enables performance mode for the branch.

enable_pull_request_preview bool

Enables pull request previews for this branch.

environment_variables Mapping[str, str]

The environment variables for the branch.

framework str

The framework for the branch.

pull_request_environment_name str

The Amplify environment name for the pull request.

source_branch str

The source branch if the branch is a pull request branch.

stage str

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

tags Mapping[str, str]

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

ttl str

The content Time To Live (TTL) for the website in seconds.

appId String

The unique ID for an Amplify app.

arn String

The Amazon Resource Name (ARN) for the branch.

associatedResources List<String>

A list of custom resources that are linked to this branch.

backendEnvironmentArn String

The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app.

basicAuthCredentials String

The basic authorization credentials for the branch.

branchName String

The name for the branch.

customDomains List<String>

The custom domains for the branch.

description String

The description for the branch.

destinationBranch String

The destination branch if the branch is a pull request branch.

displayName String

The display name for a branch. This is used as the default domain prefix.

enableAutoBuild Boolean

Enables auto building for the branch.

enableBasicAuth Boolean

Enables basic authorization for the branch.

enableNotification Boolean

Enables notifications for the branch.

enablePerformanceMode Boolean

Enables performance mode for the branch.

enablePullRequestPreview Boolean

Enables pull request previews for this branch.

environmentVariables Map<String>

The environment variables for the branch.

framework String

The framework for the branch.

pullRequestEnvironmentName String

The Amplify environment name for the pull request.

sourceBranch String

The source branch if the branch is a pull request branch.

stage String

Describes the current stage for the branch. Valid values: PRODUCTION, BETA, DEVELOPMENT, EXPERIMENTAL, PULL_REQUEST.

tags Map<String>

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

ttl String

The content Time To Live (TTL) for the website in seconds.

Import

Amplify branch can be imported using app_id and branch_name, e.g.,

 $ pulumi import aws:amplify/branch:Branch master d2ypk4k47z8u6/master

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.