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
// 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
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.
Default: no password protection
Use this to set password protection for the branch
Default: the construct's id
Default: no build spec
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.
Default: no description
environmentVariables{ [key: string]: string }environment_variablestyping.Mapping[str, str]environmentVariablesMap<String, String>EnvironmentVariablesIDictionary<string, string>EnvironmentVariables*map[string]*string#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#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#Default: automatically provision a temporary backend
pullRequestPreviewbooleanpull_request_previewboolpullRequestPreviewBooleanPullRequestPreviewboolPullRequestPreview*bool= true#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.