Skip to content
v2.274.0

Experimental

@aws-cdk/aws-amplify-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

BranchProps Struct ​

Properties for a Branch.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as amplify_alpha from '@aws-cdk/aws-amplify-alpha';
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_s3_assets as s3_assets } from 'aws-cdk-lib';

declare const app: amplify_alpha.App;
declare const asset: s3_assets.Asset;
declare const basicAuth: amplify_alpha.BasicAuth;
declare const buildSpec: codebuild.BuildSpec;
declare const role: iam.Role;
const branchProps: amplify_alpha.BranchProps = {
  app: app,

  // the properties below are optional
  asset: asset,
  autoBuild: false,
  basicAuth: basicAuth,
  branchName: 'branchName',
  buildSpec: buildSpec,
  computeRole: role,
  description: 'description',
  environmentVariables: {
    environmentVariablesKey: 'environmentVariables',
  },
  performanceMode: false,
  pullRequestEnvironmentName: 'pullRequestEnvironmentName',
  pullRequestPreview: false,
  skewProtection: false,
  stage: 'stage',
};

Properties ​

appIAppappIAppappIAppAppIAppAppIApprequired#
The application within which the branch must be created.
assetAssetassetAssetassetAssetAssetAssetAssetAsset#
Asset for deployment.

Default: no asset

The Amplify app must not have a sourceCodeProvider configured as this resource uses Amplify's startDeployment API to initiate and deploy a S3 asset onto the App.

autoBuildbooleanauto_buildboolautoBuildBooleanAutoBuildboolAutoBuild*bool= true#
Whether to enable auto building for the branch.
basicAuthBasicAuthbasic_authBasicAuthbasicAuthBasicAuthBasicAuthBasicAuthBasicAuthBasicAuth#
The Basic Auth configuration.

Default: no password protection

Use this to set password protection for the branch

branchNamestringbranch_namestrbranchNameStringBranchNamestringBranchName*string#
The name of the branch.

Default: the construct's id

buildSpecBuildSpecbuild_specBuildSpecbuildSpecBuildSpecBuildSpecBuildSpecBuildSpecBuildSpec#
BuildSpec for the branch.

Default: no build spec

computeRoleIRolecompute_roleIRolecomputeRoleIRoleComputeRoleIRoleComputeRoleIRole#
The IAM role to assign to a branch of an SSR app.

Default: undefined - No specific role for the branch. If the app has a compute role, it will be inherited.

The SSR Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions.

This role overrides the app-level compute role.

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string#
A description for the branch.

Default: no description

environmentVariables{ [key: string]: string }environment_variablestyping.Mapping[str, str]environmentVariablesMap<String, String>EnvironmentVariablesIDictionary<string, string>EnvironmentVariables*map[string]*string#
Environment variables for the branch.

Default: application environment variables

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

performanceModebooleanperformance_modeboolperformanceModeBooleanPerformanceModeboolPerformanceMode*bool= false#
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.

pullRequestEnvironmentNamestringpull_request_environment_namestrpullRequestEnvironmentNameStringPullRequestEnvironmentNamestringPullRequestEnvironmentName*string#
The dedicated backend environment for the pull request previews.

Default: automatically provision a temporary backend

pullRequestPreviewbooleanpull_request_previewboolpullRequestPreviewBooleanPullRequestPreviewboolPullRequestPreview*bool= true#
Whether to enable pull request preview for the branch.
skewProtectionbooleanskew_protectionboolskewProtectionBooleanSkewProtectionboolSkewProtection*bool#
Specifies whether the skew protection feature is enabled for the branch.

Default: None - Default setting is no skew protection.

notes

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.

stagestringstagestrstageStringStagestringStage*string#
Stage for the branch.

Default: no stage