Class DefaultStagingStackOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DefaultStagingStackOptions>
- Enclosing interface:
DefaultStagingStackOptions
DefaultStagingStackOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofDefaultStagingStackOptions.getAppId()
autoDeleteStagingAssets
(Boolean autoDeleteStagingAssets) Sets the value ofDefaultStagingStackOptions.getAutoDeleteStagingAssets()
build()
Builds the configured instance.deployTimeFileAssetLifetime
(Duration deployTimeFileAssetLifetime) Sets the value ofDefaultStagingStackOptions.getDeployTimeFileAssetLifetime()
fileAssetPublishingRole
(BootstrapRole fileAssetPublishingRole) Sets the value ofDefaultStagingStackOptions.getFileAssetPublishingRole()
imageAssetPublishingRole
(BootstrapRole imageAssetPublishingRole) Sets the value ofDefaultStagingStackOptions.getImageAssetPublishingRole()
imageAssetVersionCount
(Number imageAssetVersionCount) Sets the value ofDefaultStagingStackOptions.getImageAssetVersionCount()
stagingBucketEncryption
(BucketEncryption stagingBucketEncryption) Sets the value ofDefaultStagingStackOptions.getStagingBucketEncryption()
stagingBucketName
(String stagingBucketName) Sets the value ofDefaultStagingStackOptions.getStagingBucketName()
stagingStackNamePrefix
(String stagingStackNamePrefix) Sets the value ofDefaultStagingStackOptions.getStagingStackNamePrefix()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
appId
Sets the value ofDefaultStagingStackOptions.getAppId()
- Parameters:
appId
- A unique identifier for the application that the staging stack belongs to. This parameter is required. 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.
- Returns:
this
-
stagingBucketEncryption
@Stability(Experimental) public DefaultStagingStackOptions.Builder stagingBucketEncryption(BucketEncryption stagingBucketEncryption) Sets the value ofDefaultStagingStackOptions.getStagingBucketEncryption()
- Parameters:
stagingBucketEncryption
- Encryption type for staging bucket. This parameter is required. 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.
- Returns:
this
-
autoDeleteStagingAssets
@Stability(Experimental) public DefaultStagingStackOptions.Builder autoDeleteStagingAssets(Boolean autoDeleteStagingAssets) Sets the value ofDefaultStagingStackOptions.getAutoDeleteStagingAssets()
- Parameters:
autoDeleteStagingAssets
- Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.- Returns:
this
-
deployTimeFileAssetLifetime
@Stability(Experimental) public DefaultStagingStackOptions.Builder deployTimeFileAssetLifetime(Duration deployTimeFileAssetLifetime) Sets the value ofDefaultStagingStackOptions.getDeployTimeFileAssetLifetime()
- Parameters:
deployTimeFileAssetLifetime
- 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.- Returns:
this
-
fileAssetPublishingRole
@Stability(Experimental) public DefaultStagingStackOptions.Builder fileAssetPublishingRole(BootstrapRole fileAssetPublishingRole) Sets the value ofDefaultStagingStackOptions.getFileAssetPublishingRole()
- Parameters:
fileAssetPublishingRole
- Pass in an existing role to be used as the file publishing role.- Returns:
this
-
imageAssetPublishingRole
@Stability(Experimental) public DefaultStagingStackOptions.Builder imageAssetPublishingRole(BootstrapRole imageAssetPublishingRole) Sets the value ofDefaultStagingStackOptions.getImageAssetPublishingRole()
- Parameters:
imageAssetPublishingRole
- Pass in an existing role to be used as the image publishing role.- Returns:
this
-
imageAssetVersionCount
@Stability(Experimental) public DefaultStagingStackOptions.Builder imageAssetVersionCount(Number imageAssetVersionCount) Sets the value ofDefaultStagingStackOptions.getImageAssetVersionCount()
- Parameters:
imageAssetVersionCount
- 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.- Returns:
this
-
stagingBucketName
@Stability(Experimental) public DefaultStagingStackOptions.Builder stagingBucketName(String stagingBucketName) Sets the value ofDefaultStagingStackOptions.getStagingBucketName()
- Parameters:
stagingBucketName
- Explicit name for the staging bucket.- Returns:
this
-
stagingStackNamePrefix
@Stability(Experimental) public DefaultStagingStackOptions.Builder stagingStackNamePrefix(String stagingStackNamePrefix) Sets the value ofDefaultStagingStackOptions.getStagingStackNamePrefix()
- Parameters:
stagingStackNamePrefix
- 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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DefaultStagingStackOptions>
- Returns:
- a new instance of
DefaultStagingStackOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-