@pulumi/cdk • Docs
@pulumi/cdk / synthesizer
This is a custom synthesizer that determines how the CDK stack should be synthesized.
In our case, since we can create Pulumi resources directly, we don't need a separate bootstrap step. This is very similar to how the AppStagingSynthesizer works, but is simpler because we don't need to manage/create a separate CDK stack to manage the resources.
As CDK applications register assets this synthesizer will dynamically create the necessary staging resources and deploy the assets themselves.
- Recommended reading https://github.com/aws/aws-cdk/wiki/Security-And-Safety-Dev-Guide#controlling-the-permissions-used-by-cdk-deployments
- https://docs.aws.amazon.com/cdk/api/v2/docs/app-staging-synthesizer-alpha-readme.html
IReusableStackSynthesizer
new PulumiSynthesizer(
props
):PulumiSynthesizer
Parameter | Type |
---|---|
props |
PulumiSynthesizerOptions |
PulumiSynthesizerBase
.constructor
Property | Modifier | Type | Default value | Description | Overrides | Defined in |
---|---|---|---|---|---|---|
stagingBucket? |
public |
BucketV2 |
undefined |
The app-scoped, environment-keyed staging bucket. | - | synthesizer.ts:160 |
stagingRepos |
readonly |
Record <string , Repository > |
{} |
The app-scoped, environment-keyed ecr repositories associated with this app. | - | synthesizer.ts:165 |
stagingStack |
readonly |
CdkConstruct |
undefined |
The Pulumi ComponentResource wrapper which contains all of the staging resources. This can be added to the dependsOn of the main stack to ensure the staging assets are created first |
PulumiSynthesizerBase .stagingStack |
synthesizer.ts:155 |
getDeployTimePrefix():
string
Returns the S3 key prefix that will be used for deploy time assets.
string
PulumiSynthesizerBase
.getDeployTimePrefix
getStagingBucket():
Input
<string
>
Returns the name of the staging bucket that will be used to store assets and custom resource responses.
Input
<string
>
PulumiSynthesizerBase
.getStagingBucket
Base Synthesizer class. If you want to implement your own Pulumi Synthesizer which creates Pulumi resources then you should extend this class.
StackSynthesizer
new PulumiSynthesizerBase():
PulumiSynthesizerBase
cdk.StackSynthesizer.constructor
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
stagingStack |
abstract |
CdkConstruct |
The Pulumi ComponentResource wrapper which contains all of the staging resources. This can be added to the dependsOn of the main stack to ensure the staging assets are created first |
synthesizer.ts:105 |
getDeployTimePrefix():
string
Returns the S3 key prefix that will be used for deploy time assets.
string
abstract
getStagingBucket():Input
<string
>
Returns the name of the staging bucket that will be used to store assets and custom resource responses.
Input
<string
>
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
appId |
readonly |
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, numbers, periods (.) and dashes ('-') only and have a maximum of 17 characters. | synthesizer.ts:30 |
autoDeleteStagingAssets? |
readonly |
boolean |
Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. This will also delete the S3 buckets and ECR repositories themselves when all objects / images are removed. Default true |
synthesizer.ts:75 |
deployTimeFileAssetLifetime? |
readonly |
Duration |
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) |
synthesizer.ts:54 |
imageAssetVersionCount? |
readonly |
number |
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 |
synthesizer.ts:87 |
parent? |
readonly |
Resource |
The parent resource for any Pulumi resources created by the Synthesizer | synthesizer.ts:92 |
stagingBucketName? |
readonly |
string |
Explicit name for the staging bucket Default - a well-known name unique to this app/env. |
synthesizer.ts:37 |
stagingStackNamePrefix? |
readonly |
string |
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 'staging-stack' |
synthesizer.ts:64 |