appstagingsynthesizeralpha

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

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

App Staging Synthesizer

---

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


This library includes constructs aimed at replacing the current model of bootstrapping and providing greater control of the bootstrap experience to the CDK user. The important constructs in this library are as follows:

  • the IStagingResources interface: a framework for an app-level bootstrap stack that handles file assets and docker assets.
  • the DefaultStagingStack, which is a works-out-of-the-box implementation of the IStagingResources interface.
  • the AppStagingSynthesizer, a new CDK synthesizer that will synthesize CDK applications with the staging resources provided.

As this library is experimental, there are features that are not yet implemented. Please look at the list of Known Limitations before getting started.

To get started, update your CDK App with a new defaultStackSynthesizer:

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		 // put a unique id here
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
	}),
})

This will introduce a DefaultStagingStack in your CDK App and staging assets of your App will live in the resources from that stack rather than the CDK Bootstrap stack.

If you are migrating from a different version of synthesis your updated CDK App will target the resources in the DefaultStagingStack and no longer be tied to the bootstrapped resources in your account.

Bootstrap Model

In our default bootstrapping process, when you run cdk bootstrap aws://<account>/<region>, the following resources are created:

  • It creates Roles to assume for cross-account deployments and for Pipeline deployments;
  • It creates staging resources: a global S3 bucket and global ECR repository to hold CDK assets;
  • It creates Roles to write to the S3 bucket and ECR repository;

Because the bootstrapping resources include regional resources, you need to bootstrap every region you plan to deploy to individually. All assets of all CDK apps deploying to that account and region will be written to the single S3 Bucket and ECR repository.

By using the synthesizer in this library, instead of the DefaultStackSynthesizer, a different set of staging resources will be created for every CDK application, and they will be created automatically as part of a regular deployment, in a separate Stack that is deployed before your application Stacks. The staging resources will be one S3 bucket, and one ECR repository per image, and Roles necessary to access those buckets and ECR repositories. The Roles from the default bootstrap stack are still used (though their use can be turned off).

This has the following advantages:

  • Because staging resources are now application-specific, they can be fully cleaned up when you clean up the application.
  • Because there is now one ECR repository per image instead of one ECR repository for all images, it is possible to effectively use ECR life cycle rules (for example, retain only the most recent 5 images) to cut down on storage costs.
  • Resources between separate CDK Apps are separated so they can be cleaned up and lifecycle controlled individually.
  • Because the only shared bootstrapping resources required are Roles, which are global resources, you now only need to bootstrap every account in one Region (instead of every Region). This makes it easier to do with CloudFormation StackSets.

For the deployment roles, this synthesizer still uses the Roles from the default bootstrap stack, and nothing else. The staging resources from that bootstrap stack will be unused. You can customize the template to remove those resources if you prefer. In the future, we will provide a bootstrap stack template with only those Roles, specifically for use with this synthesizer.

Using the Default Staging Stack per Environment

The most common use case will be to use the built-in default resources. In this scenario, the synthesizer will create a new Staging Stack in each environment the CDK App is deployed to store its staging resources. To use this kind of synthesizer, use AppStagingSynthesizer.defaultResources().

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,

		// The following line is optional. By default it is assumed you have bootstrapped in the same
		// region(s) as the stack(s) you are deploying.
		DeploymentIdentities: appstagingsynthesizeralpha.DeploymentIdentities_DefaultBootstrapRoles(&DefaultBootstrapRolesOptions{
			BootstrapRegion: jsii.String("us-east-1"),
		}),
	}),
})

Every CDK App that uses the DefaultStagingStack must include an appId. This should be an identifier unique to the app and is used to differentiate staging resources associated with the app.

Default Staging Stack

The Default Staging Stack includes all the staging resources necessary for CDK Assets. The below example is of a CDK App using the AppStagingSynthesizer and creating a file asset for the Lambda Function source code. As part of the DefaultStagingStack, an S3 bucket and IAM role will be created that will be used to upload the asset to S3.

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
	}),
})

stack := awscdk.Newstack(app, jsii.String("my-stack"))

lambda.NewFunction(stack, jsii.String("lambda"), &FunctionProps{
	Code: lambda.AssetCode_FromAsset(path.join(__dirname, jsii.String("assets"))),
	Handler: jsii.String("index.handler"),
	Runtime: lambda.Runtime_PYTHON_3_9(),
})

app.Synth()
Custom Roles

You can customize some or all of the roles you'd like to use in the synthesizer as well, if all you need is to supply custom roles (and not change anything else in the DefaultStagingStack):

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		DeploymentIdentities: appstagingsynthesizeralpha.DeploymentIdentities_SpecifyRoles(&BootstrapRoles{
			CloudFormationExecutionRole: appstagingsynthesizeralpha.BootstrapRole_FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Execute")),
			DeploymentRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Deploy")),
			LookupRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Lookup")),
		}),
	}),
})

Or, you can ask to use the CLI credentials that exist at deploy-time. These credentials must have the ability to perform CloudFormation calls, lookup resources in your account, and perform CloudFormation deployment. For a full list of what is necessary, see LookupRole, DeploymentActionRole, and CloudFormationExecutionRole in the bootstrap template.

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		DeploymentIdentities: appstagingsynthesizeralpha.DeploymentIdentities_CliCredentials(),
	}),
})

The default staging stack will create roles to publish to the S3 bucket and ECR repositories, assumable by the deployment role. You can also specify an existing IAM role for the fileAssetPublishingRole or imageAssetPublishingRole:

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		FileAssetPublishingRole: appstagingsynthesizeralpha.BootstrapRole_FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/S3Access")),
		ImageAssetPublishingRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/ECRAccess")),
	}),
})
Deploy Time S3 Assets

There are two types of assets:

  • Assets used only during deployment. These are used to hand off a large piece of data to another service, that will make a private copy of that data. After deployment, the asset is only necessary for a potential future rollback.
  • Assets accessed throughout the running life time of the application.

Examples of assets that are only used at deploy time are CloudFormation Templates and Lambda Code bundles. Examples of assets accessed throughout the life time of the application are script files downloaded to run in a CodeBuild Project, or on EC2 instance startup. ECR images are always application life-time assets. S3 deploy time assets are stored with a deploy-time/ prefix, and a lifecycle rule will collect them after a configurable number of days.

Lambda assets are by default marked as deploy time assets:

var stack Stack

lambda.NewFunction(stack, jsii.String("lambda"), &FunctionProps{
	Code: lambda.AssetCode_FromAsset(path.join(__dirname, jsii.String("assets"))),
	 // lambda marks deployTime = true
	Handler: jsii.String("index.handler"),
	Runtime: lambda.Runtime_PYTHON_3_9(),
})

Or, if you want to create your own deploy time asset:

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

var stack Stack

asset := awscdk.NewAsset(stack, jsii.String("deploy-time-asset"), &AssetProps{
	DeployTime: jsii.Boolean(true),
	Path: path.join(__dirname, jsii.String("deploy-time-asset")),
})

By default, we store deploy time assets for 30 days, but you can change this number by specifying deployTimeFileAssetLifetime. The number you specify here is how long you will be able to roll back to a previous version of an application just by doing a CloudFormation deployment with the old template, without rebuilding and republishing assets.

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		DeployTimeFileAssetLifetime: awscdk.Duration_Days(jsii.Number(100)),
	}),
})
Lifecycle Rules on ECR Repositories

By default, we store a maximum of 3 revisions of a particular docker image asset. This allows for smooth faciliation of rollback scenarios where we may reference previous versions of an image. When more than 3 revisions of an asset exist in the ECR repository, the oldest one is purged.

To change the number of revisions stored, use imageAssetVersionCount:

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		ImageAssetVersionCount: jsii.Number(10),
	}),
})
Auto Delete Staging Assets on Deletion

By default, the staging resources will be cleaned up on stack deletion. That means that the S3 Bucket and ECR Repositories are set to RemovalPolicy.DESTROY and have autoDeleteObjects or emptyOnDelete turned on. This creates custom resources under the hood to facilitate cleanup. To turn this off, specify autoDeleteStagingAssets: false.

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


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		AutoDeleteStagingAssets: jsii.Boolean(false),
	}),
})
Staging Bucket Encryption

You must explicitly specify the encryption type for the staging bucket via the stagingBucketEncryption property. In future versions of this package, the default will be BucketEncryption.S3_MANAGED.

In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3 managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.

If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.

You can learn more about choosing a bucket encryption type in the S3 documentation.

Using a Custom Staging Stack per Environment

If you want to customize some behavior that is not configurable via properties, you can implement your own class that implements IStagingResources. To get a head start, you can subclass DefaultStagingStack.

type customStagingStackOptions struct {
	DefaultStagingStackOptions
}

type customStagingStack struct {
	DefaultStagingStack
}

Or you can roll your own staging resources from scratch, as long as it implements IStagingResources.

type customStagingStackProps struct {
	StackProps
}

type customStagingStack struct {
	Stack
}

func newCustomStagingStack(scope Construct, id *string, props customStagingStackProps) *customStagingStack {
	this := &customStagingStack{}
	newStack_Override(this, scope, id, props)
	return this
}

func (this *customStagingStack) addFile(asset FileAssetSource) FileStagingLocation {
	return &FileStagingLocation{
		BucketName: jsii.String("amzn-s3-demo-bucket"),
		AssumeRoleArn: jsii.String("myArn"),
		DependencyStack: this,
	}
}

func (this *customStagingStack) addDockerImage(asset DockerImageAssetSource) ImageStagingLocation {
	return &ImageStagingLocation{
		RepoName: jsii.String("myRepo"),
		AssumeRoleArn: jsii.String("myArn"),
		DependencyStack: this,
	}
}

Using your custom staging resources means implementing a CustomFactory class and calling the AppStagingSynthesizer.customFactory() static method. This has the benefit of providing a custom Staging Stack that can be created in every environment the CDK App is deployed to.

type customFactory struct {
}

func (this *customFactory) obtainStagingResources(stack Stack, context ObtainStagingResourcesContext) customStagingStack {
	myApp := awscdk.App_Of(*stack)

	return NewCustomStagingStack(myApp, fmt.Sprintf("CustomStagingStack-%v", *context.EnvironmentString), &customStagingStackProps{
	})
}

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_CustomFactory(&CustomFactoryOptions{
		Factory: NewCustomFactory(),
		OncePerEnv: jsii.Boolean(true),
	}),
})

Using an Existing Staging Stack

Use AppStagingSynthesizer.customResources() to supply an existing stack as the Staging Stack. Make sure that the custom stack you provide implements IStagingResources.

resourceApp := awscdk.NewApp()
resources := NewCustomStagingStack(resourceApp, jsii.String("CustomStagingStack"), &customStagingStackProps{
})

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_CustomResources(&CustomResourcesOptions{
		Resources: *Resources,
	}),
})

Known Limitations

Since this module is experimental, there are some known limitations:

  • Currently this module does not support CDK Pipelines. You must deploy CDK Apps using this synthesizer via cdk deploy. Please upvote this issue to indicate you want this.
  • This synthesizer only needs a bootstrap stack with Roles, without staging resources. We haven't written such a bootstrap stack yet; at the moment you can use the existing modern bootstrap stack, the staging resources in them will just go unused. You can customize the template to remove them if desired.
  • Due to limitations on the CloudFormation template size, CDK Applications can have at most 20 independent ECR images. Please upvote this issue if you need more than this.

Documentation

Overview

Cdk synthesizer for with app-scoped staging stack

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppStagingSynthesizer_DEFAULT_CLOUDFORMATION_ROLE_ARN

func AppStagingSynthesizer_DEFAULT_CLOUDFORMATION_ROLE_ARN() *string

func AppStagingSynthesizer_DEFAULT_DEPLOY_ROLE_ARN

func AppStagingSynthesizer_DEFAULT_DEPLOY_ROLE_ARN() *string

func AppStagingSynthesizer_DEFAULT_LOOKUP_ROLE_ARN

func AppStagingSynthesizer_DEFAULT_LOOKUP_ROLE_ARN() *string

func AppStagingSynthesizer_DEFAULT_QUALIFIER

func AppStagingSynthesizer_DEFAULT_QUALIFIER() *string

func DefaultStagingStack_ConsumeListReference

func DefaultStagingStack_ConsumeListReference(value *[]*string, strength awscdk.ReferenceStrength) *[]*string

Override the reference strength for a specific cross-stack string list reference.

This is the string list equivalent of `consumeReference`.

Returns: A token that resolves to the same value but uses the overridden strength. Experimental.

func DefaultStagingStack_ConsumeReference

func DefaultStagingStack_ConsumeReference(value *string, strength awscdk.ReferenceStrength) *string

Override the reference strength for a specific cross-stack reference value.

Use this to weaken (or strengthen) an individual reference without affecting other references to the same resource. For example:

```ts // producerStack defines an SNS topic declare const topic: sns.Topic;

// consumerStack subscribes to it with a weak reference, // so the producer can be torn down without blocking on this consumer

const consumerStack = new Stack(app, 'Consumer', {
  env: { account: '123456789012', region: 'us-east-1' },
});
new sns.Subscription(consumerStack, 'Subscription', {
  topic: sns.Topic.fromTopicArn(consumerStack, 'Topic', Stack.consumeReference(topic.topicArn)),
  endpoint: 'https://example.com/webhook',
  protocol: sns.SubscriptionProtocol.HTTPS,
});

```.

Returns: A token that resolves to the same value but uses the overridden strength. Experimental.

func DefaultStagingStack_IsConstruct

func DefaultStagingStack_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func DefaultStagingStack_IsStack

func DefaultStagingStack_IsStack(x interface{}) *bool

Return whether the given object is a Stack.

We do attribute detection since we can't reliably use 'instanceof'. Experimental.

func DefaultStagingStack_Of

func DefaultStagingStack_Of(construct constructs.IConstruct) awscdk.Stack

Looks up the first stack scope in which `construct` is defined.

Fails if there is no stack up the tree.

Will return the closest containing `Stack` or `NestedStack`. Experimental.

func NewDefaultStagingStack_Override

func NewDefaultStagingStack_Override(d DefaultStagingStack, scope awscdk.App, id *string, props *DefaultStagingStackProps)

Experimental.

func NewUsingAppStagingSynthesizer_Override

func NewUsingAppStagingSynthesizer_Override(u UsingAppStagingSynthesizer, scope constructs.Construct, id *string)

Experimental.

func UsingAppStagingSynthesizer_IsConstruct

func UsingAppStagingSynthesizer_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

Types

type AppStagingSynthesizer

type AppStagingSynthesizer interface {
	awscdk.StackSynthesizer
	awscdk.IReusableStackSynthesizer
	// The qualifier used to bootstrap this stack.
	// Experimental.
	BootstrapQualifier() *string
	// Retrieve the bound stack.
	//
	// Fails if the stack hasn't been bound yet.
	// Experimental.
	BoundStack() awscdk.Stack
	// The role that is passed to CloudFormation to execute the change set.
	// Experimental.
	CloudFormationExecutionRole() *string
	// The role used to lookup for this stack.
	// Experimental.
	LookupRole() *string
	// Add a CfnRule to the bound stack that checks whether an SSM parameter exceeds a given version.
	//
	// This will modify the template, so must be called before the stack is synthesized.
	// Experimental.
	AddBootstrapVersionRule(requiredVersion *float64, bootstrapStackVersionSsmParameter *string)
	// Implemented for legacy purposes;
	//
	// this will never be called.
	// Experimental.
	AddDockerImageAsset(asset *awscdk.DockerImageAssetSource) *awscdk.DockerImageAssetLocation
	// Implemented for legacy purposes;
	//
	// this will never be called.
	// Experimental.
	AddFileAsset(asset *awscdk.FileAssetSource) *awscdk.FileAssetLocation
	// Implemented for legacy purposes;
	//
	// this will never be called.
	// Experimental.
	Bind(stack awscdk.Stack)
	// Turn a docker asset location into a CloudFormation representation of that location.
	//
	// If any of the fields contain placeholders, the result will be wrapped in a `Fn.sub`.
	// Experimental.
	CloudFormationLocationFromDockerImageAsset(dest *cloudassemblyschema.DockerImageDestination) *awscdk.DockerImageAssetLocation
	// Turn a file asset location into a CloudFormation representation of that location.
	//
	// If any of the fields contain placeholders, the result will be wrapped in a `Fn.sub`.
	// Experimental.
	CloudFormationLocationFromFileAsset(location *cloudassemblyschema.FileDestination) *awscdk.FileAssetLocation
	// Write the CloudFormation stack artifact to the session.
	//
	// Use default settings to add a CloudFormationStackArtifact artifact to
	// the given synthesis session. The Stack artifact will control the settings for the
	// CloudFormation deployment.
	// Experimental.
	EmitArtifact(session awscdk.ISynthesisSession, options *awscdk.SynthesizeStackArtifactOptions)
	// Write the stack artifact to the session.
	//
	// Use default settings to add a CloudFormationStackArtifact artifact to
	// the given synthesis session.
	// Deprecated: Use `emitArtifact` instead.
	EmitStackArtifact(stack awscdk.Stack, session awscdk.ISynthesisSession, options *awscdk.SynthesizeStackArtifactOptions)
	// Returns a version of the synthesizer bound to a stack.
	// Experimental.
	ReusableBind(stack awscdk.Stack) awscdk.IBoundStackSynthesizer
	// Implemented for legacy purposes;
	//
	// this will never be called.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Have the stack write out its template.
	// Deprecated: Use `synthesizeTemplate` instead.
	SynthesizeStackTemplate(stack awscdk.Stack, session awscdk.ISynthesisSession)
	// Write the stack template to the given session.
	//
	// Return a descriptor that represents the stack template as a file asset
	// source, for adding to an asset manifest (if desired). This can be used to
	// have the asset manifest system (`cdk-assets`) upload the template to S3
	// using the appropriate role, so that afterwards only a CloudFormation
	// deployment is necessary.
	//
	// If the template is uploaded as an asset, the `stackTemplateAssetObjectUrl`
	// property should be set when calling `emitArtifact.`
	//
	// If the template is *NOT* uploaded as an asset first and the template turns
	// out to be >50KB, it will need to be uploaded to S3 anyway. At that point
	// the credentials will be the same identity that is doing the `UpdateStack`
	// call, which may not have the right permissions to write to S3.
	// Experimental.
	SynthesizeTemplate(session awscdk.ISynthesisSession, lookupRoleArn *string, lookupRoleExternalId *string, lookupRoleAdditionalOptions *map[string]interface{}) *awscdk.FileAssetSource
}

App Staging Synthesizer.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import app_staging_synthesizer_alpha "github.com/aws/aws-cdk-go/appstagingsynthesizeralpha"

var deploymentIdentities DeploymentIdentities
var stagingResourcesFactory IStagingResourcesFactory

appStagingSynthesizer := app_staging_synthesizer_alpha.AppStagingSynthesizer_CustomFactory(&CustomFactoryOptions{
	Factory: stagingResourcesFactory,

	// the properties below are optional
	BootstrapQualifier: jsii.String("bootstrapQualifier"),
	DeploymentIdentities: deploymentIdentities,
	OncePerEnv: jsii.Boolean(false),
})

Experimental.

func AppStagingSynthesizer_CustomFactory

func AppStagingSynthesizer_CustomFactory(options *CustomFactoryOptions) AppStagingSynthesizer

Supply your own stagingStackFactory method for creating an IStagingStack when a stack is bound to the synthesizer.

By default, `oncePerEnv = true`, which means that a new instance of the IStagingStack will be created in new environments. Set `oncePerEnv = false` to turn off that behavior. Experimental.

func AppStagingSynthesizer_CustomResources

func AppStagingSynthesizer_CustomResources(options *CustomResourcesOptions) AppStagingSynthesizer

Use these exact staging resources for every stack that this synthesizer is used for. Experimental.

func AppStagingSynthesizer_DefaultResources

func AppStagingSynthesizer_DefaultResources(options *DefaultResourcesOptions) AppStagingSynthesizer

Use the Default Staging Resources, creating a single stack per environment this app is deployed in. Experimental.

type AppStagingSynthesizerOptions

type AppStagingSynthesizerOptions struct {
	// Qualifier to disambiguate multiple bootstrapped environments in the same account.
	//
	// This qualifier is only used to reference bootstrapped resources. It will not
	// be used in the creation of app-specific staging resources: `appId` is used for that
	// instead.
	// Default: - Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise `DEFAULT_QUALIFIER`.
	//
	// Experimental.
	BootstrapQualifier *string `field:"optional" json:"bootstrapQualifier" yaml:"bootstrapQualifier"`
	// What roles to use to deploy applications.
	//
	// These are the roles that have permissions to interact with CloudFormation
	// on your behalf. By default these are the standard bootstrapped CDK roles,
	// but you can customize them or turn them off and use the CLI credentials
	// to deploy.
	// Default: - The standard bootstrapped CDK roles.
	//
	// Experimental.
	DeploymentIdentities DeploymentIdentities `field:"optional" json:"deploymentIdentities" yaml:"deploymentIdentities"`
}

Options that apply to all AppStagingSynthesizer variants.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import app_staging_synthesizer_alpha "github.com/aws/aws-cdk-go/appstagingsynthesizeralpha"

var deploymentIdentities DeploymentIdentities

appStagingSynthesizerOptions := &AppStagingSynthesizerOptions{
	BootstrapQualifier: jsii.String("bootstrapQualifier"),
	DeploymentIdentities: deploymentIdentities,
}

Experimental.

type BootstrapRole

type BootstrapRole interface {
	// Whether or not this is object was created using BootstrapRole.cliCredentials().
	// Experimental.
	IsCliCredentials() *bool
}

Bootstrapped role specifier.

These roles must exist already. This class does not create new IAM Roles.

Example:

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

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		DeploymentIdentities: appstagingsynthesizeralpha.DeploymentIdentities_SpecifyRoles(&BootstrapRoles{
			CloudFormationExecutionRole: appstagingsynthesizeralpha.BootstrapRole_FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Execute")),
			DeploymentRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Deploy")),
			LookupRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Lookup")),
		}),
	}),
})

Experimental.

func BootstrapRole_CliCredentials

func BootstrapRole_CliCredentials() BootstrapRole

Use the currently assumed role/credentials. Experimental.

func BootstrapRole_FromRoleArn

func BootstrapRole_FromRoleArn(arn *string) BootstrapRole

Specify an existing IAM Role to assume. Experimental.

type BootstrapRoles

type BootstrapRoles struct {
	// CloudFormation Execution Role.
	// Default: - use bootstrapped role.
	//
	// Experimental.
	CloudFormationExecutionRole BootstrapRole `field:"optional" json:"cloudFormationExecutionRole" yaml:"cloudFormationExecutionRole"`
	// Deployment Action Role.
	// Default: - use boostrapped role.
	//
	// Experimental.
	DeploymentRole BootstrapRole `field:"optional" json:"deploymentRole" yaml:"deploymentRole"`
	// Lookup Role.
	// Default: - use bootstrapped role.
	//
	// Experimental.
	LookupRole BootstrapRole `field:"optional" json:"lookupRole" yaml:"lookupRole"`
}

Roles that are bootstrapped to your account.

Example:

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

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		DeploymentIdentities: appstagingsynthesizeralpha.DeploymentIdentities_SpecifyRoles(&BootstrapRoles{
			CloudFormationExecutionRole: appstagingsynthesizeralpha.BootstrapRole_FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Execute")),
			DeploymentRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Deploy")),
			LookupRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Lookup")),
		}),
	}),
})

Experimental.

type CustomFactoryOptions

type CustomFactoryOptions struct {
	// Qualifier to disambiguate multiple bootstrapped environments in the same account.
	//
	// This qualifier is only used to reference bootstrapped resources. It will not
	// be used in the creation of app-specific staging resources: `appId` is used for that
	// instead.
	// Default: - Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise `DEFAULT_QUALIFIER`.
	//
	// Experimental.
	BootstrapQualifier *string `field:"optional" json:"bootstrapQualifier" yaml:"bootstrapQualifier"`
	// What roles to use to deploy applications.
	//
	// These are the roles that have permissions to interact with CloudFormation
	// on your behalf. By default these are the standard bootstrapped CDK roles,
	// but you can customize them or turn them off and use the CLI credentials
	// to deploy.
	// Default: - The standard bootstrapped CDK roles.
	//
	// Experimental.
	DeploymentIdentities DeploymentIdentities `field:"optional" json:"deploymentIdentities" yaml:"deploymentIdentities"`
	// The factory that will be used to return staging resources for each stack.
	// Experimental.
	Factory IStagingResourcesFactory `field:"required" json:"factory" yaml:"factory"`
	// Reuse the answer from the factory for stacks in the same environment.
	// Default: true.
	//
	// Experimental.
	OncePerEnv *bool `field:"optional" json:"oncePerEnv" yaml:"oncePerEnv"`
}

Properties for customFactory static method.

Example:

type customFactory struct {
}

func (this *customFactory) obtainStagingResources(stack Stack, context ObtainStagingResourcesContext) customStagingStack {
	myApp := awscdk.App_Of(*stack)

	return NewCustomStagingStack(myApp, fmt.Sprintf("CustomStagingStack-%v", *context.EnvironmentString), &customStagingStackProps{
	})
}

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_CustomFactory(&CustomFactoryOptions{
		Factory: NewCustomFactory(),
		OncePerEnv: jsii.Boolean(true),
	}),
})

Experimental.

type CustomResourcesOptions

type CustomResourcesOptions struct {
	// Qualifier to disambiguate multiple bootstrapped environments in the same account.
	//
	// This qualifier is only used to reference bootstrapped resources. It will not
	// be used in the creation of app-specific staging resources: `appId` is used for that
	// instead.
	// Default: - Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise `DEFAULT_QUALIFIER`.
	//
	// Experimental.
	BootstrapQualifier *string `field:"optional" json:"bootstrapQualifier" yaml:"bootstrapQualifier"`
	// What roles to use to deploy applications.
	//
	// These are the roles that have permissions to interact with CloudFormation
	// on your behalf. By default these are the standard bootstrapped CDK roles,
	// but you can customize them or turn them off and use the CLI credentials
	// to deploy.
	// Default: - The standard bootstrapped CDK roles.
	//
	// Experimental.
	DeploymentIdentities DeploymentIdentities `field:"optional" json:"deploymentIdentities" yaml:"deploymentIdentities"`
	// Use these exact staging resources for every stack that this synthesizer is used for.
	// Experimental.
	Resources IStagingResources `field:"required" json:"resources" yaml:"resources"`
}

Properties for customResources static method.

Example:

resourceApp := awscdk.NewApp()
resources := NewCustomStagingStack(resourceApp, jsii.String("CustomStagingStack"), &customStagingStackProps{
})

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_CustomResources(&CustomResourcesOptions{
		Resources: *Resources,
	}),
})

Experimental.

type DefaultBootstrapRolesOptions

type DefaultBootstrapRolesOptions struct {
	// The region where the default bootstrap roles have been created.
	//
	// By default, the region in which the stack is deployed is used.
	// Default: - the stack's current region.
	//
	// Experimental.
	BootstrapRegion *string `field:"optional" json:"bootstrapRegion" yaml:"bootstrapRegion"`
}

Options for `DeploymentIdentities.defaultBootstrappedRoles`.

Example:

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

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,

		// The following line is optional. By default it is assumed you have bootstrapped in the same
		// region(s) as the stack(s) you are deploying.
		DeploymentIdentities: appstagingsynthesizeralpha.DeploymentIdentities_DefaultBootstrapRoles(&DefaultBootstrapRolesOptions{
			BootstrapRegion: jsii.String("us-east-1"),
		}),
	}),
})

Experimental.

type DefaultResourcesOptions

type DefaultResourcesOptions struct {
	// Qualifier to disambiguate multiple bootstrapped environments in the same account.
	//
	// This qualifier is only used to reference bootstrapped resources. It will not
	// be used in the creation of app-specific staging resources: `appId` is used for that
	// instead.
	// Default: - Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise `DEFAULT_QUALIFIER`.
	//
	// Experimental.
	BootstrapQualifier *string `field:"optional" json:"bootstrapQualifier" yaml:"bootstrapQualifier"`
	// What roles to use to deploy applications.
	//
	// These are the roles that have permissions to interact with CloudFormation
	// on your behalf. By default these are the standard bootstrapped CDK roles,
	// but you can customize them or turn them off and use the CLI credentials
	// to deploy.
	// Default: - The standard bootstrapped CDK roles.
	//
	// Experimental.
	DeploymentIdentities DeploymentIdentities `field:"optional" json:"deploymentIdentities" yaml:"deploymentIdentities"`
	// A unique identifier for the application that the staging stack belongs to.
	//
	// This identifier will be used in the name of staging resources
	// created for this application, and should be unique across CDK apps.
	//
	// The identifier should include lowercase characters and dashes ('-') only
	// and have a maximum of 20 characters.
	// Experimental.
	AppId *string `field:"required" json:"appId" yaml:"appId"`
	// Encryption type for staging bucket.
	//
	// In future versions of this package, the default will be BucketEncryption.S3_MANAGED.
	//
	// In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
	// $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
	// we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
	// managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
	//
	// If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
	// BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to
	// BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
	// Experimental.
	StagingBucketEncryption awss3.BucketEncryption `field:"required" json:"stagingBucketEncryption" yaml:"stagingBucketEncryption"`
	// Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.
	// Default: true.
	//
	// Experimental.
	AutoDeleteStagingAssets *bool `field:"optional" json:"autoDeleteStagingAssets" yaml:"autoDeleteStagingAssets"`
	// The lifetime for deploy time file assets.
	//
	// Assets that are only necessary at deployment time (for instance,
	// CloudFormation templates and Lambda source code bundles) will be
	// automatically deleted after this many days. Assets that may be
	// read from the staging bucket during your application's run time
	// will not be deleted.
	//
	// Set this to the length of time you wish to be able to roll back to
	// previous versions of your application without having to do a new
	// `cdk synth` and re-upload of assets.
	// Default: - Duration.days(30)
	//
	// Experimental.
	DeployTimeFileAssetLifetime awscdk.Duration `field:"optional" json:"deployTimeFileAssetLifetime" yaml:"deployTimeFileAssetLifetime"`
	// Pass in an existing role to be used as the file publishing role.
	// Default: - a new role will be created.
	//
	// Experimental.
	FileAssetPublishingRole BootstrapRole `field:"optional" json:"fileAssetPublishingRole" yaml:"fileAssetPublishingRole"`
	// Pass in an existing role to be used as the image publishing role.
	// Default: - a new role will be created.
	//
	// Experimental.
	ImageAssetPublishingRole BootstrapRole `field:"optional" json:"imageAssetPublishingRole" yaml:"imageAssetPublishingRole"`
	// The maximum number of image versions to store in a repository.
	//
	// Previous versions of an image can be stored for rollback purposes.
	// Once a repository has more than 3 image versions stored, the oldest
	// version will be discarded. This allows for sensible garbage collection
	// while maintaining a few previous versions for rollback scenarios.
	// Default: - up to 3 versions stored.
	//
	// Experimental.
	ImageAssetVersionCount *float64 `field:"optional" json:"imageAssetVersionCount" yaml:"imageAssetVersionCount"`
	// Explicit name for the staging bucket.
	// Default: - a well-known name unique to this app/env.
	//
	// Experimental.
	StagingBucketName *string `field:"optional" json:"stagingBucketName" yaml:"stagingBucketName"`
	// Specify a custom prefix to be used as the staging stack name and construct ID.
	//
	// The prefix will be appended before the appId, which
	// is required to be part of the stack name and construct ID to
	// ensure uniqueness.
	// Default: 'StagingStack'.
	//
	// Experimental.
	StagingStackNamePrefix *string `field:"optional" json:"stagingStackNamePrefix" yaml:"stagingStackNamePrefix"`
}

Properties for stackPerEnv static method.

Example:

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

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		FileAssetPublishingRole: appstagingsynthesizeralpha.BootstrapRole_FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/S3Access")),
		ImageAssetPublishingRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/ECRAccess")),
	}),
})

Experimental.

type DefaultStagingStack

type DefaultStagingStack interface {
	awscdk.Stack
	IStagingResources
	// The AWS account into which this stack will be deployed.
	//
	// This value is resolved according to the following rules:
	//
	// 1. The value provided to `env.account` when the stack is defined. This can
	//    either be a concrete account (e.g. `585695031111`) or the
	//    `Aws.ACCOUNT_ID` token.
	// 3. `Aws.ACCOUNT_ID`, which represents the CloudFormation intrinsic reference
	//    `{ "Ref": "AWS::AccountId" }` encoded as a string token.
	//
	// Preferably, you should use the return value as an opaque string and not
	// attempt to parse it to implement your logic. If you do, you must first
	// check that it is a concrete value an not an unresolved token. If this
	// value is an unresolved token (`Token.isUnresolved(stack.account)` returns
	// `true`), this implies that the user wishes that this stack will synthesize
	// into an **account-agnostic template**. In this case, your code should either
	// fail (throw an error, emit a synth error using `Annotations.of(construct).addError()`) or
	// implement some other account-agnostic behavior.
	// Experimental.
	Account() *string
	// The ID of the cloud assembly artifact for this stack.
	// Experimental.
	ArtifactId() *string
	// Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.
	//
	// If the stack is environment-agnostic (either account and/or region are
	// tokens), this property will return an array with 2 tokens that will resolve
	// at deploy-time to the first two availability zones returned from CloudFormation's
	// `Fn::GetAZs` intrinsic function.
	//
	// If they are not available in the context, returns a set of dummy values and
	// reports them as missing, and let the CLI resolve them by calling EC2
	// `DescribeAvailabilityZones` on the target environment.
	//
	// To specify a different strategy for selecting availability zones override this method.
	// Experimental.
	AvailabilityZones() *[]*string
	// Indicates whether the stack requires bundling or not.
	// Experimental.
	BundlingRequired() *bool
	// Return the stacks this stack depends on.
	// Experimental.
	Dependencies() *[]awscdk.Stack
	// The stack to add dependencies to.
	// Experimental.
	DependencyStack() awscdk.Stack
	// The environment this Stack deploys to.
	// Experimental.
	Env() *interfaces.ResourceEnvironment
	// The environment coordinates in which this stack is deployed.
	//
	// In the form
	// `aws://account/region`. Use `stack.account` and `stack.region` to obtain
	// the specific values, no need to parse.
	//
	// You can use this value to determine if two stacks are targeting the same
	// environment.
	//
	// If either `stack.account` or `stack.region` are not concrete values (e.g.
	// `Aws.ACCOUNT_ID` or `Aws.REGION`) the special strings `unknown-account` and/or
	// `unknown-region` will be used respectively to indicate this stack is
	// region/account-agnostic.
	// Experimental.
	Environment() *string
	// Indicates if this is a nested stack, in which case `parentStack` will include a reference to its parent.
	// Experimental.
	Nested() *bool
	// If this is a nested stack, returns its parent stack.
	// Experimental.
	NestedStackParent() awscdk.Stack
	// If this is a nested stack, this represents its `AWS::CloudFormation::Stack` resource.
	//
	// `undefined` for top-level (non-nested) stacks.
	// Experimental.
	NestedStackResource() awscdk.CfnResource
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
	// Experimental.
	NotificationArns() *[]*string
	// The partition in which this stack is defined.
	// Experimental.
	Partition() *string
	// The AWS region into which this stack will be deployed (e.g. `us-west-2`).
	//
	// This value is resolved according to the following rules:
	//
	// 1. The value provided to `env.region` when the stack is defined. This can
	//    either be a concrete region (e.g. `us-west-2`) or the `Aws.REGION`
	//    token.
	// 3. `Aws.REGION`, which is represents the CloudFormation intrinsic reference
	//    `{ "Ref": "AWS::Region" }` encoded as a string token.
	//
	// Preferably, you should use the return value as an opaque string and not
	// attempt to parse it to implement your logic. If you do, you must first
	// check that it is a concrete value an not an unresolved token. If this
	// value is an unresolved token (`Token.isUnresolved(stack.region)` returns
	// `true`), this implies that the user wishes that this stack will synthesize
	// into a **region-agnostic template**. In this case, your code should either
	// fail (throw an error, emit a synth error using `Annotations.of(construct).addError()`) or
	// implement some other region-agnostic behavior.
	// Experimental.
	Region() *string
	// The ID of the stack.
	//
	// Example:
	//   // After resolving, looks like
	//   'arn:aws:cloudformation:us-west-2:123456789012:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123'
	//
	// Experimental.
	StackId() *string
	// The concrete CloudFormation physical stack name.
	//
	// This is either the name defined explicitly in the `stackName` prop or
	// allocated based on the stack's location in the construct tree. Stacks that
	// are directly defined under the app use their construct `id` as their stack
	// name. Stacks that are defined deeper within the tree will use a hashed naming
	// scheme based on the construct path to ensure uniqueness.
	//
	// If you wish to obtain the deploy-time AWS::StackName intrinsic,
	// you can use `Aws.STACK_NAME` directly.
	// Experimental.
	StackName() *string
	// The app-scoped, evironment-keyed staging bucket.
	// Experimental.
	StagingBucket() awss3.Bucket
	// The app-scoped, environment-keyed ecr repositories associated with this app.
	// Experimental.
	StagingRepos() *map[string]awsecr.Repository
	// Synthesis method for this stack.
	// Experimental.
	Synthesizer() awscdk.IStackSynthesizer
	// Tags to be applied to the stack.
	// Experimental.
	Tags() awscdk.TagManager
	// The name of the CloudFormation template file emitted to the output directory during synthesis.
	//
	// Example value: `MyStack.template.json`
	// Experimental.
	TemplateFile() *string
	// Options for CloudFormation template (like version, transform, description).
	// Experimental.
	TemplateOptions() awscdk.ITemplateOptions
	// Whether termination protection is enabled for this stack.
	// Experimental.
	TerminationProtection() *bool
	// Experimental.
	SetTerminationProtection(val *bool)
	// The Amazon domain suffix for the region in which this stack is defined.
	// Experimental.
	UrlSuffix() *string
	// Add a dependency between this stack and another stack.
	//
	// This can be used to define dependencies between any two stacks within an
	// app, and also supports nested stacks.
	//
	// Stack dependencies may not cross Stage boundaries.
	//
	// This method has been renamed to `addStackDependency` to more clearly
	// set it apart from `construct.node.addDependency`. See the documentation
	// of that function for more details.
	// Deprecated: Use `addStackDependency` instead.
	AddDependency(target awscdk.Stack, reason *string)
	// Return staging resource information for a docker asset.
	// Experimental.
	AddDockerImage(asset *awscdk.DockerImageAssetSource) *ImageStagingLocation
	// Return staging resource information for a file asset.
	// Experimental.
	AddFile(asset *awscdk.FileAssetSource) *FileStagingLocation
	// Adds an arbitrary key-value pair, with information you want to record about the stack.
	//
	// These get translated to the Metadata section of the generated template.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Add a dependency between this stack and another stack.
	//
	// This can be used to define dependencies between any two stacks within an
	// app, and also supports nested stacks.
	//
	// Stack dependencies may not cross Stage boundaries.
	//
	// This method only adds dependencies between stacks. If you are looking
	// for a generic construct-to-construct dependency mechanism, use
	// `construct.node.addDependency` instead.
	// Experimental.
	AddStackDependency(target awscdk.Stack, reason *string)
	// Configure a stack tag.
	//
	// At deploy time, CloudFormation will automatically apply all stack tags to all resources in the stack.
	// Experimental.
	AddStackTag(tagName *string, tagValue *string)
	// Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template.
	//
	// Duplicate values are removed when stack is synthesized.
	//
	// Example:
	//   declare const stack: Stack;
	//
	//   stack.addTransform('AWS::Serverless-2016-10-31')
	//
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html
	//
	// Experimental.
	AddTransform(transform *string)
	// Returns the naming scheme used to allocate logical IDs.
	//
	// By default, uses
	// the `HashedAddressingScheme` but this method can be overridden to customize
	// this behavior.
	//
	// In order to make sure logical IDs are unique and stable, we hash the resource
	// construct tree path (i.e. toplevel/secondlevel/.../myresource) and add it as
	// a suffix to the path components joined without a separator (CloudFormation
	// IDs only allow alphanumeric characters).
	//
	// The result will be:
	//
	//   <path.join(”)><md5(path.join('/')>
	//     "human"      "hash"
	//
	// If the "human" part of the ID exceeds 240 characters, we simply trim it so
	// the total ID doesn't exceed CloudFormation's 255 character limit.
	//
	// We only take 8 characters from the md5 hash (0.000005 chance of collision).
	//
	// Special cases:
	//
	// - If the path only contains a single component (i.e. it's a top-level
	//   resource), we won't add the hash to it. The hash is not needed for
	//   disambiguation and also, it allows for a more straightforward migration an
	//   existing CloudFormation template to a CDK stack without logical ID changes
	//   (or renames).
	// - For aesthetic reasons, if the last components of the path are the same
	//   (i.e. `L1/L2/Pipeline/Pipeline`), they will be de-duplicated to make the
	//   resulting human portion of the ID more pleasing: `L1L2Pipeline<HASH>`
	//   instead of `L1L2PipelinePipeline<HASH>`
	// - If a component is named "Default" it will be omitted from the path. This
	//   allows refactoring higher level abstractions around constructs without affecting
	//   the IDs of already deployed resources.
	// - If a component is named "Resource" it will be omitted from the user-visible
	//   path, but included in the hash. This reduces visual noise in the human readable
	//   part of the identifier.
	// Experimental.
	AllocateLogicalId(cfnElement awscdk.CfnElement) *string
	// Create a CloudFormation Export for a string list value.
	//
	// Returns a string list representing the corresponding `Fn.importValue()`
	// expression for this Export. The export expression is automatically wrapped with an
	// `Fn::Join` and the import value with an `Fn::Split`, since CloudFormation can only
	// export strings. You can control the name for the export by passing the `name` option.
	//
	// If you don't supply a value for `name`, the value you're exporting must be
	// a Resource attribute (for example: `bucket.bucketName`) and it will be
	// given the same name as the automatic cross-stack reference that would be created
	// if you used the attribute in another Stack.
	//
	// One of the uses for this method is to *remove* the relationship between
	// two Stacks established by automatic cross-stack references. It will
	// temporarily ensure that the CloudFormation Export still exists while you
	// remove the reference from the consuming stack. After that, you can remove
	// the resource and the manual export.
	//
	// See `exportValue` for an example of this process.
	// Experimental.
	ExportStringListValue(exportedValue interface{}, options *awscdk.ExportValueOptions) *[]*string
	// Create a CloudFormation Export for a string value.
	//
	// Returns a string representing the corresponding `Fn.importValue()`
	// expression for this Export. You can control the name for the export by
	// passing the `name` option.
	//
	// If you don't supply a value for `name`, the value you're exporting must be
	// a Resource attribute (for example: `bucket.bucketName`) and it will be
	// given the same name as the automatic cross-stack reference that would be created
	// if you used the attribute in another Stack.
	//
	// One of the uses for this method is to *remove* the relationship between
	// two Stacks established by automatic cross-stack references. It will
	// temporarily ensure that the CloudFormation Export still exists while you
	// remove the reference from the consuming stack. After that, you can remove
	// the resource and the manual export.
	//
	// Here is how the process works. Let's say there are two stacks,
	// `producerStack` and `consumerStack`, and `producerStack` has a bucket
	// called `bucket`, which is referenced by `consumerStack` (perhaps because
	// an AWS Lambda Function writes into it, or something like that).
	//
	// It is not safe to remove `producerStack.bucket` because as the bucket is being
	// deleted, `consumerStack` might still be using it.
	//
	// Instead, the process takes two deployments:
	//
	// **Deployment 1: break the relationship**:
	//
	// - Make sure `consumerStack` no longer references `bucket.bucketName` (maybe the consumer
	//   stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just
	//   remove the Lambda Function altogether).
	// - In the `ProducerStack` class, call `this.exportValue(this.bucket.bucketName)`. This
	//   will make sure the CloudFormation Export continues to exist while the relationship
	//   between the two stacks is being broken.
	// - Deploy (this will effectively only change the `consumerStack`, but it's safe to deploy both).
	//
	// **Deployment 2: remove the bucket resource**:
	//
	// - You are now free to remove the `bucket` resource from `producerStack`.
	// - Don't forget to remove the `exportValue()` call as well.
	// - Deploy again (this time only the `producerStack` will be changed -- the bucket will be deleted).
	// Experimental.
	ExportValue(exportedValue interface{}, options *awscdk.ExportValueOptions) *string
	// Creates an ARN from components.
	//
	// If `partition`, `region` or `account` are not specified, the stack's
	// partition, region and account will be used.
	//
	// If any component is the empty string, an empty string will be inserted
	// into the generated ARN at the location that component corresponds to.
	//
	// The ARN will be formatted as follows:
	//
	//   arn:{partition}:{service}:{region}:{account}:{resource}{sep}{resource-name}
	//
	// The required ARN pieces that are omitted will be taken from the stack that
	// the 'scope' is attached to. If all ARN pieces are supplied, the supplied scope
	// can be 'undefined'.
	// Experimental.
	FormatArn(components *awscdk.ArnComponents) *string
	// Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.
	//
	// This method is called when a `CfnElement` is created and used to render the
	// initial logical identity of resources. Logical ID renames are applied at
	// this stage.
	//
	// This method uses the protected method `allocateLogicalId` to render the
	// logical ID for an element. To modify the naming scheme, extend the `Stack`
	// class and override this method.
	// Experimental.
	GetLogicalId(element awscdk.CfnElement) *string
	// Look up a fact value for the given fact for the region of this stack.
	//
	// Will return a definite value only if the region of the current stack is resolved.
	// If not, a lookup map will be added to the stack and the lookup will be done at
	// CDK deployment time.
	//
	// What regions will be included in the lookup map is controlled by the
	// `@aws-cdk/core:target-partitions` context value: it must be set to a list
	// of partitions, and only regions from the given partitions will be included.
	// If no such context key is set, all regions will be included.
	//
	// This function is intended to be used by construct library authors. Application
	// builders can rely on the abstractions offered by construct libraries and do
	// not have to worry about regional facts.
	//
	// If `defaultValue` is not given, it is an error if the fact is unknown for
	// the given region.
	// Experimental.
	RegionalFact(factName *string, defaultValue *string) *string
	// Remove a stack tag.
	//
	// At deploy time, CloudFormation will automatically apply all stack tags to all resources in the stack.
	// Experimental.
	RemoveStackTag(tagName *string)
	// Rename a generated logical identities.
	//
	// To modify the naming scheme strategy, extend the `Stack` class and
	// override the `allocateLogicalId` method.
	// Experimental.
	RenameLogicalId(oldId *string, newId *string)
	// Indicate that a context key was expected.
	//
	// Contains instructions which will be emitted into the cloud assembly on how
	// the key should be supplied.
	// Experimental.
	ReportMissingContextKey(report *cloudassemblyschema.MissingContext)
	// Resolve a tokenized value in the context of the current stack.
	// Experimental.
	Resolve(obj interface{}) interface{}
	// Splits the provided ARN into its components.
	//
	// Works both if 'arn' is a string like 'arn:aws:s3:::bucket',
	// and a Token representing a dynamic CloudFormation expression
	// (in which case the returned components will also be dynamic CloudFormation expressions,
	// encoded as Tokens).
	// Experimental.
	SplitArn(arn *string, arnFormat awscdk.ArnFormat) *awscdk.ArnComponents
	// Convert an object, potentially containing tokens, to a JSON string.
	// Experimental.
	ToJsonString(obj interface{}, space *float64) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Convert an object, potentially containing tokens, to a YAML string.
	// Experimental.
	ToYamlString(obj interface{}) *string
	// Applies one or more mixins to this construct.
	//
	// Mixins are applied in order. The list of constructs is captured at the
	// start of the call, so constructs added by a mixin will not be visited.
	// Use multiple `with()` calls if subsequent mixins should apply to added
	// constructs.
	// Experimental.
	With(mixins ...constructs.IMixin) constructs.IConstruct
}

A default Staging Stack that implements IStagingResources.

Example:

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

defaultStagingStack := appstagingsynthesizeralpha.DefaultStagingStack_Factory(&DefaultStagingStackOptions{
	AppId: jsii.String("my-app-id"),
	StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
})

Experimental.

func NewDefaultStagingStack

func NewDefaultStagingStack(scope awscdk.App, id *string, props *DefaultStagingStackProps) DefaultStagingStack

Experimental.

type DefaultStagingStackOptions

type DefaultStagingStackOptions struct {
	// A unique identifier for the application that the staging stack belongs to.
	//
	// This identifier will be used in the name of staging resources
	// created for this application, and should be unique across CDK apps.
	//
	// The identifier should include lowercase characters and dashes ('-') only
	// and have a maximum of 20 characters.
	// Experimental.
	AppId *string `field:"required" json:"appId" yaml:"appId"`
	// Encryption type for staging bucket.
	//
	// In future versions of this package, the default will be BucketEncryption.S3_MANAGED.
	//
	// In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
	// $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
	// we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
	// managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
	//
	// If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
	// BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to
	// BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
	// Experimental.
	StagingBucketEncryption awss3.BucketEncryption `field:"required" json:"stagingBucketEncryption" yaml:"stagingBucketEncryption"`
	// Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.
	// Default: true.
	//
	// Experimental.
	AutoDeleteStagingAssets *bool `field:"optional" json:"autoDeleteStagingAssets" yaml:"autoDeleteStagingAssets"`
	// The lifetime for deploy time file assets.
	//
	// Assets that are only necessary at deployment time (for instance,
	// CloudFormation templates and Lambda source code bundles) will be
	// automatically deleted after this many days. Assets that may be
	// read from the staging bucket during your application's run time
	// will not be deleted.
	//
	// Set this to the length of time you wish to be able to roll back to
	// previous versions of your application without having to do a new
	// `cdk synth` and re-upload of assets.
	// Default: - Duration.days(30)
	//
	// Experimental.
	DeployTimeFileAssetLifetime awscdk.Duration `field:"optional" json:"deployTimeFileAssetLifetime" yaml:"deployTimeFileAssetLifetime"`
	// Pass in an existing role to be used as the file publishing role.
	// Default: - a new role will be created.
	//
	// Experimental.
	FileAssetPublishingRole BootstrapRole `field:"optional" json:"fileAssetPublishingRole" yaml:"fileAssetPublishingRole"`
	// Pass in an existing role to be used as the image publishing role.
	// Default: - a new role will be created.
	//
	// Experimental.
	ImageAssetPublishingRole BootstrapRole `field:"optional" json:"imageAssetPublishingRole" yaml:"imageAssetPublishingRole"`
	// The maximum number of image versions to store in a repository.
	//
	// Previous versions of an image can be stored for rollback purposes.
	// Once a repository has more than 3 image versions stored, the oldest
	// version will be discarded. This allows for sensible garbage collection
	// while maintaining a few previous versions for rollback scenarios.
	// Default: - up to 3 versions stored.
	//
	// Experimental.
	ImageAssetVersionCount *float64 `field:"optional" json:"imageAssetVersionCount" yaml:"imageAssetVersionCount"`
	// Explicit name for the staging bucket.
	// Default: - a well-known name unique to this app/env.
	//
	// Experimental.
	StagingBucketName *string `field:"optional" json:"stagingBucketName" yaml:"stagingBucketName"`
	// Specify a custom prefix to be used as the staging stack name and construct ID.
	//
	// The prefix will be appended before the appId, which
	// is required to be part of the stack name and construct ID to
	// ensure uniqueness.
	// Default: 'StagingStack'.
	//
	// Experimental.
	StagingStackNamePrefix *string `field:"optional" json:"stagingStackNamePrefix" yaml:"stagingStackNamePrefix"`
}

User configurable options to the DefaultStagingStack.

Example:

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

defaultStagingStack := appstagingsynthesizeralpha.DefaultStagingStack_Factory(&DefaultStagingStackOptions{
	AppId: jsii.String("my-app-id"),
	StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
})

Experimental.

type DefaultStagingStackProps

type DefaultStagingStackProps struct {
	// A unique identifier for the application that the staging stack belongs to.
	//
	// This identifier will be used in the name of staging resources
	// created for this application, and should be unique across CDK apps.
	//
	// The identifier should include lowercase characters and dashes ('-') only
	// and have a maximum of 20 characters.
	// Experimental.
	AppId *string `field:"required" json:"appId" yaml:"appId"`
	// Encryption type for staging bucket.
	//
	// In future versions of this package, the default will be BucketEncryption.S3_MANAGED.
	//
	// In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
	// $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
	// we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
	// managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
	//
	// If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
	// BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to
	// BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
	// Experimental.
	StagingBucketEncryption awss3.BucketEncryption `field:"required" json:"stagingBucketEncryption" yaml:"stagingBucketEncryption"`
	// Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.
	// Default: true.
	//
	// Experimental.
	AutoDeleteStagingAssets *bool `field:"optional" json:"autoDeleteStagingAssets" yaml:"autoDeleteStagingAssets"`
	// The lifetime for deploy time file assets.
	//
	// Assets that are only necessary at deployment time (for instance,
	// CloudFormation templates and Lambda source code bundles) will be
	// automatically deleted after this many days. Assets that may be
	// read from the staging bucket during your application's run time
	// will not be deleted.
	//
	// Set this to the length of time you wish to be able to roll back to
	// previous versions of your application without having to do a new
	// `cdk synth` and re-upload of assets.
	// Default: - Duration.days(30)
	//
	// Experimental.
	DeployTimeFileAssetLifetime awscdk.Duration `field:"optional" json:"deployTimeFileAssetLifetime" yaml:"deployTimeFileAssetLifetime"`
	// Pass in an existing role to be used as the file publishing role.
	// Default: - a new role will be created.
	//
	// Experimental.
	FileAssetPublishingRole BootstrapRole `field:"optional" json:"fileAssetPublishingRole" yaml:"fileAssetPublishingRole"`
	// Pass in an existing role to be used as the image publishing role.
	// Default: - a new role will be created.
	//
	// Experimental.
	ImageAssetPublishingRole BootstrapRole `field:"optional" json:"imageAssetPublishingRole" yaml:"imageAssetPublishingRole"`
	// The maximum number of image versions to store in a repository.
	//
	// Previous versions of an image can be stored for rollback purposes.
	// Once a repository has more than 3 image versions stored, the oldest
	// version will be discarded. This allows for sensible garbage collection
	// while maintaining a few previous versions for rollback scenarios.
	// Default: - up to 3 versions stored.
	//
	// Experimental.
	ImageAssetVersionCount *float64 `field:"optional" json:"imageAssetVersionCount" yaml:"imageAssetVersionCount"`
	// Explicit name for the staging bucket.
	// Default: - a well-known name unique to this app/env.
	//
	// Experimental.
	StagingBucketName *string `field:"optional" json:"stagingBucketName" yaml:"stagingBucketName"`
	// Specify a custom prefix to be used as the staging stack name and construct ID.
	//
	// The prefix will be appended before the appId, which
	// is required to be part of the stack name and construct ID to
	// ensure uniqueness.
	// Default: 'StagingStack'.
	//
	// Experimental.
	StagingStackNamePrefix *string `field:"optional" json:"stagingStackNamePrefix" yaml:"stagingStackNamePrefix"`
	// Include runtime versioning information in this Stack.
	// Default: `analyticsReporting` setting of containing `App`, or value of
	// 'aws:cdk:version-reporting' context key.
	//
	// Experimental.
	AnalyticsReporting *bool `field:"optional" json:"analyticsReporting" yaml:"analyticsReporting"`
	// Enable this flag to allow native cross region stack references.
	//
	// Enabling this will create a CloudFormation custom resource
	// in both the producing stack and consuming stack in order to perform the export/import
	//
	// This feature is currently experimental.
	// Default: false.
	//
	// Experimental.
	CrossRegionReferences *bool `field:"optional" json:"crossRegionReferences" yaml:"crossRegionReferences"`
	// A description of the stack.
	// Default: - No description.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The AWS environment (account/region) where this stack will be deployed.
	//
	// Set the `region`/`account` fields of `env` to either a concrete value to
	// select the indicated environment (recommended for production stacks), or to
	// the values of environment variables
	// `CDK_DEFAULT_REGION`/`CDK_DEFAULT_ACCOUNT` to let the target environment
	// depend on the AWS credentials/configuration that the CDK CLI is executed
	// under (recommended for development stacks).
	//
	// If the `Stack` is instantiated inside a `Stage`, any undefined
	// `region`/`account` fields from `env` will default to the same field on the
	// encompassing `Stage`, if configured there.
	//
	// If either `region` or `account` are not set nor inherited from `Stage`, the
	// Stack will be considered "*environment-agnostic*"". Environment-agnostic
	// stacks can be deployed to any environment but may not be able to take
	// advantage of all features of the CDK. For example, they will not be able to
	// use environmental context lookups such as `ec2.Vpc.fromLookup` and will not
	// automatically translate Service Principals to the right format based on the
	// environment's AWS partition, and other such enhancements.
	//
	// Example:
	//   // Use a concrete account and region to deploy this stack to:
	//   // `.account` and `.region` will simply return these values.
	//   new Stack(app, 'Stack1', {
	//     env: {
	//       account: '123456789012',
	//       region: 'us-east-1'
	//     },
	//   });
	//
	//   // Use the CLI's current credentials to determine the target environment:
	//   // `.account` and `.region` will reflect the account+region the CLI
	//   // is configured to use (based on the user CLI credentials)
	//   new Stack(app, 'Stack2', {
	//     env: {
	//       account: process.env.CDK_DEFAULT_ACCOUNT,
	//       region: process.env.CDK_DEFAULT_REGION
	//     },
	//   });
	//
	//   // Define multiple stacks stage associated with an environment
	//   const myStage = new Stage(app, 'MyStage', {
	//     env: {
	//       account: '123456789012',
	//       region: 'us-east-1'
	//     }
	//   });
	//
	//   // both of these stacks will use the stage's account/region:
	//   // `.account` and `.region` will resolve to the concrete values as above
	//   new MyStack(myStage, 'Stack1');
	//   new YourStack(myStage, 'Stack2');
	//
	//   // Define an environment-agnostic stack:
	//   // `.account` and `.region` will resolve to `{ "Ref": "AWS::AccountId" }` and `{ "Ref": "AWS::Region" }` respectively.
	//   // which will only resolve to actual values by CloudFormation during deployment.
	//   new MyStack(app, 'Stack1');
	//
	// Default: - The environment of the containing `Stage` if available,
	// otherwise create the stack will be environment-agnostic.
	//
	// Experimental.
	Env *awscdk.Environment `field:"optional" json:"env" yaml:"env"`
	// SNS Topic ARNs that will receive stack events.
	// Default: - no notification arns.
	//
	// Experimental.
	NotificationArns *[]*string `field:"optional" json:"notificationArns" yaml:"notificationArns"`
	// Options for applying a permissions boundary to all IAM Roles and Users created within this Stage.
	// Default: - no permissions boundary is applied.
	//
	// Experimental.
	PermissionsBoundary awscdk.PermissionsBoundary `field:"optional" json:"permissionsBoundary" yaml:"permissionsBoundary"`
	// A list of IPropertyInjector attached to this Stack.
	// Default: - no PropertyInjectors.
	//
	// Experimental.
	PropertyInjectors *[]awscdk.IPropertyInjector `field:"optional" json:"propertyInjectors" yaml:"propertyInjectors"`
	// Name to deploy the stack with.
	// Default: - Derived from construct path.
	//
	// Experimental.
	StackName *string `field:"optional" json:"stackName" yaml:"stackName"`
	// Enable this flag to suppress indentation in generated CloudFormation templates.
	//
	// If not specified, the value of the `@aws-cdk/core:suppressTemplateIndentation`
	// context key will be used. If that is not specified, then the
	// default value `false` will be used.
	// Default: - the value of `@aws-cdk/core:suppressTemplateIndentation`, or `false` if that is not set.
	//
	// Experimental.
	SuppressTemplateIndentation *bool `field:"optional" json:"suppressTemplateIndentation" yaml:"suppressTemplateIndentation"`
	// Synthesis method to use while deploying this stack.
	//
	// The Stack Synthesizer controls aspects of synthesis and deployment,
	// like how assets are referenced and what IAM roles to use. For more
	// information, see the README of the main CDK package.
	//
	// If not specified, the `defaultStackSynthesizer` from `App` will be used.
	// If that is not specified, `DefaultStackSynthesizer` is used if
	// `@aws-cdk/core:newStyleStackSynthesis` is set to `true` or the CDK major
	// version is v2. In CDK v1 `LegacyStackSynthesizer` is the default if no
	// other synthesizer is specified.
	// Default: - The synthesizer specified on `App`, or `DefaultStackSynthesizer` otherwise.
	//
	// Experimental.
	Synthesizer awscdk.IStackSynthesizer `field:"optional" json:"synthesizer" yaml:"synthesizer"`
	// Tags that will be applied to the Stack.
	//
	// These tags are applied to the CloudFormation Stack itself. They will not
	// appear in the CloudFormation template.
	//
	// However, at deployment time, CloudFormation will apply these tags to all
	// resources in the stack that support tagging. You will not be able to exempt
	// resources from tagging (using the `excludeResourceTypes` property of
	// `Tags.of(...).add()`) for tags applied in this way.
	// Default: {}.
	//
	// Experimental.
	Tags *map[string]*string `field:"optional" json:"tags" yaml:"tags"`
	// Whether to enable termination protection for this stack.
	// Default: false.
	//
	// Experimental.
	TerminationProtection *bool `field:"optional" json:"terminationProtection" yaml:"terminationProtection"`
	// The qualifier used to specialize strings.
	//
	// Can be used to specify custom bootstrapped role names.
	// Experimental.
	Qualifier *string `field:"required" json:"qualifier" yaml:"qualifier"`
	// The ARN of the deploy action role, if given.
	//
	// This role will need permissions to read from to the staging resources.
	// Default: - The CLI credentials are assumed, no additional permissions are granted.
	//
	// Experimental.
	DeployRoleArn *string `field:"optional" json:"deployRoleArn" yaml:"deployRoleArn"`
}

Default Staging Stack Properties.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import app_staging_synthesizer_alpha "github.com/aws/aws-cdk-go/appstagingsynthesizeralpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bootstrapRole BootstrapRole
var permissionsBoundary PermissionsBoundary
var propertyInjector IPropertyInjector
var stackSynthesizer StackSynthesizer

defaultStagingStackProps := &DefaultStagingStackProps{
	AppId: jsii.String("appId"),
	Qualifier: jsii.String("qualifier"),
	StagingBucketEncryption: awscdk.Aws_s3.BucketEncryption_UNENCRYPTED,

	// the properties below are optional
	AnalyticsReporting: jsii.Boolean(false),
	AutoDeleteStagingAssets: jsii.Boolean(false),
	CrossRegionReferences: jsii.Boolean(false),
	DeployRoleArn: jsii.String("deployRoleArn"),
	DeployTimeFileAssetLifetime: cdk.Duration_Minutes(jsii.Number(30)),
	Description: jsii.String("description"),
	Env: &Environment{
		Account: jsii.String("account"),
		Region: jsii.String("region"),
	},
	FileAssetPublishingRole: bootstrapRole,
	ImageAssetPublishingRole: bootstrapRole,
	ImageAssetVersionCount: jsii.Number(123),
	NotificationArns: []*string{
		jsii.String("notificationArns"),
	},
	PermissionsBoundary: permissionsBoundary,
	PropertyInjectors: []IPropertyInjector{
		propertyInjector,
	},
	StackName: jsii.String("stackName"),
	StagingBucketName: jsii.String("stagingBucketName"),
	StagingStackNamePrefix: jsii.String("stagingStackNamePrefix"),
	SuppressTemplateIndentation: jsii.Boolean(false),
	Synthesizer: stackSynthesizer,
	Tags: map[string]*string{
		"tagsKey": jsii.String("tags"),
	},
	TerminationProtection: jsii.Boolean(false),
}

Experimental.

type DeploymentIdentities

type DeploymentIdentities interface {
	// CloudFormation Execution Role.
	// Experimental.
	CloudFormationExecutionRole() BootstrapRole
	// Deployment Action Role.
	// Experimental.
	DeploymentRole() BootstrapRole
	// Lookup Role.
	// Default: - use bootstrapped role.
	//
	// Experimental.
	LookupRole() BootstrapRole
}

Deployment identities are the class of roles to be assumed by the CDK when deploying the App.

Example:

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

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,

		// The following line is optional. By default it is assumed you have bootstrapped in the same
		// region(s) as the stack(s) you are deploying.
		DeploymentIdentities: appstagingsynthesizeralpha.DeploymentIdentities_DefaultBootstrapRoles(&DefaultBootstrapRolesOptions{
			BootstrapRegion: jsii.String("us-east-1"),
		}),
	}),
})

Experimental.

func DeploymentIdentities_CliCredentials

func DeploymentIdentities_CliCredentials() DeploymentIdentities

Use CLI credentials for all deployment identities. Experimental.

func DeploymentIdentities_DefaultBootstrapRoles

func DeploymentIdentities_DefaultBootstrapRoles(options *DefaultBootstrapRolesOptions) DeploymentIdentities

Use the Roles that have been created by the default bootstrap stack. Experimental.

func DeploymentIdentities_SpecifyRoles

func DeploymentIdentities_SpecifyRoles(roles *BootstrapRoles) DeploymentIdentities

Specify your own roles for all deployment identities.

These roles must already exist. Experimental.

type FileStagingLocation

type FileStagingLocation struct {
	// The name of the staging bucket.
	// Experimental.
	BucketName *string `field:"required" json:"bucketName" yaml:"bucketName"`
	// The ARN to assume to write files to this bucket.
	// Default: - Don't assume a role.
	//
	// Experimental.
	AssumeRoleArn *string `field:"optional" json:"assumeRoleArn" yaml:"assumeRoleArn"`
	// The stack that creates this bucket (leads to dependencies on it).
	// Default: - Don't add dependencies.
	//
	// Experimental.
	DependencyStack awscdk.Stack `field:"optional" json:"dependencyStack" yaml:"dependencyStack"`
	// A prefix to add to the keys.
	// Default: ”.
	//
	// Experimental.
	Prefix *string `field:"optional" json:"prefix" yaml:"prefix"`
}

Information returned by the Staging Stack for each file asset.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import app_staging_synthesizer_alpha "github.com/aws/aws-cdk-go/appstagingsynthesizeralpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"

var stack Stack

fileStagingLocation := &FileStagingLocation{
	BucketName: jsii.String("bucketName"),

	// the properties below are optional
	AssumeRoleArn: jsii.String("assumeRoleArn"),
	DependencyStack: stack,
	Prefix: jsii.String("prefix"),
}

Experimental.

type IStagingResources

type IStagingResources interface {
	constructs.IConstruct
	// Return staging resource information for a docker asset.
	// Experimental.
	AddDockerImage(asset *awscdk.DockerImageAssetSource) *ImageStagingLocation
	// Return staging resource information for a file asset.
	// Experimental.
	AddFile(asset *awscdk.FileAssetSource) *FileStagingLocation
}

Staging Resource interface. Experimental.

type IStagingResourcesFactory

type IStagingResourcesFactory interface {
	// Return an object that will manage staging resources for the given stack.
	//
	// This is called whenever the `AppStagingSynthesizer` binds to a specific
	// stack, and allows selecting where the staging resources go.
	//
	// This method can choose to either create a new construct (perhaps a stack)
	// and return it, or reference an existing construct.
	// Experimental.
	ObtainStagingResources(stack awscdk.Stack, context *ObtainStagingResourcesContext) IStagingResources
}

Staging Resource Factory interface.

The function included in this class will be called by the synthesizer to create or reference an IStagingResources construct that has the necessary staging resources for the stack. Experimental.

func DefaultStagingStack_Factory

func DefaultStagingStack_Factory(options *DefaultStagingStackOptions) IStagingResourcesFactory

Return a factory that will create DefaultStagingStacks. Experimental.

type ImageStagingLocation

type ImageStagingLocation struct {
	// The name of the staging repository.
	// Experimental.
	RepoName *string `field:"required" json:"repoName" yaml:"repoName"`
	// The arn to assume to write files to this repository.
	// Default: - Don't assume a role.
	//
	// Experimental.
	AssumeRoleArn *string `field:"optional" json:"assumeRoleArn" yaml:"assumeRoleArn"`
	// The stack that creates this repository (leads to dependencies on it).
	// Default: - Don't add dependencies.
	//
	// Experimental.
	DependencyStack awscdk.Stack `field:"optional" json:"dependencyStack" yaml:"dependencyStack"`
}

Information returned by the Staging Stack for each image asset.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import app_staging_synthesizer_alpha "github.com/aws/aws-cdk-go/appstagingsynthesizeralpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"

var stack Stack

imageStagingLocation := &ImageStagingLocation{
	RepoName: jsii.String("repoName"),

	// the properties below are optional
	AssumeRoleArn: jsii.String("assumeRoleArn"),
	DependencyStack: stack,
}

Experimental.

type ObtainStagingResourcesContext

type ObtainStagingResourcesContext struct {
	// A unique string describing the environment that is guaranteed not to have tokens in it.
	// Experimental.
	EnvironmentString *string `field:"required" json:"environmentString" yaml:"environmentString"`
	// The qualifier passed to the synthesizer.
	//
	// The staging stack shouldn't need this, but it might.
	// Experimental.
	Qualifier *string `field:"required" json:"qualifier" yaml:"qualifier"`
	// The ARN of the deploy action role, if given.
	//
	// This role will need permissions to read from to the staging resources.
	// Default: - Deploy role ARN is unknown.
	//
	// Experimental.
	DeployRoleArn *string `field:"optional" json:"deployRoleArn" yaml:"deployRoleArn"`
}

Context parameters for the 'obtainStagingResources' function.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import app_staging_synthesizer_alpha "github.com/aws/aws-cdk-go/appstagingsynthesizeralpha"

obtainStagingResourcesContext := &ObtainStagingResourcesContext{
	EnvironmentString: jsii.String("environmentString"),
	Qualifier: jsii.String("qualifier"),

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

Experimental.

type StagingRoles

type StagingRoles struct {
	// Docker Asset Publishing Role.
	// Default: - staging stack creates a docker asset publishing role.
	//
	// Experimental.
	DockerAssetPublishingRole BootstrapRole `field:"optional" json:"dockerAssetPublishingRole" yaml:"dockerAssetPublishingRole"`
	// File Asset Publishing Role.
	// Default: - staging stack creates a file asset publishing role.
	//
	// Experimental.
	FileAssetPublishingRole BootstrapRole `field:"optional" json:"fileAssetPublishingRole" yaml:"fileAssetPublishingRole"`
}

Roles that are included in the Staging Stack (for access to Staging Resources).

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import app_staging_synthesizer_alpha "github.com/aws/aws-cdk-go/appstagingsynthesizeralpha"

var bootstrapRole BootstrapRole

stagingRoles := &StagingRoles{
	DockerAssetPublishingRole: bootstrapRole,
	FileAssetPublishingRole: bootstrapRole,
}

Experimental.

type UsingAppStagingSynthesizer

type UsingAppStagingSynthesizer interface {
	constructs.Construct
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Applies one or more mixins to this construct.
	//
	// Mixins are applied in order. The list of constructs is captured at the
	// start of the call, so constructs added by a mixin will not be visited.
	// Use multiple `with()` calls if subsequent mixins should apply to added
	// constructs.
	//
	// Returns: This construct for chaining.
	// Experimental.
	With(mixins ...constructs.IMixin) constructs.IConstruct
}

This is a dummy construct meant to signify that a stack is utilizing the AppStagingSynthesizer.

It does not do anything, and is not meant to be created on its own. This construct will be a part of the construct tree only and not the Cfn template. The construct tree is then encoded in the AWS::CDK::Metadata resource of the stack and injested in our metrics like every other construct.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import app_staging_synthesizer_alpha "github.com/aws/aws-cdk-go/appstagingsynthesizeralpha"

usingAppStagingSynthesizer := app_staging_synthesizer_alpha.NewUsingAppStagingSynthesizer(this, jsii.String("MyUsingAppStagingSynthesizer"))

Experimental.

func NewUsingAppStagingSynthesizer

func NewUsingAppStagingSynthesizer(scope constructs.Construct, id *string) UsingAppStagingSynthesizer

Experimental.

Directories

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

Jump to

Keyboard shortcuts

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