interface DefaultResourcesOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AppStagingSynthesizer.Alpha.DefaultResourcesOptions |
Java | software.amazon.awscdk.app.staging.synthesizer.alpha.DefaultResourcesOptions |
Python | aws_cdk.app_staging_synthesizer_alpha.DefaultResourcesOptions |
TypeScript (source) | @aws-cdk/app-staging-synthesizer-alpha ยป DefaultResourcesOptions |
Properties for stackPerEnv static method.
Example
import { BucketEncryption } from 'aws-cdk-lib/aws-s3';
const app = new App({
defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
appId: 'my-app-id',
stagingBucketEncryption: BucketEncryption.S3_MANAGED,
fileAssetPublishingRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/S3Access'),
imageAssetPublishingRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/ECRAccess'),
}),
});
Properties
Name | Type | Description |
---|---|---|
app | string | A unique identifier for the application that the staging stack belongs to. |
staging | Bucket | Encryption type for staging bucket. |
auto | boolean | Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. |
bootstrap | string | Qualifier to disambiguate multiple bootstrapped environments in the same account. |
deploy | Duration | The lifetime for deploy time file assets. |
deployment | Deployment | What roles to use to deploy applications. |
file | Bootstrap | Pass in an existing role to be used as the file publishing role. |
image | Bootstrap | Pass in an existing role to be used as the image publishing role. |
image | number | The maximum number of image versions to store in a repository. |
staging | string | Explicit name for the staging bucket. |
staging | string | Specify a custom prefix to be used as the staging stack name and construct ID. |
appId
Type:
string
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.
stagingBucketEncryption
Type:
Bucket
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.
autoDeleteStagingAssets?
Type:
boolean
(optional, default: true)
Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.
bootstrapQualifier?
Type:
string
(optional, default: Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise DEFAULT_QUALIFIER
)
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.
deployTimeFileAssetLifetime?
Type:
Duration
(optional, default: Duration.days(30))
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.
deploymentIdentities?
Type:
Deployment
(optional, default: The standard bootstrapped CDK roles)
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.
fileAssetPublishingRole?
Type:
Bootstrap
(optional, default: a new role will be created)
Pass in an existing role to be used as the file publishing role.
imageAssetPublishingRole?
Type:
Bootstrap
(optional, default: a new role will be created)
Pass in an existing role to be used as the image publishing role.
imageAssetVersionCount?
Type:
number
(optional, default: up to 3 versions stored)
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.
stagingBucketName?
Type:
string
(optional, default: a well-known name unique to this app/env.)
Explicit name for the staging bucket.
stagingStackNamePrefix?
Type:
string
(optional, default: 'StagingStack')
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.