awscdkamplifyalpha

package module
v2.21.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

AWS Amplify Construct Library


The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


The AWS Amplify Console provides a Git-based workflow for deploying and hosting fullstack serverless web applications. A fullstack serverless app consists of a backend built with cloud resources such as GraphQL or REST APIs, file and data storage, and a frontend built with single page application frameworks such as React, Angular, Vue, or Gatsby.

Setting up an app with branches, custom rules and a domain

To set up an Amplify Console app, define an App:

import * as codebuild from 'aws-cdk-lib/aws-codebuild';

const amplifyApp = new amplify.App(this, 'MyApp', {
  sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
    owner: '<user>',
    repository: '<repo>',
    oauthToken: SecretValue.secretsManager('my-github-token'),
  }),
  buildSpec: codebuild.BuildSpec.fromObjectToYaml({
    // Alternatively add a `amplify.yml` to the repo
    version: '1.0',
    frontend: {
      phases: {
        preBuild: {
          commands: [
            'yarn',
          ],
        },
        build: {
          commands: [
            'yarn build',
          ],
        },
      },
      artifacts: {
        baseDirectory: 'public',
        files:
        - '**/*',
      },
    },
  }),
});

To connect your App to GitLab, use the GitLabSourceCodeProvider:

const amplifyApp = new amplify.App(this, 'MyApp', {
  sourceCodeProvider: new amplify.GitLabSourceCodeProvider({
    owner: '<user>',
    repository: '<repo>',
    oauthToken: SecretValue.secretsManager('my-gitlab-token'),
  }),
});

To connect your App to CodeCommit, use the CodeCommitSourceCodeProvider:

import * as codecommit from 'aws-cdk-lib/aws-codecommit';

const repository = new codecommit.Repository(this, 'Repo', {
  repositoryName: 'my-repo',
});

const amplifyApp = new amplify.App(this, 'App', {
  sourceCodeProvider: new amplify.CodeCommitSourceCodeProvider({ repository }),
});

The IAM role associated with the App will automatically be granted the permission to pull the CodeCommit repository.

Add branches:

declare const amplifyApp: amplify.App;

const master = amplifyApp.addBranch('master'); // `id` will be used as repo branch name
const dev = amplifyApp.addBranch('dev', {
  performanceMode: true, // optional, enables performance mode
});
dev.addEnvironment('STAGE', 'dev');

Auto build and pull request preview are enabled by default.

Add custom rules for redirection:

declare const amplifyApp: amplify.App;
amplifyApp.addCustomRule({
  source: '/docs/specific-filename.html',
  target: '/documents/different-filename.html',
  status: amplify.RedirectStatus.TEMPORARY_REDIRECT,
});

When working with a single page application (SPA), use the CustomRule.SINGLE_PAGE_APPLICATION_REDIRECT to set up a 200 rewrite for all files to index.html except for the following file extensions: css, gif, ico, jpg, js, png, txt, svg, woff, ttf, map, json, webmanifest.

declare const mySinglePageApp: amplify.App;

mySinglePageApp.addCustomRule(amplify.CustomRule.SINGLE_PAGE_APPLICATION_REDIRECT);

Add a domain and map sub domains to branches:

declare const amplifyApp: amplify.App;
declare const master: amplify.Branch;
declare const dev: amplify.Branch;

const domain = amplifyApp.addDomain('example.com', {
  enableAutoSubdomain: true, // in case subdomains should be auto registered for branches
  autoSubdomainCreationPatterns: ['*', 'pr*'], // regex for branches that should auto register subdomains
});
domain.mapRoot(master); // map master branch to domain root
domain.mapSubDomain(master, 'www');
domain.mapSubDomain(dev); // sub domain prefix defaults to branch name

Restricting access

Password protect the app with basic auth by specifying the basicAuth prop.

Use BasicAuth.fromCredentials when referencing an existing secret:

const amplifyApp = new amplify.App(this, 'MyApp', {
  sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
    owner: '<user>',
    repository: '<repo>',
    oauthToken: SecretValue.secretsManager('my-github-token'),
  }),
  basicAuth: amplify.BasicAuth.fromCredentials('username', SecretValue.secretsManager('my-github-token')),
});

Use BasicAuth.fromGeneratedPassword to generate a password in Secrets Manager:

const amplifyApp = new amplify.App(this, 'MyApp', {
  sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
    owner: '<user>',
    repository: '<repo>',
    oauthToken: SecretValue.secretsManager('my-github-token'),
  }),
  basicAuth: amplify.BasicAuth.fromGeneratedPassword('username'),
});

Basic auth can be added to specific branches:

declare const amplifyApp: amplify.App;
amplifyApp.addBranch('feature/next', {
  basicAuth: amplify.BasicAuth.fromGeneratedPassword('username'),
});

Automatically creating and deleting branches

Use the autoBranchCreation and autoBranchDeletion props to control creation/deletion of branches:

const amplifyApp = new amplify.App(this, 'MyApp', {
  sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
    owner: '<user>',
    repository: '<repo>',
    oauthToken: SecretValue.secretsManager('my-github-token'),
  }),
  autoBranchCreation: { // Automatically connect branches that match a pattern set
    patterns: ['feature/*', 'test/*'],
  },
  autoBranchDeletion: true, // Automatically disconnect a branch when you delete a branch from your repository
});

Adding custom response headers

Use the customResponseHeaders prop to configure custom response headers for an Amplify app:

const amplifyApp = new amplify.App(this, 'App', {
  sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
    owner: '<user>',
    repository: '<repo>',
    oauthToken: SecretValue.secretsManager('my-github-token'),
  }),
  customResponseHeaders: [
    {
      pattern: '*.json',
      headers: {
        'custom-header-name-1': 'custom-header-value-1',
        'custom-header-name-2': 'custom-header-value-2',
      },
    },
    {
      pattern: '/path/*',
      headers: {
        'custom-header-name-1': 'custom-header-value-2',
      },
    },
  ],
});

Deploying Assets

sourceCodeProvider is optional; when this is not specified the Amplify app can be deployed to using .zip packages. The asset property can be used to deploy S3 assets to Amplify as part of the CDK:

import * as assets from 'aws-cdk-lib/aws-s3-assets';

declare const asset: assets.Asset;
declare const amplifyApp: amplify.App;
const branch = amplifyApp.addBranch("dev", { asset: asset });

Documentation

Overview

The CDK Construct Library for AWS::Amplify

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func App_IsConstruct

func App_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

func App_IsResource

func App_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func Branch_IsConstruct

func Branch_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

func Branch_IsResource

func Branch_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func Domain_IsConstruct

func Domain_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

func Domain_IsResource

func Domain_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func NewApp_Override

func NewApp_Override(a App, scope constructs.Construct, id *string, props *AppProps)

Experimental.

func NewBasicAuth_Override

func NewBasicAuth_Override(b BasicAuth, props *BasicAuthProps)

Experimental.

func NewBranch_Override

func NewBranch_Override(b Branch, scope constructs.Construct, id *string, props *BranchProps)

Experimental.

func NewCodeCommitSourceCodeProvider_Override

func NewCodeCommitSourceCodeProvider_Override(c CodeCommitSourceCodeProvider, props *CodeCommitSourceCodeProviderProps)

Experimental.

func NewCustomRule_Override

func NewCustomRule_Override(c CustomRule, options *CustomRuleOptions)

Experimental.

func NewDomain_Override

func NewDomain_Override(d Domain, scope constructs.Construct, id *string, props *DomainProps)

Experimental.

func NewGitHubSourceCodeProvider_Override

func NewGitHubSourceCodeProvider_Override(g GitHubSourceCodeProvider, props *GitHubSourceCodeProviderProps)

Experimental.

func NewGitLabSourceCodeProvider_Override

func NewGitLabSourceCodeProvider_Override(g GitLabSourceCodeProvider, props *GitLabSourceCodeProviderProps)

Experimental.

Types

type App

type App interface {
	awscdk.Resource
	IApp
	awsiam.IGrantable
	// The application id.
	// Experimental.
	AppId() *string
	// The name of the application.
	// Experimental.
	AppName() *string
	// The ARN of the application.
	// Experimental.
	Arn() *string
	// The default domain of the application.
	// Experimental.
	DefaultDomain() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The principal to grant permissions to.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Adds an environment variable to the auto created branch.
	//
	// All environment variables that you add are encrypted to prevent rogue
	// access so you can use them to store secret information.
	// Experimental.
	AddAutoBranchEnvironment(name *string, value *string) App
	// Adds a branch to this application.
	// Experimental.
	AddBranch(id *string, options *BranchOptions) Branch
	// Adds a custom rewrite/redirect rule to this application.
	// Experimental.
	AddCustomRule(rule CustomRule) App
	// Adds a domain to this application.
	// Experimental.
	AddDomain(id *string, options *DomainOptions) Domain
	// Adds an environment variable to this application.
	//
	// All environment variables that you add are encrypted to prevent rogue
	// access so you can use them to store secret information.
	// Experimental.
	AddEnvironment(name *string, value *string) App
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

An Amplify Console application.

Example:

amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &appProps{
	sourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&gitHubSourceCodeProviderProps{
		owner: jsii.String("<user>"),
		repository: jsii.String("<repo>"),
		oauthToken: secretValue.secretsManager(jsii.String("my-github-token")),
	}),
	autoBranchCreation: &autoBranchCreation{
		 // Automatically connect branches that match a pattern set
		patterns: []*string{
			jsii.String("feature/*"),
			jsii.String("test/*"),
		},
	},
	autoBranchDeletion: jsii.Boolean(true),
})

Experimental.

func NewApp

func NewApp(scope constructs.Construct, id *string, props *AppProps) App

Experimental.

type AppProps

type AppProps struct {
	// The name for the application.
	// Experimental.
	AppName *string `json:"appName" yaml:"appName"`
	// The auto branch creation configuration.
	//
	// Use this to automatically create
	// branches that match a certain pattern.
	// Experimental.
	AutoBranchCreation *AutoBranchCreation `json:"autoBranchCreation" yaml:"autoBranchCreation"`
	// Automatically disconnect a branch in the Amplify Console when you delete a branch from your Git repository.
	// Experimental.
	AutoBranchDeletion *bool `json:"autoBranchDeletion" yaml:"autoBranchDeletion"`
	// The Basic Auth configuration.
	//
	// Use this to set password protection at an
	// app level to all your branches.
	// Experimental.
	BasicAuth BasicAuth `json:"basicAuth" yaml:"basicAuth"`
	// BuildSpec for the application.
	//
	// Alternatively, add a `amplify.yml`
	// file to the repository.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html
	//
	// Experimental.
	BuildSpec awscodebuild.BuildSpec `json:"buildSpec" yaml:"buildSpec"`
	// The custom HTTP response headers for an Amplify app.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/custom-headers.html
	//
	// Experimental.
	CustomResponseHeaders *[]*CustomResponseHeader `json:"customResponseHeaders" yaml:"customResponseHeaders"`
	// Custom rewrite/redirect rules for the application.
	// Experimental.
	CustomRules *[]CustomRule `json:"customRules" yaml:"customRules"`
	// A description for the application.
	// Experimental.
	Description *string `json:"description" yaml:"description"`
	// Environment variables for the application.
	//
	// All environment variables that you add are encrypted to prevent rogue
	// access so you can use them to store secret information.
	// Experimental.
	EnvironmentVariables *map[string]*string `json:"environmentVariables" yaml:"environmentVariables"`
	// The IAM service role to associate with the application.
	//
	// The App
	// implements IGrantable.
	// Experimental.
	Role awsiam.IRole `json:"role" yaml:"role"`
	// The source code provider for this application.
	// Experimental.
	SourceCodeProvider ISourceCodeProvider `json:"sourceCodeProvider" yaml:"sourceCodeProvider"`
}

Properties for an App.

Example:

amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &appProps{
	sourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&gitHubSourceCodeProviderProps{
		owner: jsii.String("<user>"),
		repository: jsii.String("<repo>"),
		oauthToken: secretValue.secretsManager(jsii.String("my-github-token")),
	}),
	autoBranchCreation: &autoBranchCreation{
		 // Automatically connect branches that match a pattern set
		patterns: []*string{
			jsii.String("feature/*"),
			jsii.String("test/*"),
		},
	},
	autoBranchDeletion: jsii.Boolean(true),
})

Experimental.

type AutoBranchCreation

type AutoBranchCreation struct {
	// Whether to enable auto building for the auto created branch.
	// Experimental.
	AutoBuild *bool `json:"autoBuild" yaml:"autoBuild"`
	// The Basic Auth configuration.
	//
	// Use this to set password protection for
	// the auto created branch.
	// Experimental.
	BasicAuth BasicAuth `json:"basicAuth" yaml:"basicAuth"`
	// Build spec for the auto created branch.
	// Experimental.
	BuildSpec awscodebuild.BuildSpec `json:"buildSpec" yaml:"buildSpec"`
	// Environment variables for the auto created branch.
	//
	// All environment variables that you add are encrypted to prevent rogue
	// access so you can use them to store secret information.
	// Experimental.
	EnvironmentVariables *map[string]*string `json:"environmentVariables" yaml:"environmentVariables"`
	// Automated branch creation glob patterns.
	// Experimental.
	Patterns *[]*string `json:"patterns" yaml:"patterns"`
	// The dedicated backend environment for the pull request previews of the auto created branch.
	// Experimental.
	PullRequestEnvironmentName *string `json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"`
	// Whether to enable pull request preview for the auto created branch.
	// Experimental.
	PullRequestPreview *bool `json:"pullRequestPreview" yaml:"pullRequestPreview"`
	// Stage for the auto created branch.
	// Experimental.
	Stage *string `json:"stage" yaml:"stage"`
}

Auto branch creation configuration.

Example:

amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &appProps{
	sourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&gitHubSourceCodeProviderProps{
		owner: jsii.String("<user>"),
		repository: jsii.String("<repo>"),
		oauthToken: secretValue.secretsManager(jsii.String("my-github-token")),
	}),
	autoBranchCreation: &autoBranchCreation{
		 // Automatically connect branches that match a pattern set
		patterns: []*string{
			jsii.String("feature/*"),
			jsii.String("test/*"),
		},
	},
	autoBranchDeletion: jsii.Boolean(true),
})

Experimental.

type BasicAuth

type BasicAuth interface {
	// Binds this Basic Auth configuration to an App.
	// Experimental.
	Bind(scope constructs.Construct, id *string) *BasicAuthConfig
}

Basic Auth configuration.

Example:

amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &appProps{
	sourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&gitHubSourceCodeProviderProps{
		owner: jsii.String("<user>"),
		repository: jsii.String("<repo>"),
		oauthToken: secretValue.secretsManager(jsii.String("my-github-token")),
	}),
	basicAuth: amplify.basicAuth.fromGeneratedPassword(jsii.String("username")),
})

Experimental.

func BasicAuth_FromCredentials

func BasicAuth_FromCredentials(username *string, password awscdk.SecretValue) BasicAuth

Creates a Basic Auth configuration from a username and a password. Experimental.

func BasicAuth_FromGeneratedPassword

func BasicAuth_FromGeneratedPassword(username *string, encryptionKey awskms.IKey) BasicAuth

Creates a Basic Auth configuration with a password generated in Secrets Manager. Experimental.

func NewBasicAuth

func NewBasicAuth(props *BasicAuthProps) BasicAuth

Experimental.

type BasicAuthConfig

type BasicAuthConfig struct {
	// Whether to enable Basic Auth.
	// Experimental.
	EnableBasicAuth *bool `json:"enableBasicAuth" yaml:"enableBasicAuth"`
	// The password.
	// Experimental.
	Password *string `json:"password" yaml:"password"`
	// The username.
	// Experimental.
	Username *string `json:"username" yaml:"username"`
}

A Basic Auth configuration.

Example:

import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"
basicAuthConfig := &basicAuthConfig{
	enableBasicAuth: jsii.Boolean(false),
	password: jsii.String("password"),
	username: jsii.String("username"),
}

Experimental.

type BasicAuthProps

type BasicAuthProps struct {
	// The username.
	// Experimental.
	Username *string `json:"username" yaml:"username"`
	// The encryption key to use to encrypt the password when it's generated in Secrets Manager.
	// Experimental.
	EncryptionKey awskms.IKey `json:"encryptionKey" yaml:"encryptionKey"`
	// The password.
	// Experimental.
	Password awscdk.SecretValue `json:"password" yaml:"password"`
}

Properties for a BasicAuth.

Example:

import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"import cdk "github.com/aws/aws-cdk-go/awscdk"import awscdk "github.com/aws/aws-cdk-go/awscdk"import kms "github.com/aws/aws-cdk-go/awscdk/aws_kms"

var key key
var secretValue secretValue
basicAuthProps := &basicAuthProps{
	username: jsii.String("username"),

	// the properties below are optional
	encryptionKey: key,
	password: secretValue,
}

Experimental.

type Branch

type Branch interface {
	awscdk.Resource
	IBranch
	// The ARN of the branch.
	// Experimental.
	Arn() *string
	// The name of the branch.
	// Experimental.
	BranchName() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Adds an environment variable to this branch.
	//
	// All environment variables that you add are encrypted to prevent rogue
	// access so you can use them to store secret information.
	// Experimental.
	AddEnvironment(name *string, value *string) Branch
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

An Amplify Console branch.

Example:

var amplifyApp app

master := amplifyApp.addBranch(jsii.String("master")) // `id` will be used as repo branch name
dev := amplifyApp.addBranch(jsii.String("dev"), &branchOptions{
	performanceMode: jsii.Boolean(true),
})
dev.addEnvironment(jsii.String("STAGE"), jsii.String("dev"))

Experimental.

func NewBranch

func NewBranch(scope constructs.Construct, id *string, props *BranchProps) Branch

Experimental.

type BranchOptions

type BranchOptions struct {
	// Asset for deployment.
	//
	// 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.
	// Experimental.
	Asset awss3assets.Asset `json:"asset" yaml:"asset"`
	// Whether to enable auto building for the branch.
	// Experimental.
	AutoBuild *bool `json:"autoBuild" yaml:"autoBuild"`
	// The Basic Auth configuration.
	//
	// Use this to set password protection for
	// the branch.
	// Experimental.
	BasicAuth BasicAuth `json:"basicAuth" yaml:"basicAuth"`
	// The name of the branch.
	// Experimental.
	BranchName *string `json:"branchName" yaml:"branchName"`
	// BuildSpec for the branch.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html
	//
	// Experimental.
	BuildSpec awscodebuild.BuildSpec `json:"buildSpec" yaml:"buildSpec"`
	// A description for the branch.
	// Experimental.
	Description *string `json:"description" yaml:"description"`
	// Environment variables for the branch.
	//
	// All environment variables that you add are encrypted to prevent rogue
	// access so you can use them to store secret information.
	// Experimental.
	EnvironmentVariables *map[string]*string `json:"environmentVariables" yaml:"environmentVariables"`
	// 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.
	// Experimental.
	PerformanceMode *bool `json:"performanceMode" yaml:"performanceMode"`
	// The dedicated backend environment for the pull request previews.
	// Experimental.
	PullRequestEnvironmentName *string `json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"`
	// Whether to enable pull request preview for the branch.
	// Experimental.
	PullRequestPreview *bool `json:"pullRequestPreview" yaml:"pullRequestPreview"`
	// Stage for the branch.
	// Experimental.
	Stage *string `json:"stage" yaml:"stage"`
}

Options to add a branch to an application.

Example:

var amplifyApp app

master := amplifyApp.addBranch(jsii.String("master")) // `id` will be used as repo branch name
dev := amplifyApp.addBranch(jsii.String("dev"), &branchOptions{
	performanceMode: jsii.Boolean(true),
})
dev.addEnvironment(jsii.String("STAGE"), jsii.String("dev"))

Experimental.

type BranchProps

type BranchProps struct {
	// Asset for deployment.
	//
	// 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.
	// Experimental.
	Asset awss3assets.Asset `json:"asset" yaml:"asset"`
	// Whether to enable auto building for the branch.
	// Experimental.
	AutoBuild *bool `json:"autoBuild" yaml:"autoBuild"`
	// The Basic Auth configuration.
	//
	// Use this to set password protection for
	// the branch.
	// Experimental.
	BasicAuth BasicAuth `json:"basicAuth" yaml:"basicAuth"`
	// The name of the branch.
	// Experimental.
	BranchName *string `json:"branchName" yaml:"branchName"`
	// BuildSpec for the branch.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html
	//
	// Experimental.
	BuildSpec awscodebuild.BuildSpec `json:"buildSpec" yaml:"buildSpec"`
	// A description for the branch.
	// Experimental.
	Description *string `json:"description" yaml:"description"`
	// Environment variables for the branch.
	//
	// All environment variables that you add are encrypted to prevent rogue
	// access so you can use them to store secret information.
	// Experimental.
	EnvironmentVariables *map[string]*string `json:"environmentVariables" yaml:"environmentVariables"`
	// 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.
	// Experimental.
	PerformanceMode *bool `json:"performanceMode" yaml:"performanceMode"`
	// The dedicated backend environment for the pull request previews.
	// Experimental.
	PullRequestEnvironmentName *string `json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"`
	// Whether to enable pull request preview for the branch.
	// Experimental.
	PullRequestPreview *bool `json:"pullRequestPreview" yaml:"pullRequestPreview"`
	// Stage for the branch.
	// Experimental.
	Stage *string `json:"stage" yaml:"stage"`
	// The application within which the branch must be created.
	// Experimental.
	App IApp `json:"app" yaml:"app"`
}

Properties for a Branch.

Example:

import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"import awscdk "github.com/aws/aws-cdk-go/awscdk"import codebuild "github.com/aws/aws-cdk-go/awscdk/aws_codebuild"import awscdk "github.com/aws/aws-cdk-go/awscdk"import s3_assets "github.com/aws/aws-cdk-go/awscdk/aws_s3_assets"

var app app
var asset asset
var basicAuth basicAuth
var buildSpec buildSpec
branchProps := &branchProps{
	app: app,

	// the properties below are optional
	asset: asset,
	autoBuild: jsii.Boolean(false),
	basicAuth: basicAuth,
	branchName: jsii.String("branchName"),
	buildSpec: buildSpec,
	description: jsii.String("description"),
	environmentVariables: map[string]*string{
		"environmentVariablesKey": jsii.String("environmentVariables"),
	},
	performanceMode: jsii.Boolean(false),
	pullRequestEnvironmentName: jsii.String("pullRequestEnvironmentName"),
	pullRequestPreview: jsii.Boolean(false),
	stage: jsii.String("stage"),
}

Experimental.

type CodeCommitSourceCodeProvider

type CodeCommitSourceCodeProvider interface {
	ISourceCodeProvider
	// Binds the source code provider to an app.
	// Experimental.
	Bind(app App) *SourceCodeProviderConfig
}

CodeCommit source code provider.

Example:

import codecommit "github.com/aws/aws-cdk-go/awscdk"

repository := codecommit.NewRepository(this, jsii.String("Repo"), &repositoryProps{
	repositoryName: jsii.String("my-repo"),
})

amplifyApp := amplify.NewApp(this, jsii.String("App"), &appProps{
	sourceCodeProvider: amplify.NewCodeCommitSourceCodeProvider(&codeCommitSourceCodeProviderProps{
		repository: repository,
	}),
})

Experimental.

func NewCodeCommitSourceCodeProvider

func NewCodeCommitSourceCodeProvider(props *CodeCommitSourceCodeProviderProps) CodeCommitSourceCodeProvider

Experimental.

type CodeCommitSourceCodeProviderProps

type CodeCommitSourceCodeProviderProps struct {
	// The CodeCommit repository.
	// Experimental.
	Repository awscodecommit.IRepository `json:"repository" yaml:"repository"`
}

Properties for a CodeCommit source code provider.

Example:

import codecommit "github.com/aws/aws-cdk-go/awscdk"

repository := codecommit.NewRepository(this, jsii.String("Repo"), &repositoryProps{
	repositoryName: jsii.String("my-repo"),
})

amplifyApp := amplify.NewApp(this, jsii.String("App"), &appProps{
	sourceCodeProvider: amplify.NewCodeCommitSourceCodeProvider(&codeCommitSourceCodeProviderProps{
		repository: repository,
	}),
})

Experimental.

type CustomResponseHeader

type CustomResponseHeader struct {
	// The map of custom headers to be applied.
	// Experimental.
	Headers *map[string]*string `json:"headers" yaml:"headers"`
	// These custom headers will be applied to all URL file paths that match this pattern.
	// Experimental.
	Pattern *string `json:"pattern" yaml:"pattern"`
}

Custom response header of an Amplify App.

Example:

import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"
customResponseHeader := &customResponseHeader{
	headers: map[string]*string{
		"headersKey": jsii.String("headers"),
	},
	pattern: jsii.String("pattern"),
}

Experimental.

type CustomRule

type CustomRule interface {
	// The condition for a URL rewrite or redirect rule, e.g. country code.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
	//
	// Experimental.
	Condition() *string
	// The source pattern for a URL rewrite or redirect rule.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
	//
	// Experimental.
	Source() *string
	// The status code for a URL rewrite or redirect rule.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
	//
	// Experimental.
	Status() RedirectStatus
	// The target pattern for a URL rewrite or redirect rule.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
	//
	// Experimental.
	Target() *string
}

Custom rewrite/redirect rule for an Amplify App.

Example:

var amplifyApp app
amplifyApp.addCustomRule(map[string]interface{}{
	"source": jsii.String("/docs/specific-filename.html"),
	"target": jsii.String("/documents/different-filename.html"),
	"status": amplify.RedirectStatus_TEMPORARY_REDIRECT,
})

See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html

Experimental.

func CustomRule_SINGLE_PAGE_APPLICATION_REDIRECT

func CustomRule_SINGLE_PAGE_APPLICATION_REDIRECT() CustomRule

func NewCustomRule

func NewCustomRule(options *CustomRuleOptions) CustomRule

Experimental.

type CustomRuleOptions

type CustomRuleOptions struct {
	// The source pattern for a URL rewrite or redirect rule.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
	//
	// Experimental.
	Source *string `json:"source" yaml:"source"`
	// The target pattern for a URL rewrite or redirect rule.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
	//
	// Experimental.
	Target *string `json:"target" yaml:"target"`
	// The condition for a URL rewrite or redirect rule, e.g. country code.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
	//
	// Experimental.
	Condition *string `json:"condition" yaml:"condition"`
	// The status code for a URL rewrite or redirect rule.
	// See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
	//
	// Experimental.
	Status RedirectStatus `json:"status" yaml:"status"`
}

Options for a custom rewrite/redirect rule for an Amplify App.

Example:

import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"
customRuleOptions := &customRuleOptions{
	source: jsii.String("source"),
	target: jsii.String("target"),

	// the properties below are optional
	condition: jsii.String("condition"),
	status: amplify_alpha.redirectStatus_REWRITE,
}

Experimental.

type Domain

type Domain interface {
	awscdk.Resource
	// The ARN of the domain.
	// Experimental.
	Arn() *string
	// The DNS Record for certificate verification.
	// Experimental.
	CertificateRecord() *string
	// Branch patterns for the automatically created subdomain.
	// Experimental.
	DomainAutoSubDomainCreationPatterns() *[]*string
	// The IAM service role for the subdomain.
	// Experimental.
	DomainAutoSubDomainIamRole() *string
	// Specifies whether the automated creation of subdomains for branches is enabled.
	// Experimental.
	DomainEnableAutoSubDomain() awscdk.IResolvable
	// The name of the domain.
	// Experimental.
	DomainName() *string
	// The status of the domain association.
	// Experimental.
	DomainStatus() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The reason for the current status of the domain.
	// Experimental.
	StatusReason() *string
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Maps a branch to the domain root.
	// Experimental.
	MapRoot(branch IBranch) Domain
	// Maps a branch to a sub domain.
	// Experimental.
	MapSubDomain(branch IBranch, prefix *string) Domain
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

An Amplify Console domain.

Example:

var amplifyApp app
var master branch
var dev branch

domain := amplifyApp.addDomain(jsii.String("example.com"), &domainOptions{
	enableAutoSubdomain: jsii.Boolean(true),
	 // in case subdomains should be auto registered for branches
	autoSubdomainCreationPatterns: []*string{
		jsii.String("*"),
		jsii.String("pr*"),
	},
})
domain.mapRoot(master) // map master branch to domain root
domain.mapSubDomain(master, jsii.String("www"))
domain.mapSubDomain(dev)

Experimental.

func NewDomain

func NewDomain(scope constructs.Construct, id *string, props *DomainProps) Domain

Experimental.

type DomainOptions

type DomainOptions struct {
	// Branches which should automatically create subdomains.
	// Experimental.
	AutoSubdomainCreationPatterns *[]*string `json:"autoSubdomainCreationPatterns" yaml:"autoSubdomainCreationPatterns"`
	// The name of the domain.
	// Experimental.
	DomainName *string `json:"domainName" yaml:"domainName"`
	// Automatically create subdomains for connected branches.
	// Experimental.
	EnableAutoSubdomain *bool `json:"enableAutoSubdomain" yaml:"enableAutoSubdomain"`
	// Subdomains.
	// Experimental.
	SubDomains *[]*SubDomain `json:"subDomains" yaml:"subDomains"`
}

Options to add a domain to an application.

Example:

var amplifyApp app
var master branch
var dev branch

domain := amplifyApp.addDomain(jsii.String("example.com"), &domainOptions{
	enableAutoSubdomain: jsii.Boolean(true),
	 // in case subdomains should be auto registered for branches
	autoSubdomainCreationPatterns: []*string{
		jsii.String("*"),
		jsii.String("pr*"),
	},
})
domain.mapRoot(master) // map master branch to domain root
domain.mapSubDomain(master, jsii.String("www"))
domain.mapSubDomain(dev)

Experimental.

type DomainProps

type DomainProps struct {
	// Branches which should automatically create subdomains.
	// Experimental.
	AutoSubdomainCreationPatterns *[]*string `json:"autoSubdomainCreationPatterns" yaml:"autoSubdomainCreationPatterns"`
	// The name of the domain.
	// Experimental.
	DomainName *string `json:"domainName" yaml:"domainName"`
	// Automatically create subdomains for connected branches.
	// Experimental.
	EnableAutoSubdomain *bool `json:"enableAutoSubdomain" yaml:"enableAutoSubdomain"`
	// Subdomains.
	// Experimental.
	SubDomains *[]*SubDomain `json:"subDomains" yaml:"subDomains"`
	// The application to which the domain must be connected.
	// Experimental.
	App IApp `json:"app" yaml:"app"`
	// The IAM role with access to Route53 when using enableAutoSubdomain.
	// Experimental.
	AutoSubDomainIamRole awsiam.IRole `json:"autoSubDomainIamRole" yaml:"autoSubDomainIamRole"`
}

Properties for a Domain.

Example:

import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"import awscdk "github.com/aws/aws-cdk-go/awscdk"import iam "github.com/aws/aws-cdk-go/awscdk/aws_iam"

var app app
var branch branch
var role role
domainProps := &domainProps{
	app: app,

	// the properties below are optional
	autoSubdomainCreationPatterns: []*string{
		jsii.String("autoSubdomainCreationPatterns"),
	},
	autoSubDomainIamRole: role,
	domainName: jsii.String("domainName"),
	enableAutoSubdomain: jsii.Boolean(false),
	subDomains: []subDomain{
		&subDomain{
			branch: branch,

			// the properties below are optional
			prefix: jsii.String("prefix"),
		},
	},
}

Experimental.

type GitHubSourceCodeProvider

type GitHubSourceCodeProvider interface {
	ISourceCodeProvider
	// Binds the source code provider to an app.
	// Experimental.
	Bind(_app App) *SourceCodeProviderConfig
}

GitHub source code provider.

Example:

amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &appProps{
	sourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&gitHubSourceCodeProviderProps{
		owner: jsii.String("<user>"),
		repository: jsii.String("<repo>"),
		oauthToken: secretValue.secretsManager(jsii.String("my-github-token")),
	}),
	autoBranchCreation: &autoBranchCreation{
		 // Automatically connect branches that match a pattern set
		patterns: []*string{
			jsii.String("feature/*"),
			jsii.String("test/*"),
		},
	},
	autoBranchDeletion: jsii.Boolean(true),
})

Experimental.

func NewGitHubSourceCodeProvider

func NewGitHubSourceCodeProvider(props *GitHubSourceCodeProviderProps) GitHubSourceCodeProvider

Experimental.

type GitHubSourceCodeProviderProps

type GitHubSourceCodeProviderProps struct {
	// A personal access token with the `repo` scope.
	// Experimental.
	OauthToken awscdk.SecretValue `json:"oauthToken" yaml:"oauthToken"`
	// The user or organization owning the repository.
	// Experimental.
	Owner *string `json:"owner" yaml:"owner"`
	// The name of the repository.
	// Experimental.
	Repository *string `json:"repository" yaml:"repository"`
}

Properties for a GitHub source code provider.

Example:

amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &appProps{
	sourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&gitHubSourceCodeProviderProps{
		owner: jsii.String("<user>"),
		repository: jsii.String("<repo>"),
		oauthToken: secretValue.secretsManager(jsii.String("my-github-token")),
	}),
	autoBranchCreation: &autoBranchCreation{
		 // Automatically connect branches that match a pattern set
		patterns: []*string{
			jsii.String("feature/*"),
			jsii.String("test/*"),
		},
	},
	autoBranchDeletion: jsii.Boolean(true),
})

Experimental.

type GitLabSourceCodeProvider

type GitLabSourceCodeProvider interface {
	ISourceCodeProvider
	// Binds the source code provider to an app.
	// Experimental.
	Bind(_app App) *SourceCodeProviderConfig
}

GitLab source code provider.

Example:

amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &appProps{
	sourceCodeProvider: amplify.NewGitLabSourceCodeProvider(&gitLabSourceCodeProviderProps{
		owner: jsii.String("<user>"),
		repository: jsii.String("<repo>"),
		oauthToken: secretValue.secretsManager(jsii.String("my-gitlab-token")),
	}),
})

Experimental.

func NewGitLabSourceCodeProvider

func NewGitLabSourceCodeProvider(props *GitLabSourceCodeProviderProps) GitLabSourceCodeProvider

Experimental.

type GitLabSourceCodeProviderProps

type GitLabSourceCodeProviderProps struct {
	// A personal access token with the `repo` scope.
	// Experimental.
	OauthToken awscdk.SecretValue `json:"oauthToken" yaml:"oauthToken"`
	// The user or organization owning the repository.
	// Experimental.
	Owner *string `json:"owner" yaml:"owner"`
	// The name of the repository.
	// Experimental.
	Repository *string `json:"repository" yaml:"repository"`
}

Properties for a GitLab source code provider.

Example:

amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &appProps{
	sourceCodeProvider: amplify.NewGitLabSourceCodeProvider(&gitLabSourceCodeProviderProps{
		owner: jsii.String("<user>"),
		repository: jsii.String("<repo>"),
		oauthToken: secretValue.secretsManager(jsii.String("my-gitlab-token")),
	}),
})

Experimental.

type IApp

type IApp interface {
	awscdk.IResource
	// The application id.
	// Experimental.
	AppId() *string
}

An Amplify Console application. Experimental.

func App_FromAppId

func App_FromAppId(scope constructs.Construct, id *string, appId *string) IApp

Import an existing application. Experimental.

type IBranch

type IBranch interface {
	awscdk.IResource
	// The name of the branch.
	// Experimental.
	BranchName() *string
}

A branch. Experimental.

func Branch_FromBranchName

func Branch_FromBranchName(scope constructs.Construct, id *string, branchName *string) IBranch

Import an existing branch. Experimental.

type ISourceCodeProvider

type ISourceCodeProvider interface {
	// Binds the source code provider to an app.
	// Experimental.
	Bind(app App) *SourceCodeProviderConfig
}

A source code provider. Experimental.

type RedirectStatus

type RedirectStatus string

The status code for a URL rewrite or redirect rule.

Example:

var amplifyApp app
amplifyApp.addCustomRule(map[string]interface{}{
	"source": jsii.String("/docs/specific-filename.html"),
	"target": jsii.String("/documents/different-filename.html"),
	"status": amplify.RedirectStatus_TEMPORARY_REDIRECT,
})

Experimental.

const (
	// Rewrite (200).
	// Experimental.
	RedirectStatus_REWRITE RedirectStatus = "REWRITE"
	// Permanent redirect (301).
	// Experimental.
	RedirectStatus_PERMANENT_REDIRECT RedirectStatus = "PERMANENT_REDIRECT"
	// Temporary redirect (302).
	// Experimental.
	RedirectStatus_TEMPORARY_REDIRECT RedirectStatus = "TEMPORARY_REDIRECT"
	// Not found (404).
	// Experimental.
	RedirectStatus_NOT_FOUND RedirectStatus = "NOT_FOUND"
	// Not found rewrite (404).
	// Experimental.
	RedirectStatus_NOT_FOUND_REWRITE RedirectStatus = "NOT_FOUND_REWRITE"
)

type SourceCodeProviderConfig

type SourceCodeProviderConfig struct {
	// The repository for the application. Must use the `HTTPS` protocol.
	//
	// For example, `https://github.com/aws/aws-cdk`.
	// Experimental.
	Repository *string `json:"repository" yaml:"repository"`
	// Personal Access token for 3rd party source control system for an Amplify App, used to create webhook and read-only deploy key.
	//
	// Token is not stored.
	//
	// Either `accessToken` or `oauthToken` must be specified if `repository`
	// is sepcified.
	// Experimental.
	AccessToken awscdk.SecretValue `json:"accessToken" yaml:"accessToken"`
	// OAuth token for 3rd party source control system for an Amplify App, used to create webhook and read-only deploy key.
	//
	// OAuth token is not stored.
	//
	// Either `accessToken` or `oauthToken` must be specified if `repository`
	// is specified.
	// Experimental.
	OauthToken awscdk.SecretValue `json:"oauthToken" yaml:"oauthToken"`
}

Configuration for the source code provider.

Example:

import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"import cdk "github.com/aws/aws-cdk-go/awscdk"

var secretValue secretValue
sourceCodeProviderConfig := &sourceCodeProviderConfig{
	repository: jsii.String("repository"),

	// the properties below are optional
	accessToken: secretValue,
	oauthToken: secretValue,
}

Experimental.

type SubDomain

type SubDomain struct {
	// The branch.
	// Experimental.
	Branch IBranch `json:"branch" yaml:"branch"`
	// The prefix.
	//
	// Use ” to map to the root of the domain.
	// Experimental.
	Prefix *string `json:"prefix" yaml:"prefix"`
}

Sub domain settings.

Example:

import amplify_alpha "github.com/aws/aws-cdk-go/awscdkamplifyalpha"

var branch branch
subDomain := &subDomain{
	branch: branch,

	// the properties below are optional
	prefix: jsii.String("prefix"),
}

Experimental.

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL