Documentation ¶
Index ¶
- func App_IsConstruct(x interface{}) *bool
- func App_IsResource(construct awscdk.IConstruct) *bool
- func Branch_IsConstruct(x interface{}) *bool
- func Branch_IsResource(construct awscdk.IConstruct) *bool
- func CfnApp_CFN_RESOURCE_TYPE_NAME() *string
- func CfnApp_IsCfnElement(x interface{}) *bool
- func CfnApp_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnApp_IsConstruct(x interface{}) *bool
- func CfnBranch_CFN_RESOURCE_TYPE_NAME() *string
- func CfnBranch_IsCfnElement(x interface{}) *bool
- func CfnBranch_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnBranch_IsConstruct(x interface{}) *bool
- func CfnDomain_CFN_RESOURCE_TYPE_NAME() *string
- func CfnDomain_IsCfnElement(x interface{}) *bool
- func CfnDomain_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnDomain_IsConstruct(x interface{}) *bool
- func Domain_IsConstruct(x interface{}) *bool
- func Domain_IsResource(construct awscdk.IConstruct) *bool
- 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 NewCfnApp_Override(c CfnApp, scope awscdk.Construct, id *string, props *CfnAppProps)
- func NewCfnBranch_Override(c CfnBranch, scope awscdk.Construct, id *string, props *CfnBranchProps)
- func NewCfnDomain_Override(c CfnDomain, scope awscdk.Construct, id *string, props *CfnDomainProps)
- 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 CfnApp
- type CfnAppProps
- type CfnApp_AutoBranchCreationConfigProperty
- type CfnApp_BasicAuthConfigProperty
- type CfnApp_CustomRuleProperty
- type CfnApp_EnvironmentVariableProperty
- type CfnBranch
- type CfnBranchProps
- type CfnBranch_BasicAuthConfigProperty
- type CfnBranch_EnvironmentVariableProperty
- type CfnDomain
- type CfnDomainProps
- type CfnDomain_SubDomainSettingProperty
- 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 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
Return whether the given object is a Construct. Experimental.
func App_IsResource ¶
func App_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Branch_IsConstruct ¶
func Branch_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func Branch_IsResource ¶
func Branch_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func CfnApp_CFN_RESOURCE_TYPE_NAME ¶
func CfnApp_CFN_RESOURCE_TYPE_NAME() *string
func CfnApp_IsCfnElement ¶
func CfnApp_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnApp_IsCfnResource ¶
func CfnApp_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnApp_IsConstruct ¶
func CfnApp_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnBranch_CFN_RESOURCE_TYPE_NAME ¶
func CfnBranch_CFN_RESOURCE_TYPE_NAME() *string
func CfnBranch_IsCfnElement ¶
func CfnBranch_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnBranch_IsCfnResource ¶
func CfnBranch_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnBranch_IsConstruct ¶
func CfnBranch_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func CfnDomain_CFN_RESOURCE_TYPE_NAME ¶
func CfnDomain_CFN_RESOURCE_TYPE_NAME() *string
func CfnDomain_IsCfnElement ¶
func CfnDomain_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.
func CfnDomain_IsCfnResource ¶
func CfnDomain_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource. Experimental.
func CfnDomain_IsConstruct ¶
func CfnDomain_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func Domain_IsConstruct ¶
func Domain_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func Domain_IsResource ¶
func Domain_IsResource(construct awscdk.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func NewApp_Override ¶
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 NewCfnApp_Override ¶
func NewCfnApp_Override(c CfnApp, scope awscdk.Construct, id *string, props *CfnAppProps)
Create a new `AWS::Amplify::App`.
func NewCfnBranch_Override ¶
func NewCfnBranch_Override(c CfnBranch, scope awscdk.Construct, id *string, props *CfnBranchProps)
Create a new `AWS::Amplify::Branch`.
func NewCfnDomain_Override ¶
func NewCfnDomain_Override(c CfnDomain, scope awscdk.Construct, id *string, props *CfnDomainProps)
Create a new `AWS::Amplify::Domain`.
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 construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // 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 // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*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: 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. // 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. // 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. // 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. // Experimental. BasicAuth BasicAuth `field:"optional" 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 `field:"optional" 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 `field:"optional" json:"customResponseHeaders" yaml:"customResponseHeaders"` // Custom rewrite/redirect rules for the application. // Experimental. CustomRules *[]CustomRule `field:"optional" json:"customRules" yaml:"customRules"` // A description for the application. // 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. // Experimental. EnvironmentVariables *map[string]*string `field:"optional" json:"environmentVariables" yaml:"environmentVariables"` // The IAM service role to associate with the application. // // The App // implements IGrantable. // Experimental. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` // The source code provider for this application. // 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. // Experimental. AutoBuild *bool `field:"optional" json:"autoBuild" yaml:"autoBuild"` // The Basic Auth configuration. // // Use this to set password protection for // the auto created branch. // Experimental. BasicAuth BasicAuth `field:"optional" json:"basicAuth" yaml:"basicAuth"` // Build spec for the auto created branch. // 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. // Experimental. EnvironmentVariables *map[string]*string `field:"optional" json:"environmentVariables" yaml:"environmentVariables"` // Automated branch creation glob patterns. // Experimental. Patterns *[]*string `field:"optional" json:"patterns" yaml:"patterns"` // The dedicated backend environment for the pull request previews of the auto created branch. // Experimental. PullRequestEnvironmentName *string `field:"optional" json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"` // Whether to enable pull request preview for the auto created branch. // Experimental. PullRequestPreview *bool `field:"optional" json:"pullRequestPreview" yaml:"pullRequestPreview"` // Stage for the auto created branch. // 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 awscdk.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 "github.com/aws/aws-cdk-go/awscdk" 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. // Experimental. EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"` // The 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 monocdk "github.com/aws/aws-cdk-go/awscdk" import "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 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 construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // 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 // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*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 `field:"optional" json:"asset" yaml:"asset"` // Whether to enable auto building for the branch. // Experimental. AutoBuild *bool `field:"optional" json:"autoBuild" yaml:"autoBuild"` // The Basic Auth configuration. // // Use this to set password protection for // the branch. // Experimental. BasicAuth BasicAuth `field:"optional" json:"basicAuth" yaml:"basicAuth"` // The name of the branch. // 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 // // Experimental. BuildSpec awscodebuild.BuildSpec `field:"optional" json:"buildSpec" yaml:"buildSpec"` // A description for the branch. // 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. // 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. // Experimental. PerformanceMode *bool `field:"optional" json:"performanceMode" yaml:"performanceMode"` // The dedicated backend environment for the pull request previews. // Experimental. PullRequestEnvironmentName *string `field:"optional" json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"` // Whether to enable pull request preview for the branch. // Experimental. PullRequestPreview *bool `field:"optional" json:"pullRequestPreview" yaml:"pullRequestPreview"` // Stage for the branch. // Experimental. Stage *string `field:"optional" 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 `field:"optional" json:"asset" yaml:"asset"` // Whether to enable auto building for the branch. // Experimental. AutoBuild *bool `field:"optional" json:"autoBuild" yaml:"autoBuild"` // The Basic Auth configuration. // // Use this to set password protection for // the branch. // Experimental. BasicAuth BasicAuth `field:"optional" json:"basicAuth" yaml:"basicAuth"` // The name of the branch. // 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 // // Experimental. BuildSpec awscodebuild.BuildSpec `field:"optional" json:"buildSpec" yaml:"buildSpec"` // A description for the branch. // 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. // 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. // Experimental. PerformanceMode *bool `field:"optional" json:"performanceMode" yaml:"performanceMode"` // The dedicated backend environment for the pull request previews. // Experimental. PullRequestEnvironmentName *string `field:"optional" json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"` // Whether to enable pull request preview for the branch. // Experimental. PullRequestPreview *bool `field:"optional" json:"pullRequestPreview" yaml:"pullRequestPreview"` // Stage for the branch. // 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 "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 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 CfnApp ¶
type CfnApp interface { awscdk.CfnResource awscdk.IInspectable // The personal access token for a GitHub repository for an Amplify app. // // The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored. // // Use `AccessToken` for GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, use `OauthToken` . // // You must specify either `AccessToken` or `OauthToken` when you create a new app. // // Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see [Migrating an existing OAuth app to the Amplify GitHub App](https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth) in the *Amplify User Guide* . // // *Length Constraints:* Minimum length of 1. Maximum length of 255. AccessToken() *string SetAccessToken(val *string) // Unique Id for the Amplify App. AttrAppId() *string // Name for the Amplify App. AttrAppName() *string // ARN for the Amplify App. AttrArn() *string // Default domain for the Amplify App. AttrDefaultDomain() *string // Sets the configuration for your automatic branch creation. AutoBranchCreationConfig() interface{} SetAutoBranchCreationConfig(val interface{}) // The credentials for basic authorization for an Amplify app. // // You must base64-encode the authorization credentials and provide them in the format `user:password` . BasicAuthConfig() interface{} SetBasicAuthConfig(val interface{}) // The build specification (build spec) for an Amplify app. // // *Length Constraints:* Minimum length of 1. Maximum length of 25000. // // *Pattern:* (?s).+ BuildSpec() *string SetBuildSpec(val *string) // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // The custom HTTP headers for an Amplify app. // // *Length Constraints:* Minimum length of 0. Maximum length of 25000. // // *Pattern:* (?s).* CustomHeaders() *string SetCustomHeaders(val *string) // The custom rewrite and redirect rules for an Amplify app. CustomRules() interface{} SetCustomRules(val interface{}) // The description for an Amplify app. // // *Length Constraints:* Maximum length of 1000. // // *Pattern:* (?s).* Description() *string SetDescription(val *string) // Automatically disconnect a branch in the Amplify Console when you delete a branch from your Git repository. EnableBranchAutoDeletion() interface{} SetEnableBranchAutoDeletion(val interface{}) // The environment variables map for an Amplify app. EnvironmentVariables() interface{} SetEnvironmentVariables(val interface{}) // The AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) of the Amplify app. // // *Length Constraints:* Minimum length of 0. Maximum length of 1000. // // *Pattern:* (?s).* IamServiceRole() *string SetIamServiceRole(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The name for an Amplify app. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. // // *Pattern:* (?s).+ Name() *string SetName(val *string) // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // The OAuth token for a third-party source control system for an Amplify app. // // The OAuth token is used to create a webhook and a read-only deploy key using SSH cloning. The OAuth token is not stored. // // Use `OauthToken` for repository providers other than GitHub, such as Bitbucket or CodeCommit. To authorize access to GitHub as your repository provider, use `AccessToken` . // // You must specify either `OauthToken` or `AccessToken` when you create a new app. // // Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see [Migrating an existing OAuth app to the Amplify GitHub App](https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth) in the *Amplify User Guide* . // // *Length Constraints:* Maximum length of 1000. // // *Pattern:* (?s).* OauthToken() *string SetOauthToken(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The repository for an Amplify app. // // *Pattern:* (?s).* Repository() *string SetRepository(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // The tag for an Amplify app. Tags() awscdk.TagManager // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // 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, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Amplify::App`.
The AWS::Amplify::App resource creates Apps in the Amplify Console. An App is a collection of branches.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnApp := awscdk.Aws_amplify.NewCfnApp(this, jsii.String("MyCfnApp"), &cfnAppProps{ name: jsii.String("name"), // the properties below are optional accessToken: jsii.String("accessToken"), autoBranchCreationConfig: &autoBranchCreationConfigProperty{ autoBranchCreationPatterns: []*string{ jsii.String("autoBranchCreationPatterns"), }, basicAuthConfig: &basicAuthConfigProperty{ enableBasicAuth: jsii.Boolean(false), password: jsii.String("password"), username: jsii.String("username"), }, buildSpec: jsii.String("buildSpec"), enableAutoBranchCreation: jsii.Boolean(false), enableAutoBuild: jsii.Boolean(false), enablePerformanceMode: jsii.Boolean(false), enablePullRequestPreview: jsii.Boolean(false), environmentVariables: []interface{}{ &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }, }, pullRequestEnvironmentName: jsii.String("pullRequestEnvironmentName"), stage: jsii.String("stage"), }, basicAuthConfig: &basicAuthConfigProperty{ enableBasicAuth: jsii.Boolean(false), password: jsii.String("password"), username: jsii.String("username"), }, buildSpec: jsii.String("buildSpec"), customHeaders: jsii.String("customHeaders"), customRules: []interface{}{ &customRuleProperty{ source: jsii.String("source"), target: jsii.String("target"), // the properties below are optional condition: jsii.String("condition"), status: jsii.String("status"), }, }, description: jsii.String("description"), enableBranchAutoDeletion: jsii.Boolean(false), environmentVariables: []interface{}{ &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }, }, iamServiceRole: jsii.String("iamServiceRole"), oauthToken: jsii.String("oauthToken"), repository: jsii.String("repository"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, })
type CfnAppProps ¶
type CfnAppProps struct { // The name for an Amplify app. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. // // *Pattern:* (?s).+ Name *string `field:"required" json:"name" yaml:"name"` // The personal access token for a GitHub repository for an Amplify app. // // The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored. // // Use `AccessToken` for GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, use `OauthToken` . // // You must specify either `AccessToken` or `OauthToken` when you create a new app. // // Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see [Migrating an existing OAuth app to the Amplify GitHub App](https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth) in the *Amplify User Guide* . // // *Length Constraints:* Minimum length of 1. Maximum length of 255. AccessToken *string `field:"optional" json:"accessToken" yaml:"accessToken"` // Sets the configuration for your automatic branch creation. AutoBranchCreationConfig interface{} `field:"optional" json:"autoBranchCreationConfig" yaml:"autoBranchCreationConfig"` // The credentials for basic authorization for an Amplify app. // // You must base64-encode the authorization credentials and provide them in the format `user:password` . BasicAuthConfig interface{} `field:"optional" json:"basicAuthConfig" yaml:"basicAuthConfig"` // The build specification (build spec) for an Amplify app. // // *Length Constraints:* Minimum length of 1. Maximum length of 25000. // // *Pattern:* (?s).+ BuildSpec *string `field:"optional" json:"buildSpec" yaml:"buildSpec"` // The custom HTTP headers for an Amplify app. // // *Length Constraints:* Minimum length of 0. Maximum length of 25000. // // *Pattern:* (?s).* CustomHeaders *string `field:"optional" json:"customHeaders" yaml:"customHeaders"` // The custom rewrite and redirect rules for an Amplify app. CustomRules interface{} `field:"optional" json:"customRules" yaml:"customRules"` // The description for an Amplify app. // // *Length Constraints:* Maximum length of 1000. // // *Pattern:* (?s).* Description *string `field:"optional" json:"description" yaml:"description"` // Automatically disconnect a branch in the Amplify Console when you delete a branch from your Git repository. EnableBranchAutoDeletion interface{} `field:"optional" json:"enableBranchAutoDeletion" yaml:"enableBranchAutoDeletion"` // The environment variables map for an Amplify app. EnvironmentVariables interface{} `field:"optional" json:"environmentVariables" yaml:"environmentVariables"` // The AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) of the Amplify app. // // *Length Constraints:* Minimum length of 0. Maximum length of 1000. // // *Pattern:* (?s).* IamServiceRole *string `field:"optional" json:"iamServiceRole" yaml:"iamServiceRole"` // The OAuth token for a third-party source control system for an Amplify app. // // The OAuth token is used to create a webhook and a read-only deploy key using SSH cloning. The OAuth token is not stored. // // Use `OauthToken` for repository providers other than GitHub, such as Bitbucket or CodeCommit. To authorize access to GitHub as your repository provider, use `AccessToken` . // // You must specify either `OauthToken` or `AccessToken` when you create a new app. // // Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see [Migrating an existing OAuth app to the Amplify GitHub App](https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth) in the *Amplify User Guide* . // // *Length Constraints:* Maximum length of 1000. // // *Pattern:* (?s).* OauthToken *string `field:"optional" json:"oauthToken" yaml:"oauthToken"` // The repository for an Amplify app. // // *Pattern:* (?s).* Repository *string `field:"optional" json:"repository" yaml:"repository"` // The tag for an Amplify app. Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnApp`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnAppProps := &cfnAppProps{ name: jsii.String("name"), // the properties below are optional accessToken: jsii.String("accessToken"), autoBranchCreationConfig: &autoBranchCreationConfigProperty{ autoBranchCreationPatterns: []*string{ jsii.String("autoBranchCreationPatterns"), }, basicAuthConfig: &basicAuthConfigProperty{ enableBasicAuth: jsii.Boolean(false), password: jsii.String("password"), username: jsii.String("username"), }, buildSpec: jsii.String("buildSpec"), enableAutoBranchCreation: jsii.Boolean(false), enableAutoBuild: jsii.Boolean(false), enablePerformanceMode: jsii.Boolean(false), enablePullRequestPreview: jsii.Boolean(false), environmentVariables: []interface{}{ &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }, }, pullRequestEnvironmentName: jsii.String("pullRequestEnvironmentName"), stage: jsii.String("stage"), }, basicAuthConfig: &basicAuthConfigProperty{ enableBasicAuth: jsii.Boolean(false), password: jsii.String("password"), username: jsii.String("username"), }, buildSpec: jsii.String("buildSpec"), customHeaders: jsii.String("customHeaders"), customRules: []interface{}{ &customRuleProperty{ source: jsii.String("source"), target: jsii.String("target"), // the properties below are optional condition: jsii.String("condition"), status: jsii.String("status"), }, }, description: jsii.String("description"), enableBranchAutoDeletion: jsii.Boolean(false), environmentVariables: []interface{}{ &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }, }, iamServiceRole: jsii.String("iamServiceRole"), oauthToken: jsii.String("oauthToken"), repository: jsii.String("repository"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, }
type CfnApp_AutoBranchCreationConfigProperty ¶
type CfnApp_AutoBranchCreationConfigProperty struct { // Automated branch creation glob patterns for the Amplify app. AutoBranchCreationPatterns *[]*string `field:"optional" json:"autoBranchCreationPatterns" yaml:"autoBranchCreationPatterns"` // Sets password protection for your auto created branch. BasicAuthConfig interface{} `field:"optional" json:"basicAuthConfig" yaml:"basicAuthConfig"` // The build specification (build spec) for the autocreated branch. // // *Length Constraints:* Minimum length of 1. Maximum length of 25000. BuildSpec *string `field:"optional" json:"buildSpec" yaml:"buildSpec"` // Enables automated branch creation for the Amplify app. EnableAutoBranchCreation interface{} `field:"optional" json:"enableAutoBranchCreation" yaml:"enableAutoBranchCreation"` // Enables auto building for the auto created branch. EnableAutoBuild interface{} `field:"optional" json:"enableAutoBuild" yaml:"enableAutoBuild"` // 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. EnablePerformanceMode interface{} `field:"optional" json:"enablePerformanceMode" yaml:"enablePerformanceMode"` // Sets whether pull request previews are enabled for each branch that Amplify Console automatically creates for your app. // // Amplify Console creates previews by deploying your app to a unique URL whenever a pull request is opened for the branch. Development and QA teams can use this preview to test the pull request before it's merged into a production or integration branch. // // To provide backend support for your preview, the Amplify Console automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the `PullRequestEnvironmentName` property. // // For more information, see [Web Previews](https://docs.aws.amazon.com/amplify/latest/userguide/pr-previews.html) in the *AWS Amplify Hosting User Guide* . EnablePullRequestPreview interface{} `field:"optional" json:"enablePullRequestPreview" yaml:"enablePullRequestPreview"` // Environment variables for the auto created branch. EnvironmentVariables interface{} `field:"optional" json:"environmentVariables" yaml:"environmentVariables"` // If pull request previews are enabled, you can use this property to specify a dedicated backend environment for your previews. // // For example, you could specify an environment named `prod` , `test` , or `dev` that you initialized with the Amplify CLI. // // To enable pull request previews, set the `EnablePullRequestPreview` property to `true` . // // If you don't specify an environment, the Amplify Console provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Console deletes this environment when the pull request is closed. // // For more information about creating backend environments, see [Feature Branch Deployments and Team Workflows](https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html) in the *AWS Amplify Hosting User Guide* . // // *Length Constraints:* Maximum length of 20. // // *Pattern:* (?s).* PullRequestEnvironmentName *string `field:"optional" json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"` // Stage for the auto created branch. Stage *string `field:"optional" json:"stage" yaml:"stage"` }
Use the AutoBranchCreationConfig property type to automatically create branches that match a certain pattern.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" autoBranchCreationConfigProperty := &autoBranchCreationConfigProperty{ autoBranchCreationPatterns: []*string{ jsii.String("autoBranchCreationPatterns"), }, basicAuthConfig: &basicAuthConfigProperty{ enableBasicAuth: jsii.Boolean(false), password: jsii.String("password"), username: jsii.String("username"), }, buildSpec: jsii.String("buildSpec"), enableAutoBranchCreation: jsii.Boolean(false), enableAutoBuild: jsii.Boolean(false), enablePerformanceMode: jsii.Boolean(false), enablePullRequestPreview: jsii.Boolean(false), environmentVariables: []interface{}{ &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }, }, pullRequestEnvironmentName: jsii.String("pullRequestEnvironmentName"), stage: jsii.String("stage"), }
type CfnApp_BasicAuthConfigProperty ¶
type CfnApp_BasicAuthConfigProperty struct { // Enables basic authorization for the Amplify app's branches. EnableBasicAuth interface{} `field:"optional" json:"enableBasicAuth" yaml:"enableBasicAuth"` // The password for basic authorization. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. Password *string `field:"optional" json:"password" yaml:"password"` // The user name for basic authorization. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. Username *string `field:"optional" json:"username" yaml:"username"` }
Use the BasicAuthConfig property type to set password protection at an app level to all your branches.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" basicAuthConfigProperty := &basicAuthConfigProperty{ enableBasicAuth: jsii.Boolean(false), password: jsii.String("password"), username: jsii.String("username"), }
type CfnApp_CustomRuleProperty ¶
type CfnApp_CustomRuleProperty struct { // The source pattern for a URL rewrite or redirect rule. // // *Length Constraints:* Minimum length of 1. Maximum length of 2048. // // *Pattern:* (?s).+ Source *string `field:"required" json:"source" yaml:"source"` // The target pattern for a URL rewrite or redirect rule. // // *Length Constraints:* Minimum length of 1. Maximum length of 2048. // // *Pattern:* (?s).+ Target *string `field:"required" json:"target" yaml:"target"` // The condition for a URL rewrite or redirect rule, such as a country code. // // *Length Constraints:* Minimum length of 0. Maximum length of 2048. // // *Pattern:* (?s).* Condition *string `field:"optional" json:"condition" yaml:"condition"` // The status code for a URL rewrite or redirect rule. // // - **200** - Represents a 200 rewrite rule. // - **301** - Represents a 301 (moved pemanently) redirect rule. This and all future requests should be directed to the target URL. // - **302** - Represents a 302 temporary redirect rule. // - **404** - Represents a 404 redirect rule. // - **404-200** - Represents a 404 rewrite rule. // // *Length Constraints:* Minimum length of 3. Maximum length of 7. // // *Pattern:* .{3,7} Status *string `field:"optional" json:"status" yaml:"status"` }
The CustomRule property type allows you to specify redirects, rewrites, and reverse proxies.
Redirects enable a web app to reroute navigation from one URL to another.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" customRuleProperty := &customRuleProperty{ source: jsii.String("source"), target: jsii.String("target"), // the properties below are optional condition: jsii.String("condition"), status: jsii.String("status"), }
type CfnApp_EnvironmentVariableProperty ¶
type CfnApp_EnvironmentVariableProperty struct { // The environment variable name. // // *Length Constraints:* Maximum length of 255. // // *Pattern:* (?s).* Name *string `field:"required" json:"name" yaml:"name"` // The environment variable value. // // *Length Constraints:* Maximum length of 5500. // // *Pattern:* (?s).* Value *string `field:"required" json:"value" yaml:"value"` }
Environment variables are key-value pairs that are available at build time.
Set environment variables for all branches in your app.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" environmentVariableProperty := &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }
type CfnBranch ¶
type CfnBranch interface { awscdk.CfnResource awscdk.IInspectable // The unique ID for an Amplify app. // // *Length Constraints:* Minimum length of 1. Maximum length of 20. // // *Pattern:* d[a-z0-9]+. AppId() *string SetAppId(val *string) // ARN for a branch, part of an Amplify App. AttrArn() *string // Name for a branch, part of an Amplify App. AttrBranchName() *string // The basic authorization credentials for a branch of an Amplify app. // // You must base64-encode the authorization credentials and provide them in the format `user:password` . BasicAuthConfig() interface{} SetBasicAuthConfig(val interface{}) // The name for the branch. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. // // *Pattern:* (?s).+ BranchName() *string SetBranchName(val *string) // The build specification (build spec) for the branch. // // *Length Constraints:* Minimum length of 1. Maximum length of 25000. // // *Pattern:* (?s).+ BuildSpec() *string SetBuildSpec(val *string) // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // The description for the branch that is part of an Amplify app. // // *Length Constraints:* Maximum length of 1000. // // *Pattern:* (?s).* Description() *string SetDescription(val *string) // Enables auto building for the branch. EnableAutoBuild() interface{} SetEnableAutoBuild(val interface{}) // 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. EnablePerformanceMode() interface{} SetEnablePerformanceMode(val interface{}) // Sets whether the Amplify Console creates a preview for each pull request that is made for this branch. // // If this property is enabled, the Amplify Console deploys your app to a unique preview URL after each pull request is opened. Development and QA teams can use this preview to test the pull request before it's merged into a production or integration branch. // // To provide backend support for your preview, the Amplify Console automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the `PullRequestEnvironmentName` property. // // For more information, see [Web Previews](https://docs.aws.amazon.com/amplify/latest/userguide/pr-previews.html) in the *AWS Amplify Hosting User Guide* . EnablePullRequestPreview() interface{} SetEnablePullRequestPreview(val interface{}) // The environment variables for the branch. EnvironmentVariables() interface{} SetEnvironmentVariables(val interface{}) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews. // // For example, you could specify an environment named `prod` , `test` , or `dev` that you initialized with the Amplify CLI and mapped to this branch. // // To enable pull request previews, set the `EnablePullRequestPreview` property to `true` . // // If you don't specify an environment, the Amplify Console provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Console deletes this environment when the pull request is closed. // // For more information about creating backend environments, see [Feature Branch Deployments and Team Workflows](https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html) in the *AWS Amplify Hosting User Guide* . // // *Length Constraints:* Maximum length of 20. // // *Pattern:* (?s).* PullRequestEnvironmentName() *string SetPullRequestEnvironmentName(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // Describes the current stage for the branch. // // *Valid Values:* PRODUCTION | BETA | DEVELOPMENT | EXPERIMENTAL | PULL_REQUEST. Stage() *string SetStage(val *string) // The tag for the branch. Tags() awscdk.TagManager // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // 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, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Amplify::Branch`.
The AWS::Amplify::Branch resource creates a new branch within an app.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnBranch := awscdk.Aws_amplify.NewCfnBranch(this, jsii.String("MyCfnBranch"), &cfnBranchProps{ appId: jsii.String("appId"), branchName: jsii.String("branchName"), // the properties below are optional basicAuthConfig: &basicAuthConfigProperty{ password: jsii.String("password"), username: jsii.String("username"), // the properties below are optional enableBasicAuth: jsii.Boolean(false), }, buildSpec: jsii.String("buildSpec"), description: jsii.String("description"), enableAutoBuild: jsii.Boolean(false), enablePerformanceMode: jsii.Boolean(false), enablePullRequestPreview: jsii.Boolean(false), environmentVariables: []interface{}{ &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }, }, pullRequestEnvironmentName: jsii.String("pullRequestEnvironmentName"), stage: jsii.String("stage"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, })
func NewCfnBranch ¶
func NewCfnBranch(scope awscdk.Construct, id *string, props *CfnBranchProps) CfnBranch
Create a new `AWS::Amplify::Branch`.
type CfnBranchProps ¶
type CfnBranchProps struct { // The unique ID for an Amplify app. // // *Length Constraints:* Minimum length of 1. Maximum length of 20. // // *Pattern:* d[a-z0-9]+. AppId *string `field:"required" json:"appId" yaml:"appId"` // The name for the branch. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. // // *Pattern:* (?s).+ BranchName *string `field:"required" json:"branchName" yaml:"branchName"` // The basic authorization credentials for a branch of an Amplify app. // // You must base64-encode the authorization credentials and provide them in the format `user:password` . BasicAuthConfig interface{} `field:"optional" json:"basicAuthConfig" yaml:"basicAuthConfig"` // The build specification (build spec) for the branch. // // *Length Constraints:* Minimum length of 1. Maximum length of 25000. // // *Pattern:* (?s).+ BuildSpec *string `field:"optional" json:"buildSpec" yaml:"buildSpec"` // The description for the branch that is part of an Amplify app. // // *Length Constraints:* Maximum length of 1000. // // *Pattern:* (?s).* Description *string `field:"optional" json:"description" yaml:"description"` // Enables auto building for the branch. EnableAutoBuild interface{} `field:"optional" json:"enableAutoBuild" yaml:"enableAutoBuild"` // 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. EnablePerformanceMode interface{} `field:"optional" json:"enablePerformanceMode" yaml:"enablePerformanceMode"` // Sets whether the Amplify Console creates a preview for each pull request that is made for this branch. // // If this property is enabled, the Amplify Console deploys your app to a unique preview URL after each pull request is opened. Development and QA teams can use this preview to test the pull request before it's merged into a production or integration branch. // // To provide backend support for your preview, the Amplify Console automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the `PullRequestEnvironmentName` property. // // For more information, see [Web Previews](https://docs.aws.amazon.com/amplify/latest/userguide/pr-previews.html) in the *AWS Amplify Hosting User Guide* . EnablePullRequestPreview interface{} `field:"optional" json:"enablePullRequestPreview" yaml:"enablePullRequestPreview"` // The environment variables for the branch. EnvironmentVariables interface{} `field:"optional" json:"environmentVariables" yaml:"environmentVariables"` // If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews. // // For example, you could specify an environment named `prod` , `test` , or `dev` that you initialized with the Amplify CLI and mapped to this branch. // // To enable pull request previews, set the `EnablePullRequestPreview` property to `true` . // // If you don't specify an environment, the Amplify Console provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Console deletes this environment when the pull request is closed. // // For more information about creating backend environments, see [Feature Branch Deployments and Team Workflows](https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html) in the *AWS Amplify Hosting User Guide* . // // *Length Constraints:* Maximum length of 20. // // *Pattern:* (?s).* PullRequestEnvironmentName *string `field:"optional" json:"pullRequestEnvironmentName" yaml:"pullRequestEnvironmentName"` // Describes the current stage for the branch. // // *Valid Values:* PRODUCTION | BETA | DEVELOPMENT | EXPERIMENTAL | PULL_REQUEST. Stage *string `field:"optional" json:"stage" yaml:"stage"` // The tag for the branch. Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnBranch`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnBranchProps := &cfnBranchProps{ appId: jsii.String("appId"), branchName: jsii.String("branchName"), // the properties below are optional basicAuthConfig: &basicAuthConfigProperty{ password: jsii.String("password"), username: jsii.String("username"), // the properties below are optional enableBasicAuth: jsii.Boolean(false), }, buildSpec: jsii.String("buildSpec"), description: jsii.String("description"), enableAutoBuild: jsii.Boolean(false), enablePerformanceMode: jsii.Boolean(false), enablePullRequestPreview: jsii.Boolean(false), environmentVariables: []interface{}{ &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }, }, pullRequestEnvironmentName: jsii.String("pullRequestEnvironmentName"), stage: jsii.String("stage"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, }
type CfnBranch_BasicAuthConfigProperty ¶
type CfnBranch_BasicAuthConfigProperty struct { // The password for basic authorization. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. Password *string `field:"required" json:"password" yaml:"password"` // The user name for basic authorization. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. Username *string `field:"required" json:"username" yaml:"username"` // Enables basic authorization for the branch. EnableBasicAuth interface{} `field:"optional" json:"enableBasicAuth" yaml:"enableBasicAuth"` }
Use the BasicAuthConfig property type to set password protection for a specific branch.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" basicAuthConfigProperty := &basicAuthConfigProperty{ password: jsii.String("password"), username: jsii.String("username"), // the properties below are optional enableBasicAuth: jsii.Boolean(false), }
type CfnBranch_EnvironmentVariableProperty ¶
type CfnBranch_EnvironmentVariableProperty struct { // The environment variable name. // // *Length Constraints:* Maximum length of 255. // // *Pattern:* (?s).* Name *string `field:"required" json:"name" yaml:"name"` // The environment variable value. // // *Length Constraints:* Maximum length of 5500. // // *Pattern:* (?s).* Value *string `field:"required" json:"value" yaml:"value"` }
The EnvironmentVariable property type sets environment variables for a specific branch.
Environment variables are key-value pairs that are available at build time.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" environmentVariableProperty := &environmentVariableProperty{ name: jsii.String("name"), value: jsii.String("value"), }
type CfnDomain ¶
type CfnDomain interface { awscdk.CfnResource awscdk.IInspectable // The unique ID for an Amplify app. // // *Length Constraints:* Minimum length of 1. Maximum length of 20. // // *Pattern:* d[a-z0-9]+. AppId() *string SetAppId(val *string) // ARN for the Domain Association. AttrArn() *string // Branch patterns for the automatically created subdomain. AttrAutoSubDomainCreationPatterns() *[]*string // The IAM service role for the subdomain. AttrAutoSubDomainIamRole() *string // DNS Record for certificate verification. AttrCertificateRecord() *string // Name of the domain. AttrDomainName() *string // Status for the Domain Association. AttrDomainStatus() *string // Specifies whether the automated creation of subdomains for branches is enabled. AttrEnableAutoSubDomain() awscdk.IResolvable // Reason for the current status of the domain. AttrStatusReason() *string // Sets the branch patterns for automatic subdomain creation. AutoSubDomainCreationPatterns() *[]*string SetAutoSubDomainCreationPatterns(val *[]*string) // The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains. // // *Length Constraints:* Maximum length of 1000. // // *Pattern:* ^$|^arn:aws:iam::\d{12}:role.+ AutoSubDomainIamRole() *string SetAutoSubDomainIamRole(val *string) // Options for this resource, such as condition, update policy etc. // Experimental. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. // Experimental. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. // Experimental. CreationStack() *[]*string // The domain name for the domain association. // // *Length Constraints:* Maximum length of 255. // // *Pattern:* ^(((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9])\.)+((?!-)[A-Za-z0-9-]{1,62}[A-Za-z0-9])(\.)?$ DomainName() *string SetDomainName(val *string) // Enables the automated creation of subdomains for branches. EnableAutoSubDomain() interface{} SetEnableAutoSubDomain(val interface{}) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. // Experimental. LogicalId() *string // The construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. // Experimental. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). // Experimental. Stack() awscdk.Stack // The setting for the subdomain. SubDomainSettings() interface{} SetSubDomainSettings(val interface{}) // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. // Experimental. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. // Experimental. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. // Experimental. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. // Experimental. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. // Experimental. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. // Experimental. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // 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, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. // Experimental. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // // Experimental. GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Overrides the auto-generated logical ID with a specific ID. // Experimental. OverrideLogicalId(newLogicalId *string) // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. // Experimental. ShouldSynthesize() *bool // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // // Returns: a string representation of this resource. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. Validate() *[]*string // Experimental. ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Amplify::Domain`.
The AWS::Amplify::Domain resource allows you to connect a custom domain to your app.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnDomain := awscdk.Aws_amplify.NewCfnDomain(this, jsii.String("MyCfnDomain"), &cfnDomainProps{ appId: jsii.String("appId"), domainName: jsii.String("domainName"), subDomainSettings: []interface{}{ &subDomainSettingProperty{ branchName: jsii.String("branchName"), prefix: jsii.String("prefix"), }, }, // the properties below are optional autoSubDomainCreationPatterns: []*string{ jsii.String("autoSubDomainCreationPatterns"), }, autoSubDomainIamRole: jsii.String("autoSubDomainIamRole"), enableAutoSubDomain: jsii.Boolean(false), })
func NewCfnDomain ¶
func NewCfnDomain(scope awscdk.Construct, id *string, props *CfnDomainProps) CfnDomain
Create a new `AWS::Amplify::Domain`.
type CfnDomainProps ¶
type CfnDomainProps struct { // The unique ID for an Amplify app. // // *Length Constraints:* Minimum length of 1. Maximum length of 20. // // *Pattern:* d[a-z0-9]+. AppId *string `field:"required" json:"appId" yaml:"appId"` // The domain name for the domain association. // // *Length Constraints:* Maximum length of 255. // // *Pattern:* ^(((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9])\.)+((?!-)[A-Za-z0-9-]{1,62}[A-Za-z0-9])(\.)?$ DomainName *string `field:"required" json:"domainName" yaml:"domainName"` // The setting for the subdomain. SubDomainSettings interface{} `field:"required" json:"subDomainSettings" yaml:"subDomainSettings"` // Sets the branch patterns for automatic subdomain creation. AutoSubDomainCreationPatterns *[]*string `field:"optional" json:"autoSubDomainCreationPatterns" yaml:"autoSubDomainCreationPatterns"` // The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains. // // *Length Constraints:* Maximum length of 1000. // // *Pattern:* ^$|^arn:aws:iam::\d{12}:role.+ AutoSubDomainIamRole *string `field:"optional" json:"autoSubDomainIamRole" yaml:"autoSubDomainIamRole"` // Enables the automated creation of subdomains for branches. EnableAutoSubDomain interface{} `field:"optional" json:"enableAutoSubDomain" yaml:"enableAutoSubDomain"` }
Properties for defining a `CfnDomain`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnDomainProps := &cfnDomainProps{ appId: jsii.String("appId"), domainName: jsii.String("domainName"), subDomainSettings: []interface{}{ &subDomainSettingProperty{ branchName: jsii.String("branchName"), prefix: jsii.String("prefix"), }, }, // the properties below are optional autoSubDomainCreationPatterns: []*string{ jsii.String("autoSubDomainCreationPatterns"), }, autoSubDomainIamRole: jsii.String("autoSubDomainIamRole"), enableAutoSubDomain: jsii.Boolean(false), }
type CfnDomain_SubDomainSettingProperty ¶
type CfnDomain_SubDomainSettingProperty struct { // The branch name setting for the subdomain. // // *Length Constraints:* Minimum length of 1. Maximum length of 255. // // *Pattern:* (?s).+ BranchName *string `field:"required" json:"branchName" yaml:"branchName"` // The prefix setting for the subdomain. // // *Length Constraints:* Maximum length of 255. // // *Pattern:* (?s).* Prefix *string `field:"required" json:"prefix" yaml:"prefix"` }
The SubDomainSetting property type enables you to connect a subdomain (for example, example.exampledomain.com) to a specific branch.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" subDomainSettingProperty := &subDomainSettingProperty{ branchName: jsii.String("branchName"), prefix: jsii.String("prefix"), }
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"` }
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 "github.com/aws/aws-cdk-go/awscdk" 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
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 // // 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 // // Experimental. Status RedirectStatus `field:"optional" json:"status" yaml:"status"` }
Options for a custom rewrite/redirect rule for an Amplify App.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" customRuleOptions := &customRuleOptions{ source: jsii.String("source"), target: jsii.String("target"), // the properties below are optional condition: jsii.String("condition"), status: awscdk.Aws_amplify.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 construct tree node associated with this construct. // Experimental. Node() awscdk.ConstructNode // 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 // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. OnPrepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. OnSynthesize(session constructs.ISynthesisSession) // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if the construct is valid. // Experimental. OnValidate() *[]*string // Perform final modifications before synthesis. // // This method can be implemented by derived constructs in order to perform // final changes before synthesis. prepare() will be called after child // constructs have been prepared. // // This is an advanced framework feature. Only use this if you // understand the implications. // Experimental. Prepare() // Allows this construct to emit artifacts into the cloud assembly during synthesis. // // This method is usually implemented by framework-level constructs such as `Stack` and `Asset` // as they participate in synthesizing the cloud assembly. // Experimental. Synthesize(session awscdk.ISynthesisSession) // Returns a string representation of this construct. // Experimental. ToString() *string // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // Experimental. Validate() *[]*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 `field:"optional" json:"autoSubdomainCreationPatterns" yaml:"autoSubdomainCreationPatterns"` // The name of the domain. // Experimental. DomainName *string `field:"optional" json:"domainName" yaml:"domainName"` // Automatically create subdomains for connected branches. // Experimental. EnableAutoSubdomain *bool `field:"optional" json:"enableAutoSubdomain" yaml:"enableAutoSubdomain"` // Subdomains. // Experimental. SubDomains *[]*SubDomain `field:"optional" 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 `field:"optional" json:"autoSubdomainCreationPatterns" yaml:"autoSubdomainCreationPatterns"` // The name of the domain. // Experimental. DomainName *string `field:"optional" json:"domainName" yaml:"domainName"` // Automatically create subdomains for connected branches. // Experimental. EnableAutoSubdomain *bool `field:"optional" json:"enableAutoSubdomain" yaml:"enableAutoSubdomain"` // 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. // 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 "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" 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: 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.
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("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 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 ¶
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 ¶
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 `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. // 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. // 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 monocdk "github.com/aws/aws-cdk-go/awscdk" import "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. // 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 "github.com/aws/aws-cdk-go/awscdk" var branch branch subDomain := &subDomain{ branch: branch, // the properties below are optional prefix: jsii.String("prefix"), }
Experimental.