@aws-cdk/app-staging-synthesizer-alpha 2.84.0-alpha.0 → 2.86.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +218 -42
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +5 -1
- package/README.md +57 -115
- package/lib/app-staging-synthesizer.js +7 -8
- package/lib/bootstrap-roles.d.ts +30 -2
- package/lib/bootstrap-roles.js +32 -4
- package/lib/default-staging-stack.d.ts +20 -0
- package/lib/default-staging-stack.js +48 -6
- package/package.json +8 -8
package/.jsii
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "https://aws.amazon.com"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"aws-cdk-lib": "2.
|
|
11
|
+
"aws-cdk-lib": "2.86.0",
|
|
12
12
|
"constructs": "^10.0.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencyClosure": {
|
|
@@ -547,6 +547,19 @@
|
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
},
|
|
550
|
+
"aws-cdk-lib.aws_cleanrooms": {
|
|
551
|
+
"targets": {
|
|
552
|
+
"dotnet": {
|
|
553
|
+
"package": "Amazon.CDK.AWS.CleanRooms"
|
|
554
|
+
},
|
|
555
|
+
"java": {
|
|
556
|
+
"package": "services.cleanrooms"
|
|
557
|
+
},
|
|
558
|
+
"python": {
|
|
559
|
+
"module": "aws_cdk.aws_cleanrooms"
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
},
|
|
550
563
|
"aws-cdk-lib.aws_cloud9": {
|
|
551
564
|
"targets": {
|
|
552
565
|
"dotnet": {
|
|
@@ -3466,7 +3479,7 @@
|
|
|
3466
3479
|
"stability": "experimental"
|
|
3467
3480
|
},
|
|
3468
3481
|
"homepage": "https://github.com/aws/aws-cdk",
|
|
3469
|
-
"jsiiVersion": "5.0.
|
|
3482
|
+
"jsiiVersion": "5.0.11 (build 5e2d6be)",
|
|
3470
3483
|
"keywords": [
|
|
3471
3484
|
"aws",
|
|
3472
3485
|
"cdk"
|
|
@@ -3485,7 +3498,7 @@
|
|
|
3485
3498
|
},
|
|
3486
3499
|
"name": "@aws-cdk/app-staging-synthesizer-alpha",
|
|
3487
3500
|
"readme": {
|
|
3488
|
-
"markdown": "# App Staging Synthesizer\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\nThis library includes constructs aimed at replacing the current model of bootstrapping and providing\ngreater control of the bootstrap experience to the CDK user. The important constructs in this library\nare as follows:\n\n- the `IStagingResources` interface: a framework for an app-level bootstrap stack that handles\n file assets and docker assets.\n- the `DefaultStagingStack`, which is a works-out-of-the-box implementation of the `IStagingResources`\n interface.\n- the `AppStagingSynthesizer`, a new CDK synthesizer that will synthesize CDK applications with\n the staging resources provided.\n\n> As this library is `experimental`, there are features that are not yet implemented. Please look\n> at the list of [Known Limitations](#known-limitations) before getting started.\n\nTo get started, update your CDK App with a new `defaultStackSynthesizer`:\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id', // put a unique id here\n }),\n});\n```\n\nThis will introduce a `DefaultStagingStack` in your CDK App and staging assets of your App\nwill live in the resources from that stack rather than the CDK Bootstrap stack.\n\nIf you are migrating from a different version of synthesis your updated CDK App will target\nthe resources in the `DefaultStagingStack` and no longer be tied to the bootstrapped resources\nin your account.\n\n## Bootstrap Model\n\nOur current bootstrap model looks like this, when you run `cdk bootstrap aws://<account>/<region>` :\n\n```text\n┌───────────────────────────────────┐┌────────────────────────┐┌────────────────────────┐\n│ ││ ││ │\n│ ││ ││ │\n│ ┌───────────────┐ ││ ┌──────────────┐ ││ ┌──────────────┐ │\n│ │Bootstrap Stack│ ││ │ CDK App 1 │ ││ │ CDK App 2 │ │\n│ └───────────────┘ ││ └──────────────┘ ││ └──────────────┘ │\n│ ││ ││ │\n│ ││ ││ │\n│ ┌───────────────────────────┐ ││ ┌────────────┐ ││ │\n│ │IAM Role for CFN execution │ ││┌────│ S3 Asset │ ││ │\n│ │ IAM Role for lookup │ │││ └────────────┘ ││ │\n│ │ IAM Role for deployment │ │││ ││ │\n│ └───────────────────────────┘ │││ ││ ┌─────────────┐ │\n│ │││ ┌──────────┼┼─────│ S3 Asset │ │\n│ │││ │ ││ └─────────────┘ │\n│ ┌───────────────────────────────┐ │││ │ ││ │\n│ │ IAM Role for File Publishing │ │││ │ ││ │\n│ │ IAM Role for Image Publishing │ │││ │ ││ │\n│ └───────────────────────────────┘ │││ │ ││ │\n│ │││ │ ││ │\n│ ┌─────────────────────────────┐ │││ │ ││ │\n│ │S3 Bucket for Staging Assets │ │││ │ ││ │\n│ │ KMS Key encryption │◀─┼┼┴────────────┘ ││ ┌────────────┐ │\n│ └─────────────────────────────┘ ││ ┌──────────┼┼───── │ ECR Asset │ │\n│ ││ │ ││ └────────────┘ │\n│ ││ │ ││ │\n│┌─────────────────────────────────┐││ │ ││ │\n││ECR Repository for Staging Assets◀┼┼─────────────┘ ││ │\n│└─────────────────────────────────┘││ ││ │\n│ ││ ││ │\n│ ││ ││ │\n│ ││ ││ │\n│ ││ ││ │\n│ ││ ││ │\n│ ││ ││ │\n└───────────────────────────────────┘└────────────────────────┘└────────────────────────┘\n```\n\nYour CDK Application utilizes these resources when deploying. For example, if you have a file asset,\nit gets uploaded to the S3 Staging Bucket using the File Publishing Role when you run `cdk deploy`.\n\nThis library introduces an alternate model to bootstrapping, by splitting out essential CloudFormation IAM roles\nand staging resources. There will still be a Bootstrap Stack, but this will only contain IAM roles necessary for\nCloudFormation deployment. Each CDK App will instead be in charge of its own staging resources, including the\nS3 Bucket, ECR Repositories, and associated IAM roles. It works like this:\n\nThe Staging Stack will contain, on a per-need basis,\n\n- 1 S3 Bucket with KMS encryption for all file assets in the CDK App.\n- An ECR Repository _per_ image (and its revisions).\n- IAM roles with access to the Bucket and Repositories.\n\n```text\n┌─────────────────────────────┐┌───────────────────────────────────────┐┌───────────────────────────────────────┐\n│ ││ ││ │\n│ ┌───────────────┐ ││ ┌──────────────┐ ││ ┌──────────────┐ │\n│ │Bootstrap Stack│ ││ │ CDK App 1 │ ││ │ CDK App 2 │ │\n│ └───────────────┘ ││ └──────────────┘ ││ └──────────────┘ │\n│ ││┌──────────────────┐ ││┌──────────────────┐ │\n│ │││ ┌──────────────┐ │ │││ ┌──────────────┐ │ │\n│ │││ │Staging Stack │ │ │││ │Staging Stack │ │ │\n│ │││ └──────────────┘ │ │││ └──────────────┘ │ │\n│ │││ │ │││ │ │\n│ │││ │ │││ │ │\n│ │││┌────────────────┐│ ┌────────────┐│││┌────────────────┐│ ┌────────────┐│\n│ ││││ IAM Role for ││ ┌───│ S3 Asset │││││ IAM Role for ││ ┌───│ S3 Asset ││\n│ ││││File Publishing ││ │ └────────────┘││││File Publishing ││ │ └────────────┘│\n│ │││└────────────────┘│ │ ││││ IAM Role for ││ │ │\n│ │││ │ │ ││││Image Publishing││ │ │\n│┌───────────────────────────┐│││ │ │ │││└────────────────┘│ │ │\n││IAM Role for CFN execution ││││ │ │ │││ │ │ │\n││ IAM Role for lookup ││││ │ │ │││ │ │ │\n││ IAM Role for deployment ││││┌────────────────┐│ │ │││┌────────────────┐│ │ │\n│└───────────────────────────┘││││ S3 Bucket for ││ │ ││││ S3 Bucket for ││ │ │\n│ ││││ Staging Assets │◀─┘ ││││ Staging Assets │◀─┘ │\n│ │││└────────────────┘│ │││└────────────────┘│ ┌───────────┐│\n│ │││ │ │││ │ ┌───│ ECR Asset ││\n│ │││ │ │││┌────────────────┐│ │ └───────────┘│\n│ │││ │ ││││ ECR Repository ││ │ │\n│ │││ │ ││││ for Staging │◀──┘ │\n│ │││ │ ││││ Assets ││ │\n│ │││ │ │││└────────────────┘│ │\n│ │││ │ │││ │ │\n│ │││ │ │││ │ │\n│ │││ │ │││ │ │\n│ │││ │ │││ │ │\n│ │││ │ │││ │ │\n│ ││└──────────────────┘ ││└──────────────────┘ │\n└─────────────────────────────┘└───────────────────────────────────────┘└───────────────────────────────────────┘\n```\n\nThis allows staging resources to be created when needed next to the CDK App. It has the following\nbenefits:\n\n- Resources between separate CDK Apps are separated so they can be cleaned up and lifecycle\ncontrolled individually.\n- Users have a familiar way to customize staging resources in the CDK Application.\n\n## Using the Default Staging Stack per Environment\n\nThe most common use case will be to use the built-in default resources. In this scenario, the\nsynthesizer will create a new Staging Stack in each environment the CDK App is deployed to store\nits staging resources. To use this kind of synthesizer, use `AppStagingSynthesizer.defaultResources()`.\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n }),\n});\n```\n\nEvery CDK App that uses the `DefaultStagingStack` must include an `appId`. This should\nbe an identifier unique to the app and is used to differentiate staging resources associated\nwith the app.\n\n### Default Staging Stack\n\nThe Default Staging Stack includes all the staging resources necessary for CDK Assets. The below example\nis of a CDK App using the `AppStagingSynthesizer` and creating a file asset for the Lambda Function\nsource code. As part of the `DefaultStagingStack`, an S3 bucket and IAM role will be created that will be\nused to upload the asset to S3.\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({ appId: 'my-app-id' }),\n});\n\nconst stack = new Stack(app, 'my-stack');\n\nnew lambda.Function(stack, 'lambda', {\n code: lambda.AssetCode.fromAsset(path.join(__dirname, 'assets')),\n handler: 'index.handler',\n runtime: lambda.Runtime.PYTHON_3_9,\n});\n\napp.synth();\n```\n\n### Custom Roles\n\nYou can customize some or all of the roles you'd like to use in the synthesizer as well,\nif all you need is to supply custom roles (and not change anything else in the `DefaultStagingStack`):\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n deploymentIdentities: DeploymentIdentities.specifyRoles({\n cloudFormationExecutionRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Execute'),\n deploymentRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Deploy'),\n lookupRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Lookup'),\n }),\n }),\n});\n```\n\nOr, you can ask to use the CLI credentials that exist at deploy-time.\nThese credentials must have the ability to perform CloudFormation calls,\nlookup resources in your account, and perform CloudFormation deployment.\nFor a full list of what is necessary, see `LookupRole`, `DeploymentActionRole`,\nand `CloudFormationExecutionRole` in the\n[bootstrap template](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml).\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n deploymentIdentities: DeploymentIdentities.cliCredentials(),\n }),\n});\n```\n\nThe default staging stack will create roles to publish to the S3 bucket and ECR repositories,\nassumable by the deployment role. You can also specify an existing IAM role for the\n`fileAssetPublishingRole` or `imageAssetPublishingRole`:\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n fileAssetPublishingRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/S3Access'),\n imageAssetPublishingRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/ECRAccess'),\n }),\n});\n```\n\n### Deploy Time S3 Assets\n\nThere are two types of assets:\n\n- Assets used only during deployment. These are used to hand off a large piece of data to another\nservice, that will make a private copy of that data. After deployment, the asset is only necessary for\na potential future rollback.\n- Assets accessed throughout the running life time of the application.\n\nExamples of assets that are only used at deploy time are CloudFormation Templates and Lambda Code\nbundles. Examples of assets accessed throughout the life time of the application are script files\ndownloaded to run in a CodeBuild Project, or on EC2 instance startup. ECR images are always application\nlife-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.\n\nLambda assets are by default marked as deploy time assets:\n\n```ts\ndeclare const stack: Stack;\nnew lambda.Function(stack, 'lambda', {\n code: lambda.AssetCode.fromAsset(path.join(__dirname, 'assets')), // lambda marks deployTime = true\n handler: 'index.handler',\n runtime: lambda.Runtime.PYTHON_3_9,\n});\n```\n\nOr, if you want to create your own deploy time asset:\n\n```ts\nimport { Asset } from 'aws-cdk-lib/aws-s3-assets';\n\ndeclare const stack: Stack;\nconst asset = new Asset(stack, 'deploy-time-asset', {\n deployTime: true,\n path: path.join(__dirname, './deploy-time-asset'),\n});\n```\n\nBy default, we store deploy time assets for 30 days, but you can change this number by specifying\n`deployTimeFileAssetLifetime`. The number you specify here is how long you will be able to roll back\nto a previous version of an application just by doing a CloudFormation deployment with the old\ntemplate, without rebuilding and republishing assets.\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n deployTimeFileAssetLifetime: Duration.days(100),\n }),\n});\n```\n\n### Lifecycle Rules on ECR Repositories\n\nBy default, we store a maximum of 3 revisions of a particular docker image asset. This allows\nfor smooth faciliation of rollback scenarios where we may reference previous versions of an\nimage. When more than 3 revisions of an asset exist in the ECR repository, the oldest one is\npurged.\n\nTo change the number of revisions stored, use `imageAssetVersionCount`:\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n imageAssetVersionCount: 10,\n }),\n});\n```\n\n## Using a Custom Staging Stack per Environment\n\nIf you want to customize some behavior that is not configurable via properties,\nyou can implement your own class that implements `IStagingResources`. To get a head start,\nyou can subclass `DefaultStagingStack`.\n\n```ts\ninterface CustomStagingStackOptions extends DefaultStagingStackOptions {}\n\nclass CustomStagingStack extends DefaultStagingStack {\n}\n```\n\nOr you can roll your own staging resources from scratch, as long as it implements `IStagingResources`.\n\n```ts\ninterface CustomStagingStackProps extends StackProps {}\n\nclass CustomStagingStack extends Stack implements IStagingResources {\n public constructor(scope: Construct, id: string, props: CustomStagingStackProps) {\n super(scope, id, props);\n }\n\n public addFile(asset: FileAssetSource): FileStagingLocation {\n return {\n bucketName: 'myBucket',\n assumeRoleArn: 'myArn',\n dependencyStack: this,\n };\n }\n\n public addDockerImage(asset: DockerImageAssetSource): ImageStagingLocation {\n return {\n repoName: 'myRepo',\n assumeRoleArn: 'myArn',\n dependencyStack: this,\n };\n }\n}\n```\n\nUsing your custom staging resources means implementing a `CustomFactory` class and calling the\n`AppStagingSynthesizer.customFactory()` static method. This has the benefit of providing a\ncustom Staging Stack that can be created in every environment the CDK App is deployed to.\n\n```ts fixture=with-custom-staging\nclass CustomFactory implements IStagingResourcesFactory {\n public obtainStagingResources(stack: Stack, context: ObtainStagingResourcesContext) {\n const myApp = App.of(stack);\n\n return new CustomStagingStack(myApp!, `CustomStagingStack-${context.environmentString}`, {});\n }\n}\n\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.customFactory({\n factory: new CustomFactory(),\n oncePerEnv: true, // by default\n }),\n});\n```\n\n## Using an Existing Staging Stack\n\nUse `AppStagingSynthesizer.customResources()` to supply an existing stack as the Staging Stack.\nMake sure that the custom stack you provide implements `IStagingResources`.\n\n```ts fixture=with-custom-staging\nconst resourceApp = new App();\nconst resources = new CustomStagingStack(resourceApp, 'CustomStagingStack', {});\n\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.customResources({\n resources,\n }),\n});\n```\n\n## Known Limitations\n\nSince this module is experimental, there are some known limitations:\n\n- Currently this module does not support CDK Pipelines. You must deploy CDK Apps using this\n synthesizer via `cdk deploy`.\n- This synthesizer only needs a bootstrap stack with Roles, without staging resources. We\n haven't written such a bootstrap stack yet; at the moment you can use the existing modern\n bootstrap stack, the staging resources in them will just go unused.\n- Due to limitations on the CloudFormation template size, CDK Applications can have\n at most 38 independent ECR images.\n- When you run `cdk destroy` (for example during testing), the staging bucket and ECR\n repositories will be left behind because CloudFormation cannot clean up non-empty resources.\n You must deploy those resources manually if you want to redeploy again using the same `appId`.\n"
|
|
3501
|
+
"markdown": "# App Staging Synthesizer\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\nThis library includes constructs aimed at replacing the current model of bootstrapping and providing\ngreater control of the bootstrap experience to the CDK user. The important constructs in this library\nare as follows:\n\n- the `IStagingResources` interface: a framework for an app-level bootstrap stack that handles\n file assets and docker assets.\n- the `DefaultStagingStack`, which is a works-out-of-the-box implementation of the `IStagingResources`\n interface.\n- the `AppStagingSynthesizer`, a new CDK synthesizer that will synthesize CDK applications with\n the staging resources provided.\n\n> As this library is `experimental`, there are features that are not yet implemented. Please look\n> at the list of [Known Limitations](#known-limitations) before getting started.\n\nTo get started, update your CDK App with a new `defaultStackSynthesizer`:\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id', // put a unique id here\n }),\n});\n```\n\nThis will introduce a `DefaultStagingStack` in your CDK App and staging assets of your App\nwill live in the resources from that stack rather than the CDK Bootstrap stack.\n\nIf you are migrating from a different version of synthesis your updated CDK App will target\nthe resources in the `DefaultStagingStack` and no longer be tied to the bootstrapped resources\nin your account.\n\n## Bootstrap Model\n\nIn our default bootstrapping process, when you run `cdk bootstrap aws://<account>/<region>`, the following\nresources are created:\n\n- It creates Roles to assume for cross-account deployments and for Pipeline deployments;\n- It creates staging resources: a global S3 bucket and global ECR repository to hold CDK assets;\n- It creates Roles to write to the S3 bucket and ECR repository;\n\nBecause the bootstrapping resources include regional resources, you need to bootstrap\nevery region you plan to deploy to individually. All assets of all CDK apps deploying\nto that account and region will be written to the single S3 Bucket and ECR repository.\n\nBy using the synthesizer in this library, instead of the\n`DefaultStackSynthesizer`, a different set of staging resources will be created\nfor every CDK application, and they will be created automatically as part of a\nregular deployment, in a separate Stack that is deployed before your application\nStacks. The staging resources will be one S3 bucket, and *one ECR repository per\nimage*, and Roles necessary to access those buckets and ECR repositories. The\nRoles from the default bootstrap stack are still used (though their use can be\nturned off).\n\nThis has the following advantages:\n\n- Because staging resources are now application-specific, they can be fully cleaned up when you clean up\n the application.\n- Because there is now one ECR repository per image instead of one ECR repository for all images, it is\n possible to effectively use ECR life cycle rules (for example, retain only the most recent 5 images)\n to cut down on storage costs.\n- Resources between separate CDK Apps are separated so they can be cleaned up and lifecycle\n controlled individually.\n- Because the only shared bootstrapping resources required are Roles, which are global resources,\n you now only need to bootstrap every account in one Region (instead of every Region). This makes it\n easier to do with CloudFormation StackSets.\n\nFor the deployment roles, this synthesizer still uses the Roles from the default\nbootstrap stack, and nothing else. The staging resources from that bootstrap\nstack will be unused. You can customize the template to remove those resources\nif you prefer. In the future, we will provide a bootstrap stack template with\nonly those Roles, specifically for use with this synthesizer.\n\n## Using the Default Staging Stack per Environment\n\nThe most common use case will be to use the built-in default resources. In this scenario, the\nsynthesizer will create a new Staging Stack in each environment the CDK App is deployed to store\nits staging resources. To use this kind of synthesizer, use `AppStagingSynthesizer.defaultResources()`.\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n\n // The following line is optional. By default it is assumed you have bootstrapped in the same\n // region(s) as the stack(s) you are deploying.\n deploymentIdentities: DeploymentIdentities.defaultBootstrapRoles({ bootstrapRegion: 'us-east-1' }),\n }),\n});\n```\n\nEvery CDK App that uses the `DefaultStagingStack` must include an `appId`. This should\nbe an identifier unique to the app and is used to differentiate staging resources associated\nwith the app.\n\n### Default Staging Stack\n\nThe Default Staging Stack includes all the staging resources necessary for CDK Assets. The below example\nis of a CDK App using the `AppStagingSynthesizer` and creating a file asset for the Lambda Function\nsource code. As part of the `DefaultStagingStack`, an S3 bucket and IAM role will be created that will be\nused to upload the asset to S3.\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({ appId: 'my-app-id' }),\n});\n\nconst stack = new Stack(app, 'my-stack');\n\nnew lambda.Function(stack, 'lambda', {\n code: lambda.AssetCode.fromAsset(path.join(__dirname, 'assets')),\n handler: 'index.handler',\n runtime: lambda.Runtime.PYTHON_3_9,\n});\n\napp.synth();\n```\n\n### Custom Roles\n\nYou can customize some or all of the roles you'd like to use in the synthesizer as well,\nif all you need is to supply custom roles (and not change anything else in the `DefaultStagingStack`):\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n deploymentIdentities: DeploymentIdentities.specifyRoles({\n cloudFormationExecutionRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Execute'),\n deploymentRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Deploy'),\n lookupRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Lookup'),\n }),\n }),\n});\n```\n\nOr, you can ask to use the CLI credentials that exist at deploy-time.\nThese credentials must have the ability to perform CloudFormation calls,\nlookup resources in your account, and perform CloudFormation deployment.\nFor a full list of what is necessary, see `LookupRole`, `DeploymentActionRole`,\nand `CloudFormationExecutionRole` in the\n[bootstrap template](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml).\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n deploymentIdentities: DeploymentIdentities.cliCredentials(),\n }),\n});\n```\n\nThe default staging stack will create roles to publish to the S3 bucket and ECR repositories,\nassumable by the deployment role. You can also specify an existing IAM role for the\n`fileAssetPublishingRole` or `imageAssetPublishingRole`:\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n fileAssetPublishingRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/S3Access'),\n imageAssetPublishingRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/ECRAccess'),\n }),\n});\n```\n\n### Deploy Time S3 Assets\n\nThere are two types of assets:\n\n- Assets used only during deployment. These are used to hand off a large piece of data to another\nservice, that will make a private copy of that data. After deployment, the asset is only necessary for\na potential future rollback.\n- Assets accessed throughout the running life time of the application.\n\nExamples of assets that are only used at deploy time are CloudFormation Templates and Lambda Code\nbundles. Examples of assets accessed throughout the life time of the application are script files\ndownloaded to run in a CodeBuild Project, or on EC2 instance startup. ECR images are always application\nlife-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.\n\nLambda assets are by default marked as deploy time assets:\n\n```ts\ndeclare const stack: Stack;\nnew lambda.Function(stack, 'lambda', {\n code: lambda.AssetCode.fromAsset(path.join(__dirname, 'assets')), // lambda marks deployTime = true\n handler: 'index.handler',\n runtime: lambda.Runtime.PYTHON_3_9,\n});\n```\n\nOr, if you want to create your own deploy time asset:\n\n```ts\nimport { Asset } from 'aws-cdk-lib/aws-s3-assets';\n\ndeclare const stack: Stack;\nconst asset = new Asset(stack, 'deploy-time-asset', {\n deployTime: true,\n path: path.join(__dirname, './deploy-time-asset'),\n});\n```\n\nBy default, we store deploy time assets for 30 days, but you can change this number by specifying\n`deployTimeFileAssetLifetime`. The number you specify here is how long you will be able to roll back\nto a previous version of an application just by doing a CloudFormation deployment with the old\ntemplate, without rebuilding and republishing assets.\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n deployTimeFileAssetLifetime: Duration.days(100),\n }),\n});\n```\n\n### Lifecycle Rules on ECR Repositories\n\nBy default, we store a maximum of 3 revisions of a particular docker image asset. This allows\nfor smooth faciliation of rollback scenarios where we may reference previous versions of an\nimage. When more than 3 revisions of an asset exist in the ECR repository, the oldest one is\npurged.\n\nTo change the number of revisions stored, use `imageAssetVersionCount`:\n\n```ts\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n imageAssetVersionCount: 10,\n }),\n});\n```\n\n## Using a Custom Staging Stack per Environment\n\nIf you want to customize some behavior that is not configurable via properties,\nyou can implement your own class that implements `IStagingResources`. To get a head start,\nyou can subclass `DefaultStagingStack`.\n\n```ts\ninterface CustomStagingStackOptions extends DefaultStagingStackOptions {}\n\nclass CustomStagingStack extends DefaultStagingStack {\n}\n```\n\nOr you can roll your own staging resources from scratch, as long as it implements `IStagingResources`.\n\n```ts\ninterface CustomStagingStackProps extends StackProps {}\n\nclass CustomStagingStack extends Stack implements IStagingResources {\n public constructor(scope: Construct, id: string, props: CustomStagingStackProps) {\n super(scope, id, props);\n }\n\n public addFile(asset: FileAssetSource): FileStagingLocation {\n return {\n bucketName: 'myBucket',\n assumeRoleArn: 'myArn',\n dependencyStack: this,\n };\n }\n\n public addDockerImage(asset: DockerImageAssetSource): ImageStagingLocation {\n return {\n repoName: 'myRepo',\n assumeRoleArn: 'myArn',\n dependencyStack: this,\n };\n }\n}\n```\n\nUsing your custom staging resources means implementing a `CustomFactory` class and calling the\n`AppStagingSynthesizer.customFactory()` static method. This has the benefit of providing a\ncustom Staging Stack that can be created in every environment the CDK App is deployed to.\n\n```ts fixture=with-custom-staging\nclass CustomFactory implements IStagingResourcesFactory {\n public obtainStagingResources(stack: Stack, context: ObtainStagingResourcesContext) {\n const myApp = App.of(stack);\n\n return new CustomStagingStack(myApp!, `CustomStagingStack-${context.environmentString}`, {});\n }\n}\n\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.customFactory({\n factory: new CustomFactory(),\n oncePerEnv: true, // by default\n }),\n});\n```\n\n## Using an Existing Staging Stack\n\nUse `AppStagingSynthesizer.customResources()` to supply an existing stack as the Staging Stack.\nMake sure that the custom stack you provide implements `IStagingResources`.\n\n```ts fixture=with-custom-staging\nconst resourceApp = new App();\nconst resources = new CustomStagingStack(resourceApp, 'CustomStagingStack', {});\n\nconst app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.customResources({\n resources,\n }),\n});\n```\n\n## Known Limitations\n\nSince this module is experimental, there are some known limitations:\n\n- Currently this module does not support CDK Pipelines. You must deploy CDK Apps using this\n synthesizer via `cdk deploy`. Please upvote [this issue](https://github.com/aws/aws-cdk/issues/26118)\n to indicate you want this.\n- This synthesizer only needs a bootstrap stack with Roles, without staging resources. We\n haven't written such a bootstrap stack yet; at the moment you can use the existing modern\n bootstrap stack, the staging resources in them will just go unused. You can customize the\n template to remove them if desired.\n- Due to limitations on the CloudFormation template size, CDK Applications can have\n at most 38 independent ECR images. Please upvote [this issue](https://github.com/aws/aws-cdk/issues/26119)\n if you need more than this.\n"
|
|
3489
3502
|
},
|
|
3490
3503
|
"repository": {
|
|
3491
3504
|
"directory": "packages/@aws-cdk/app-staging-synthesizer-alpha",
|
|
@@ -3884,7 +3897,7 @@
|
|
|
3884
3897
|
"kind": "class",
|
|
3885
3898
|
"locationInModule": {
|
|
3886
3899
|
"filename": "lib/bootstrap-roles.ts",
|
|
3887
|
-
"line":
|
|
3900
|
+
"line": 8
|
|
3888
3901
|
},
|
|
3889
3902
|
"methods": [
|
|
3890
3903
|
{
|
|
@@ -3894,7 +3907,7 @@
|
|
|
3894
3907
|
},
|
|
3895
3908
|
"locationInModule": {
|
|
3896
3909
|
"filename": "lib/bootstrap-roles.ts",
|
|
3897
|
-
"line":
|
|
3910
|
+
"line": 12
|
|
3898
3911
|
},
|
|
3899
3912
|
"name": "cliCredentials",
|
|
3900
3913
|
"returns": {
|
|
@@ -3911,7 +3924,7 @@
|
|
|
3911
3924
|
},
|
|
3912
3925
|
"locationInModule": {
|
|
3913
3926
|
"filename": "lib/bootstrap-roles.ts",
|
|
3914
|
-
"line":
|
|
3927
|
+
"line": 19
|
|
3915
3928
|
},
|
|
3916
3929
|
"name": "fromRoleArn",
|
|
3917
3930
|
"parameters": [
|
|
@@ -3936,7 +3949,7 @@
|
|
|
3936
3949
|
},
|
|
3937
3950
|
"locationInModule": {
|
|
3938
3951
|
"filename": "lib/bootstrap-roles.ts",
|
|
3939
|
-
"line":
|
|
3952
|
+
"line": 31
|
|
3940
3953
|
},
|
|
3941
3954
|
"name": "isCliCredentials",
|
|
3942
3955
|
"returns": {
|
|
@@ -3964,7 +3977,7 @@
|
|
|
3964
3977
|
"kind": "interface",
|
|
3965
3978
|
"locationInModule": {
|
|
3966
3979
|
"filename": "lib/bootstrap-roles.ts",
|
|
3967
|
-
"line":
|
|
3980
|
+
"line": 142
|
|
3968
3981
|
},
|
|
3969
3982
|
"name": "BootstrapRoles",
|
|
3970
3983
|
"properties": [
|
|
@@ -3978,7 +3991,7 @@
|
|
|
3978
3991
|
"immutable": true,
|
|
3979
3992
|
"locationInModule": {
|
|
3980
3993
|
"filename": "lib/bootstrap-roles.ts",
|
|
3981
|
-
"line":
|
|
3994
|
+
"line": 148
|
|
3982
3995
|
},
|
|
3983
3996
|
"name": "cloudFormationExecutionRole",
|
|
3984
3997
|
"optional": true,
|
|
@@ -3996,7 +4009,7 @@
|
|
|
3996
4009
|
"immutable": true,
|
|
3997
4010
|
"locationInModule": {
|
|
3998
4011
|
"filename": "lib/bootstrap-roles.ts",
|
|
3999
|
-
"line":
|
|
4012
|
+
"line": 155
|
|
4000
4013
|
},
|
|
4001
4014
|
"name": "deploymentRole",
|
|
4002
4015
|
"optional": true,
|
|
@@ -4014,7 +4027,7 @@
|
|
|
4014
4027
|
"immutable": true,
|
|
4015
4028
|
"locationInModule": {
|
|
4016
4029
|
"filename": "lib/bootstrap-roles.ts",
|
|
4017
|
-
"line":
|
|
4030
|
+
"line": 162
|
|
4018
4031
|
},
|
|
4019
4032
|
"name": "lookupRole",
|
|
4020
4033
|
"optional": true,
|
|
@@ -4125,6 +4138,47 @@
|
|
|
4125
4138
|
],
|
|
4126
4139
|
"symbolId": "lib/app-staging-synthesizer:CustomResourcesOptions"
|
|
4127
4140
|
},
|
|
4141
|
+
"@aws-cdk/app-staging-synthesizer-alpha.DefaultBootstrapRolesOptions": {
|
|
4142
|
+
"assembly": "@aws-cdk/app-staging-synthesizer-alpha",
|
|
4143
|
+
"datatype": true,
|
|
4144
|
+
"docs": {
|
|
4145
|
+
"stability": "experimental",
|
|
4146
|
+
"summary": "Options for `DeploymentIdentities.defaultBootstrappedRoles`.",
|
|
4147
|
+
"example": "const app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n\n // The following line is optional. By default it is assumed you have bootstrapped in the same\n // region(s) as the stack(s) you are deploying.\n deploymentIdentities: DeploymentIdentities.defaultBootstrapRoles({ bootstrapRegion: 'us-east-1' }),\n }),\n});",
|
|
4148
|
+
"custom": {
|
|
4149
|
+
"exampleMetadata": "infused"
|
|
4150
|
+
}
|
|
4151
|
+
},
|
|
4152
|
+
"fqn": "@aws-cdk/app-staging-synthesizer-alpha.DefaultBootstrapRolesOptions",
|
|
4153
|
+
"kind": "interface",
|
|
4154
|
+
"locationInModule": {
|
|
4155
|
+
"filename": "lib/bootstrap-roles.ts",
|
|
4156
|
+
"line": 128
|
|
4157
|
+
},
|
|
4158
|
+
"name": "DefaultBootstrapRolesOptions",
|
|
4159
|
+
"properties": [
|
|
4160
|
+
{
|
|
4161
|
+
"abstract": true,
|
|
4162
|
+
"docs": {
|
|
4163
|
+
"default": "- the stack's current region",
|
|
4164
|
+
"remarks": "By default, the region in which the stack is deployed is used.",
|
|
4165
|
+
"stability": "experimental",
|
|
4166
|
+
"summary": "The region where the default bootstrap roles have been created."
|
|
4167
|
+
},
|
|
4168
|
+
"immutable": true,
|
|
4169
|
+
"locationInModule": {
|
|
4170
|
+
"filename": "lib/bootstrap-roles.ts",
|
|
4171
|
+
"line": 136
|
|
4172
|
+
},
|
|
4173
|
+
"name": "bootstrapRegion",
|
|
4174
|
+
"optional": true,
|
|
4175
|
+
"type": {
|
|
4176
|
+
"primitive": "string"
|
|
4177
|
+
}
|
|
4178
|
+
}
|
|
4179
|
+
],
|
|
4180
|
+
"symbolId": "lib/bootstrap-roles:DefaultBootstrapRolesOptions"
|
|
4181
|
+
},
|
|
4128
4182
|
"@aws-cdk/app-staging-synthesizer-alpha.DefaultResourcesOptions": {
|
|
4129
4183
|
"assembly": "@aws-cdk/app-staging-synthesizer-alpha",
|
|
4130
4184
|
"datatype": true,
|
|
@@ -4164,7 +4218,7 @@
|
|
|
4164
4218
|
},
|
|
4165
4219
|
"locationInModule": {
|
|
4166
4220
|
"filename": "lib/default-staging-stack.ts",
|
|
4167
|
-
"line":
|
|
4221
|
+
"line": 230
|
|
4168
4222
|
},
|
|
4169
4223
|
"parameters": [
|
|
4170
4224
|
{
|
|
@@ -4193,7 +4247,7 @@
|
|
|
4193
4247
|
"kind": "class",
|
|
4194
4248
|
"locationInModule": {
|
|
4195
4249
|
"filename": "lib/default-staging-stack.ts",
|
|
4196
|
-
"line":
|
|
4250
|
+
"line": 143
|
|
4197
4251
|
},
|
|
4198
4252
|
"methods": [
|
|
4199
4253
|
{
|
|
@@ -4203,7 +4257,7 @@
|
|
|
4203
4257
|
},
|
|
4204
4258
|
"locationInModule": {
|
|
4205
4259
|
"filename": "lib/default-staging-stack.ts",
|
|
4206
|
-
"line":
|
|
4260
|
+
"line": 147
|
|
4207
4261
|
},
|
|
4208
4262
|
"name": "factory",
|
|
4209
4263
|
"parameters": [
|
|
@@ -4228,7 +4282,7 @@
|
|
|
4228
4282
|
},
|
|
4229
4283
|
"locationInModule": {
|
|
4230
4284
|
"filename": "lib/default-staging-stack.ts",
|
|
4231
|
-
"line":
|
|
4285
|
+
"line": 450
|
|
4232
4286
|
},
|
|
4233
4287
|
"name": "addDockerImage",
|
|
4234
4288
|
"overrides": "@aws-cdk/app-staging-synthesizer-alpha.IStagingResources",
|
|
@@ -4253,7 +4307,7 @@
|
|
|
4253
4307
|
},
|
|
4254
4308
|
"locationInModule": {
|
|
4255
4309
|
"filename": "lib/default-staging-stack.ts",
|
|
4256
|
-
"line":
|
|
4310
|
+
"line": 438
|
|
4257
4311
|
},
|
|
4258
4312
|
"name": "addFile",
|
|
4259
4313
|
"overrides": "@aws-cdk/app-staging-synthesizer-alpha.IStagingResources",
|
|
@@ -4282,7 +4336,7 @@
|
|
|
4282
4336
|
"immutable": true,
|
|
4283
4337
|
"locationInModule": {
|
|
4284
4338
|
"filename": "lib/default-staging-stack.ts",
|
|
4285
|
-
"line":
|
|
4339
|
+
"line": 207
|
|
4286
4340
|
},
|
|
4287
4341
|
"name": "dependencyStack",
|
|
4288
4342
|
"type": {
|
|
@@ -4297,7 +4351,7 @@
|
|
|
4297
4351
|
"immutable": true,
|
|
4298
4352
|
"locationInModule": {
|
|
4299
4353
|
"filename": "lib/default-staging-stack.ts",
|
|
4300
|
-
"line":
|
|
4354
|
+
"line": 202
|
|
4301
4355
|
},
|
|
4302
4356
|
"name": "stagingRepos",
|
|
4303
4357
|
"type": {
|
|
@@ -4317,7 +4371,7 @@
|
|
|
4317
4371
|
"immutable": true,
|
|
4318
4372
|
"locationInModule": {
|
|
4319
4373
|
"filename": "lib/default-staging-stack.ts",
|
|
4320
|
-
"line":
|
|
4374
|
+
"line": 197
|
|
4321
4375
|
},
|
|
4322
4376
|
"name": "stagingBucket",
|
|
4323
4377
|
"optional": true,
|
|
@@ -4343,7 +4397,7 @@
|
|
|
4343
4397
|
"kind": "interface",
|
|
4344
4398
|
"locationInModule": {
|
|
4345
4399
|
"filename": "lib/default-staging-stack.ts",
|
|
4346
|
-
"line":
|
|
4400
|
+
"line": 45
|
|
4347
4401
|
},
|
|
4348
4402
|
"name": "DefaultStagingStackOptions",
|
|
4349
4403
|
"properties": [
|
|
@@ -4357,13 +4411,31 @@
|
|
|
4357
4411
|
"immutable": true,
|
|
4358
4412
|
"locationInModule": {
|
|
4359
4413
|
"filename": "lib/default-staging-stack.ts",
|
|
4360
|
-
"line":
|
|
4414
|
+
"line": 55
|
|
4361
4415
|
},
|
|
4362
4416
|
"name": "appId",
|
|
4363
4417
|
"type": {
|
|
4364
4418
|
"primitive": "string"
|
|
4365
4419
|
}
|
|
4366
4420
|
},
|
|
4421
|
+
{
|
|
4422
|
+
"abstract": true,
|
|
4423
|
+
"docs": {
|
|
4424
|
+
"default": "true",
|
|
4425
|
+
"stability": "experimental",
|
|
4426
|
+
"summary": "Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories."
|
|
4427
|
+
},
|
|
4428
|
+
"immutable": true,
|
|
4429
|
+
"locationInModule": {
|
|
4430
|
+
"filename": "lib/default-staging-stack.ts",
|
|
4431
|
+
"line": 113
|
|
4432
|
+
},
|
|
4433
|
+
"name": "autoDeleteStagingAssets",
|
|
4434
|
+
"optional": true,
|
|
4435
|
+
"type": {
|
|
4436
|
+
"primitive": "boolean"
|
|
4437
|
+
}
|
|
4438
|
+
},
|
|
4367
4439
|
{
|
|
4368
4440
|
"abstract": true,
|
|
4369
4441
|
"docs": {
|
|
@@ -4375,7 +4447,7 @@
|
|
|
4375
4447
|
"immutable": true,
|
|
4376
4448
|
"locationInModule": {
|
|
4377
4449
|
"filename": "lib/default-staging-stack.ts",
|
|
4378
|
-
"line":
|
|
4450
|
+
"line": 93
|
|
4379
4451
|
},
|
|
4380
4452
|
"name": "deployTimeFileAssetLifetime",
|
|
4381
4453
|
"optional": true,
|
|
@@ -4393,7 +4465,7 @@
|
|
|
4393
4465
|
"immutable": true,
|
|
4394
4466
|
"locationInModule": {
|
|
4395
4467
|
"filename": "lib/default-staging-stack.ts",
|
|
4396
|
-
"line":
|
|
4468
|
+
"line": 69
|
|
4397
4469
|
},
|
|
4398
4470
|
"name": "fileAssetPublishingRole",
|
|
4399
4471
|
"optional": true,
|
|
@@ -4411,7 +4483,7 @@
|
|
|
4411
4483
|
"immutable": true,
|
|
4412
4484
|
"locationInModule": {
|
|
4413
4485
|
"filename": "lib/default-staging-stack.ts",
|
|
4414
|
-
"line":
|
|
4486
|
+
"line": 76
|
|
4415
4487
|
},
|
|
4416
4488
|
"name": "imageAssetPublishingRole",
|
|
4417
4489
|
"optional": true,
|
|
@@ -4430,7 +4502,7 @@
|
|
|
4430
4502
|
"immutable": true,
|
|
4431
4503
|
"locationInModule": {
|
|
4432
4504
|
"filename": "lib/default-staging-stack.ts",
|
|
4433
|
-
"line":
|
|
4505
|
+
"line": 105
|
|
4434
4506
|
},
|
|
4435
4507
|
"name": "imageAssetVersionCount",
|
|
4436
4508
|
"optional": true,
|
|
@@ -4448,7 +4520,7 @@
|
|
|
4448
4520
|
"immutable": true,
|
|
4449
4521
|
"locationInModule": {
|
|
4450
4522
|
"filename": "lib/default-staging-stack.ts",
|
|
4451
|
-
"line":
|
|
4523
|
+
"line": 62
|
|
4452
4524
|
},
|
|
4453
4525
|
"name": "stagingBucketName",
|
|
4454
4526
|
"optional": true,
|
|
@@ -4465,7 +4537,7 @@
|
|
|
4465
4537
|
"docs": {
|
|
4466
4538
|
"stability": "experimental",
|
|
4467
4539
|
"summary": "Default Staging Stack Properties.",
|
|
4468
|
-
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as app_staging_synthesizer_alpha from '@aws-cdk/app-staging-synthesizer-alpha';\nimport * as cdk from 'aws-cdk-lib';\n\ndeclare const bootstrapRole: app_staging_synthesizer_alpha.BootstrapRole;\ndeclare const permissionsBoundary: cdk.PermissionsBoundary;\ndeclare const stackSynthesizer: cdk.StackSynthesizer;\nconst defaultStagingStackProps: app_staging_synthesizer_alpha.DefaultStagingStackProps = {\n appId: 'appId',\n qualifier: 'qualifier',\n\n // the properties below are optional\n analyticsReporting: false,\n crossRegionReferences: false,\n deployRoleArn: 'deployRoleArn',\n deployTimeFileAssetLifetime: cdk.Duration.minutes(30),\n description: 'description',\n env: {\n account: 'account',\n region: 'region',\n },\n fileAssetPublishingRole: bootstrapRole,\n imageAssetPublishingRole: bootstrapRole,\n imageAssetVersionCount: 123,\n permissionsBoundary: permissionsBoundary,\n stackName: 'stackName',\n stagingBucketName: 'stagingBucketName',\n synthesizer: stackSynthesizer,\n tags: {\n tagsKey: 'tags',\n },\n terminationProtection: false,\n};",
|
|
4540
|
+
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as app_staging_synthesizer_alpha from '@aws-cdk/app-staging-synthesizer-alpha';\nimport * as cdk from 'aws-cdk-lib';\n\ndeclare const bootstrapRole: app_staging_synthesizer_alpha.BootstrapRole;\ndeclare const permissionsBoundary: cdk.PermissionsBoundary;\ndeclare const stackSynthesizer: cdk.StackSynthesizer;\nconst defaultStagingStackProps: app_staging_synthesizer_alpha.DefaultStagingStackProps = {\n appId: 'appId',\n qualifier: 'qualifier',\n\n // the properties below are optional\n analyticsReporting: false,\n autoDeleteStagingAssets: false,\n crossRegionReferences: false,\n deployRoleArn: 'deployRoleArn',\n deployTimeFileAssetLifetime: cdk.Duration.minutes(30),\n description: 'description',\n env: {\n account: 'account',\n region: 'region',\n },\n fileAssetPublishingRole: bootstrapRole,\n imageAssetPublishingRole: bootstrapRole,\n imageAssetVersionCount: 123,\n permissionsBoundary: permissionsBoundary,\n stackName: 'stackName',\n stagingBucketName: 'stagingBucketName',\n suppressTemplateIndentation: false,\n synthesizer: stackSynthesizer,\n tags: {\n tagsKey: 'tags',\n },\n terminationProtection: false,\n};",
|
|
4469
4541
|
"custom": {
|
|
4470
4542
|
"exampleMetadata": "fixture=_generated"
|
|
4471
4543
|
}
|
|
@@ -4478,7 +4550,7 @@
|
|
|
4478
4550
|
"kind": "interface",
|
|
4479
4551
|
"locationInModule": {
|
|
4480
4552
|
"filename": "lib/default-staging-stack.ts",
|
|
4481
|
-
"line":
|
|
4553
|
+
"line": 119
|
|
4482
4554
|
},
|
|
4483
4555
|
"name": "DefaultStagingStackProps",
|
|
4484
4556
|
"properties": [
|
|
@@ -4492,7 +4564,7 @@
|
|
|
4492
4564
|
"immutable": true,
|
|
4493
4565
|
"locationInModule": {
|
|
4494
4566
|
"filename": "lib/default-staging-stack.ts",
|
|
4495
|
-
"line":
|
|
4567
|
+
"line": 134
|
|
4496
4568
|
},
|
|
4497
4569
|
"name": "qualifier",
|
|
4498
4570
|
"type": {
|
|
@@ -4510,7 +4582,7 @@
|
|
|
4510
4582
|
"immutable": true,
|
|
4511
4583
|
"locationInModule": {
|
|
4512
4584
|
"filename": "lib/default-staging-stack.ts",
|
|
4513
|
-
"line":
|
|
4585
|
+
"line": 127
|
|
4514
4586
|
},
|
|
4515
4587
|
"name": "deployRoleArn",
|
|
4516
4588
|
"optional": true,
|
|
@@ -4526,7 +4598,7 @@
|
|
|
4526
4598
|
"docs": {
|
|
4527
4599
|
"stability": "experimental",
|
|
4528
4600
|
"summary": "Deployment identities are the class of roles to be assumed by the CDK when deploying the App.",
|
|
4529
|
-
"example": "const app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n
|
|
4601
|
+
"example": "const app = new App({\n defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({\n appId: 'my-app-id',\n\n // The following line is optional. By default it is assumed you have bootstrapped in the same\n // region(s) as the stack(s) you are deploying.\n deploymentIdentities: DeploymentIdentities.defaultBootstrapRoles({ bootstrapRegion: 'us-east-1' }),\n }),\n});",
|
|
4530
4602
|
"custom": {
|
|
4531
4603
|
"exampleMetadata": "infused"
|
|
4532
4604
|
}
|
|
@@ -4535,7 +4607,7 @@
|
|
|
4535
4607
|
"kind": "class",
|
|
4536
4608
|
"locationInModule": {
|
|
4537
4609
|
"filename": "lib/bootstrap-roles.ts",
|
|
4538
|
-
"line":
|
|
4610
|
+
"line": 61
|
|
4539
4611
|
},
|
|
4540
4612
|
"methods": [
|
|
4541
4613
|
{
|
|
@@ -4545,7 +4617,7 @@
|
|
|
4545
4617
|
},
|
|
4546
4618
|
"locationInModule": {
|
|
4547
4619
|
"filename": "lib/bootstrap-roles.ts",
|
|
4548
|
-
"line":
|
|
4620
|
+
"line": 65
|
|
4549
4621
|
},
|
|
4550
4622
|
"name": "cliCredentials",
|
|
4551
4623
|
"returns": {
|
|
@@ -4555,6 +4627,32 @@
|
|
|
4555
4627
|
},
|
|
4556
4628
|
"static": true
|
|
4557
4629
|
},
|
|
4630
|
+
{
|
|
4631
|
+
"docs": {
|
|
4632
|
+
"stability": "experimental",
|
|
4633
|
+
"summary": "Use the Roles that have been created by the default bootstrap stack."
|
|
4634
|
+
},
|
|
4635
|
+
"locationInModule": {
|
|
4636
|
+
"filename": "lib/bootstrap-roles.ts",
|
|
4637
|
+
"line": 84
|
|
4638
|
+
},
|
|
4639
|
+
"name": "defaultBootstrapRoles",
|
|
4640
|
+
"parameters": [
|
|
4641
|
+
{
|
|
4642
|
+
"name": "options",
|
|
4643
|
+
"optional": true,
|
|
4644
|
+
"type": {
|
|
4645
|
+
"fqn": "@aws-cdk/app-staging-synthesizer-alpha.DefaultBootstrapRolesOptions"
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
],
|
|
4649
|
+
"returns": {
|
|
4650
|
+
"type": {
|
|
4651
|
+
"fqn": "@aws-cdk/app-staging-synthesizer-alpha.DeploymentIdentities"
|
|
4652
|
+
}
|
|
4653
|
+
},
|
|
4654
|
+
"static": true
|
|
4655
|
+
},
|
|
4558
4656
|
{
|
|
4559
4657
|
"docs": {
|
|
4560
4658
|
"remarks": "These roles\nmust already exist.",
|
|
@@ -4563,7 +4661,7 @@
|
|
|
4563
4661
|
},
|
|
4564
4662
|
"locationInModule": {
|
|
4565
4663
|
"filename": "lib/bootstrap-roles.ts",
|
|
4566
|
-
"line":
|
|
4664
|
+
"line": 77
|
|
4567
4665
|
},
|
|
4568
4666
|
"name": "specifyRoles",
|
|
4569
4667
|
"parameters": [
|
|
@@ -4587,16 +4685,50 @@
|
|
|
4587
4685
|
{
|
|
4588
4686
|
"docs": {
|
|
4589
4687
|
"stability": "experimental",
|
|
4590
|
-
"summary": "
|
|
4688
|
+
"summary": "CloudFormation Execution Role."
|
|
4591
4689
|
},
|
|
4592
4690
|
"immutable": true,
|
|
4593
4691
|
"locationInModule": {
|
|
4594
4692
|
"filename": "lib/bootstrap-roles.ts",
|
|
4595
|
-
"line":
|
|
4693
|
+
"line": 102
|
|
4596
4694
|
},
|
|
4597
|
-
"name": "
|
|
4695
|
+
"name": "cloudFormationExecutionRole",
|
|
4696
|
+
"optional": true,
|
|
4598
4697
|
"type": {
|
|
4599
|
-
"fqn": "@aws-cdk/app-staging-synthesizer-alpha.
|
|
4698
|
+
"fqn": "@aws-cdk/app-staging-synthesizer-alpha.BootstrapRole"
|
|
4699
|
+
}
|
|
4700
|
+
},
|
|
4701
|
+
{
|
|
4702
|
+
"docs": {
|
|
4703
|
+
"stability": "experimental",
|
|
4704
|
+
"summary": "Deployment Action Role."
|
|
4705
|
+
},
|
|
4706
|
+
"immutable": true,
|
|
4707
|
+
"locationInModule": {
|
|
4708
|
+
"filename": "lib/bootstrap-roles.ts",
|
|
4709
|
+
"line": 107
|
|
4710
|
+
},
|
|
4711
|
+
"name": "deploymentRole",
|
|
4712
|
+
"optional": true,
|
|
4713
|
+
"type": {
|
|
4714
|
+
"fqn": "@aws-cdk/app-staging-synthesizer-alpha.BootstrapRole"
|
|
4715
|
+
}
|
|
4716
|
+
},
|
|
4717
|
+
{
|
|
4718
|
+
"docs": {
|
|
4719
|
+
"default": "- use bootstrapped role",
|
|
4720
|
+
"stability": "experimental",
|
|
4721
|
+
"summary": "Lookup Role."
|
|
4722
|
+
},
|
|
4723
|
+
"immutable": true,
|
|
4724
|
+
"locationInModule": {
|
|
4725
|
+
"filename": "lib/bootstrap-roles.ts",
|
|
4726
|
+
"line": 113
|
|
4727
|
+
},
|
|
4728
|
+
"name": "lookupRole",
|
|
4729
|
+
"optional": true,
|
|
4730
|
+
"type": {
|
|
4731
|
+
"fqn": "@aws-cdk/app-staging-synthesizer-alpha.BootstrapRole"
|
|
4600
4732
|
}
|
|
4601
4733
|
}
|
|
4602
4734
|
],
|
|
@@ -4980,7 +5112,7 @@
|
|
|
4980
5112
|
"kind": "interface",
|
|
4981
5113
|
"locationInModule": {
|
|
4982
5114
|
"filename": "lib/bootstrap-roles.ts",
|
|
4983
|
-
"line":
|
|
5115
|
+
"line": 169
|
|
4984
5116
|
},
|
|
4985
5117
|
"name": "StagingRoles",
|
|
4986
5118
|
"properties": [
|
|
@@ -4994,7 +5126,7 @@
|
|
|
4994
5126
|
"immutable": true,
|
|
4995
5127
|
"locationInModule": {
|
|
4996
5128
|
"filename": "lib/bootstrap-roles.ts",
|
|
4997
|
-
"line":
|
|
5129
|
+
"line": 182
|
|
4998
5130
|
},
|
|
4999
5131
|
"name": "dockerAssetPublishingRole",
|
|
5000
5132
|
"optional": true,
|
|
@@ -5012,7 +5144,7 @@
|
|
|
5012
5144
|
"immutable": true,
|
|
5013
5145
|
"locationInModule": {
|
|
5014
5146
|
"filename": "lib/bootstrap-roles.ts",
|
|
5015
|
-
"line":
|
|
5147
|
+
"line": 175
|
|
5016
5148
|
},
|
|
5017
5149
|
"name": "fileAssetPublishingRole",
|
|
5018
5150
|
"optional": true,
|
|
@@ -5022,8 +5154,52 @@
|
|
|
5022
5154
|
}
|
|
5023
5155
|
],
|
|
5024
5156
|
"symbolId": "lib/bootstrap-roles:StagingRoles"
|
|
5157
|
+
},
|
|
5158
|
+
"@aws-cdk/app-staging-synthesizer-alpha.UsingAppStagingSynthesizer": {
|
|
5159
|
+
"assembly": "@aws-cdk/app-staging-synthesizer-alpha",
|
|
5160
|
+
"base": "constructs.Construct",
|
|
5161
|
+
"docs": {
|
|
5162
|
+
"remarks": "It does not do anything, and is not meant\nto be created on its own. This construct will be a part of the\nconstruct tree only and not the Cfn template. The construct tree is\nthen encoded in the AWS::CDK::Metadata resource of the stack and\ninjested in our metrics like every other construct.",
|
|
5163
|
+
"stability": "experimental",
|
|
5164
|
+
"summary": "This is a dummy construct meant to signify that a stack is utilizing the AppStagingSynthesizer.",
|
|
5165
|
+
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as app_staging_synthesizer_alpha from '@aws-cdk/app-staging-synthesizer-alpha';\nconst usingAppStagingSynthesizer = new app_staging_synthesizer_alpha.UsingAppStagingSynthesizer(this, 'MyUsingAppStagingSynthesizer');",
|
|
5166
|
+
"custom": {
|
|
5167
|
+
"exampleMetadata": "fixture=_generated"
|
|
5168
|
+
}
|
|
5169
|
+
},
|
|
5170
|
+
"fqn": "@aws-cdk/app-staging-synthesizer-alpha.UsingAppStagingSynthesizer",
|
|
5171
|
+
"initializer": {
|
|
5172
|
+
"docs": {
|
|
5173
|
+
"stability": "experimental"
|
|
5174
|
+
},
|
|
5175
|
+
"locationInModule": {
|
|
5176
|
+
"filename": "lib/default-staging-stack.ts",
|
|
5177
|
+
"line": 37
|
|
5178
|
+
},
|
|
5179
|
+
"parameters": [
|
|
5180
|
+
{
|
|
5181
|
+
"name": "scope",
|
|
5182
|
+
"type": {
|
|
5183
|
+
"fqn": "constructs.Construct"
|
|
5184
|
+
}
|
|
5185
|
+
},
|
|
5186
|
+
{
|
|
5187
|
+
"name": "id",
|
|
5188
|
+
"type": {
|
|
5189
|
+
"primitive": "string"
|
|
5190
|
+
}
|
|
5191
|
+
}
|
|
5192
|
+
]
|
|
5193
|
+
},
|
|
5194
|
+
"kind": "class",
|
|
5195
|
+
"locationInModule": {
|
|
5196
|
+
"filename": "lib/default-staging-stack.ts",
|
|
5197
|
+
"line": 36
|
|
5198
|
+
},
|
|
5199
|
+
"name": "UsingAppStagingSynthesizer",
|
|
5200
|
+
"symbolId": "lib/default-staging-stack:UsingAppStagingSynthesizer"
|
|
5025
5201
|
}
|
|
5026
5202
|
},
|
|
5027
|
-
"version": "2.
|
|
5203
|
+
"version": "2.86.0-alpha.0",
|
|
5028
5204
|
"fingerprint": "**********"
|
|
5029
5205
|
}
|
package/.jsii.tabl.json.gz
CHANGED
|
Binary file
|