Documentation
¶
Overview ¶
The CDK Construct Library for AWS::Amplify
The CDK Construct Library for AWS::Amplify
The CDK Construct Library for AWS::Amplify
Index ¶
- func App_IsConstruct(x interface{}) *bool
- func App_IsOwnedResource(construct constructs.IConstruct) *bool
- func App_IsResource(construct constructs.IConstruct) *bool
- func App_PROPERTY_INJECTION_ID() *string
- func Branch_IsConstruct(x interface{}) *bool
- func Branch_IsOwnedResource(construct constructs.IConstruct) *bool
- func Branch_IsResource(construct constructs.IConstruct) *bool
- func Branch_PROPERTY_INJECTION_ID() *string
- func Domain_IsConstruct(x interface{}) *bool
- func Domain_IsOwnedResource(construct constructs.IConstruct) *bool
- func Domain_IsResource(construct constructs.IConstruct) *bool
- func Domain_PROPERTY_INJECTION_ID() *string
- func NewApp_Override(a App, scope constructs.Construct, id *string, props *AppProps)
- func NewBasicAuth_Override(b BasicAuth, props *BasicAuthProps)
- func NewBranch_Override(b Branch, scope constructs.Construct, id *string, props *BranchProps)
- func NewCodeCommitSourceCodeProvider_Override(c CodeCommitSourceCodeProvider, props *CodeCommitSourceCodeProviderProps)
- func NewCustomRule_Override(c CustomRule, options *CustomRuleOptions)
- func NewDomain_Override(d Domain, scope constructs.Construct, id *string, props *DomainProps)
- func NewGitHubSourceCodeProvider_Override(g GitHubSourceCodeProvider, props *GitHubSourceCodeProviderProps)
- func NewGitLabSourceCodeProvider_Override(g GitLabSourceCodeProvider, props *GitLabSourceCodeProviderProps)
- type App
- type AppProps
- type AutoBranchCreation
- type BasicAuth
- type BasicAuthConfig
- type BasicAuthProps
- type Branch
- type BranchOptions
- type BranchProps
- type BuildComputeType
- type CacheConfigType
- type CodeCommitSourceCodeProvider
- type CodeCommitSourceCodeProviderProps
- type CustomResponseHeader
- type CustomRule
- type CustomRuleOptions
- type Domain
- type DomainOptions
- type DomainProps
- type GitHubSourceCodeProvider
- type GitHubSourceCodeProviderProps
- type GitLabSourceCodeProvider
- type GitLabSourceCodeProviderProps
- type IApp
- type IBranch
- type ISourceCodeProvider
- type Platform
- type RedirectStatus
- type SourceCodeProviderConfig
- type SubDomain
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.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.
func App_IsOwnedResource ¶
func App_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise. Experimental.
func App_IsResource ¶
func App_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func App_PROPERTY_INJECTION_ID ¶
func App_PROPERTY_INJECTION_ID() *string
func Branch_IsConstruct ¶
func Branch_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.
func Branch_IsOwnedResource ¶
func Branch_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise. Experimental.
func Branch_IsResource ¶
func Branch_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Branch_PROPERTY_INJECTION_ID ¶
func Branch_PROPERTY_INJECTION_ID() *string
func Domain_IsConstruct ¶
func Domain_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.
func Domain_IsOwnedResource ¶
func Domain_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise. Experimental.
func Domain_IsResource ¶
func Domain_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Domain_PROPERTY_INJECTION_ID ¶
func Domain_PROPERTY_INJECTION_ID() *string
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 IAM role for an SSR app.
// Experimental.
ComputeRole() awsiam.IRole
// The default domain of the application.
// Experimental.
DefaultDomain() *string
// The environment this resource belongs to.
//
// For resources that are created and managed in a Stack (those created by
// creating new class instances like `new Role()`, `new Bucket()`, etc.), this
// is always the same as the environment of the stack they belong to.
//
// For referenced resources (those obtained from referencing methods like
// `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
// different than the stack they were imported into.
// Experimental.
Env() *interfaces.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 platform of the app.
// Experimental.
Platform() Platform
// 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
// Applies one or more mixins to this construct.
//
// Mixins are applied in order. The list of constructs is captured at the
// start of the call, so constructs added by a mixin will not be visited.
// Use multiple `with()` calls if subsequent mixins should apply to added
// constructs.
// Experimental.
With(mixins ...constructs.IMixin) constructs.IConstruct
}
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: awscdk.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 AppProps ¶
type AppProps struct {
// The name for the application.
// Default: - a CDK generated name.
//
// Experimental.
AppName *string `field:"optional" json:"appName" yaml:"appName"`
// The auto branch creation configuration.
//
// Use this to automatically create
// branches that match a certain pattern.
// Default: - no auto branch creation.
//
// Experimental.
AutoBranchCreation *AutoBranchCreation `field:"optional" json:"autoBranchCreation" yaml:"autoBranchCreation"`
// Automatically disconnect a branch in the Amplify Console when you delete a branch from your Git repository.
// Default: false.
//
// Experimental.
AutoBranchDeletion *bool `field:"optional" json:"autoBranchDeletion" yaml:"autoBranchDeletion"`
// The Basic Auth configuration.
//
// Use this to set password protection at an
// app level to all your branches.
// Default: - no password protection.
//
// Experimental.
BasicAuth BasicAuth `field:"optional" json:"basicAuth" yaml:"basicAuth"`
// Specifies the size of the build instance.
// Default: undefined - Amplify default setting is `BuildComputeType.STANDARD_8GB`.
//
// Experimental.
BuildComputeType BuildComputeType `field:"optional" json:"buildComputeType" yaml:"buildComputeType"`
// 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
//
// Default: - no build spec.
//
// Experimental.
BuildSpec awscodebuild.BuildSpec `field:"optional" json:"buildSpec" yaml:"buildSpec"`
// The type of cache configuration to use for an Amplify app.
// Default: CacheConfigType.AMPLIFY_MANAGED
//
// Experimental.
CacheConfigType CacheConfigType `field:"optional" json:"cacheConfigType" yaml:"cacheConfigType"`
// The IAM role for an SSR app.
//
// The Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions.
// Default: undefined - a new role is created when `platform` is `Platform.WEB_COMPUTE` or `Platform.WEB_DYNAMIC`, otherwise no compute role
//
// Experimental.
ComputeRole awsiam.IRole `field:"optional" json:"computeRole" yaml:"computeRole"`
// The custom HTTP response headers for an Amplify app.
// See: https://docs.aws.amazon.com/amplify/latest/userguide/custom-headers.html
//
// Default: - no custom response headers.
//
// Experimental.
CustomResponseHeaders *[]*CustomResponseHeader `field:"optional" json:"customResponseHeaders" yaml:"customResponseHeaders"`
// Custom rewrite/redirect rules for the application.
// Default: - no custom rewrite/redirect rules.
//
// Experimental.
CustomRules *[]CustomRule `field:"optional" json:"customRules" yaml:"customRules"`
// A description for the application.
// Default: - no description.
//
// Experimental.
Description *string `field:"optional" 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.
// Default: - no environment variables.
//
// Experimental.
EnvironmentVariables *map[string]*string `field:"optional" json:"environmentVariables" yaml:"environmentVariables"`
// Indicates the hosting platform to use.
//
// Set to WEB for static site
// generated (SSG) apps (i.e. a Create React App or Gatsby) and WEB_COMPUTE
// for server side rendered (SSR) apps (i.e. NextJS).
// Default: Platform.WEB
//
// Experimental.
Platform Platform `field:"optional" json:"platform" yaml:"platform"`
// The IAM service role to associate with the application.
//
// The App
// implements IGrantable.
// Default: - a new role is created.
//
// Experimental.
Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
// The source code provider for this application.
// Default: - not connected to a source code provider.
//
// Experimental.
SourceCodeProvider ISourceCodeProvider `field:"optional" 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: awscdk.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.
// Default: true.
//
// Experimental.
AutoBuild *bool `field:"optional" json:"autoBuild" yaml:"autoBuild"`
// The Basic Auth configuration.
//
// Use this to set password protection for
// the auto created branch.
// Default: - no password protection.
//
// Experimental.
BasicAuth BasicAuth `field:"optional" json:"basicAuth" yaml:"basicAuth"`
// Build spec for the auto created branch.
// Default: - application build spec.
//
// Experimental.
BuildSpec awscodebuild.BuildSpec `field:"optional" 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.
// Default: - application environment variables.
//
// Experimental.
EnvironmentVariables *map[string]*string `field:"optional" json:"environmentVariables" yaml:"environmentVariables"`
// Automated branch creation glob patterns.
// Default: - all repository branches.
//
// Experimental.
Patterns *[]*string `field:"optional" json:"patterns" yaml:"patterns"`
// The dedicated backend environment for the pull request previews of the auto created branch.
// Default: - automatically provision a temporary backend.
//
// Experimental.
PullRequestEnvironmentName *string `field:"optional" json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"`
// Whether to enable pull request preview for the auto created branch.
// Default: true.
//
// Experimental.
PullRequestPreview *bool `field:"optional" json:"pullRequestPreview" yaml:"pullRequestPreview"`
// Stage for the auto created branch.
// Default: - no stage.
//
// Experimental.
Stage *string `field:"optional" 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: awscdk.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: awscdk.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 ¶
Creates a Basic Auth configuration with a password generated in Secrets Manager. Experimental.
type BasicAuthConfig ¶
type BasicAuthConfig struct {
// Whether to enable Basic Auth.
// Experimental.
EnableBasicAuth *bool `field:"required" json:"enableBasicAuth" yaml:"enableBasicAuth"`
// The password.
// Experimental.
Password *string `field:"required" json:"password" yaml:"password"`
// The username.
// Experimental.
Username *string `field:"required" json:"username" yaml:"username"`
}
A Basic Auth configuration.
Example:
// 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"
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 `field:"required" json:"username" yaml:"username"`
// The encryption key to use to encrypt the password when it's generated in Secrets Manager.
// Default: - default master key.
//
// Experimental.
EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
// The password.
// Default: - A Secrets Manager generated password.
//
// Experimental.
Password awscdk.SecretValue `field:"optional" json:"password" yaml:"password"`
}
Properties for a BasicAuth.
Example:
// 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 cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
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 in a Stack (those created by
// creating new class instances like `new Role()`, `new Bucket()`, etc.), this
// is always the same as the environment of the stack they belong to.
//
// For referenced resources (those obtained from referencing methods like
// `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
// different than the stack they were imported into.
// Experimental.
Env() *interfaces.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
// Applies one or more mixins to this construct.
//
// Mixins are applied in order. The list of constructs is captured at the
// start of the call, so constructs added by a mixin will not be visited.
// Use multiple `with()` calls if subsequent mixins should apply to added
// constructs.
// Experimental.
With(mixins ...constructs.IMixin) constructs.IConstruct
}
An Amplify Console branch.
Example:
var computeRole Role
var amplifyApp App
branch := amplifyApp.AddBranch(jsii.String("dev"), &BranchOptions{
ComputeRole: ComputeRole,
})
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.
// Default: - no asset.
//
// Experimental.
Asset awss3assets.Asset `field:"optional" json:"asset" yaml:"asset"`
// Whether to enable auto building for the branch.
// Default: true.
//
// Experimental.
AutoBuild *bool `field:"optional" json:"autoBuild" yaml:"autoBuild"`
// The Basic Auth configuration.
//
// Use this to set password protection for
// the branch.
// Default: - no password protection.
//
// Experimental.
BasicAuth BasicAuth `field:"optional" json:"basicAuth" yaml:"basicAuth"`
// The name of the branch.
// Default: - the construct's id.
//
// Experimental.
BranchName *string `field:"optional" json:"branchName" yaml:"branchName"`
// BuildSpec for the branch.
// See: https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html
//
// Default: - no build spec.
//
// Experimental.
BuildSpec awscodebuild.BuildSpec `field:"optional" json:"buildSpec" yaml:"buildSpec"`
// The IAM role to assign to a branch of an SSR app.
//
// 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: undefined - No specific role for the branch. If the app has a compute role, it will be inherited.
//
// Experimental.
ComputeRole awsiam.IRole `field:"optional" json:"computeRole" yaml:"computeRole"`
// A description for the branch.
// Default: - no description.
//
// Experimental.
Description *string `field:"optional" 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.
// Default: - application environment variables.
//
// Experimental.
EnvironmentVariables *map[string]*string `field:"optional" 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.
// Default: false.
//
// Experimental.
PerformanceMode *bool `field:"optional" json:"performanceMode" yaml:"performanceMode"`
// The dedicated backend environment for the pull request previews.
// Default: - automatically provision a temporary backend.
//
// Experimental.
PullRequestEnvironmentName *string `field:"optional" json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"`
// Whether to enable pull request preview for the branch.
// Default: true.
//
// Experimental.
PullRequestPreview *bool `field:"optional" json:"pullRequestPreview" yaml:"pullRequestPreview"`
// Specifies whether the skew protection feature is enabled for the branch.
//
// 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: None - Default setting is no skew protection.
//
// Experimental.
SkewProtection *bool `field:"optional" json:"skewProtection" yaml:"skewProtection"`
// Stage for the branch.
// Default: - no stage.
//
// Experimental.
Stage *string `field:"optional" json:"stage" yaml:"stage"`
}
Options to add a branch to an application.
Example:
var computeRole Role
var amplifyApp App
branch := amplifyApp.AddBranch(jsii.String("dev"), &BranchOptions{
ComputeRole: ComputeRole,
})
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.
// Default: - no asset.
//
// Experimental.
Asset awss3assets.Asset `field:"optional" json:"asset" yaml:"asset"`
// Whether to enable auto building for the branch.
// Default: true.
//
// Experimental.
AutoBuild *bool `field:"optional" json:"autoBuild" yaml:"autoBuild"`
// The Basic Auth configuration.
//
// Use this to set password protection for
// the branch.
// Default: - no password protection.
//
// Experimental.
BasicAuth BasicAuth `field:"optional" json:"basicAuth" yaml:"basicAuth"`
// The name of the branch.
// Default: - the construct's id.
//
// Experimental.
BranchName *string `field:"optional" json:"branchName" yaml:"branchName"`
// BuildSpec for the branch.
// See: https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html
//
// Default: - no build spec.
//
// Experimental.
BuildSpec awscodebuild.BuildSpec `field:"optional" json:"buildSpec" yaml:"buildSpec"`
// The IAM role to assign to a branch of an SSR app.
//
// 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: undefined - No specific role for the branch. If the app has a compute role, it will be inherited.
//
// Experimental.
ComputeRole awsiam.IRole `field:"optional" json:"computeRole" yaml:"computeRole"`
// A description for the branch.
// Default: - no description.
//
// Experimental.
Description *string `field:"optional" 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.
// Default: - application environment variables.
//
// Experimental.
EnvironmentVariables *map[string]*string `field:"optional" 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.
// Default: false.
//
// Experimental.
PerformanceMode *bool `field:"optional" json:"performanceMode" yaml:"performanceMode"`
// The dedicated backend environment for the pull request previews.
// Default: - automatically provision a temporary backend.
//
// Experimental.
PullRequestEnvironmentName *string `field:"optional" json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"`
// Whether to enable pull request preview for the branch.
// Default: true.
//
// Experimental.
PullRequestPreview *bool `field:"optional" json:"pullRequestPreview" yaml:"pullRequestPreview"`
// Specifies whether the skew protection feature is enabled for the branch.
//
// 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: None - Default setting is no skew protection.
//
// Experimental.
SkewProtection *bool `field:"optional" json:"skewProtection" yaml:"skewProtection"`
// Stage for the branch.
// Default: - no stage.
//
// Experimental.
Stage *string `field:"optional" json:"stage" yaml:"stage"`
// The application within which the branch must be created.
// Experimental.
App IApp `field:"required" json:"app" yaml:"app"`
}
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 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"),
}
Experimental.
type BuildComputeType ¶
type BuildComputeType string
Specifies the size of the build instance.
Example:
amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &AppProps{
BuildComputeType: amplify.BuildComputeType_LARGE_16GB,
})
Experimental.
const ( // vCPUs: 4, Memory: 8 GiB, Disk space: 128 GB. // Experimental. BuildComputeType_STANDARD_8GB BuildComputeType = "STANDARD_8GB" // vCPUs: 8, Memory: 16 GiB, Disk space: 128 GB. // Experimental. BuildComputeType_LARGE_16GB BuildComputeType = "LARGE_16GB" // vCPUs: 36, Memory: 72 GiB, Disk space: 256 GB. // Experimental. BuildComputeType_XLARGE_72GB BuildComputeType = "XLARGE_72GB" )
type CacheConfigType ¶
type CacheConfigType string
The type of cache configuration to use for an Amplify app.
Example:
amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &AppProps{
CacheConfigType: amplify.CacheConfigType_AMPLIFY_MANAGED_NO_COOKIES,
})
Experimental.
const ( // AMPLIFY_MANAGED - Automatically applies an optimized cache configuration for your app based on its platform, routing rules, and rewrite rules. // Experimental. CacheConfigType_AMPLIFY_MANAGED CacheConfigType = "AMPLIFY_MANAGED" // AMPLIFY_MANAGED_NO_COOKIES - The same as AMPLIFY_MANAGED, except that it excludes all cookies from the cache key. // Experimental. CacheConfigType_AMPLIFY_MANAGED_NO_COOKIES CacheConfigType = "AMPLIFY_MANAGED_NO_COOKIES" )
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 `field:"required" 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 `field:"required" json:"headers" yaml:"headers"`
// These custom headers will be applied to all URL file paths that match this pattern.
// Experimental.
Pattern *string `field:"required" json:"pattern" yaml:"pattern"`
// If the app uses a monorepo structure, the appRoot from the build spec to apply the custom headers to.
// Default: - The appRoot is omitted in the custom headers output.
//
// Experimental.
AppRoot *string `field:"optional" json:"appRoot" yaml:"appRoot"`
}
Custom response header of an Amplify App.
Example:
// 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"
customResponseHeader := &CustomResponseHeader{
Headers: map[string]*string{
"headersKey": jsii.String("headers"),
},
Pattern: jsii.String("pattern"),
// the properties below are optional
AppRoot: jsii.String("appRoot"),
}
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
//
// Default: - no condition.
//
// 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
//
// Default: PERMANENT_REDIRECT.
//
// 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:
import "github.com/aws/aws-cdk-go/awscdkamplifyalpha"
var amplifyApp App
amplifyApp.AddCustomRule(awscdkamplifyalpha.NewCustomRule(&CustomRuleOptions{
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
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 `field:"required" 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 `field:"required" 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
//
// Default: - no condition.
//
// Experimental.
Condition *string `field:"optional" 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
//
// Default: PERMANENT_REDIRECT.
//
// Experimental.
Status RedirectStatus `field:"optional" json:"status" yaml:"status"`
}
Options for a custom rewrite/redirect rule for an Amplify App.
Example:
import "github.com/aws/aws-cdk-go/awscdkamplifyalpha"
var amplifyApp App
amplifyApp.AddCustomRule(awscdkamplifyalpha.NewCustomRule(&CustomRuleOptions{
Source: jsii.String("/docs/specific-filename.html"),
Target: jsii.String("/documents/different-filename.html"),
Status: amplify.RedirectStatus_TEMPORARY_REDIRECT,
}))
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 in a Stack (those created by
// creating new class instances like `new Role()`, `new Bucket()`, etc.), this
// is always the same as the environment of the stack they belong to.
//
// For referenced resources (those obtained from referencing methods like
// `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
// different than the stack they were imported into.
// Experimental.
Env() *interfaces.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
// Applies one or more mixins to this construct.
//
// Mixins are applied in order. The list of constructs is captured at the
// start of the call, so constructs added by a mixin will not be visited.
// Use multiple `with()` calls if subsequent mixins should apply to added
// constructs.
// Experimental.
With(mixins ...constructs.IMixin) constructs.IConstruct
}
An Amplify Console domain.
Example:
var amplifyApp App
var main 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(main) // map main branch to domain root
domain.MapSubDomain(main, 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.
// Default: - all repository branches ['*', 'pr*'].
//
// Experimental.
AutoSubdomainCreationPatterns *[]*string `field:"optional" json:"autoSubdomainCreationPatterns" yaml:"autoSubdomainCreationPatterns"`
// The type of SSL/TLS certificate to use for your custom domain.
// Default: - Amplify uses the default certificate that it provisions and manages for you.
//
// Experimental.
CustomCertificate awscertificatemanager.ICertificate `field:"optional" json:"customCertificate" yaml:"customCertificate"`
// The name of the domain.
// Default: - the construct's id.
//
// Experimental.
DomainName *string `field:"optional" json:"domainName" yaml:"domainName"`
// Automatically create subdomains for connected branches.
// Default: false.
//
// Experimental.
EnableAutoSubdomain *bool `field:"optional" json:"enableAutoSubdomain" yaml:"enableAutoSubdomain"`
// Subdomains.
// Default: - use `addSubDomain()` to add subdomains.
//
// Experimental.
SubDomains *[]*SubDomain `field:"optional" json:"subDomains" yaml:"subDomains"`
}
Options to add a domain to an application.
Example:
var amplifyApp App
var main 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(main) // map main branch to domain root
domain.MapSubDomain(main, jsii.String("www"))
domain.MapSubDomain(dev)
Experimental.
type DomainProps ¶
type DomainProps struct {
// Branches which should automatically create subdomains.
// Default: - all repository branches ['*', 'pr*'].
//
// Experimental.
AutoSubdomainCreationPatterns *[]*string `field:"optional" json:"autoSubdomainCreationPatterns" yaml:"autoSubdomainCreationPatterns"`
// The type of SSL/TLS certificate to use for your custom domain.
// Default: - Amplify uses the default certificate that it provisions and manages for you.
//
// Experimental.
CustomCertificate awscertificatemanager.ICertificate `field:"optional" json:"customCertificate" yaml:"customCertificate"`
// The name of the domain.
// Default: - the construct's id.
//
// Experimental.
DomainName *string `field:"optional" json:"domainName" yaml:"domainName"`
// Automatically create subdomains for connected branches.
// Default: false.
//
// Experimental.
EnableAutoSubdomain *bool `field:"optional" json:"enableAutoSubdomain" yaml:"enableAutoSubdomain"`
// Subdomains.
// Default: - use `addSubDomain()` to add subdomains.
//
// Experimental.
SubDomains *[]*SubDomain `field:"optional" json:"subDomains" yaml:"subDomains"`
// The application to which the domain must be connected.
// Experimental.
App IApp `field:"required" json:"app" yaml:"app"`
// The IAM role with access to Route53 when using enableAutoSubdomain.
// Default: - the IAM role from App.grantPrincipal
//
// Experimental.
AutoSubDomainIamRole awsiam.IRole `field:"optional" json:"autoSubDomainIamRole" yaml:"autoSubDomainIamRole"`
}
Properties for a Domain.
Example:
// 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"
var app App
var branch Branch
var certificate Certificate
var role Role
domainProps := &DomainProps{
App: app,
// the properties below are optional
AutoSubdomainCreationPatterns: []*string{
jsii.String("autoSubdomainCreationPatterns"),
},
AutoSubDomainIamRole: role,
CustomCertificate: certificate,
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("App"), &AppProps{
SourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&GitHubSourceCodeProviderProps{
Owner: jsii.String("<user>"),
Repository: jsii.String("<repo>"),
OauthToken: awscdk.SecretValue_SecretsManager(jsii.String("my-github-token")),
}),
CustomResponseHeaders: []CustomResponseHeader{
&CustomResponseHeader{
Pattern: jsii.String("*.json"),
Headers: map[string]*string{
"custom-header-name-1": jsii.String("custom-header-value-1"),
"custom-header-name-2": jsii.String("custom-header-value-2"),
},
},
&CustomResponseHeader{
Pattern: jsii.String("/path/*"),
Headers: map[string]*string{
"custom-header-name-1": jsii.String("custom-header-value-2"),
},
},
},
})
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 `field:"required" json:"oauthToken" yaml:"oauthToken"`
// The user or organization owning the repository.
// Experimental.
Owner *string `field:"required" json:"owner" yaml:"owner"`
// The name of the repository.
// Experimental.
Repository *string `field:"required" json:"repository" yaml:"repository"`
}
Properties for a GitHub source code provider.
Example:
amplifyApp := amplify.NewApp(this, jsii.String("App"), &AppProps{
SourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&GitHubSourceCodeProviderProps{
Owner: jsii.String("<user>"),
Repository: jsii.String("<repo>"),
OauthToken: awscdk.SecretValue_SecretsManager(jsii.String("my-github-token")),
}),
CustomResponseHeaders: []CustomResponseHeader{
&CustomResponseHeader{
Pattern: jsii.String("*.json"),
Headers: map[string]*string{
"custom-header-name-1": jsii.String("custom-header-value-1"),
"custom-header-name-2": jsii.String("custom-header-value-2"),
},
},
&CustomResponseHeader{
Pattern: jsii.String("/path/*"),
Headers: map[string]*string{
"custom-header-name-1": jsii.String("custom-header-value-2"),
},
},
},
})
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: awscdk.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 `field:"required" json:"oauthToken" yaml:"oauthToken"`
// The user or organization owning the repository.
// Experimental.
Owner *string `field:"required" json:"owner" yaml:"owner"`
// The name of the repository.
// Experimental.
Repository *string `field:"required" 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: awscdk.SecretValue_SecretsManager(jsii.String("my-gitlab-token")),
}),
})
Experimental.
type IApp ¶
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 Platform ¶
type Platform string
Available hosting platforms to use on the App.
Example:
amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &AppProps{
Platform: amplify.Platform_WEB_COMPUTE,
})
Experimental.
const ( // WEB - Used to indicate that the app is hosted using only static assets. // Experimental. Platform_WEB Platform = "WEB" // WEB_COMPUTE - Used to indicate the app is hosted using a combination of server side rendered and static assets. // Experimental. Platform_WEB_COMPUTE Platform = "WEB_COMPUTE" // WEB_DYNAMIC - Used to indicate the app is hosted using a fully dynamic architecture, where requests are processed at runtime by backend compute services. // Experimental. Platform_WEB_DYNAMIC Platform = "WEB_DYNAMIC" )
type RedirectStatus ¶
type RedirectStatus string
The status code for a URL rewrite or redirect rule.
Example:
import "github.com/aws/aws-cdk-go/awscdkamplifyalpha"
var amplifyApp App
amplifyApp.AddCustomRule(awscdkamplifyalpha.NewCustomRule(&CustomRuleOptions{
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 `field:"required" 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.
// Default: - do not use a token.
//
// Experimental.
AccessToken awscdk.SecretValue `field:"optional" 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.
// Default: - do not use a token.
//
// Experimental.
OauthToken awscdk.SecretValue `field:"optional" json:"oauthToken" yaml:"oauthToken"`
}
Configuration for the source code provider.
Example:
// 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 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 `field:"required" json:"branch" yaml:"branch"`
// The prefix.
//
// Use ” to map to the root of the domain.
// Default: - the branch name.
//
// Experimental.
Prefix *string `field:"optional" json:"prefix" yaml:"prefix"`
}
Sub domain settings.
Example:
// 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"
var branch Branch
subDomain := &SubDomain{
Branch: branch,
// the properties below are optional
Prefix: jsii.String("prefix"),
}
Experimental.
Source Files
¶
- App.go
- AppProps.go
- App__checks.go
- AutoBranchCreation.go
- BasicAuth.go
- BasicAuthConfig.go
- BasicAuthProps.go
- BasicAuth__checks.go
- Branch.go
- BranchOptions.go
- BranchProps.go
- Branch__checks.go
- BuildComputeType.go
- CacheConfigType.go
- CodeCommitSourceCodeProvider.go
- CodeCommitSourceCodeProviderProps.go
- CodeCommitSourceCodeProvider__checks.go
- CustomResponseHeader.go
- CustomRule.go
- CustomRuleOptions.go
- CustomRule__checks.go
- Domain.go
- DomainOptions.go
- DomainProps.go
- Domain__checks.go
- GitHubSourceCodeProvider.go
- GitHubSourceCodeProviderProps.go
- GitHubSourceCodeProvider__checks.go
- GitLabSourceCodeProvider.go
- GitLabSourceCodeProviderProps.go
- GitLabSourceCodeProvider__checks.go
- IApp.go
- IBranch.go
- ISourceCodeProvider.go
- ISourceCodeProvider__checks.go
- Platform.go
- RedirectStatus.go
- SourceCodeProviderConfig.go
- SubDomain.go
- main.go