DefaultResourcesOptions
- class aws_cdk.app_staging_synthesizer_alpha.DefaultResourcesOptions(*, bootstrap_qualifier=None, deployment_identities=None, app_id, staging_bucket_encryption, auto_delete_staging_assets=None, deploy_time_file_asset_lifetime=None, file_asset_publishing_role=None, image_asset_publishing_role=None, image_asset_version_count=None, staging_bucket_name=None, staging_stack_name_prefix=None)
Bases:
AppStagingSynthesizerOptions
,DefaultStagingStackOptions
(experimental) Properties for stackPerEnv static method.
- Parameters:
bootstrap_qualifier (
Optional
[str
]) – (experimental) 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, otherwiseDEFAULT_QUALIFIER
deployment_identities (
Optional
[DeploymentIdentities
]) – (experimental) 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 rolesapp_id (
str
) – (experimental) 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.staging_bucket_encryption (
BucketEncryption
) – (experimental) 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.auto_delete_staging_assets (
Optional
[bool
]) – (experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. Default: truedeploy_time_file_asset_lifetime (
Optional
[Duration
]) – (experimental) 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 newcdk synth
and re-upload of assets. Default: - Duration.days(30)file_asset_publishing_role (
Optional
[BootstrapRole
]) – (experimental) Pass in an existing role to be used as the file publishing role. Default: - a new role will be createdimage_asset_publishing_role (
Optional
[BootstrapRole
]) – (experimental) Pass in an existing role to be used as the image publishing role. Default: - a new role will be createdimage_asset_version_count (
Union
[int
,float
,None
]) – (experimental) 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 storedstaging_bucket_name (
Optional
[str
]) – (experimental) Explicit name for the staging bucket. Default: - a well-known name unique to this app/env.staging_stack_name_prefix (
Optional
[str
]) – (experimental) 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’
- Stability:
experimental
- ExampleMetadata:
infused
Example:
from aws_cdk.aws_s3 import BucketEncryption app = App( default_stack_synthesizer=AppStagingSynthesizer.default_resources( app_id="my-app-id", staging_bucket_encryption=BucketEncryption.S3_MANAGED, file_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/S3Access"), image_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/ECRAccess") ) )
Attributes
- app_id
(experimental) 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.
- Stability:
experimental
- auto_delete_staging_assets
(experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.
- Default:
true
- Stability:
experimental
- bootstrap_qualifier
(experimental) 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
- Stability:
experimental
- deploy_time_file_asset_lifetime
(experimental) 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)
- Stability:
experimental
- deployment_identities
(experimental) 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
- Stability:
experimental
- file_asset_publishing_role
(experimental) Pass in an existing role to be used as the file publishing role.
- Default:
a new role will be created
- Stability:
experimental
- image_asset_publishing_role
(experimental) Pass in an existing role to be used as the image publishing role.
- Default:
a new role will be created
- Stability:
experimental
- image_asset_version_count
(experimental) 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
- Stability:
experimental
- staging_bucket_encryption
(experimental) 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.
- Stability:
experimental
- staging_bucket_name
(experimental) Explicit name for the staging bucket.
- Default:
a well-known name unique to this app/env.
- Stability:
experimental
- staging_stack_name_prefix
(experimental) 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’
- Stability:
experimental