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.
| Stability | Experimental |
|---|---|
| Source | lib/branch.ts |
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',
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_amplify_alpha as amplify_alpha
from aws_cdk import aws_codebuild as codebuild
from aws_cdk import aws_iam as iam
from aws_cdk import aws_s3_assets as s3_assets
# app: amplify_alpha.App
# asset: s3_assets.Asset
# basic_auth: amplify_alpha.BasicAuth
# build_spec: codebuild.BuildSpec
# role: iam.Role
branch_props = amplify_alpha.BranchProps(
app=app,
# the properties below are optional
asset=asset,
auto_build=False,
basic_auth=basic_auth,
branch_name="branchName",
build_spec=build_spec,
compute_role=role,
description="description",
environment_variables={
"environment_variables_key": "environmentVariables"
},
performance_mode=False,
pull_request_environment_name="pullRequestEnvironmentName",
pull_request_preview=False,
skew_protection=False,
stage="stage"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.amplify.alpha.*;
import software.amazon.awscdk.services.codebuild.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.s3.assets.*;
App app;
Asset asset;
BasicAuth basicAuth;
BuildSpec buildSpec;
Role role;
BranchProps branchProps = BranchProps.builder()
.app(app)
// the properties below are optional
.asset(asset)
.autoBuild(false)
.basicAuth(basicAuth)
.branchName("branchName")
.buildSpec(buildSpec)
.computeRole(role)
.description("description")
.environmentVariables(Map.of(
"environmentVariablesKey", "environmentVariables"))
.performanceMode(false)
.pullRequestEnvironmentName("pullRequestEnvironmentName")
.pullRequestPreview(false)
.skewProtection(false)
.stage("stage")
.build();
// Install: dotnet add package Amazon.CDK.AWS.Amplify.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Amplify.Alpha;
using Amazon.CDK.AWS.CodeBuild;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.S3.Assets;
App app;
Asset asset;
BasicAuth basicAuth;
BuildSpec buildSpec;
Role role;
var branchProps = new BranchProps {
App = app,
// the properties below are optional
Asset = asset,
AutoBuild = false,
BasicAuth = basicAuth,
BranchName = "branchName",
BuildSpec = buildSpec,
ComputeRole = role,
Description = "description",
EnvironmentVariables = new Dictionary<string, string> {
{ "environmentVariablesKey", "environmentVariables" }
},
PerformanceMode = false,
PullRequestEnvironmentName = "pullRequestEnvironmentName",
PullRequestPreview = false,
SkewProtection = false,
Stage = "stage"
};
// Install: go get github.com/aws/aws-cdk-go/awscdkamplifyalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var app App
var asset Asset
var basicAuth BasicAuth
var buildSpec BuildSpec
var role Role
branchProps := &BranchProps{
App: app,
// the properties below are optional
Asset: asset,
AutoBuild: jsii.Boolean(false),
BasicAuth: basicAuth,
BranchName: jsii.String("branchName"),
BuildSpec: buildSpec,
ComputeRole: role,
Description: jsii.String("description"),
EnvironmentVariables: map[string]*string{
"environmentVariablesKey": jsii.String("environmentVariables"),
},
PerformanceMode: jsii.Boolean(false),
PullRequestEnvironmentName: jsii.String("pullRequestEnvironmentName"),
PullRequestPreview: jsii.Boolean(false),
SkewProtection: jsii.Boolean(false),
Stage: jsii.String("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.
autoBuildoptionalbooleanauto_buildoptionalboolautoBuildoptionalBooleanAutoBuildoptionalboolAutoBuildoptional*bool = true #basicAuthoptionalBasicAuthbasic_authoptionalBasicAuthbasicAuthoptionalBasicAuthBasicAuthoptionalBasicAuthBasicAuthoptionalBasicAuth #Default: no password protection
Use this to set password protection for the branch
branchNameoptionalstringbranch_nameoptionalstrbranchNameoptionalStringBranchNameoptionalstringBranchNameoptional*string #Default: the construct's id
buildSpecoptionalBuildSpecbuild_specoptionalBuildSpecbuildSpecoptionalBuildSpecBuildSpecoptionalBuildSpecBuildSpecoptionalBuildSpec #Default: no build spec
computeRoleoptionalIRolecompute_roleoptionalIRolecomputeRoleoptionalIRoleComputeRoleoptionalIRoleComputeRoleoptionalIRole #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.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #Default: no description
environmentVariablesoptional{ [key: string]: string }environment_variablesoptionaltyping.Mapping[str, str]environmentVariablesoptionalMap<String, String>EnvironmentVariablesoptionalIDictionary<string, string>EnvironmentVariablesoptional*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.
performanceModeoptionalbooleanperformance_modeoptionalboolperformanceModeoptionalBooleanPerformanceModeoptionalboolPerformanceModeoptional*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.
pullRequestEnvironmentNameoptionalstringpull_request_environment_nameoptionalstrpullRequestEnvironmentNameoptionalStringPullRequestEnvironmentNameoptionalstringPullRequestEnvironmentNameoptional*string #Default: automatically provision a temporary backend
pullRequestPreviewoptionalbooleanpull_request_previewoptionalboolpullRequestPreviewoptionalBooleanPullRequestPreviewoptionalboolPullRequestPreviewoptional*bool = true #skewProtectionoptionalbooleanskew_protectionoptionalboolskewProtectionoptionalBooleanSkewProtectionoptionalboolSkewProtectionoptional*bool #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.
Default: no stage