diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 4301162431c57..ce7f2e3b72090 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -25,9 +25,9 @@ jobs: # These labels are required stale-issue-label: closing-soon - exempt-issue-label: no-autoclose + exempt-issue-labels: no-autoclose stale-pr-label: closing-soon - exempt-pr-label: no-autoclose + exempt-pr-labels: no-autoclose response-requested-label: response-requested # Don't set closed-for-staleness label to skip closing very old issues diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index fd741fdcf0f85..49d8f1c164d6c 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.40.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.39.1-alpha.0...v2.40.0-alpha.0) (2022-08-31) + + +### Features + +* **glue:** Added value to PythonVersion enum ([#21670](https://github.com/aws/aws-cdk/issues/21670)) ([9774d4c](https://github.com/aws/aws-cdk/commit/9774d4ce11287d91278290369dc783a83d784fdf)), closes [#21568](https://github.com/aws/aws-cdk/issues/21568) [/github.com/aws/aws-cdk/issues/21568#issuecomment-1219668861](https://github.com/aws//github.com/aws/aws-cdk/issues/21568/issues/issuecomment-1219668861) +* **msk:** added msk cluster sasl iam property ([#21798](https://github.com/aws/aws-cdk/issues/21798)) ([d30a530](https://github.com/aws/aws-cdk/commit/d30a530a68d97ac455125bf4a2154a31adcb9582)) + + +### Bug Fixes + +* **integ-runner:** array arguments aren't recognizing multiple options ([#21763](https://github.com/aws/aws-cdk/issues/21763)) ([d942324](https://github.com/aws/aws-cdk/commit/d942324cef7646397f9359dfb91819ded72874b0)), closes [#20384](https://github.com/aws/aws-cdk/issues/20384) + ## [2.39.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.39.0-alpha.0...v2.39.1-alpha.0) (2022-08-29) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index de4808fb97af4..0a562f22785bc 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.40.0](https://github.com/aws/aws-cdk/compare/v2.39.1...v2.40.0) (2022-08-31) + + +### Features + +* **cdk-cli-wrapper:** add `progress` argument for cdk deploy ([#21762](https://github.com/aws/aws-cdk/issues/21762)) ([dab83cc](https://github.com/aws/aws-cdk/commit/dab83cc4e70ec477abb4fdf2a2ac6319dff143e9)) +* **core:** `Fn::ToJsonString` and `Fn::Length` intrinsic functions ([#21749](https://github.com/aws/aws-cdk/issues/21749)) ([7472fa4](https://github.com/aws/aws-cdk/commit/7472fa484e45cc5dd05c10e4998c02d28f60da65)) + + +### Bug Fixes + +* **certificatemanager:** domainName not checked for length ([#21807](https://github.com/aws/aws-cdk/issues/21807)) ([3e55092](https://github.com/aws/aws-cdk/commit/3e55092fb70e0ec74ee7c4144d6e39a29d8757ae)) +* **ecs:** secretToken required but declared as optional ([#21745](https://github.com/aws/aws-cdk/issues/21745)) ([26ac81f](https://github.com/aws/aws-cdk/commit/26ac81f77877f504ede97997db8e3b48670f643e)), closes [#21744](https://github.com/aws/aws-cdk/issues/21744) +* **ecs-patterns:** add validation for queue and queue related props ([#21717](https://github.com/aws/aws-cdk/issues/21717)) ([7e9bd7d](https://github.com/aws/aws-cdk/commit/7e9bd7d8419313c333b7a0fffdc489363046e4e2)) +* **integ:** write assertion stack name to integ manifest ([#21809](https://github.com/aws/aws-cdk/issues/21809)) ([e2dc2cb](https://github.com/aws/aws-cdk/commit/e2dc2cb76109bcac249f28eac8da3335c8b06e9d)), closes [#21646](https://github.com/aws/aws-cdk/issues/21646) +* **servicecatalog:** incorrect service in portfolio arn generation ([#21770](https://github.com/aws/aws-cdk/issues/21770)) ([f9ca639](https://github.com/aws/aws-cdk/commit/f9ca639175352bad1db78666c750f00955627d1a)), closes [#20849](https://github.com/aws/aws-cdk/issues/20849) + ## [2.39.1](https://github.com/aws/aws-cdk/compare/v2.39.0...v2.39.1) (2022-08-29) diff --git a/package.json b/package.json index 9db5b4443591c..a81e661eea36c 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,10 @@ "fs-extra": "^9.1.0", "graceful-fs": "^4.2.10", "jest-junit": "^13.2.0", - "jsii-diff": "^1.65.1", - "jsii-pacmak": "^1.65.1", - "jsii-reflect": "^1.65.1", - "jsii-rosetta": "^1.65.1", + "jsii-diff": "^1.66.0", + "jsii-pacmak": "^1.66.0", + "jsii-reflect": "^1.66.0", + "jsii-rosetta": "^1.66.0", "lerna": "^4.0.0", "patch-package": "^6.4.7", "semver": "^6.3.0", diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/.eslintrc.js b/packages/@aws-cdk-containers/ecs-service-extensions/.eslintrc.js deleted file mode 100644 index 2658ee8727166..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/.eslintrc.js +++ /dev/null @@ -1,3 +0,0 @@ -const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc'); -baseConfig.parserOptions.project = __dirname + '/tsconfig.json'; -module.exports = baseConfig; diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/.gitignore b/packages/@aws-cdk-containers/ecs-service-extensions/.gitignore deleted file mode 100644 index 0865b27d394a2..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -*.js -*.js.map -*.d.ts -*.generated.ts -dist -lib/generated/resources.ts -.jsii - -.coverage -__pycache__ - -.LAST_BUILD -.nyc_output -coverage -nyc.config.js -.LAST_PACKAGE -*.snk -!.eslintrc.js - -junit.xml - -!jest.config.js -!**/*.integ.snapshot/**/asset.*/*.js -!**/*.integ.snapshot/**/asset.*/*.d.ts - -!**/*.integ.snapshot/**/asset.*/** diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/.npmignore b/packages/@aws-cdk-containers/ecs-service-extensions/.npmignore deleted file mode 100644 index 9bcdfbb4d0764..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/.npmignore +++ /dev/null @@ -1,29 +0,0 @@ -# Don't include original .ts files when doing `npm pack` -*.ts -!*.d.ts -coverage -.nyc_output -*.tgz - -dist -.LAST_PACKAGE -.LAST_BUILD -!*.js - -# Include .jsii -!.jsii - -*.snk - -*.tsbuildinfo - -tsconfig.json -.eslintrc.js - -**/cdk.out -junit.xml - -test/ -jest.config.js -**/*.integ.snapshot -**/*.integ.snapshot diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/CONTRIBUTING.md b/packages/@aws-cdk-containers/ecs-service-extensions/CONTRIBUTING.md deleted file mode 100644 index 5a6ad506d18ea..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -See: [Contributing Guide](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-ecs/README.md) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/LICENSE b/packages/@aws-cdk-containers/ecs-service-extensions/LICENSE deleted file mode 100644 index 82ad00bb02d0b..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/NOTICE b/packages/@aws-cdk-containers/ecs-service-extensions/NOTICE deleted file mode 100644 index 1b7adbb891265..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/NOTICE +++ /dev/null @@ -1,2 +0,0 @@ -AWS Cloud Development Kit (AWS CDK) -Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/README.md b/packages/@aws-cdk-containers/ecs-service-extensions/README.md deleted file mode 100644 index 49ebf7186ef2a..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/README.md +++ /dev/null @@ -1,538 +0,0 @@ -# CDK Construct library for building ECS services - - ---- - -![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge) - ---- - - - -> ⚠️ v2 of this library is now available! It is compatible with AWS CDK v2 and available in -> multiple languages. -> The source code for v2 lives [here](https://github.com/cdklabs/cdk-ecs-service-extensions). -> To migrate from this library to v2, see the [Migration Guide](https://github.com/cdklabs/cdk-ecs-service-extensions/blob/main/MIGRATING.md). - -This library provides a high level, extensible pattern for constructing services -deployed using Amazon ECS. - -The `Service` construct provided by this module can be extended with optional `ServiceExtension` classes that add supplemental ECS features including: - -- [AWS X-Ray](https://aws.amazon.com/xray/) for tracing your application -- [Amazon CloudWatch Agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html) for capturing per task stats -- [AWS AppMesh](https://aws.amazon.com/app-mesh/) for adding your application to a service mesh -- [Application Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html), for exposing your service to the public -- [AWS FireLens](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html), for filtering and routing application logs -- [Injecter Extension](#injecter-extension), for allowing your service connect to other AWS services by granting permission and injecting environment variables -- [Queue Extension](#queue-extension), for allowing your service to consume messages from an SQS Queue which can be populated by one or more SNS Topics that it is subscribed to -- [Community Extensions](#community-extensions), providing support for advanced use cases - -The `ServiceExtension` class is an abstract class which you can also implement in -order to build your own custom service extensions for modifying your service, or -attaching your own custom resources or sidecars. - -## Example - -```ts -import { AppMeshExtension, CloudwatchAgentExtension, Container, Environment, FireLensExtension, HttpLoadBalancerExtension, Service, ServiceDescription, XRayExtension } from 'ecs-service-builder'; - -// Create an environment to deploy a service in. -const environment = new Environment(stack, 'production'); - -// Build out the service description -const nameDescription = new ServiceDescription(); -nameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); -nameDescription.add(new AppMeshExtension({ mesh })); -nameDescription.add(new FireLensExtension()); -nameDescription.add(new XRayExtension()); -nameDescription.add(new CloudwatchAgentExtension()); -nameDescription.add(new HttpLoadBalancerExtension()); - -// Implement the service description as a real service inside -// an environment. -const nameService = new Service(stack, 'name', { - environment: environment, - serviceDescription: nameDescription, -}); -``` - -## Creating an `Environment` - -An `Environment` is a place to deploy your services. You can have multiple environments -on a single AWS account. For example, you could create a `test` environment as well -as a `production` environment so you have a place to verify that your application -works as intended before you deploy it to a live environment. - -Each environment is isolated from other environments. In other words, -when you create an environment, by default the construct supplies its own VPC, -ECS Cluster, and any other required resources for the environment: - -```ts -const environment = new Environment(stack, 'production'); -``` - -However, you can also choose to build an environment out of a pre-existing VPC -or ECS Cluster: - -```ts -const vpc = new ec2.Vpc(stack, 'VPC'); -const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - -const environment = new Environment(stack, 'production', { - vpc, - cluster, -}); -``` - -## Defining your `ServiceDescription` - -The `ServiceDescription` defines what application you want the service to run and -what optional extensions you want to add to the service. The most basic form of a `ServiceDescription` looks like this: - -```ts -const nameDescription = new ServiceDescription(); -nameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); -``` - -Every `ServiceDescription` requires at minimum that you add a `Container` extension -which defines the main application (essential) container to run for the service. - -### Logging using `awslogs` log driver - -If no observability extensions have been configured for a service, the ECS Service Extensions configures an `awslogs` log driver for the application container of the service to send the container logs to CloudWatch Logs. - -You can either provide a log group to the `Container` extension or one will be created for you by the CDK. - -Following is an example of an application with an `awslogs` log driver configured for the application container: - -```ts -const environment = new Environment(stack, 'production'); - -const nameDescription = new ServiceDescription(); -nameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, - logGroup: new awslogs.LogGroup(stack, 'MyLogGroup'), -})); -``` - -If a log group is not provided, no observability extensions have been created, and the `ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER` feature flag is enabled, then logging will be configured by default and a log group will be created for you. - -The `ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER` feature flag is enabled by default in any CDK apps that are created with CDK v1.140.0 or v2.8.0 and later. - -To enable default logging for previous versions, ensure that the `ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER` flag within the application stack context is set to true, like so: - -```ts -stack.node.setContext(cxapi.ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER, true); -``` - -Alternatively, you can also set the feature flag in the `cdk.json` file. For more information, refer the [docs](https://docs.aws.amazon.com/cdk/v2/guide/featureflags.html). - -After adding the `Container` extension, you can optionally enable additional features for the service using the `ServiceDescription.add()` method: - -```ts -nameDescription.add(new AppMeshExtension({ mesh })); -nameDescription.add(new FireLensExtension()); -nameDescription.add(new XRayExtension()); -nameDescription.add(new CloudwatchAgentExtension()); -nameDescription.add(new HttpLoadBalancerExtension()); -nameDescription.add(new AssignPublicIpExtension()); -``` - -## Launching the `ServiceDescription` as a `Service` - -Once the service description is defined, you can launch it as a service: - -```ts -const nameService = new Service(stack, 'name', { - environment: environment, - serviceDescription: nameDescription, -}); -``` - -At this point, all the service resources will be created. This includes the ECS Task -Definition, Service, as well as any other attached resources, such as App Mesh Virtual -Node or an Application Load Balancer. - -## Creating your own taskRole - -Sometimes the taskRole should be defined outside of the service so that you can create strict resource policies (ie. S3 bucket policies) that are restricted to a given taskRole: - -```ts -const taskRole = new iam.Role(stack, 'CustomTaskRole', { - assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), -}); - -// Use taskRole in any CDK resource policies -// new s3.BucketPolicy(this, 'BucketPolicy, {}); - -const nameService = new Service(stack, 'name', { - environment: environment, - serviceDescription: nameDescription, - taskRole, -}); -``` - -## Task Auto-Scaling - -You can configure the task count of a service to match demand. The recommended way of achieving this is to configure target tracking policies for your service which scales in and out in order to keep metrics around target values. - -You need to configure an auto scaling target for the service by setting the `minTaskCount` (defaults to 1) and `maxTaskCount` in the `Service` construct. Then you can specify target values for "CPU Utilization" or "Memory Utilization" across all tasks in your service. Note that the `desiredCount` value will be set to `undefined` if the auto scaling target is configured. - -If you want to configure auto-scaling policies based on resources like Application Load Balancer or SQS Queues, you can set the corresponding resource-specific fields in the extension. For example, you can enable target tracking scaling based on Application Load Balancer request count as follows: - -```ts -const stack = new cdk.Stack(); -const environment = new Environment(stack, 'production'); -const serviceDescription = new ServiceDescription(); - -serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('my-alb'), -})); - -// Add the extension with target `requestsPerTarget` value set -serviceDescription.add(new HttpLoadBalancerExtension({ requestsPerTarget: 10 })); - -// Configure the auto scaling target -new Service(stack, 'my-service', { - environment, - serviceDescription, - desiredCount: 5, - // Task auto-scaling constuct for the service - autoScaleTaskCount: { - maxTaskCount: 10, - targetCpuUtilization: 70, - targetMemoryUtilization: 50, - }, -}); -``` - -You can also define your own service extensions for [other auto-scaling policies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html) for your service by making use of the `scalableTaskCount` attribute of the `Service` class. - -## Creating your own custom `ServiceExtension` - -In addition to using the default service extensions that come with this module, you -can choose to implement your own custom service extensions. The `ServiceExtension` -class is an abstract class you can implement yourself. The following example -implements a custom service extension that could be added to a service in order to -autoscale it based on scaling intervals of SQS Queue size: - -```ts -export class MyCustomAutoscaling extends ServiceExtension { - constructor() { - super('my-custom-autoscaling'); - // Scaling intervals for the step scaling policy - this.scalingSteps = [{ upper: 0, change: -1 }, { lower: 100, change: +1 }, { lower: 500, change: +5 }]; - this.sqsQueue = new sqs.Queue(this.scope, 'my-queue'); - } - - // This hook utilizes the resulting service construct - // once it is created - public useService(service: ecs.Ec2Service | ecs.FargateService) { - this.parentService.scalableTaskCount.scaleOnMetric('QueueMessagesVisibleScaling', { - metric: this.sqsQueue.metricApproximateNumberOfMessagesVisible(), - scalingSteps: this.scalingSteps, - }); - } -} -``` - -This `ServiceExtension` can now be reused and added to any number of different -service descriptions. This allows you to develop reusable bits of configuration, -attach them to many different services, and centrally manage them. Updating the -`ServiceExtension` in one place would update all services that use it, instead of -requiring decentralized updates to many different services. - -Every `ServiceExtension` can implement the following hooks to modify the properties -of constructs, or make use of the resulting constructs: - -- `addHooks()` - This hook is called after all the extensions are added to a - ServiceDescription, but before any of the other extension hooks have been run. - It gives each extension a chance to do some inspection of the overall ServiceDescription - and see what other extensions have been added. Some extensions may want to register - hooks on the other extensions to modify them. For example, the Firelens extension - wants to be able to modify the settings of the application container to route logs - through Firelens. -- `modifyTaskDefinitionProps()` - This is hook is passed the proposed - ecs.TaskDefinitionProps for a TaskDefinition that is about to be created. - This allows the extension to make modifications to the task definition props - before the TaskDefinition is created. For example, the App Mesh extension modifies - the proxy settings for the task. -- `useTaskDefinition()` - After the TaskDefinition is created, this hook is - passed the actual TaskDefinition construct that was created. This allows the - extension to add containers to the task, modify the task definition's IAM role, - etc. -- `resolveContainerDependencies()` - Once all extensions have added their containers, - each extension is given a chance to modify its container's `dependsOn` settings. - Extensions need to check and see what other extensions were enabled and decide - whether their container needs to wait on another container to start first. -- `modifyServiceProps()` - Before an Ec2Service or FargateService is created, this - hook is passed a draft version of the service props to change. Each extension adds - its own modifications to the service properties. For example, the App Mesh extension - needs to modify the service settings to enable CloudMap service discovery. -- `useService()` - After the service is created, this hook is given a chance to - utilize that service. This is used by extensions like the load balancer or App Mesh - extension, which create and link other AWS resources to the ECS extension. -- `connectToService()` - This hook is called when a user wants to connect one service - to another service. It allows an extension to implement logic about how to allow - connections from one service to another. For example, the App Mesh extension implements - this method in order to easily connect one service mesh service to another, which - allows the service's Envoy proxy sidecars to route traffic to each other. - -## Connecting services - -One of the hooks that a `ServiceExtension` can implement is a hook for connection -logic. This is utilized when connecting one service to another service, e.g. -connecting a user facing web service with a backend API. Usage looks like this: - -```ts -const frontend = new Service(stack, 'frontend', { - environment, - serviceDescription: frontendDescription -}); -const backend = new Service(stack, 'backend', { - environment, - serviceDescription: backendDescription -}); - -frontend.connectTo(backend); -``` - -The address that a service will use to talk to another service depends on the -type of ingress that has been created by the extension that did the connecting. -For example, if an App Mesh extension has been used, then the service is accessible -at a DNS address of `.`. For example: - -```ts -const environment = new Environment(stack, 'production'); - -// Define the frontend tier -const frontendDescription = new ServiceDescription(); -frontendDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ContainerImage.fromRegistry('my-frontend-service'), - environment: { - BACKEND_URL: 'http://backend.production' - }, -})); -const frontend = new Service(stack, 'frontend', { - environment, - serviceDescription: frontendDescription -}); - -// Define the backend tier -const backendDescription = new ServiceDescription(); -backendDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ContainerImage.fromRegistry('my-backend-service'), - environment: { - FRONTEND_URL: 'http://frontend.production' - }, -})); -const backend = new Service(stack, 'backend', { - environment, - serviceDescription: backendDescription -}); - -// Connect the two tiers to each other -frontend.connectTo(backend); -``` - -The above code uses the well-known service discovery name for each -service, and passes it as an environment variable to the container so -that the container knows what address to use when communicating to -the other service. - -## Importing a pre-existing cluster - -To create an environment with a pre-existing cluster, you must import the cluster first, then use `Environment.fromEnvironmentAttributes()`. When a cluster is imported into an environment, the cluster is treated as immutable. As a result, no extension may modify the cluster to change a setting. - -```ts - -const cluster = ecs.Cluster.fromClusterAttributes(stack, 'Cluster', { - ... -}); - -const environment = Environment.fromEnvironmentAttributes(stack, 'Environment', { - capacityType: EnvironmentCapacityType.EC2, // or `FARGATE` - cluster, -}); - -``` - -## Injecter Extension - -This service extension accepts a list of `Injectable` resources. It grants access to these resources and adds the necessary environment variables to the tasks that are part of the service. - -For example, an `InjectableTopic` is an SNS Topic that grants permission to the task role and adds the topic ARN as an environment variable to the task definition. - -### Publishing to SNS Topics - -You can use this extension to set up publishing permissions for SNS Topics. - -```ts -nameDescription.add(new InjecterExtension({ - injectables: [new InjectableTopic({ - // SNS Topic the service will publish to - topic: new sns.Topic(stack, 'my-topic'), - })], -})); -``` - -## Queue Extension - -This service extension creates a default SQS Queue `eventsQueue` for the service (if not provided) and optionally also accepts list of `ISubscribable` objects that the `eventsQueue` can subscribe to. The service extension creates the subscriptions and sets up permissions for the service to consume messages from the SQS Queue. - -### Setting up SNS Topic Subscriptions for SQS Queues - -You can use this extension to set up SNS Topic subscriptions for the `eventsQueue`. To do this, create a new object of type `TopicSubscription` for every SNS Topic you want the `eventsQueue` to subscribe to and provide it as input to the service extension. - -```ts -const myServiceDescription = nameDescription.add(new QueueExtension({ - // Provide list of topic subscriptions that you want the `eventsQueue` to subscribe to - subscriptions: [new TopicSubscription({ - topic: new sns.Topic(stack, 'my-topic'), - }], -})); - -// To access the `eventsQueue` for the service, use the `eventsQueue` getter for the extension -const myQueueExtension = myServiceDescription.extensions.queue as QueueExtension; -const myEventsQueue = myQueueExtension.eventsQueue; -``` - -For setting up a topic-specific queue subscription, you can provide a custom queue in the `TopicSubscription` object along with the SNS Topic. The extension will set up a topic subscription for the provided queue instead of the default `eventsQueue` of the service. - -```ts -nameDescription.add(new QueueExtension({ - eventsQueue: myEventsQueue, - subscriptions: [new TopicSubscription({ - topic: new sns.Topic(stack, 'my-topic'), - // `myTopicQueue` will subscribe to the `my-topic` instead of `eventsQueue` - topicSubscriptionQueue: { - queue: myTopicQueue, - }, - }], -})); -``` - -### Configuring auto scaling based on SQS Queues - -You can scale your service up or down to maintain an acceptable queue latency by tracking the backlog per task. It configures a target tracking scaling policy with target value (acceptable backlog per task) calculated by dividing the `acceptableLatency` by `messageProcessingTime`. For example, if the maximum acceptable latency for a message to be processed after its arrival in the SQS Queue is 10 mins and the average processing time for a task is 250 milliseconds per message, then `acceptableBacklogPerTask = 10 * 60 / 0.25 = 2400`. Therefore, each queue can hold up to 2400 messages before the service starts to scale up. For this, a target tracking policy will be attached to the scaling target for your service with target value `2400`. For more information, please refer: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-using-sqs-queue.html . - -You can configure auto scaling based on SQS Queue for your service as follows: - -```ts -nameDescription.add(new QueueExtension({ - eventsQueue: myEventsQueue, - // Need to specify `scaleOnLatency` to configure auto scaling based on SQS Queue - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(10), - messageProcessingTime: cdk.Duration.millis(250), - }, - subscriptions: [new TopicSubscription({ - topic: new sns.Topic(stack, 'my-topic'), - // `myTopicQueue` will subscribe to the `my-topic` instead of `eventsQueue` - topicSubscriptionQueue: { - queue: myTopicQueue, - // Optionally provide `scaleOnLatency` for configuring separate autoscaling for `myTopicQueue` - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(10), - messageProcessingTime: cdk.Duration.millis(250), - } - }, - }], -})); -``` - -## Publish/Subscribe Service Pattern - -The [Publish/Subscribe Service Pattern](https://aws.amazon.com/pub-sub-messaging/) is used for implementing asynchronous communication between services. It involves 'publisher' services emitting events to SNS Topics, which are passed to subscribed SQS queues and then consumed by 'worker' services. - -The following example adds the `InjecterExtension` to a `Publisher` Service which can publish events to an SNS Topic and adds the `QueueExtension` to a `Worker` Service which can poll its `eventsQueue` to consume messages populated by the topic. - -```ts -const environment = new Environment(stack, 'production'); - -const pubServiceDescription = new ServiceDescription(); -pubServiceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('sns-publish'), -})); - -const myTopic = new sns.Topic(stack, 'myTopic'); - -// Add the `InjecterExtension` to the service description to allow publishing events to `myTopic` -pubServiceDescription.add(new InjecterExtension({ - injectables: [new InjectableTopic({ - topic: myTopic, - }], -})); - -// Create the `Publisher` Service -new Service(stack, 'Publisher', { - environment: environment, - serviceDescription: pubServiceDescription, -}); - -const subServiceDescription = new ServiceDescription(); -subServiceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('sqs-reader'), -})); - -// Add the `QueueExtension` to the service description to subscribe to `myTopic` -subServiceDescription.add(new QueueExtension({ - subscriptions: [new TopicSubscription({ - topic: myTopic, - }], -})); - -// Create the `Worker` Service -new Service(stack, 'Worker', { - environment: environment, - serviceDescription: subServiceDescription, -}); -``` - -## Community Extensions - -We encourage the development of Community Service Extensions that support -advanced features. Here are some useful extensions that we have reviewed: - -- [ListenerRulesExtension](https://www.npmjs.com/package/@wheatstalk/ecs-service-extension-listener-rules) for more precise control over Application Load Balancer rules - -> Please submit a pull request so that we can review your service extension and -> list it here. diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/jest.config.js b/packages/@aws-cdk-containers/ecs-service-extensions/jest.config.js deleted file mode 100644 index e88b48ab04549..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/jest.config.js +++ /dev/null @@ -1,9 +0,0 @@ -const baseConfig = require('../../../tools/@aws-cdk/cdk-build-tools/config/jest.config'); -module.exports = { - ...baseConfig, - coverageThreshold: { - global: { - branches: 70, - } - } -}; diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/environment.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/environment.ts deleted file mode 100644 index 5fae1c627bead..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/environment.ts +++ /dev/null @@ -1,166 +0,0 @@ -import * as ec2 from '@aws-cdk/aws-ec2'; -import * as ecs from '@aws-cdk/aws-ecs'; -import { Construct } from 'constructs'; -import { EnvironmentCapacityType } from './extensions/extension-interfaces'; - -/** - * Settings for the environment where you want to deploy your services. - */ -export interface EnvironmentProps { - /** - * The VPC used by the service for networking. - * - * @default - Create a new VPC - */ - readonly vpc?: ec2.IVpc, - - /** - * The ECS cluster which provides compute capacity to this service. - * - * [disable-awslint:ref-via-interface] - * @default - Create a new cluster - */ - readonly cluster?: ecs.Cluster - - /** - * The type of capacity to use for this environment. - * - * @default - EnvironmentCapacityType.FARGATE - */ - readonly capacityType?: EnvironmentCapacityType -} - -/** - * An environment into which to deploy a service. - */ -export interface IEnvironment { - /** - * The name of this environment. - */ - readonly id: string; - - /** - * The VPC into which environment services should be placed. - */ - readonly vpc: ec2.IVpc; - - /** - * The cluster that is providing capacity for this service. - */ - readonly cluster: ecs.ICluster; - - /** - * The capacity type used by the service's cluster. - */ - readonly capacityType: EnvironmentCapacityType; - - /** - * Add a default cloudmap namespace to the environment's cluster. - */ - addDefaultCloudMapNamespace(options: ecs.CloudMapNamespaceOptions): void; -} - -/** - * An environment into which to deploy a service. This environment - * can either be instantiated with a pre-existing AWS VPC and ECS cluster, - * or it can create its own VPC and cluster. By default, it will create - * a cluster with Fargate capacity. - */ -export class Environment extends Construct implements IEnvironment { - /** - * Import an existing environment from its attributes. - */ - public static fromEnvironmentAttributes(scope: Construct, id: string, attrs: EnvironmentAttributes): IEnvironment { - return new ImportedEnvironment(scope, id, attrs); - } - - /** - * The name of this environment. - */ - public readonly id: string; - - /** - * The VPC where environment services should be placed. - */ - public readonly vpc: ec2.IVpc; - - /** - * The cluster that is providing capacity for this service. - */ - public readonly cluster: ecs.Cluster; - - /** - * The capacity type used by the service's cluster. - */ - public readonly capacityType: EnvironmentCapacityType; - - private readonly scope: Construct; - - constructor(scope: Construct, id: string, props?: EnvironmentProps) { - super(scope, id); - - this.scope = scope; - this.id = id; - - if (props && props.vpc) { - this.vpc = props.vpc; - } else { - this.vpc = new ec2.Vpc(this.scope, `${this.id}-environment-vpc`); - } - - if (props && props.cluster) { - this.cluster = props.cluster; - } else { - this.cluster = new ecs.Cluster(this.scope, `${this.id}-environment-cluster`, { vpc: this.vpc }); - } - - if (props && props.capacityType) { - this.capacityType = props.capacityType; - } else { - this.capacityType = EnvironmentCapacityType.FARGATE; - } - } - - /** - * Add a default cloudmap namespace to the environment's cluster. - */ - addDefaultCloudMapNamespace(options: ecs.CloudMapNamespaceOptions) { - this.cluster.addDefaultCloudMapNamespace(options); - } -} - -export interface EnvironmentAttributes { - /** - * The capacity type used by the service's cluster. - */ - capacityType: EnvironmentCapacityType; - - /** - * The cluster that is providing capacity for this service. - */ - cluster: ecs.ICluster; -} - -export class ImportedEnvironment extends Construct implements IEnvironment { - public readonly capacityType: EnvironmentCapacityType; - public readonly cluster: ecs.ICluster; - public readonly id: string; - public readonly vpc: ec2.IVpc; - - constructor(scope: Construct, id: string, props: EnvironmentAttributes) { - super(scope, id); - - this.id = id; - this.capacityType = props.capacityType; - this.cluster = props.cluster; - this.vpc = props.cluster.vpc; - } - - /** - * Adding a default cloudmap namespace to the cluster will throw an error, as we don't - * own it. - */ - addDefaultCloudMapNamespace(_options: ecs.CloudMapNamespaceOptions) { - throw new Error('the cluster environment is immutable when imported'); - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/appmesh.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/appmesh.ts deleted file mode 100644 index 0e1df5fca95cb..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/appmesh.ts +++ /dev/null @@ -1,379 +0,0 @@ -import * as appmesh from '@aws-cdk/aws-appmesh'; -import * as ec2 from '@aws-cdk/aws-ec2'; -import * as ecr from '@aws-cdk/aws-ecr'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as iam from '@aws-cdk/aws-iam'; -import * as cdk from '@aws-cdk/core'; -import * as regionInfo from '@aws-cdk/region-info'; -import { Construct } from 'constructs'; -import { Service } from '../service'; -import { Container } from './container'; -import { ServiceExtension, ServiceBuild } from './extension-interfaces'; - -// The version of the App Mesh envoy sidecar to add to the task. -const APP_MESH_ENVOY_SIDECAR_VERSION = 'v1.15.1.0-prod'; - -/** - * The settings for the App Mesh extension. - */ -export interface MeshProps { - /** - * The service mesh into which to register the service. - */ - readonly mesh: appmesh.Mesh; - - /** - * The protocol of the service. - * Valid values are Protocol.HTTP, Protocol.HTTP2, Protocol.TCP, Protocol.GRPC - * @default - Protocol.HTTP - */ - readonly protocol?: appmesh.Protocol; -} - -/** - * This extension adds an Envoy sidecar to the task definition and - * creates the App Mesh resources required to route network traffic - * to the container in a service mesh. - * - * The service will then be available to other App Mesh services at the - * address `.`. For example, a service called - * `orders` deploying in an environment called `production` would be accessible - * to other App Mesh enabled services at the address `http://orders.production`. - */ -export class AppMeshExtension extends ServiceExtension { - protected virtualNode!: appmesh.VirtualNode; - protected virtualService!: appmesh.VirtualService; - protected virtualRouter!: appmesh.VirtualRouter; - protected route!: appmesh.Route; - private mesh: appmesh.Mesh; - - /** - * The protocol used for AppMesh routing. - * default - Protocol.HTTP - */ - public readonly protocol: appmesh.Protocol; - - constructor(props: MeshProps) { - super('appmesh'); - this.mesh = props.mesh; - - if (props.protocol) { - this.protocol = props.protocol; - } else { - this.protocol = appmesh.Protocol.HTTP; - } - } - - public prehook(service: Service, scope: Construct) { - this.parentService = service; - this.scope = scope; - - // Make sure that the parent cluster for this service has - // a namespace attached. - if (!this.parentService.cluster.defaultCloudMapNamespace) { - this.parentService.environment.addDefaultCloudMapNamespace({ - // Name the namespace after the environment name. - // Service DNS will be like . - name: this.parentService.environment.id, - }); - } - } - - public modifyTaskDefinitionProps(props: ecs.TaskDefinitionProps): ecs.TaskDefinitionProps { - // Find the app extension, to get its port - const containerextension = this.parentService.serviceDescription.get('service-container') as Container; - - if (!containerextension) { - throw new Error('Appmesh extension requires an application extension'); - } - - return { - ...props, - - // App Mesh requires AWS VPC networking mode so that each - // task can have its own IP address - networkMode: ecs.NetworkMode.AWS_VPC, - - // This configures the envoy container as a proxy for all - // traffic going into and out of the task, with a few exceptions - // for metadata endpoints or other ports that need direct - // communication - proxyConfiguration: new ecs.AppMeshProxyConfiguration({ - containerName: 'envoy', - properties: { - appPorts: [containerextension.trafficPort], - proxyEgressPort: 15001, - proxyIngressPort: 15000, - - // The App Mesh proxy runs with this user ID, and this keeps its - // own outbound connections from recursively attempting to infinitely proxy. - ignoredUID: 1337, - - // This GID is ignored and any outbound traffic originating from containers that - // use this group ID will be ignored by the proxy. This is primarily utilized by - // the FireLens extension, so that outbound application logs don't have to go through Envoy - // and therefore add extra burden to the proxy sidecar. Instead the logs can go directly - // to CloudWatch - ignoredGID: 1338, - - egressIgnoredIPs: [ - '169.254.170.2', // Allow services to talk directly to ECS metadata endpoints - '169.254.169.254', // and EC2 instance endpoint - ], - - // If there is outbound traffic to specific ports that you want to - // ignore the proxy those ports can be added here. - egressIgnoredPorts: [], - }, - }), - } as ecs.TaskDefinitionProps; - } - - private accountIdForRegion(region: string) { - return { ecrRepo: regionInfo.RegionInfo.get(region).appMeshRepositoryAccount }; - } - - public useTaskDefinition(taskDefinition: ecs.TaskDefinition) { - var region = cdk.Stack.of(this.scope).region; - var partition = cdk.Stack.of(this.scope).partition; - var appMeshRepo; - - // This is currently necessary because App Mesh has different images in each region, - // and some regions have their images in a different account. See: - // https://docs.aws.amazon.com/app-mesh/latest/userguide/envoy.html - const mapping = new cdk.CfnMapping(this.scope, `${this.parentService.id}-envoy-image-account-mapping`, { - mapping: { - 'ap-northeast-1': this.accountIdForRegion('ap-northeast-1'), - 'ap-northeast-2': this.accountIdForRegion('ap-northeast-2'), - 'ap-south-1': this.accountIdForRegion('ap-south-1'), - 'ap-southeast-1': this.accountIdForRegion('ap-southeast-1'), - 'ap-southeast-2': this.accountIdForRegion('ap-southeast-1'), - 'ca-central-1': this.accountIdForRegion('ca-central-1'), - 'cn-north-1': this.accountIdForRegion('cn-north-1'), - 'cn-northwest-1': this.accountIdForRegion('cn-northwest-1'), - 'eu-central-1': this.accountIdForRegion('eu-central-1'), - 'eu-north-1': this.accountIdForRegion('eu-north-1'), - 'eu-south-1': this.accountIdForRegion('eu-south-1'), - 'eu-west-1': this.accountIdForRegion('eu-west-1'), - 'eu-west-2': this.accountIdForRegion('eu-west-2'), - 'eu-west-3': this.accountIdForRegion('eu-west-3'), - 'sa-east-1': this.accountIdForRegion('sa-east-1'), - 'us-east-1': this.accountIdForRegion('us-east-1'), - 'us-east-2': this.accountIdForRegion('us-east-2'), - 'us-west-1': this.accountIdForRegion('us-west-1'), - 'us-west-2': this.accountIdForRegion('us-west-2'), - - 'me-south-1': this.accountIdForRegion('me-south-1'), - 'ap-east-1': this.accountIdForRegion('ap-east-1'), - 'af-south-1': this.accountIdForRegion('af-south-1'), - }, - }); - - // WHEN - const ownerAccount = mapping.findInMap(region, 'ecrRepo'); - - appMeshRepo = ecr.Repository.fromRepositoryAttributes( - this.scope, - `${this.parentService.id}-envoy-repo`, - { - repositoryName: 'aws-appmesh-envoy', - repositoryArn: `arn:${partition}:ecr:${region}:${ownerAccount}:repository/aws-appmesh-envoy`, - }, - ); - - this.container = taskDefinition.addContainer('envoy', { - image: ecs.ContainerImage.fromEcrRepository(appMeshRepo, APP_MESH_ENVOY_SIDECAR_VERSION), - essential: true, - environment: { - APPMESH_VIRTUAL_NODE_NAME: `mesh/${this.mesh.meshName}/virtualNode/${this.parentService.id}`, - AWS_REGION: cdk.Stack.of(this.parentService).region, - ENABLE_ENVOY_STATS_TAGS: '1', - ENABLE_ENVOY_DOG_STATSD: '1', - }, - healthCheck: { - command: [ - 'CMD-SHELL', - 'curl -s http://localhost:9901/server_info | grep state | grep -q LIVE', - ], - startPeriod: cdk.Duration.seconds(10), - interval: cdk.Duration.seconds(5), - timeout: cdk.Duration.seconds(2), - }, - memoryReservationMiB: 128, - user: '1337', - logging: new ecs.AwsLogDriver({ streamPrefix: 'envoy' }), - }); - - // Modify the task definition role to allow the Envoy sidecar to get - // configuration from the Envoy control plane, for this particular - // mesh only. - new iam.Policy(this.scope, `${this.parentService.id}-envoy-to-appmesh`, { - roles: [taskDefinition.taskRole], - statements: [ - new iam.PolicyStatement({ - resources: [this.mesh.meshArn], - actions: ['appmesh:StreamAggregatedResources'], - }), - ], - }); - - // Raise the number of open file descriptors allowed. This is - // necessary when the Envoy proxy is handling large amounts of - // traffic. - this.container.addUlimits({ - softLimit: 1024000, - hardLimit: 1024000, - name: ecs.UlimitName.NOFILE, - }); - } - - // Enable CloudMap for the service. - public modifyServiceProps(props: ServiceBuild): ServiceBuild { - return { - ...props, - - // Ensure that service tasks are registered into - // CloudMap so that the App Mesh proxy can find them. - cloudMapOptions: { - dnsRecordType: 'A', - dnsTtl: cdk.Duration.seconds(10), - failureThreshold: 2, - name: this.parentService.id, - }, - - // These specific deployment settings are currently required in order to - // maintain availability during a rolling deploy of the service with App Mesh - // https://docs.aws.amazon.com/app-mesh/latest/userguide/best-practices.html#reduce-deployment-velocity - minHealthyPercent: 100, - maxHealthyPercent: 125, // Note that at low task count the Service will boost this setting higher - } as ServiceBuild; - } - - // Now that the service is defined, we can create the AppMesh virtual service - // and virtual node for the real service - public useService(service: ecs.Ec2Service | ecs.FargateService) { - const containerextension = this.parentService.serviceDescription.get('service-container') as Container; - - if (!containerextension) { - throw new Error('Firelens extension requires an application extension'); - } - - const cloudmapNamespace = this.parentService.cluster.defaultCloudMapNamespace; - - if (!cloudmapNamespace) { - throw new Error('You must add a CloudMap namespace to the ECS cluster in order to use the AppMesh extension'); - } - - function addListener(protocol: appmesh.Protocol, port: number): appmesh.VirtualNodeListener { - switch (protocol) { - case appmesh.Protocol.HTTP : - return appmesh.VirtualNodeListener.http({ port }); - - case appmesh.Protocol.HTTP2 : - return appmesh.VirtualNodeListener.http2({ port }); - - case appmesh.Protocol.GRPC : - return appmesh.VirtualNodeListener.grpc({ port }); - - case appmesh.Protocol.TCP : - return appmesh.VirtualNodeListener.tcp({ port }); - } - } - - // Create a virtual node for the name service - this.virtualNode = new appmesh.VirtualNode(this.scope, `${this.parentService.id}-virtual-node`, { - mesh: this.mesh, - virtualNodeName: this.parentService.id, - serviceDiscovery: service.cloudMapService - ? appmesh.ServiceDiscovery.cloudMap(service.cloudMapService) - : undefined, - listeners: [addListener(this.protocol, containerextension.trafficPort)], - }); - - // Create a virtual router for this service. This allows for retries - // and other similar behaviors. - this.virtualRouter = new appmesh.VirtualRouter(this.scope, `${this.parentService.id}-virtual-router`, { - mesh: this.mesh, - listeners: [ - this.virtualRouterListener(containerextension.trafficPort), - ], - virtualRouterName: `${this.parentService.id}`, - }); - - // Form the service name that requests will be made to - const serviceName = `${this.parentService.id}.${cloudmapNamespace.namespaceName}`; - const weightedTargets: appmesh.WeightedTarget[] = [{ - virtualNode: this.virtualNode, - weight: 1, - }]; - // Now add the virtual node as a route in the virtual router - // Ensure that the route type matches the protocol type. - this.route = this.virtualRouter.addRoute(`${this.parentService.id}-route`, { - routeSpec: this.routeSpec(weightedTargets, serviceName), - }); - - // Now create a virtual service. Relationship goes like this: - // virtual service -> virtual router -> virtual node - this.virtualService = new appmesh.VirtualService(this.scope, `${this.parentService.id}-virtual-service`, { - virtualServiceProvider: appmesh.VirtualServiceProvider.virtualRouter(this.virtualRouter), - virtualServiceName: serviceName, - }); - } - - // Connect the app mesh extension for this service to an app mesh - // extension on another service. - public connectToService(otherService: Service) { - const otherAppMesh = otherService.serviceDescription.get('appmesh') as AppMeshExtension; - const otherContainer = otherService.serviceDescription.get('service-container') as Container; - - // Do a check to ensure that these services are in the same environment. - // Currently this extension only supports connecting services within - // the same VPC, same App Mesh service mesh, and same Cloud Map namespace - if (otherAppMesh.parentService.environment.id !== this.parentService.environment.id) { - throw new Error(`Unable to connect service '${this.parentService.id}' in environment '${this.parentService.environment.id}' to service '${otherService.id}' in environment '${otherAppMesh.parentService.environment.id}' because services can not be connected across environment boundaries`); - } - - // First allow this service to talk to the other service - // at a network level. This opens the security groups so that - // the security groups of these two services to each other - this.parentService.ecsService.connections.allowTo( - otherService.ecsService, - ec2.Port.tcp(otherContainer.trafficPort), - `Accept inbound traffic from ${this.parentService.id}`, - ); - - // Next update the app mesh config so that the local Envoy - // proxy on this service knows how to route traffic to - // nodes from the other service. - this.virtualNode.addBackend(appmesh.Backend.virtualService(otherAppMesh.virtualService)); - } - - private routeSpec(weightedTargets: appmesh.WeightedTarget[], serviceName: string): appmesh.RouteSpec { - switch (this.protocol) { - case appmesh.Protocol.HTTP: return appmesh.RouteSpec.http({ - weightedTargets: weightedTargets, - }); - case appmesh.Protocol.HTTP2: return appmesh.RouteSpec.http2({ - weightedTargets: weightedTargets, - }); - case appmesh.Protocol.GRPC: return appmesh.RouteSpec.grpc({ - weightedTargets: weightedTargets, - match: { - serviceName: serviceName, - }, - }); - case appmesh.Protocol.TCP: return appmesh.RouteSpec.tcp({ - weightedTargets: weightedTargets, - }); - } - } - - private virtualRouterListener(port: number): appmesh.VirtualRouterListener { - switch (this.protocol) { - case appmesh.Protocol.HTTP: return appmesh.VirtualRouterListener.http(port); - case appmesh.Protocol.HTTP2: return appmesh.VirtualRouterListener.http2(port); - case appmesh.Protocol.GRPC: return appmesh.VirtualRouterListener.grpc(port); - case appmesh.Protocol.TCP: return appmesh.VirtualRouterListener.tcp(port); - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/assign-public-ip.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/assign-public-ip.ts deleted file mode 100644 index b7501385373b6..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/assign-public-ip.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as ec2 from '@aws-cdk/aws-ec2'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as route53 from '@aws-cdk/aws-route53'; -import { Construct } from 'constructs'; -import { Service } from '../../service'; -import { Container } from '../container'; -import { ServiceExtension, ServiceBuild, EnvironmentCapacityType } from '../extension-interfaces'; -import { TaskRecordManager } from './task-record-manager'; - -export interface AssignPublicIpExtensionOptions { - /** - * Enable publishing task public IPs to a recordset in a Route 53 hosted zone. - * - * Note: If you want to change the DNS zone or record name, you will need to - * remove this extension completely and then re-add it. - */ - dns?: AssignPublicIpDnsOptions; -} - -export interface AssignPublicIpDnsOptions { - /** - * A DNS Zone to expose task IPs in. - */ - zone: route53.IHostedZone; - - /** - * Name of the record to add to the zone and in which to add the task IP - * addresses to. - * - * @example 'myservice' - */ - recordName: string; -} - -/** - * Modifies the service to assign a public ip to each task and optionally - * exposes public IPs in a Route 53 record set. - * - * Note: If you want to change the DNS zone or record name, you will need to - * remove this extension completely and then re-add it. - */ -export class AssignPublicIpExtension extends ServiceExtension { - dns?: AssignPublicIpDnsOptions; - - constructor(options?: AssignPublicIpExtensionOptions) { - super('public-ip'); - - this.dns = options?.dns; - } - - private hasDns() { - return Boolean(this.dns); - } - - public prehook(service: Service, _scope: Construct) { - super.prehook(service, _scope); - - if (service.capacityType != EnvironmentCapacityType.FARGATE) { - throw new Error('AssignPublicIp only supports Fargate tasks'); - } - } - - public modifyServiceProps(props: ServiceBuild): ServiceBuild { - return { - ...props, - assignPublicIp: true, - } as ServiceBuild; - } - - public useService(service: ecs.Ec2Service | ecs.FargateService) { - if (this.hasDns()) { - new TaskRecordManager(service, 'TaskRecordManager', { - service: service, - dnsZone: this.dns!.zone, - dnsRecordName: this.dns!.recordName, - }); - - const container = this.parentService.serviceDescription.get('service-container') as Container; - service.connections.allowFromAnyIpv4( - ec2.Port.tcp(container.trafficPort), - 'Accept inbound traffic on traffic port from anywhere', - ); - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/index.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/index.ts deleted file mode 100644 index 81a5e787e9ab9..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './assign-public-ip'; diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/.style.yapf b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/.style.yapf deleted file mode 100644 index 72e1005523a92..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/.style.yapf +++ /dev/null @@ -1,6 +0,0 @@ -# Format using: yapf -ri . -# Since you're here, unit test using: python -m unittest discover -[style] -based_on_style = pep8 -column_limit = 120 -SPLIT_BEFORE_NAMED_ASSIGNS = False diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/Pipfile b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/Pipfile deleted file mode 100644 index 27927581bc218..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/Pipfile +++ /dev/null @@ -1,14 +0,0 @@ -[[source]] -url = "https://pypi.python.org/simple" -verify_ssl = true -name = "pypi" - -[packages] - -[dev-packages] -yapf = "*" -boto3 = "*" -coverage = "*" - -[requires] -python_version = "3.8" diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/Pipfile.lock b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/Pipfile.lock deleted file mode 100644 index 37b1c47e3d5e7..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/Pipfile.lock +++ /dev/null @@ -1,138 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "62f31cd5a0266aa03d564dff455c3c2fd49b3e086ede177a42d574a15789fbda" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.8" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.python.org/simple", - "verify_ssl": true - } - ] - }, - "default": {}, - "develop": { - "boto3": { - "hashes": [ - "sha256:76b3ee0d1dd860c9218bc864cd29f1ee986f6e1e75e8669725dd3c411039379e", - "sha256:c39cb6ed376ba1d4689ac8f6759a2b2d8a0b0424dbec0cd3af1558079bcf06e8" - ], - "index": "pypi", - "version": "==1.20.23" - }, - "botocore": { - "hashes": [ - "sha256:640b62110aa6d1c25553eceafb5bcd89aedeb84b191598d1f6492ad24374d285", - "sha256:7459766c4594f3b8877e8013f93f0dc6c6486acbeb7d9c9ae488396529cc2e84" - ], - "markers": "python_version >= '3.6'", - "version": "==1.23.23" - }, - "coverage": { - "hashes": [ - "sha256:01774a2c2c729619760320270e42cd9e797427ecfddd32c2a7b639cdc481f3c0", - "sha256:03b20e52b7d31be571c9c06b74746746d4eb82fc260e594dc662ed48145e9efd", - "sha256:0a7726f74ff63f41e95ed3a89fef002916c828bb5fcae83b505b49d81a066884", - "sha256:1219d760ccfafc03c0822ae2e06e3b1248a8e6d1a70928966bafc6838d3c9e48", - "sha256:13362889b2d46e8d9f97c421539c97c963e34031ab0cb89e8ca83a10cc71ac76", - "sha256:174cf9b4bef0db2e8244f82059a5a72bd47e1d40e71c68ab055425172b16b7d0", - "sha256:17e6c11038d4ed6e8af1407d9e89a2904d573be29d51515f14262d7f10ef0a64", - "sha256:215f8afcc02a24c2d9a10d3790b21054b58d71f4b3c6f055d4bb1b15cecce685", - "sha256:22e60a3ca5acba37d1d4a2ee66e051f5b0e1b9ac950b5b0cf4aa5366eda41d47", - "sha256:2641f803ee9f95b1f387f3e8f3bf28d83d9b69a39e9911e5bfee832bea75240d", - "sha256:276651978c94a8c5672ea60a2656e95a3cce2a3f31e9fb2d5ebd4c215d095840", - "sha256:3f7c17209eef285c86f819ff04a6d4cbee9b33ef05cbcaae4c0b4e8e06b3ec8f", - "sha256:3feac4084291642165c3a0d9eaebedf19ffa505016c4d3db15bfe235718d4971", - "sha256:49dbff64961bc9bdd2289a2bda6a3a5a331964ba5497f694e2cbd540d656dc1c", - "sha256:4e547122ca2d244f7c090fe3f4b5a5861255ff66b7ab6d98f44a0222aaf8671a", - "sha256:5829192582c0ec8ca4a2532407bc14c2f338d9878a10442f5d03804a95fac9de", - "sha256:5d6b09c972ce9200264c35a1d53d43ca55ef61836d9ec60f0d44273a31aa9f17", - "sha256:600617008aa82032ddeace2535626d1bc212dfff32b43989539deda63b3f36e4", - "sha256:619346d57c7126ae49ac95b11b0dc8e36c1dd49d148477461bb66c8cf13bb521", - "sha256:63c424e6f5b4ab1cf1e23a43b12f542b0ec2e54f99ec9f11b75382152981df57", - "sha256:6dbc1536e105adda7a6312c778f15aaabe583b0e9a0b0a324990334fd458c94b", - "sha256:6e1394d24d5938e561fbeaa0cd3d356207579c28bd1792f25a068743f2d5b282", - "sha256:86f2e78b1eff847609b1ca8050c9e1fa3bd44ce755b2ec30e70f2d3ba3844644", - "sha256:8bdfe9ff3a4ea37d17f172ac0dff1e1c383aec17a636b9b35906babc9f0f5475", - "sha256:8e2c35a4c1f269704e90888e56f794e2d9c0262fb0c1b1c8c4ee44d9b9e77b5d", - "sha256:92b8c845527eae547a2a6617d336adc56394050c3ed8a6918683646328fbb6da", - "sha256:9365ed5cce5d0cf2c10afc6add145c5037d3148585b8ae0e77cc1efdd6aa2953", - "sha256:9a29311bd6429be317c1f3fe4bc06c4c5ee45e2fa61b2a19d4d1d6111cb94af2", - "sha256:9a2b5b52be0a8626fcbffd7e689781bf8c2ac01613e77feda93d96184949a98e", - "sha256:a4bdeb0a52d1d04123b41d90a4390b096f3ef38eee35e11f0b22c2d031222c6c", - "sha256:a9c8c4283e17690ff1a7427123ffb428ad6a52ed720d550e299e8291e33184dc", - "sha256:b637c57fdb8be84e91fac60d9325a66a5981f8086c954ea2772efe28425eaf64", - "sha256:bf154ba7ee2fd613eb541c2bc03d3d9ac667080a737449d1a3fb342740eb1a74", - "sha256:c254b03032d5a06de049ce8bca8338a5185f07fb76600afff3c161e053d88617", - "sha256:c332d8f8d448ded473b97fefe4a0983265af21917d8b0cdcb8bb06b2afe632c3", - "sha256:c7912d1526299cb04c88288e148c6c87c0df600eca76efd99d84396cfe00ef1d", - "sha256:cfd9386c1d6f13b37e05a91a8583e802f8059bebfccde61a418c5808dea6bbfa", - "sha256:d5d2033d5db1d58ae2d62f095e1aefb6988af65b4b12cb8987af409587cc0739", - "sha256:dca38a21e4423f3edb821292e97cec7ad38086f84313462098568baedf4331f8", - "sha256:e2cad8093172b7d1595b4ad66f24270808658e11acf43a8f95b41276162eb5b8", - "sha256:e3db840a4dee542e37e09f30859f1612da90e1c5239a6a2498c473183a50e781", - "sha256:edcada2e24ed68f019175c2b2af2a8b481d3d084798b8c20d15d34f5c733fa58", - "sha256:f467bbb837691ab5a8ca359199d3429a11a01e6dfb3d9dcc676dc035ca93c0a9", - "sha256:f506af4f27def639ba45789fa6fde45f9a217da0be05f8910458e4557eed020c", - "sha256:f614fc9956d76d8a88a88bb41ddc12709caa755666f580af3a688899721efecd", - "sha256:f9afb5b746781fc2abce26193d1c817b7eb0e11459510fba65d2bd77fe161d9e", - "sha256:fb8b8ee99b3fffe4fd86f4c81b35a6bf7e4462cba019997af2fe679365db0c49" - ], - "index": "pypi", - "version": "==6.2" - }, - "jmespath": { - "hashes": [ - "sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9", - "sha256:cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f" - ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.10.0" - }, - "python-dateutil": { - "hashes": [ - "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", - "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.8.2" - }, - "s3transfer": { - "hashes": [ - "sha256:50ed823e1dc5868ad40c8dc92072f757aa0e653a192845c94a3b676f4a62da4c", - "sha256:9c1dc369814391a6bda20ebbf4b70a0f34630592c9aa520856bf384916af2803" - ], - "markers": "python_version >= '3.6'", - "version": "==0.5.0" - }, - "six": { - "hashes": [ - "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", - "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.16.0" - }, - "urllib3": { - "hashes": [ - "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", - "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.7" - }, - "yapf": { - "hashes": [ - "sha256:408fb9a2b254c302f49db83c59f9aa0b4b0fd0ec25be3a5c51181327922ff63d", - "sha256:e3a234ba8455fe201eaa649cdac872d590089a18b661e39bbac7020978dd9c2e" - ], - "index": "pypi", - "version": "==0.31.0" - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/index.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/index.py deleted file mode 100644 index 790102022efed..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/index.py +++ /dev/null @@ -1,34 +0,0 @@ -import logging -import os - -import boto3 - -from lib.cleanup_resource_handler import CleanupResourceHandler -from lib.queue_handler import QueueHandler - -logging.getLogger().setLevel(logging.INFO) - - -def queue_handler(event, context): - """ - Handler for the event queue lambda trigger - """ - - ec2_client = boto3.client('ec2') - dynamodb_resource = boto3.resource('dynamodb') - route53_client = boto3.client('route53') - - handler = QueueHandler(ec2_client=ec2_client, dynamodb_resource=dynamodb_resource, route53_client=route53_client, - environ=os.environ) - - return handler.handle(event, context) - - -def cleanup_resource_handler(event, context): - """ - Event handler for the custom resource. - """ - - route53_client = boto3.client('route53') - handler = CleanupResourceHandler(route53_client=route53_client) - handler.handle_event(event, context) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/__init__.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/cleanup_resource_handler.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/cleanup_resource_handler.py deleted file mode 100644 index 1ffde51b261c0..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/cleanup_resource_handler.py +++ /dev/null @@ -1,51 +0,0 @@ -import time -from dataclasses import dataclass -import logging -from typing import Any - -from lib.route53 import Route53RecordSetAccessor, Route53RecordSetLocator - - -@dataclass -class CleanupResourceProperties: - HostedZoneId: str - RecordName: str - ServiceToken: str - - -class CleanupResourceHandler: - route53_client: Any - monitor_interval: int - - def __init__(self, route53_client, monitor_interval=5): - self.record_set_accessor = Route53RecordSetAccessor(route53_client=route53_client) - self.monitor_interval = monitor_interval - - def handle_event(self, event, context): - request_type = event['RequestType'] - resource_properties = event['ResourceProperties'] - logging.info(f'Handling a {request_type} event with properties {resource_properties}') - - # Decode resource properties right away so that mis-configured - # properties will always fail quickly. - resource_properties = CleanupResourceProperties(**resource_properties) - - if request_type == 'Delete': - return self.on_delete(resource_properties) - - def on_delete(self, resource_properties: CleanupResourceProperties): - locator = Route53RecordSetLocator(hosted_zone_id=resource_properties.HostedZoneId, - record_name=resource_properties.RecordName) - - deleted = self.record_set_accessor.delete(locator=locator) - - if deleted: - logging.info(f'Monitoring for the record deletion') - for interval_number in range(1, 10): - if not self.record_set_accessor.exists(locator): - logging.info(f'The record has been deleted') - return - else: - logging.info(f'The record still exists') - if self.monitor_interval > 0: - time.sleep(self.monitor_interval) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/events.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/events.py deleted file mode 100644 index aa34343a00170..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/events.py +++ /dev/null @@ -1,15 +0,0 @@ -from lib.records import TaskInfo, EniInfo - - -def extract_event_task_info(task_description) -> TaskInfo: - arn = task_description['taskArn'] - - # Parse the eni info out of the the attachments - enis = [ - EniInfo(eni_id=detail['value']) for network_interface in task_description['attachments'] - if network_interface['type'] == 'eni' for detail in network_interface['details'] - if detail['name'] == 'networkInterfaceId' - ] - - # Create an object out of the extracted information - return TaskInfo(task_arn=arn, enis=enis) \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/queue_handler.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/queue_handler.py deleted file mode 100644 index db56b4c898264..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/queue_handler.py +++ /dev/null @@ -1,117 +0,0 @@ -import json -import logging -from typing import Any - -from lib.events import extract_event_task_info -from lib.records import DdbRecordKey, DdbRecord -from lib.records_table import RecordsTableAccessor, RecordUpdate -from lib.route53 import Route53RecordSetLocator, Route53RecordSetAccessor -from lib.running_task_collector import RunningTaskCollector - - -class QueueHandler: - def __init__(self, ec2_client, route53_client, dynamodb_resource, environ): - self.ec2_client = ec2_client - self.route53_client = route53_client - - hosted_zone_id = environ['HOSTED_ZONE_ID'] - record_name = environ['RECORD_NAME'] - records_table = environ['RECORDS_TABLE'] - - cluster_arn = environ['CLUSTER_ARN'] - self.service_name = environ['SERVICE_NAME'] - - self.records_table_key = DdbRecordKey(cluster_arn=cluster_arn, service_name=self.service_name) - self.records_table_accessor = RecordsTableAccessor(table_client=dynamodb_resource.Table(records_table)) - - self.record_set_locator = Route53RecordSetLocator(hosted_zone_id=hosted_zone_id, record_name=record_name) - self.record_set_accessor = Route53RecordSetAccessor(route53_client=self.route53_client) - - def handle(self, event, context): - logging.info(f'event = {json.dumps(event)}') - - # Get a reference record from the records table to check for incoming - # event inconsistencies. - reference_record = self.records_table_accessor.get_record(self.records_table_key) - - # Collect running and stopped tasks from the status change events - running_tasks, stopped_tasks = self.collect_event_task_info(event, reference_record) - - # Build up a set of updates for the record - update = RecordUpdate(running_tasks=running_tasks, stopped_tasks=stopped_tasks) - - # Record the current record set locator - update.current_record_set(self.record_set_locator) - - # Clean any extra record sets in case the recordset has moved. - for record_set_locator in reference_record.record_sets: - if not record_set_locator.matches(self.record_set_locator): - update.extra_record_set(record_set_locator) - self.try_to_delete_record(record_set_locator) - - # Introduce some delay - # records_table.optimistic_simulation_delay = 5 - - # Update the record - ddb_record = self.records_table_accessor.put_update(key=self.records_table_key, update=update) - - # Update DNS - self.record_set_accessor.update(locator=self.record_set_locator, ipv4s=ddb_record.ipv4s) - - def collect_event_task_info(self, event, reference_record: DdbRecord): - running_task_collector = RunningTaskCollector(ec2_client=self.ec2_client, reference_record=reference_record) - stopped_tasks = [] - for message in decode_records(event): - if 'details' not in message: - logging.info(f'Received a non-task state message {message}') - continue - - task_description = message['details'] - - group = task_description['group'] - if group != f'service:{self.service_name}': - logging.info(f'Skipping irrelevant task description from group {group}') - continue - - task_info = extract_event_task_info(task_description) - logging.info(f'extracted task_info = {task_info}') - - last_status = task_description['lastStatus'] - if last_status == 'RUNNING': - logging.info(f'Collecting {task_info.task_arn} as running') - running_task_collector.collect(task_info) - - elif last_status == 'STOPPED': - logging.info(f'Collecting {task_info.task_arn} as stopped') - stopped_tasks.append(task_info) - - else: - logging.warning(f'{task_info.task_arn} had an unexpected status: {last_status}') - - # Query the ENIs store-back public IPs. - running_task_collector.fill_eni_info_from_eni_query() - - running_tasks = running_task_collector.tasks - - return running_tasks, stopped_tasks - - def try_to_delete_record(self, record_set_locator: Route53RecordSetLocator): - """ - Try to delete the given record set. This may not be possible if the - record is in a hosted zone we don't have access to. This may happen - when the user changes dns zones at the service extension level. - """ - - try: - self.record_set_accessor.delete(record_set_locator) - - except: - # We give up pretty easily if the record set accessor can't delete - # the extraneous record for any reason that the accessor can't - # handle. - logging.warning(f'Could not delete the extraneous record set {record_set_locator}') - - -def decode_records(sqs_event): - logging.info(f'sqs_event = {json.dumps(sqs_event)}') - return [json.loads(sqs_record['body']) for sqs_record in sqs_event['Records']] diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/records.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/records.py deleted file mode 100644 index a6a1f2a374ab0..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/records.py +++ /dev/null @@ -1,185 +0,0 @@ -from dataclasses import dataclass, field -from datetime import datetime -from typing import Optional, List, Dict, Set - -from boto3.dynamodb.conditions import Key - -from lib.route53 import Route53RecordSetLocator - - -@dataclass -class EniInfo: - eni_id: str - public_ipv4: Optional[str] = None - - -@dataclass -class TaskInfo: - task_arn: str - enis: List[EniInfo] - stopped_datetime: Optional[datetime] = None - - # Tombstone information for the dynamodb record. - - def set_stopped_marker(self): - """ - Mark this task as stopped. - """ - self.stopped_datetime = datetime.utcnow() - - def is_stopped(self): - """ - Check if this task is stopped. - """ - return True if self.stopped_datetime is not None else False - - -@dataclass -class DdbRecordKey: - cluster_arn: str - service_name: str - - def to_composite(self): - return f'{self.cluster_arn}#{self.service_name}' - - @staticmethod - def from_composite(composite: str): - cluster_arn, service_name = composite.split('#') - return DdbRecordKey(cluster_arn=cluster_arn, service_name=service_name) - - -@dataclass -class DdbRecord: - key: DdbRecordKey - ipv4s: Set[str] = field(default_factory=set) - task_info: Dict[str, TaskInfo] = field(default_factory=dict) - record_sets: Set[Route53RecordSetLocator] = field(default_factory=set) - version: int = 0 - - def task_is_stopped(self, task_info: TaskInfo): - """ - Check if a task has already stopped. - """ - - return task_info.task_arn in self.task_info and self.task_info[task_info.task_arn].is_stopped() - - -class DdbRecordEncoding: - PK_NAME = 'cluster_service' - ATTR_VERSION = 'version' - ATTR_IPV4S = 'ipv4s' - ATTR_TASK_INFO = 'task_info' - ATTR_TASK_ARN = 'task_arn' - ATTR_TASK_ENIS = 'enis' - ATTR_TASK_STOPPED_DATETIME = 'stopped_datetime' - ATTR_ENI_ID = 'eni_id' - ATTR_ENI_PUBLIC_IPV4 = 'public_ipv4' - ATTR_RECORD_SETS = 'record_sets' - ATTR_RECORD_SET_ZONE = 'hosted_zone_id' - ATTR_RECORD_SET_NAME = 'record_name' - - def get_identity(self, key: DdbRecordKey): - return {self.PK_NAME: key.to_composite()} - - def get_identity_expression(self, key: DdbRecordKey): - return Key(self.PK_NAME).eq(key.to_composite()) - - def encode(self, record: DdbRecord) -> dict: - data = dict() - data[self.PK_NAME] = record.key.to_composite() - data[self.ATTR_VERSION] = record.version - - if len(record.ipv4s) > 0: - # Sorting only matters here for repeatability in tests, as set ordering - # isn't easily predictable. - data[self.ATTR_IPV4S] = [v for v in sorted(record.ipv4s)] - - if len(record.record_sets) > 0: - data[self.ATTR_RECORD_SETS] = [self.encode_record_set(v) for v in sorted(record.record_sets)] - - if len(record.task_info) > 0: - data[self.ATTR_TASK_INFO] = { - task_info.task_arn: self.encode_task_info(task_info) - for task_info in record.task_info.values() - } - - return data - - def encode_record_set(self, record_set: Route53RecordSetLocator): - return { - self.ATTR_RECORD_SET_ZONE: record_set.hosted_zone_id, - self.ATTR_RECORD_SET_NAME: record_set.record_name, - } - - def encode_task_info(self, task_info: TaskInfo) -> dict: - data = dict() - data[self.ATTR_TASK_ARN] = task_info.task_arn - - if task_info.stopped_datetime is not None: - data[self.ATTR_TASK_STOPPED_DATETIME] = task_info.stopped_datetime.isoformat() - - if len(task_info.enis) > 0: - data[self.ATTR_TASK_ENIS] = [self.encode_eni_info(eni_info) for eni_info in task_info.enis] - - return data - - def encode_eni_info(self, eni_info: EniInfo) -> dict: - data = dict() - data[self.ATTR_ENI_ID] = eni_info.eni_id - if eni_info.public_ipv4 is not None: - data[self.ATTR_ENI_PUBLIC_IPV4] = eni_info.public_ipv4 - - return data - - def decode(self, data: dict) -> DdbRecord: - key = DdbRecordKey.from_composite(data[self.PK_NAME]) - version = int(data[self.ATTR_VERSION]) - - ipv4s = set() - if self.ATTR_IPV4S in data: - ipv4s = {ip for ip in data[self.ATTR_IPV4S]} - - record_sets = set() - if self.ATTR_RECORD_SETS in data: - for record_set_data in data[self.ATTR_RECORD_SETS]: - record_set = self.decode_record_set(record_set_data) - record_sets.add(record_set) - - task_info = dict() - if self.ATTR_TASK_INFO in data: - task_info = { - k: self.decode_task_info(task_info_data) - for (k, task_info_data) in data[self.ATTR_TASK_INFO].items() - } - - record = DdbRecord(key=key, version=version, ipv4s=ipv4s, task_info=task_info, record_sets=record_sets) - - return record - - def decode_record_set(self, data) -> Route53RecordSetLocator: - hosted_zone_id = data[self.ATTR_RECORD_SET_ZONE] - record_name = data[self.ATTR_RECORD_SET_NAME] - - return Route53RecordSetLocator(hosted_zone_id=hosted_zone_id, record_name=record_name) - - def decode_task_info(self, data) -> TaskInfo: - task_arn = data[self.ATTR_TASK_ARN] - - stopped_datetime = None - if self.ATTR_TASK_STOPPED_DATETIME in data: - stopped_datetime = datetime.fromisoformat(data[self.ATTR_TASK_STOPPED_DATETIME]) - - enis = [] - if self.ATTR_TASK_ENIS in data: - enis = [self.decode_eni_info(eni_info_data) for eni_info_data in data[self.ATTR_TASK_ENIS]] - - return TaskInfo(task_arn=task_arn, stopped_datetime=stopped_datetime, enis=enis) - - def decode_eni_info(self, data) -> EniInfo: - eni_id = data[self.ATTR_ENI_ID] - - public_ipv4 = None - if self.ATTR_ENI_PUBLIC_IPV4 in data: - public_ipv4 = data[self.ATTR_ENI_PUBLIC_IPV4] - - return EniInfo(eni_id=eni_id, public_ipv4=public_ipv4) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/records_table.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/records_table.py deleted file mode 100644 index 390ef0066dde5..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/records_table.py +++ /dev/null @@ -1,215 +0,0 @@ -import logging -import time -from dataclasses import dataclass, field -from datetime import datetime, timedelta -from typing import * - -from boto3.dynamodb.conditions import Attr -from botocore.exceptions import ClientError - -from lib.records import DdbRecord, DdbRecordKey, DdbRecordEncoding, TaskInfo -from lib.route53 import Route53RecordSetLocator - - -@dataclass -class RecordUpdate: - running_tasks: List[TaskInfo] = field(default_factory=list) - stopped_tasks: List[TaskInfo] = field(default_factory=list) - record_sets_added: List[Route53RecordSetLocator] = field(default_factory=list) - record_sets_removed: List[Route53RecordSetLocator] = field(default_factory=list) - - def current_record_set(self, record_set: Route53RecordSetLocator): - self.record_sets_added.append(record_set) - - def extra_record_set(self, record_set: Route53RecordSetLocator): - self.record_sets_removed.append(record_set) - - -class RecordsTableAccessor: - """ - Abstracts management of the task records to putting running and stopped tasks. - """ - - table_client: Any - ddb_record_encoding: DdbRecordEncoding - - # Max number of attempts at optimistic put_tasks - max_attempts = 50 - - # Amount of lag to add (if any) to simulate concurrent locking conflicts in - # lambda - optimistic_simulation_delay = 0 - - def __init__(self, table_client): - """ - Initializes a RecordsTable. Provide a boto3.resource - """ - self.table_client = table_client - self.ddb_record_encoding = DdbRecordEncoding() - - def delete(self, key: DdbRecordKey): - """ - Delete a record by record key. - """ - - logging.info(f'Deleting {key}') - self.table_client.delete_item(Key=self.ddb_record_encoding.get_identity(key)) - - def put_update(self, key: DdbRecordKey, update: RecordUpdate) -> DdbRecord: - """ - Retries putting tasks into the table record with optimistic locking. - """ - - for attempt in range(0, self.max_attempts): - try: - logging.info(f'Attempting to put the task optimistically (attempt {attempt+1})') - return self.put_update_optimistically(key=key, update=update) - except ClientError as e: - if e.response['Error']['Code'] == 'ConditionalCheckFailedException': - logging.info(f'Check condition was rejected') - continue - else: - raise - - # Ran out of retries!! - raise Exception('Exceeded maximum retries while optimistically putting changes') - - def get_record(self, key: DdbRecordKey) -> DdbRecord: - """ - Gets the record by key or provides a blank record. - """ - - # Search for the pertinent record - response = self.table_client.query(KeyConditionExpression=self.ddb_record_encoding.get_identity_expression(key)) - - if len(response['Items']) > 0: - # Decode a pre-existing record - logging.info(f'Found a pre-existing record') - return self.ddb_record_encoding.decode(response['Items'][0]) - else: - logging.info(f'Creating a new record') - # Create a new record - return DdbRecord(key=key) - - def put_update_optimistically(self, key: DdbRecordKey, update: RecordUpdate) -> DdbRecord: - """ - Optimistically record running and stopped tasks for this record. - """ - - ddb_record = self.get_record(key=key) - - # Add some lag (if any) to simulate concurrent locking conflicts in lambda - if self.optimistic_simulation_delay > 0: - time.sleep(self.optimistic_simulation_delay) - - # Update the record with the running and stopped task info - update_ddb_record(ddb_record=ddb_record, update=update) - - # Optimistic locking condition - optimistic_lock_condition = Attr(self.ddb_record_encoding.ATTR_VERSION).not_exists() \ - | Attr(self.ddb_record_encoding.ATTR_VERSION).eq(ddb_record.version) - - # Prepare the record for updating - ddb_record.version += 1 - item = self.ddb_record_encoding.encode(ddb_record) - - # Put it up - self.table_client.put_item(Item=item, ConditionExpression=optimistic_lock_condition) - - return ddb_record - - -def update_ddb_record(ddb_record: DdbRecord, update: RecordUpdate) -> DdbRecord: - """ - Updates a DynamoDB record with the list of running and stopped tasks. - """ - - # Add the record sets we want to add - for record_set in update.record_sets_added: - ddb_record.record_sets.add(record_set) - - # Remove the ones we want to remove - for record_set in update.record_sets_removed: - if record_set in ddb_record.record_sets: - ddb_record.record_sets.remove(record_set) - - # Add running task info to the record - for running_task in update.running_tasks: - # Don't add a task as running when it previously stopped (out-of-order receive) - if running_task.task_arn in ddb_record.task_info and ddb_record.task_info[running_task.task_arn].is_stopped(): - logging.info( - f'Received {running_task.task_arn} transition to RUNNING, but it was already stopped. Ignored.') - continue - - # Record info about the running task - ddb_record.task_info[running_task.task_arn] = running_task - - # Add all public ips to the public ip set - for eni in running_task.enis: - if eni.public_ipv4 is not None: - ddb_record.ipv4s.add(eni.public_ipv4) - - logging.info(f'Recorded {running_task.task_arn} as RUNNING.') - - # Remove stopped task ips from the record and set "stopped" markers on the - # stored task info. - for stopped_task in update.stopped_tasks: - # When the stopped task was previously represented in the task info list, - # then we fetch the old representation for its potential ip address info. - if stopped_task.task_arn in ddb_record.task_info: - task_arn = stopped_task.task_arn - stored_task = ddb_record.task_info[task_arn] - - # When the task is not yet marked as stopped, we need to mark it as such - # and remove its eni ips from the ip list. - if not stored_task.is_stopped(): - stored_task.set_stopped_marker() - - for eni in stored_task.enis: - if eni.public_ipv4 is not None and eni.public_ipv4 in ddb_record.ipv4s: - ddb_record.ipv4s.remove(eni.public_ipv4) - - logging.info(f'Recorded {task_arn} as STOPPED.') - - else: - # Stored task already marked as stopped, so the received task is a - # duplicate. Ignore it. - logging.info(f'Received {task_arn} which was already STOPPED. Ignoring.') - pass - - else: - # Stopped task isn't in the task list, so we've received an out-of-order - # STOPPED transition. We don't know this task, but we know that if we - # receive a running task in the future, that we don't want to accept it. - stopped_task.set_stopped_marker() - ddb_record.task_info[stopped_task.task_arn] = stopped_task - logging.info(f'Recorded {stopped_task.task_arn} as STOPPED even though we have never seen it.') - - # Expunge expired tasks. Use a copy of the dict items to avoid errors from the - # dictionary changing while iterating. - for (key, task) in list(ddb_record.task_info.items()): - if task_info_has_expired(task): - logging.info(f'Expunging {task.task_arn} as expired.') - del ddb_record.task_info[key] - - return ddb_record - - -# The the length of time that a task marked as stopped may continue to exist -# in the task info list before it is expunged. -STOPPED_MARKER_EXPIRATION = timedelta(minutes=30) - - -def task_info_has_expired(task_info: TaskInfo): - """ - Determine if this task info can be deleted from the DDB record. If the task - has stopped and the stopped marker expiration has elapsed, then we can - delete, otherwise the task info must be kept to filter out-of-order duplicate - RUNNING state transition events. - """ - - if not task_info.is_stopped(): - return False - - stopped_marker_age = datetime.utcnow() - task_info.stopped_datetime - return True if stopped_marker_age > STOPPED_MARKER_EXPIRATION else False diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/route53.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/route53.py deleted file mode 100644 index df3b23c76a1fe..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/route53.py +++ /dev/null @@ -1,167 +0,0 @@ -from dataclasses import dataclass -import time -from typing import * -import logging - -from botocore.exceptions import ClientError - - -@dataclass -class Route53RecordSetLocator: - hosted_zone_id: str - record_name: str - - def __str__(self): - """String serialization for hashing and comparison""" - return f'{self.hosted_zone_id}#{self.record_name}' - - def __hash__(self): - """Unique hash for this object is based on its string serialization""" - return int.from_bytes(self.__str__().encode(), 'little') - - def __lt__(self, other): - """set() uses this""" - return self.__str__() < other.__str__() - - def get_dot_suffixed_name(self): - return self.record_name + '.' - - def matches_record_set(self, record_set): - return record_set['Name'] == self.get_dot_suffixed_name() - - def matches(self, record_set_locator): - return self.record_name == record_set_locator.record_name and self.hosted_zone_id == record_set_locator.hosted_zone_id - - -class Route53RecordSetAccessor: - route53_client: Any - ttl = 60 - - def __init__(self, route53_client: Any): - self.route53_client = route53_client - - def update(self, locator: Route53RecordSetLocator, ipv4s: Set[str] = None): - ipv4s = set() if ipv4s is None else ipv4s - - record_set, is_new = retry_with_backoff(lambda: self.get_record_set(locator)) - if is_new: - logging.info(f'Found a pre-existing record set: {record_set}') - else: - logging.info('Creating a new record set') - - if len(ipv4s) > 0: - record_set['ResourceRecords'] = map_ips_to_resource_records(ipv4s) - retry_with_backoff(lambda: self.request_upsert(locator, record_set)) - elif not is_new: - retry_with_backoff(lambda: self.request_delete(locator, record_set)) - else: - logging.info('Refusing to do anything with a new but empty recordset') - - def get_record_set(self, locator: Route53RecordSetLocator) -> Tuple[dict, bool]: - record_type = 'A' - result = self.route53_client.list_resource_record_sets(HostedZoneId=locator.hosted_zone_id, - StartRecordName=locator.record_name, - StartRecordType=record_type, MaxItems="1") - - logging.info(f'Query result: {result}') - existing_record_set = find_locator_record_set(locator, record_type, result['ResourceRecordSets']) - if existing_record_set: - return existing_record_set, False - else: - return { - 'Name': locator.get_dot_suffixed_name(), - 'Type': record_type, - 'ResourceRecords': [], - 'TTL': self.ttl - }, True - - def request_upsert(self, locator: Route53RecordSetLocator, record_set): - logging.info(f'Upserting record set {record_set}') - self.route53_client.change_resource_record_sets( - HostedZoneId=locator.hosted_zone_id, ChangeBatch={ - 'Comment': 'Automatic', - 'Changes': [{ - 'Action': 'UPSERT', - 'ResourceRecordSet': record_set - }] - }) - - def delete(self, locator: Route53RecordSetLocator): - """ - Delete the record. Returns true if it found and deleted the record. - Returns false if it didn't need to delete anything. - """ - - logging.info(f'Querying for {locator}') - record_set, is_new = retry_with_backoff(lambda: self.get_record_set(locator)) - - if not is_new: - logging.info(f'Found a record set') - retry_with_backoff(lambda: self.request_delete(locator, record_set)) - logging.info(f'Deleted record set {record_set}') - return True - - else: - logging.info(f'Did not find a record set, so no deletion needed') - return False - - def exists(self, locator: Route53RecordSetLocator): - """ - Returns true if the record exists. False otherwise. - """ - - _, is_new = retry_with_backoff(lambda: self.get_record_set(locator)) - - return not is_new - - def request_delete(self, locator: Route53RecordSetLocator, record_set): - logging.info(f'Deleting record set: {record_set}') - self.route53_client.change_resource_record_sets( - HostedZoneId=locator.hosted_zone_id, ChangeBatch={ - 'Comment': 'Automatic', - 'Changes': [{ - 'Action': 'DELETE', - 'ResourceRecordSet': record_set, - }] - }) - - -def exponential_backoff(attempt: int): - return 2**attempt - - -def retry_with_backoff(call: Callable, attempts=5, backoff=exponential_backoff): - for attempt in range(0, attempts): - try: - return call() - - except ClientError as e: - if e.response['Error']['Code'] == 'Throttling': - backoff_seconds = backoff(attempt) - logging.info(f'Attempt {attempt+1} throttled. Backing off for {backoff_seconds}.') - time.sleep(backoff_seconds) - continue - - if e.response['Error']['Code'] == 'PriorRequestNotComplete': - backoff_seconds = backoff(attempt) - logging.info( - f'Attempt {attempt+1} discovered the prior request is not yet complete. Backing off for {backoff_seconds}.' - ) - time.sleep(backoff_seconds) - continue - - raise - - -def map_ips_to_resource_records(ips: Set[str]): - # Take up to the first 400 ips after sorting as the max recordset record quota is 400 - ips_sorted_limited = sorted(ips)[0:400] - return [{'Value': ip} for ip in ips_sorted_limited] - - -def find_locator_record_set(locator: Route53RecordSetLocator, record_type: str, record_sets: list): - for record_set in record_sets: - if locator.matches_record_set(record_set) and record_set['Type'] == record_type: - return record_set - - return None diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/running_task_collector.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/running_task_collector.py deleted file mode 100644 index a7034d81e5e53..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/lib/running_task_collector.py +++ /dev/null @@ -1,57 +0,0 @@ -import logging -from typing import * - -from lib.records import DdbRecord, EniInfo, TaskInfo - - -class RunningTaskCollector: - """ - Collects information about running tasks. After collecting all task info, - when `fill_eni_info_from_eni_query()` is called, the collector queries - for the ip addresses of the tasks and fills in the appropriate records. - """ - - ec2_client: Any - tasks: List[TaskInfo] - enis_by_id: Dict[str, EniInfo] - - def __init__(self, ec2_client, reference_record: DdbRecord): - self.ec2_client = ec2_client - self.tasks = list() - self.enis_by_id = dict() - self.reference_record = reference_record - - def collect(self, task_info): - # Check to see if the task we've received is already stopped. If so, - # we refuse to collect it on the basis that we'll just get an eni - # doesn't exist error anyway. - if self.reference_record.task_is_stopped(task_info): - logging.info(f'Refusing to collect {task_info.task_arn} as it has already been deleted') - return - - # Append the task info to the master list - self.tasks.append(task_info) - - # Collect enis indexed by their ids - for eni in task_info.enis: - self.enis_by_id[eni.eni_id] = eni - - def fill_eni_info_from_eni_query(self): - for eni_description in self.describe_enis(): - eni_id = eni_description['NetworkInterfaceId'] - - if 'Association' in eni_description: - public_ipv4 = eni_description['Association']['PublicIp'] - if public_ipv4 and eni_id in self.enis_by_id: - self.enis_by_id[eni_id].public_ipv4 = public_ipv4 - - def describe_enis(self): - paginator = self.ec2_client.get_paginator('describe_network_interfaces') - - eni_ids = list(self.enis_by_id.keys()) - for page in paginator.paginate(NetworkInterfaceIds=eni_ids): - for eni in page['NetworkInterfaces']: - yield eni - - def get_ips(self): - return [eni.public_ipv4 for eni in self.enis_by_id.values()] diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/run_test.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/run_test.py deleted file mode 100644 index 7efd5dc08534d..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/run_test.py +++ /dev/null @@ -1,5 +0,0 @@ -import unittest - -if __name__ == "__main__": - test_suite = unittest.defaultTestLoader.discover('.') - unittest.TextTestRunner().run(test_suite) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/__init__.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/__init__.py deleted file mode 100644 index 539bac0f9e2aa..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Keep this file so that python -m unittest discover can find these tests. diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/ddb-record.json b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/ddb-record.json deleted file mode 100644 index f62cf391abf39..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/ddb-record.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "cluster_service": "CLUSTER_ARN#SERVICE", - "ipv4s": [ - "1.1.2.1", - "1.1.2.2" - ], - "task_info": { - "TASK1_ARN": { - "enis": [ - { - "eni_id": "TASK1_ENI1_ID", - "public_ipv4": "1.1.1.1" - } - ], - "stopped_datetime": "2020-10-04T23:47:36.322158", - "task_arn": "TASK1_ARN" - }, - "TASK2_ARN": { - "enis": [ - { - "eni_id": "TASK2_ENI1_ID", - "public_ipv4": "1.1.2.1" - }, - { - "eni_id": "TASK2_ENI2_ID", - "public_ipv4": "1.1.2.2" - } - ], - "task_arn": "TASK2_ARN" - } - }, - "record_sets": [ - { - "hosted_zone_id": "ABCD", - "record_name": "test-record.myexample.com" - }, - { - "hosted_zone_id": "ABCD", - "record_name": "test-record2.myexample.com" - } - ], - "version": 12 -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/eni_description.json b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/eni_description.json deleted file mode 100644 index 9e790e455fb99..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/eni_description.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Association": { - "IpOwnerId": "amazon", - "PublicDnsName": "example.com", - "PublicIp": "1.2.3.4" - }, - "Attachment": { - "AttachTime": "2020-10-03T23:42:51+00:00", - "AttachmentId": "eni-attach-0704671692ecf366b", - "DeleteOnTermination": false, - "DeviceIndex": 1, - "InstanceOwnerId": "000000000", - "Status": "attached" - }, - "AvailabilityZone": "test-region-1a", - "Description": "arn:aws:ecs:test-region-1:0000000000:attachment/20d24cce-3d50-493d-b890-32d4f11859f4", - "Groups": [ - { - "GroupName": "aws-ecs-integ-nameserviceSecurityGroup33F4662C-16PM465FOR8L1", - "GroupId": "sg-0b83d6ad2edd8e940" - } - ], - "InterfaceType": "interface", - "Ipv6Addresses": [], - "MacAddress": "02:a4:cb:74:0f:a8", - "NetworkInterfaceId": "eni-abcd", - "OwnerId": "0000000000", - "PrivateDnsName": "ip-10-0-0-19.test-region-1.compute.internal", - "PrivateIpAddress": "10.0.0.19", - "PrivateIpAddresses": [ - { - "Association": { - "IpOwnerId": "amazon", - "PublicDnsName": "example.com", - "PublicIp": "1.2.3.4" - }, - "Primary": true, - "PrivateDnsName": "ip-10-0-0-19.test-region-1.compute.internal", - "PrivateIpAddress": "10.0.0.19" - } - ], - "RequesterId": "0000000000", - "RequesterManaged": true, - "SourceDestCheck": true, - "Status": "in-use", - "SubnetId": "subnet-036b0d1413bb6bd2c", - "TagSet": [], - "VpcId": "vpc-0e63014e689c4b14f" -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/task_description.json b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/task_description.json deleted file mode 100644 index 7bf19d91893a2..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/fixtures/task_description.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "attachments": [ - { - "id": "", - "type": "eni", - "status": "DELETED", - "details": [ - { - "name": "subnetId", - "value": "subnet-" - }, - { - "name": "networkInterfaceId", - "value": "eni-abcd" - }, - { - "name": "macAddress", - "value": "" - }, - { - "name": "privateIPv4Address", - "value": "10.0.0.52" - } - ] - } - ], - "availabilityZone": "test-region-1a", - "clusterArn": "arn:aws:ecs:test-region-1::cluster/aws-ecs-integ-productionenvironmentclusterC6599D2D-U7W8a2P2HPhC", - "containers": [ - { - "containerArn": "arn:aws:ecs:test-region-1::container/ff3b49f4-5eea-46cd-99c6-069584b3fb8e", - "exitCode": 1, - "lastStatus": "STOPPED", - "name": "app", - "image": "nathanpeck/name", - "runtimeId": "", - "taskArn": "arn:aws:ecs:test-region-1::task/12345678-1234-1234-1234-1234567890AB", - "networkInterfaces": [ - { - "attachmentId": "323eb03f-dedf-44b6-aa5f-d9d7f7b37714", - "privateIpv4Address": "10.0.0.52" - } - ], - "cpu": "256", - "memory": "512" - } - ], - "createdAt": "2020-10-03T22:31:35.117Z", - "launchType": "FARGATE", - "cpu": "256", - "memory": "512", - "desiredStatus": "STOPPED", - "group": "service:aws-ecs-integ-nameserviceService8015C8D6-I4TwUFv4xk2o", - "lastStatus": "STOPPED", - "overrides": { - "containerOverrides": [ - { - "name": "app" - } - ] - }, - "connectivity": "CONNECTED", - "connectivityAt": "2020-10-03T22:31:43.32Z", - "pullStartedAt": "2020-10-03T22:31:46.764Z", - "startedAt": "2020-10-03T22:31:54.764Z", - "startedBy": "ecs-svc/7073659324082574009", - "stoppingAt": "2020-10-03T22:43:06.753Z", - "stoppedAt": "2020-10-03T22:43:31.542Z", - "pullStoppedAt": "2020-10-03T22:31:53.764Z", - "executionStoppedAt": "2020-10-03T22:43:08Z", - "stoppedReason": "Scaling activity initiated by (deployment ecs-svc/7073659324082574009)", - "updatedAt": "2020-10-03T22:43:31.542Z", - "taskArn": "arn:aws:ecs:test-region-1::task/12345678-1234-1234-1234-1234567890AB", - "taskDefinitionArn": "arn:aws:ecs:test-region-1::task-definition/awsecsintegnametaskdefinition0EA6A1A0:3", - "version": 7, - "platformVersion": "1.3.0" -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_cleanup_resource_handler.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_cleanup_resource_handler.py deleted file mode 100644 index c5ec1d0cf61ec..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_cleanup_resource_handler.py +++ /dev/null @@ -1,46 +0,0 @@ -import unittest -import unittest.mock as mock - -from lib.cleanup_resource_handler import CleanupResourceHandler -from lib.route53 import Route53RecordSetLocator - - -class TestCleanupResourceHandler(unittest.TestCase): - def test_handler_rejects_invalid_properties(self): - handler = CleanupResourceHandler(route53_client=mock.Mock()) - with self.assertRaises(Exception): - handler.handle_event({'RequestType': 'Delete', 'ResourceProperties': {'Invalid': 'Invalid'}}, {}) - - def test_handling_delete(self): - handler = CleanupResourceHandler(route53_client=mock.Mock(), monitor_interval=0) - record_set_accessor = mock.Mock() - record_set_accessor.delete = mock.Mock(return_value=True) # True = Deleted - - exists_count = 0 - - def exists_side_effect(*args): - nonlocal exists_count - exists_count += 1 - return True if exists_count < 3 else False - - record_set_accessor.exists = mock.Mock(side_effect=exists_side_effect) - - handler.record_set_accessor = record_set_accessor - - event = { - 'RequestType': 'Delete', - 'ResourceProperties': { - 'ServiceToken': 'Something', - 'HostedZoneId': 'ZONE', - 'RecordName': 'something.mydomain.com' - } - } - - # WHEN - handler.handle_event(event, {}) - - # THEN - expected_locator = Route53RecordSetLocator(hosted_zone_id='ZONE', record_name='something.mydomain.com') - record_set_accessor.delete.assert_called_with(locator=expected_locator) - record_set_accessor.exists.assert_called() - self.assertEqual(record_set_accessor.exists.call_count, 3) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_events.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_events.py deleted file mode 100644 index a616bd7999309..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_events.py +++ /dev/null @@ -1,21 +0,0 @@ -import json -import os -import unittest - -from lib.events import extract_event_task_info - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(THIS_DIR, 'fixtures', 'task_description.json')) as f: - TASK_DESCRIPTION = json.loads(f.read()) - - -class TestEvents(unittest.TestCase): - def test_extract_event_task_info(self): - task_info = extract_event_task_info(TASK_DESCRIPTION) - - self.assertEqual(task_info.task_arn, 'arn:aws:ecs:test-region-1::task/12345678-1234-1234-1234-1234567890AB') - self.assertTrue(not task_info.is_stopped()) - - self.assertEqual(len(task_info.enis), 1) - self.assertEqual(task_info.enis[0].eni_id, 'eni-abcd') - self.assertEqual(task_info.enis[0].public_ipv4, None) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_queue_handler.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_queue_handler.py deleted file mode 100644 index 91477451cf72e..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_queue_handler.py +++ /dev/null @@ -1,29 +0,0 @@ -import unittest -import unittest.mock as mock - -from lib.queue_handler import QueueHandler - - -class TestQueueHandler(unittest.TestCase): - def test_queue_handler_sets_up(self): - environ = { - 'HOSTED_ZONE_ID': 'HOSTED_ZONE_ID', - 'RECORD_NAME': 'RECORD_NAME', - 'RECORDS_TABLE': 'RECORDS_TABLE', - 'CLUSTER_ARN': 'CLUSTER_ARN', - 'SERVICE_NAME': 'SERVICE_NAME', - } - - ec2_client = mock.Mock() - route53_client = mock.Mock() - dynamodb_resource = mock.Mock() - - # WHEN - - handler = QueueHandler(ec2_client=ec2_client, route53_client=route53_client, - dynamodb_resource=dynamodb_resource, environ=environ) - - # THEN - dynamodb_resource.Table.called_width('RECORDS_TABLE') - - pass diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_records.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_records.py deleted file mode 100644 index cb2e1e45f6ed4..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_records.py +++ /dev/null @@ -1,46 +0,0 @@ -import json -import os -import unittest -from datetime import datetime - -from lib.records import DdbRecordEncoding, TaskInfo, EniInfo - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(THIS_DIR, 'fixtures', 'ddb-record.json')) as f: - DDB_RECORD_ENCODED = json.loads(f.read()) - - -class TestRecords(unittest.TestCase): - def test_task_info_stopped_marker(self): - task_info = TaskInfo(task_arn='a', enis=[]) - task_info.set_stopped_marker() - self.assertTrue(task_info.is_stopped()) - - def test_ddb_record_encoding(self): - # GIVEN - ddb_record_encoding = DdbRecordEncoding() - - # WHEN - ddb_record = ddb_record_encoding.decode(DDB_RECORD_ENCODED) - ddb_record_reencoded = ddb_record_encoding.encode(ddb_record) - - # THEN - self.assertEqual(ddb_record.key.cluster_arn, 'CLUSTER_ARN') - self.assertEqual(ddb_record.key.service_name, 'SERVICE') - self.assertEqual(sorted(ddb_record.ipv4s), ['1.1.2.1', '1.1.2.2']) - self.assertEqual( - ddb_record.task_info['TASK1_ARN'], - TaskInfo(task_arn='TASK1_ARN', stopped_datetime=datetime(2020, 10, 4, 23, 47, 36, 322158), enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ])) - self.assertEqual( - ddb_record.task_info['TASK2_ARN'], - TaskInfo( - task_arn='TASK2_ARN', enis=[ - EniInfo(eni_id='TASK2_ENI1_ID', public_ipv4='1.1.2.1'), - EniInfo(eni_id='TASK2_ENI2_ID', public_ipv4='1.1.2.2'), - ])) - self.assertEqual(len(ddb_record.record_sets), 2) - - self.maxDiff = 9999999 - self.assertEqual(ddb_record_reencoded, DDB_RECORD_ENCODED) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_records_table.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_records_table.py deleted file mode 100644 index 3429c152a6a35..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_records_table.py +++ /dev/null @@ -1,188 +0,0 @@ -import json -import os -import unittest -import unittest.mock as mock - -from boto3.dynamodb.conditions import ConditionExpressionBuilder -from botocore.exceptions import ClientError - -from lib.records import DdbRecordKey, TaskInfo, EniInfo, DdbRecord -from lib.records_table import RecordsTableAccessor, update_ddb_record, RecordUpdate -from lib.route53 import Route53RecordSetLocator - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(THIS_DIR, 'fixtures', 'ddb-record.json')) as f: - DDB_RECORD_ENCODED = json.loads(f.read()) - - -class TestRecordsTable(unittest.TestCase): - def test_put_tasks_creates_with_optimistic_lock(self): - # GIVEN - table_client = mock.Mock() - table_client.query = mock.Mock(return_value={'Items': []}) - - key = DdbRecordKey(cluster_arn='a', service_name='b') - records_table = RecordsTableAccessor(table_client=table_client) - - running = [TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ])] - - # WHEN - records_table.put_update_optimistically(key=key, update=RecordUpdate(running_tasks=running)) - - # THEN - table_client.put_item.assert_called() - item = table_client.put_item.call_args.kwargs['Item'] - self.assertEqual(item['version'], 1) - - condition_expression = table_client.put_item.call_args.kwargs['ConditionExpression'] - expr, atts, vals = ConditionExpressionBuilder().build_expression(condition_expression) - self.assertEqual(expr, '(attribute_not_exists(#n0) OR #n1 = :v0)') - self.assertEqual(atts, {'#n0': 'version', '#n1': 'version'}) - self.assertEqual(vals, {':v0': 0}) - - def test_put_tasks_updates_with_optimistic_lock(self): - # GIVEN - table_client = mock.Mock() - table_client.query = mock.Mock(return_value={'Items': [dict(DDB_RECORD_ENCODED)]}) - - key = DdbRecordKey(cluster_arn='FOO', service_name='test.myexample.com') - records_table = RecordsTableAccessor(table_client=table_client) - - running = [TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ])] - - # WHEN - records_table.put_update_optimistically(key=key, update=RecordUpdate(running_tasks=running)) - - # THEN - condition_expression = table_client.put_item.call_args.kwargs['ConditionExpression'] - expr, atts, vals = ConditionExpressionBuilder().build_expression(condition_expression) - self.assertEqual(vals, {':v0': 12}) - - def test_put_tasks_retries_optimistically(self): - # GIVEN - table_client = mock.Mock() - table_client.query = mock.Mock(return_value={'Items': []}) - table_client.put_item = mock.Mock( - side_effect=ClientError({'Error': { - 'Code': 'ConditionalCheckFailedException' - }}, 'PutItem')) - - records_table = RecordsTableAccessor(table_client=table_client) - key = DdbRecordKey(cluster_arn='a', service_name='b') - - # WHEN - with self.assertRaisesRegex(Exception, r'Exceeded maximum retries'): - records_table.put_update(key=key, update=RecordUpdate()) - - # THEN - self.assertEqual(table_client.query.call_count, records_table.max_attempts) - self.assertEqual(table_client.put_item.call_count, records_table.max_attempts) - - def test_put_tasks_raises_other_errors(self): - # GIVEN - table_client = mock.Mock() - table_client.query = mock.Mock(return_value={'Items': []}) - table_client.put_item = mock.Mock(side_effect=ClientError({'Error': {'Code': 'SomethingElse'}}, 'PutItem')) - - records_table = RecordsTableAccessor(table_client=table_client) - key = DdbRecordKey(cluster_arn='a', service_name='b') - - # WHEN - with self.assertRaisesRegex(Exception, r'SomethingElse'): - records_table.put_update(key=key, update=RecordUpdate()) - - # THEN - self.assertEqual(table_client.query.call_count, 1) - self.assertEqual(table_client.put_item.call_count, 1) - - def test_delete(self): - # GIVEN - table_client = mock.Mock() - key = DdbRecordKey(cluster_arn='a', service_name='b') - records_table = RecordsTableAccessor(table_client=table_client) - - # WHEN - records_table.delete(key) - - # THEN - table_client.delete_item.called_with(Key='a#b') - - def test_update_ddb_record(self): - # GIVEN - ddb_record = DdbRecord(key=DdbRecordKey(cluster_arn='a', service_name='b')) - - # TASK1->RUNNING, TASK2->RUNNING - ord1_running = [ - TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ]), - TaskInfo(task_arn='TASK2_ARN', enis=[ - EniInfo(eni_id='TASK2_ENI1_ID', public_ipv4='1.1.2.1'), - ]), - ] - # TASK3->STOPPED (out of order) - ord1_stopped = [ - TaskInfo(task_arn='TASK3_ARN', enis=[ - EniInfo(eni_id='TASK3_ENI1_ID'), - ]), - ] - - # TASK1->STOPPED, TASK3->STOPPED (duplicate) - ord2_stopped = [ - # Expected TASK1 transition to STOPPED - TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID'), - ]), - # Duplicate TASK3 transition to STOPPED - TaskInfo(task_arn='TASK3_ARN', enis=[ - EniInfo(eni_id='TASK3_ENI1_ID'), - ]), - ] - - # TASK1->RUNNING (out of order), TASK3->RUNNING (out of order) - ord3_running = [ - TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ]), - TaskInfo(task_arn='TASK3_ARN', enis=[ - EniInfo(eni_id='TASK3_ENI1_ID', public_ipv4='1.1.3.1'), - ]), - ] - - # WHEN - update_ddb_record(ddb_record, RecordUpdate(running_tasks=ord1_running, stopped_tasks=ord1_stopped)) - update_ddb_record(ddb_record, RecordUpdate(stopped_tasks=ord2_stopped)) - update_ddb_record(ddb_record, RecordUpdate(running_tasks=ord3_running)) - - # THEN - self.assertEqual(len(ddb_record.task_info), 3, msg='expected 3 task infos') - self.assertTrue(ddb_record.task_info['TASK1_ARN'].is_stopped()) - self.assertTrue(not ddb_record.task_info['TASK2_ARN'].is_stopped()) - self.assertTrue(ddb_record.task_info['TASK3_ARN'].is_stopped()) - - self.assertFalse('1.1.1.1' in ddb_record.ipv4s, - msg='ord3_running should have been ignored because the task previously stopped') - self.assertEqual(sorted(ddb_record.ipv4s), ['1.1.2.1']) - - def test_update_record_sets(self): - # GIVEN - ddb_record = DdbRecord(key=DdbRecordKey(cluster_arn='a', service_name='b')) - ord1 = [ - Route53RecordSetLocator('a', 'b'), - Route53RecordSetLocator('a', 'c'), - ] - ord2 = [ - Route53RecordSetLocator('a', 'b'), - ] - - # WHEN - update_ddb_record(ddb_record, RecordUpdate(record_sets_added=ord1)) - update_ddb_record(ddb_record, RecordUpdate(record_sets_removed=ord2)) - - # THEN - self.assertEqual(len(ddb_record.record_sets), 1) - self.assertTrue(Route53RecordSetLocator('a', 'c') in ddb_record.record_sets) \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_route53.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_route53.py deleted file mode 100644 index a77093dcf484d..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_route53.py +++ /dev/null @@ -1,281 +0,0 @@ -import unittest -import unittest.mock as mock - -from botocore.exceptions import ClientError - -from lib.route53 import Route53RecordSetLocator, Route53RecordSetAccessor, exponential_backoff, retry_with_backoff, \ - map_ips_to_resource_records, find_locator_record_set - - -class TestRoute53(unittest.TestCase): - def get_route53_client_mock(self): - route53_client = mock.Mock() - record_set_value = None - - route53_client.list_resource_record_sets = mock.Mock( - side_effect=lambda **kwargs: - {'ResourceRecordSets': [record_set_value] if record_set_value is not None else []}) - - def change_resource_record_sets(HostedZoneId, ChangeBatch): - nonlocal record_set_value - change = ChangeBatch['Changes'][0] - change_action = change['Action'] - - if change_action == 'UPSERT': - record_set_value = change['ResourceRecordSet'] - elif change_action == 'DELETE': - record_set_value = None - - route53_client.change_resource_record_sets = mock.Mock(side_effect=change_resource_record_sets) - - return route53_client - - def test_creating_records(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - merger = Route53RecordSetAccessor(route53_client) - - # WHEN - merger.update(locator, ipv4s={'1.1.1.1'}) - - # THEN - route53_client.change_resource_record_sets.assert_called_with( - HostedZoneId='foo', ChangeBatch={ - 'Comment': - 'Automatic', - 'Changes': [{ - 'Action': 'UPSERT', - 'ResourceRecordSet': { - 'Name': 'foo.myexample.com.', - 'Type': 'A', - 'ResourceRecords': [ - { - 'Value': '1.1.1.1' - }, - ], - 'TTL': 60 - } - }] - }) - - def test_creating_empty_records(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - merger = Route53RecordSetAccessor(route53_client) - - # WHEN - merger.update(locator, ipv4s=set()) - - # THEN - route53_client.change_resource_record_sets.assert_not_called() - - def test_deleting_records(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # Set up the mock with a record. - record_set.update(locator, ipv4s={'1.1.1.1'}) - - # WHEN - record_set.update(locator, ipv4s=set()) - - # THEN - route53_client.change_resource_record_sets.assert_called_with( - HostedZoneId='foo', ChangeBatch={ - 'Comment': - 'Automatic', - 'Changes': [{ - 'Action': 'DELETE', - 'ResourceRecordSet': { - 'Name': 'foo.myexample.com.', - 'Type': 'A', - 'ResourceRecords': [ - { - 'Value': '1.1.1.1' - }, - ], - 'TTL': 60 - } - }] - }) - - def test_deleting_records_with_frontend(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # Set up the mock with a record. - record_set.update(locator, ipv4s={'1.1.1.1'}) - - # WHEN - record_set.delete(locator) - - # THEN - self.assertEqual(route53_client.list_resource_record_sets.call_count, 2) - route53_client.change_resource_record_sets.assert_called_with( - HostedZoneId='foo', ChangeBatch={ - 'Comment': - 'Automatic', - 'Changes': [{ - 'Action': 'DELETE', - 'ResourceRecordSet': { - 'Name': 'foo.myexample.com.', - 'Type': 'A', - 'ResourceRecords': [ - { - 'Value': '1.1.1.1' - }, - ], - 'TTL': 60 - } - }] - }) - - def test_deleting_no_records_with_frontend(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # WHEN - record_set.delete(locator) - - # THEN - self.assertEqual(route53_client.list_resource_record_sets.call_count, 1) - route53_client.change_resource_record_sets.assert_not_called() - - def test_checks_not_exists(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # WHEN - exists = record_set.exists(locator) - - # THEN - self.assertTrue(not exists) - - def test_checks_exists(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # WHEN - record_set.update(locator, ipv4s={'1.1.1.1'}) - exists = record_set.exists(locator) - - # THEN - self.assertTrue(exists) - - def test_exponential_backoff(self): - self.assertEqual(exponential_backoff(0), 1) - self.assertEqual(exponential_backoff(1), 2) - self.assertEqual(exponential_backoff(2), 4) - - def test_retry_with_backoff_throttling(self): - # GIVEN - call = mock.Mock(side_effect=ClientError(error_response={'Error': { - 'Code': 'Throttling' - }}, operation_name='any')) - - # WHEN - retry_with_backoff(call, attempts=5, backoff=lambda x: 0) - - # THEN - self.assertEqual(call.call_count, 5) - - def test_retry_with_backoff_prior_request_not_complete(self): - # GIVEN - call = mock.Mock(side_effect=ClientError(error_response={'Error': { - 'Code': 'PriorRequestNotComplete' - }}, operation_name='any')) - - # WHEN - retry_with_backoff(call, attempts=5, backoff=lambda x: 0) - - # THEN - self.assertEqual(call.call_count, 5) - - def test_retry_with_backoff_other_client_errors(self): - # GIVEN - call = mock.Mock(side_effect=ClientError(error_response={'Error': { - 'Code': 'SomethingElse' - }}, operation_name='any')) - - # WHEN/THEN - with self.assertRaisesRegex(ClientError, r'SomethingElse'): - retry_with_backoff(call, attempts=5, backoff=lambda x: 0) - self.assertEqual(call.call_count, 1) - - def test_retry_with_backoff_other_errors(self): - # GIVEN - call = mock.Mock(side_effect=Exception('very good reason')) - - # WHEN/THEN - with self.assertRaisesRegex(Exception, r'very good reason'): - retry_with_backoff(call, attempts=5, backoff=lambda x: 0) - self.assertEqual(call.call_count, 1) - - def test_map_ips_to_resource_records(self): - # GIVEN - ips = {'1.1.1.1', '1.1.1.2'} - - # WHEN - output = map_ips_to_resource_records(ips) - - # THEN - self.assertEqual(output, [{'Value': '1.1.1.1'}, {'Value': '1.1.1.2'}]) - - def test_map_ips_to_resource_records_truncates_to_400(self): - # GIVEN - ips = {f'1.1.{a}.{b}' for a in range(1, 255) for b in range(1, 255)} - - # WHEN - output = map_ips_to_resource_records(ips) - - # THEN - self.assertEqual(len(output), 400) - - def test_find_locator_record_set_ignores_irrelevant_records(self): - # GIVEN - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='test-record.myexample.com') - record_sets = [{ - 'Name': 'u-record.myexample.com.', - 'Type': 'A', - 'TTL': 60, - 'ResourceRecords': [{ - 'Value': '1.1.1.1' - }] - }] - - # WHEN - result = find_locator_record_set(locator, 'A', record_sets) - - # THEN - self.assertIsNone(result) - - def test_find_locator_record_set_finds_it(self): - # GIVEN - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='test-record.myexample.com') - matching_record = { - 'Name': 'test-record.myexample.com.', - 'Type': 'A', - 'TTL': 60, - 'ResourceRecords': [{ - 'Value': '1.1.1.1' - }] - } - record_sets = [matching_record] - - # WHEN - result = find_locator_record_set(locator, 'A', record_sets) - - # THEN - self.assertEqual(result, matching_record) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_tasks.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_tasks.py deleted file mode 100644 index b4b491750bcce..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/test/test_tasks.py +++ /dev/null @@ -1,55 +0,0 @@ -import json -import os -import unittest -import unittest.mock as mock -from datetime import datetime - -from lib.events import extract_event_task_info -from lib.records import TaskInfo, DdbRecord, DdbRecordKey -from lib.running_task_collector import RunningTaskCollector - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(THIS_DIR, 'fixtures', 'task_description.json')) as f: - TASK_DESCRIPTION = json.loads(f.read()) -with open(os.path.join(THIS_DIR, 'fixtures', 'eni_description.json')) as f: - ENI_DESCRIPTION = json.loads(f.read()) - - -class TestRunningTasksCollector(unittest.TestCase): - def test_task_collector(self): - # GIVEN - ec2_client = mock.Mock() - paginator = mock.Mock() - paginator.paginate = mock.Mock(return_value=[{'NetworkInterfaces': [ENI_DESCRIPTION]}]) - ec2_client.get_paginator = mock.Mock(return_value=paginator) - - reference_record = DdbRecord(key=DdbRecordKey(cluster_arn="A", service_name="B")) - collector = RunningTaskCollector(ec2_client=ec2_client, reference_record=reference_record) - - # WHEN - task_info = extract_event_task_info(TASK_DESCRIPTION) - collector.collect(task_info) - collector.fill_eni_info_from_eni_query() - - # THEN - paginator.paginate.assert_called_with(NetworkInterfaceIds=['eni-abcd']) - self.assertTrue('1.2.3.4' in collector.get_ips()) - - def test_task_collector_doesnt_collect_stopped_tasks(self): - # GIVEN - ec2_client = mock.Mock() - paginator = mock.Mock() - paginator.paginate = mock.Mock(return_value=[{'NetworkInterfaces': [ENI_DESCRIPTION]}]) - ec2_client.get_paginator = mock.Mock(return_value=paginator) - - task_arn = TASK_DESCRIPTION['taskArn'] - task_info = {task_arn: TaskInfo(task_arn=task_arn, enis=[], stopped_datetime=datetime.utcnow())} - reference_record = DdbRecord(key=DdbRecordKey(cluster_arn="A", service_name="B"), task_info=task_info) - collector = RunningTaskCollector(ec2_client=ec2_client, reference_record=reference_record) - - # WHEN - task_info = extract_event_task_info(TASK_DESCRIPTION) - collector.collect(task_info) - - # THEN - self.assertEqual(len(collector.tasks), 0) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/task-record-manager.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/task-record-manager.ts deleted file mode 100644 index dd0bd0718d2e9..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/task-record-manager.ts +++ /dev/null @@ -1,208 +0,0 @@ -import * as path from 'path'; -import * as dynamodb from '@aws-cdk/aws-dynamodb'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as events from '@aws-cdk/aws-events'; -import * as events_targets from '@aws-cdk/aws-events-targets'; -import * as iam from '@aws-cdk/aws-iam'; -import * as lambda from '@aws-cdk/aws-lambda'; -import * as lambda_es from '@aws-cdk/aws-lambda-event-sources'; -import * as route53 from '@aws-cdk/aws-route53'; -import * as sqs from '@aws-cdk/aws-sqs'; -import * as cdk from '@aws-cdk/core'; -import * as customresources from '@aws-cdk/custom-resources'; -import { Construct } from 'constructs'; - -export interface TaskRecordManagerProps { - service: ecs.Ec2Service | ecs.FargateService; - dnsZone: route53.IHostedZone; - dnsRecordName: string; -} - -/** - * An event-driven serverless app to maintain a list of public ips in a Route 53 - * hosted zone. - */ -export class TaskRecordManager extends Construct { - constructor(scope: Construct, id: string, props: TaskRecordManagerProps) { - super(scope, id); - - // Poison pills go here. - const deadLetterQueue = new sqs.Queue(this, 'EventsDL', { - retentionPeriod: cdk.Duration.days(14), - }); - - // Time limit for processing queue items - we set the lambda time limit to - // this value as well. - const eventsQueueVisibilityTimeout = cdk.Duration.seconds(30); - - // This queue lets us batch together ecs task state events. This is useful - // for when when we would be otherwise bombarded by them. - const eventsQueue = new sqs.Queue(this, 'EventsQueue', { - deadLetterQueue: { - maxReceiveCount: 500, - queue: deadLetterQueue, - }, - visibilityTimeout: eventsQueueVisibilityTimeout, - }); - - // Storage for task and record set information. - const recordsTable = new dynamodb.Table(this, 'Records', { - partitionKey: { - name: 'cluster_service', - type: dynamodb.AttributeType.STRING, - }, - billingMode: dynamodb.BillingMode.PAY_PER_REQUEST, - removalPolicy: cdk.RemovalPolicy.DESTROY, - }); - - // Put the cluster's task state changes events into the queue. - const runningEventRule = new events.Rule(this, 'RuleRunning', { - eventPattern: { - source: ['aws.ecs'], - detailType: ['ECS Task State Change'], - detail: { - clusterArn: [props.service.cluster.clusterArn], - lastStatus: ['RUNNING'], - desiredStatus: ['RUNNING'], - }, - }, - targets: [ - new events_targets.SqsQueue(eventsQueue), - ], - }); - - const stoppedEventRule = new events.Rule(this, 'RuleStopped', { - eventPattern: { - source: ['aws.ecs'], - detailType: ['ECS Task State Change'], - detail: { - clusterArn: [props.service.cluster.clusterArn], - lastStatus: ['STOPPED'], - desiredStatus: ['STOPPED'], - }, - }, - targets: [ - new events_targets.SqsQueue(eventsQueue), - ], - }); - - // Shared codebase for the lambdas. - const code = lambda.Code.fromAsset(path.join(__dirname, 'lambda'), { - exclude: [ - '.coverage', - '*.pyc', - '.idea', - ], - }); - - // Fully qualified domain name of the record - const recordFqdn = cdk.Fn.join('.', [props.dnsRecordName, props.dnsZone.zoneName]); - - // Allow access to manage a zone's records. - const dnsPolicyStatement = new iam.PolicyStatement({ - effect: iam.Effect.ALLOW, - actions: [ - 'route53:ChangeResourceRecordSets', - 'route53:ListResourceRecordSets', - ], - resources: [props.dnsZone.hostedZoneArn], - }); - - // This function consumes events from the event queue and does the work of - // querying task IP addresses and creating, updating record sets. When there - // are zero tasks, it deletes the record set. - const eventHandler = new lambda.Function(this, 'EventHandler', { - code: code, - handler: 'index.queue_handler', - runtime: lambda.Runtime.PYTHON_3_8, - timeout: eventsQueueVisibilityTimeout, - // Single-concurrency to prevent a race to set the RecordSet - reservedConcurrentExecutions: 1, - environment: { - HOSTED_ZONE_ID: props.dnsZone.hostedZoneId, - RECORD_NAME: recordFqdn, - RECORDS_TABLE: recordsTable.tableName, - CLUSTER_ARN: props.service.cluster.clusterArn, - SERVICE_NAME: props.service.serviceName, - }, - events: [ - new lambda_es.SqsEventSource(eventsQueue), - ], - initialPolicy: [ - // Look up task IPs - new iam.PolicyStatement({ - effect: iam.Effect.ALLOW, - actions: ['ec2:DescribeNetworkInterfaces'], - resources: ['*'], - }), - dnsPolicyStatement, - ], - }); - recordsTable.grantReadWriteData(eventHandler); - - // The lambda for a custom resource provider that deletes dangling record - // sets when the stack is deleted. - const cleanupResourceProviderHandler = new lambda.Function(this, 'CleanupResourceProviderHandler', { - code: code, - handler: 'index.cleanup_resource_handler', - runtime: lambda.Runtime.PYTHON_3_8, - timeout: cdk.Duration.minutes(5), - initialPolicy: [ - dnsPolicyStatement, - ], - }); - - const cleanupResourceProvider = new customresources.Provider(this, 'CleanupResourceProvider', { - onEventHandler: cleanupResourceProviderHandler, - }); - - const cleanupResource = new cdk.CustomResource(this, 'Cleanup', { - serviceToken: cleanupResourceProvider.serviceToken, - properties: { - HostedZoneId: props.dnsZone.hostedZoneId, - RecordName: recordFqdn, - }, - }); - - // Prime the event queue with a message so that changes to dns config are - // quickly applied. - const primingSdkCall: customresources.AwsSdkCall = { - service: 'SQS', - action: 'sendMessage', - parameters: { - QueueUrl: eventsQueue.queueUrl, - DelaySeconds: 10, - MessageBody: '{ "prime": true }', - // Add the hosted zone id and record name so that priming occurs with - // dns config updates. - MessageAttributes: { - HostedZoneId: { DataType: 'String', StringValue: props.dnsZone.hostedZoneId }, - RecordName: { DataType: 'String', StringValue: props.dnsRecordName }, - }, - }, - physicalResourceId: customresources.PhysicalResourceId.fromResponse('MessageId'), - }; - - const primingCall = new customresources.AwsCustomResource(this, 'PrimingCall', { - onCreate: primingSdkCall, - onUpdate: primingSdkCall, - policy: customresources.AwsCustomResourcePolicy.fromStatements([ - new iam.PolicyStatement({ - effect: iam.Effect.ALLOW, - actions: ['sqs:SendMessage'], - resources: [eventsQueue.queueArn], - }), - ]), - }); - - // Send the priming call after the handler is created/updated. - primingCall.node.addDependency(eventHandler); - - // Ensure that the cleanup resource is deleted last (so it can clean up) - props.service.taskDefinition.node.addDependency(cleanupResource); - // Ensure that the event rules are created first so we can catch the first - // state transitions. - props.service.taskDefinition.node.addDependency(runningEventRule); - props.service.taskDefinition.node.addDependency(stoppedEventRule); - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/cloudwatch-agent.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/cloudwatch-agent.ts deleted file mode 100644 index 5ca7106cfa968..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/cloudwatch-agent.ts +++ /dev/null @@ -1,73 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from 'constructs'; -import { Service } from '../service'; -import { ServiceExtension } from './extension-interfaces'; - -const CLOUDWATCH_AGENT_IMAGE = 'amazon/cloudwatch-agent:latest'; - -/** - * This extension adds a CloudWatch agent to the task definition and - * configures the task to be able to publish metrics to CloudWatch. - */ -export class CloudwatchAgentExtension extends ServiceExtension { - private CW_CONFIG_CONTENT = { - logs: { - metrics_collected: { - emf: {}, - }, - }, - metrics: { - metrics_collected: { - statsd: {}, - }, - }, - }; - - constructor() { - super('cloudwatchAgent'); - } - - public prehook(service: Service, scope: Construct) { - this.parentService = service; - this.scope = scope; - } - - public useTaskDefinition(taskDefinition: ecs.TaskDefinition) { - // Add the CloudWatch Agent to this task - this.container = taskDefinition.addContainer('cloudwatch-agent', { - image: ecs.ContainerImage.fromRegistry(CLOUDWATCH_AGENT_IMAGE), - environment: { - CW_CONFIG_CONTENT: JSON.stringify(this.CW_CONFIG_CONTENT), - }, - logging: new ecs.AwsLogDriver({ streamPrefix: 'cloudwatch-agent' }), - user: '0:1338', // Ensure that CloudWatch agent outbound traffic doesn't go through proxy - memoryReservationMiB: 50, - }); - - // Add permissions that allow the cloudwatch agent to publish metrics - new iam.Policy(this.scope, `${this.parentService.id}-publish-metrics`, { - roles: [taskDefinition.taskRole], - statements: [ - new iam.PolicyStatement({ - resources: ['*'], - actions: ['cloudwatch:PutMetricData'], - }), - ], - }); - } - - public resolveContainerDependencies() { - if (!this.container) { - throw new Error('The container dependency hook was called before the container was created'); - } - - const appmeshextension = this.parentService.serviceDescription.get('appmesh'); - if (appmeshextension && appmeshextension.container) { - this.container.addContainerDependencies({ - container: appmeshextension.container, - condition: ecs.ContainerDependencyCondition.HEALTHY, - }); - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/container.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/container.ts deleted file mode 100644 index ee4eee5d99327..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/container.ts +++ /dev/null @@ -1,187 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as awslogs from '@aws-cdk/aws-logs'; -import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; -import { Construct, Node } from 'constructs'; -import { Service } from '../service'; -import { ServiceExtension } from './extension-interfaces'; - -/** - * Setting for the main application container of a service. - */ -export interface ContainerExtensionProps { - /** - * How much CPU the container requires. - */ - readonly cpu: number, - - /** - * How much memory in megabytes the container requires. - */ - readonly memoryMiB: number, - - /** - * The image to run. - */ - readonly image: ecs.ContainerImage, - - /** - * What port the image listen for traffic on. - */ - readonly trafficPort: number, - - /** - * Environment variables to pass into the container. - * - * @default - No environment variables. - */ - readonly environment?: { - [key: string]: string, - } - - /** - * The log group into which application container logs should be routed. - * - * @default - A log group is automatically created for you if the `ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER` feature flag is set. - */ - readonly logGroup?: awslogs.ILogGroup; -} - -/** - * The main container of a service. This is generally the container - * which runs your application business logic. Other extensions will attach - * sidecars alongside this main container. - */ -export class Container extends ServiceExtension { - /** - * The port on which the container expects to receive network traffic - */ - public readonly trafficPort: number; - - /** - * The log group into which application container logs should be routed. - */ - public logGroup?: awslogs.ILogGroup; - - /** - * The settings for the container. - */ - private props: ContainerExtensionProps; - - constructor(props: ContainerExtensionProps) { - super('service-container'); - this.props = props; - this.trafficPort = props.trafficPort; - this.logGroup = props.logGroup; - } - - public prehook(service: Service, scope: Construct) { - this.parentService = service; - this.scope = scope; - } - - // This hook sets the overall task resource requirements to the - // resource requirements of the application itself. - public modifyTaskDefinitionProps(props: ecs.TaskDefinitionProps): ecs.TaskDefinitionProps { - return { - ...props, - cpu: this.props.cpu.toString(), - memoryMiB: this.props.memoryMiB.toString(), - } as ecs.TaskDefinitionProps; - } - - // This hook adds the application container to the task definition. - public useTaskDefinition(taskDefinition: ecs.TaskDefinition) { - let containerProps = { - image: this.props.image, - cpu: Number(this.props.cpu), - memoryLimitMiB: Number(this.props.memoryMiB), - environment: this.props.environment, - } as ecs.ContainerDefinitionOptions; - - // Let other extensions mutate the container definition. This is - // used by extensions which want to add environment variables, modify - // logging parameters, etc. - this.containerMutatingHooks.forEach((hookProvider) => { - containerProps = hookProvider.mutateContainerDefinition(containerProps); - }); - - // If no observability extensions have been added to the service description then we can configure the `awslogs` log driver - if (!containerProps.logging) { - // Create a log group for the service if one is not provided by the user (only if feature flag is set) - if (!this.logGroup && Node.of(this.parentService).tryGetContext(cxapi.ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER)) { - this.logGroup = new awslogs.LogGroup(this.scope, `${this.parentService.id}-logs`, { - logGroupName: `${this.parentService.id}-logs`, - removalPolicy: cdk.RemovalPolicy.DESTROY, - retention: awslogs.RetentionDays.ONE_MONTH, - }); - } - - if (this.logGroup) { - containerProps = { - ...containerProps, - logging: new ecs.AwsLogDriver({ - streamPrefix: this.parentService.id, - logGroup: this.logGroup, - }), - }; - } - } else { - if (this.logGroup) { - throw Error(`Log configuration already specified. You cannot provide a log group for the application container of service '${this.parentService.id}' while also adding log configuration separately using service extensions.`); - } - } - this.container = taskDefinition.addContainer('app', containerProps); - - // Create a port mapping for the container - this.container.addPortMappings({ - containerPort: this.trafficPort, - }); - - // Raise the ulimits for this main application container - // so that it can handle more concurrent requests - this.container.addUlimits({ - softLimit: 1024000, - hardLimit: 1024000, - name: ecs.UlimitName.NOFILE, - }); - } - - public resolveContainerDependencies() { - if (!this.container) { - throw new Error('The container dependency hook was called before the container was created'); - } - - const firelens = this.parentService.serviceDescription.get('firelens'); - if (firelens && firelens.container) { - this.container.addContainerDependencies({ - container: firelens.container, - condition: ecs.ContainerDependencyCondition.START, - }); - } - - const appmeshextension = this.parentService.serviceDescription.get('appmesh'); - if (appmeshextension && appmeshextension.container) { - this.container.addContainerDependencies({ - container: appmeshextension.container, - condition: ecs.ContainerDependencyCondition.HEALTHY, - }); - } - - const cloudwatchextension = this.parentService.serviceDescription.get('cloudwatchAgent'); - if (cloudwatchextension && cloudwatchextension.container) { - this.container.addContainerDependencies({ - container: cloudwatchextension.container, - condition: ecs.ContainerDependencyCondition.START, - }); - } - - const xrayextension = this.parentService.serviceDescription.get('xray'); - if (xrayextension && xrayextension.container) { - this.container.addContainerDependencies({ - container: xrayextension.container, - condition: ecs.ContainerDependencyCondition.HEALTHY, - }); - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/extension-interfaces.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/extension-interfaces.ts deleted file mode 100644 index bc75242d0a68c..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/extension-interfaces.ts +++ /dev/null @@ -1,249 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Construct } from 'constructs'; -import { Service, ConnectToProps } from '../service'; - -/** - * The types of capacity that are supported. These capacity types may change the - * behavior of an extension. - */ -export enum EnvironmentCapacityType { - /** - * Specify that the environment should use AWS Fargate for - * hosting containers. - */ - FARGATE = 'fargate', - - /** - * Specify that the environment should launch containers onto - * EC2 instances. - */ - EC2 = 'ec2' -} - -/** - * A set of mutable service props in the process of being assembled using a - * builder pattern. They will eventually to be translated into an - * ecs.Ec2ServiceProps or ecs.FargateServiceProps interface, depending on the - * environment's capacity type. - */ -export interface ServiceBuild { - /** - * The cluster in which to launch the service. - */ - readonly cluster: ecs.ICluster, - - /** - * The task definition registered to this service. - */ - readonly taskDefinition: ecs.TaskDefinition, - - /** - * Specifies whether the task's elastic network interface receives a public IP - * address. - * - * If true, each task will receive a public IP address. - * - * @default - false - */ - readonly assignPublicIp?: boolean; - - /** - * Configuration for how to register the service in service discovery. - * - * @default - No Cloud Map configured - */ - readonly cloudMapOptions?: ecs.CloudMapOptions - - /** - * How long the healthcheck can fail during initial task startup before - * the task is considered unhealthy. This is used to give the task more - * time to start passing healthchecks. - * - * @default - No grace period - */ - readonly healthCheckGracePeriod?: cdk.Duration, - - /** - * How many tasks to run. - * - * @default - 1 - */ - readonly desiredCount?: number; - - /** - * Minimum healthy task percentage. - * - * @default - 100 - */ - readonly minHealthyPercent?: number; - - /** - * Maximum percentage of tasks that can be launched. - * - * @default - 200 - */ - readonly maxHealthyPercent?: number; -} - -/** - * The shape of a service extension. This abstract class is implemented - * by other extensions that extend the hooks to implement any custom - * logic that they want to run during each step of preparing the service. - */ -export abstract class ServiceExtension { - /** - * The name of the extension. - */ - public name: string; - - /** - * The container for this extension. Most extensions have a container, but not - * every extension is required to have a container. Some extensions may just - * modify the properties of the service, or create external resources - * connected to the service. - */ - public container?: ecs.ContainerDefinition; - - /** - * The service which this extension is being added to. - * Initially, extensions are collected into a ServiceDescription, but no service - * exists yet. Later, when the ServiceDescription is used to create a service, - * the extension is told what Service it is now working on. - */ - protected parentService!: Service; - protected scope!: Construct; - - // A list of other extensions which want to mutate the - // container definition for this extension. - protected containerMutatingHooks: ContainerMutatingHook[] = []; - - constructor(name: string) { - this.name = name; - } - - /** - * A hook that allows the extension to add hooks to other - * extensions that are registered. - */ - public addHooks() { } // tslint:disable-line - - /** - * This hook allows another service extension to register a mutating hook for - * changing the primary container of this extension. This is primarily used - * for the application extension. For example, the Firelens extension wants to - * be able to modify the settings of the application container to - * route logs through Firelens. - * - * @param hook - */ - public addContainerMutatingHook(hook: ContainerMutatingHook) { - this.containerMutatingHooks.push(hook); - } - - /** - * This is a hook which allows extensions to modify the settings of the - * task definition prior to it being created. For example, the App Mesh - * extension needs to configure an Envoy proxy in the task definition, - * or the Application extension wants to set the overall resource for - * the task. - * - * @param props - Properties of the task definition to be created - */ - public modifyTaskDefinitionProps(props: ecs.TaskDefinitionProps): ecs.TaskDefinitionProps { - return { - ...props, - } as ecs.TaskDefinitionProps; - } - - /** - * A hook that is called for each extension ahead of time to - * allow for any initial setup, such as creating resources in - * advance. - * - * @param parent - The parent service which this extension has been added to - * @param scope - The scope that this extension should create resources in - */ - public prehook(parent: Service, scope: Construct) { - this.parentService = parent; - this.scope = scope; - } - - /** - * Once the task definition is created, this hook is called for each - * extension to give it a chance to add containers to the task definition, - * change the task definition's role to add permissions, etc. - * - * @param taskDefinition - The created task definition to add containers to - */ - public useTaskDefinition(taskDefinition: ecs.TaskDefinition) { - taskDefinition = taskDefinition; - } - - /** - * Once all containers are added to the task definition, this hook is - * called for each extension to give it a chance to resolve its dependency - * graph so that its container starts in the right order based on the - * other extensions that were enabled. - */ - public resolveContainerDependencies() { - return; - } - - /** - * Prior to launching the task definition as a service, this hook - * is called on each extension to give it a chance to mutate the properties - * of the service to be created. - * - * @param props - The service properties to mutate. - */ - public modifyServiceProps(props: ServiceBuild): ServiceBuild { - return { - ...props, - } as ServiceBuild; - } - - /** - * When this hook is implemented by extension, it allows the extension - * to use the service which has been created. It is generally used to - * create any final resources which might depend on the service itself. - * - * @param service - The generated service. - */ - public useService(service: ecs.Ec2Service | ecs.FargateService) { - service = service; - } - - /** - * This hook allows the extension to establish a connection to - * extensions from another service. Usually used for things like - * allowing one service to talk to the load balancer or service mesh - * proxy for another service. - * - * @param service - The other service to connect to. - */ - public connectToService(service: Service, connectToProps: ConnectToProps) { - service = service; - connectToProps = connectToProps; - } -} - -/** - * This is an abstract class wrapper for a mutating hook. It is - * extended by any extension which wants to mutate other extension's containers. - */ -export abstract class ContainerMutatingHook { - /** - * This is a hook for modifying the container definition of any upstream - * containers. This is primarily used for the main application container. - * For example, the Firelens extension wants to be able to modify the logging - * settings of the application container. - * - * @param props - The container definition to mutate. - */ - public mutateContainerDefinition(props: ecs.ContainerDefinitionOptions): ecs.ContainerDefinitionOptions { - return { - ...props, - } as ecs.ContainerDefinitionOptions; - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/firelens.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/firelens.ts deleted file mode 100644 index d0684edeac474..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/firelens.ts +++ /dev/null @@ -1,127 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as awslogs from '@aws-cdk/aws-logs'; -import * as cdk from '@aws-cdk/core'; -import { Construct } from 'constructs'; -import { Service } from '../service'; -import { Container } from './container'; -import { ContainerMutatingHook, ServiceExtension } from './extension-interfaces'; - -/** - * Settings for the hook which mutates the application container - * to route logs through FireLens. - */ -export interface FirelensProps { - /** - * The parent service that is being mutated. - */ - readonly parentService: Service; - - /** - * The log group into which logs should be routed. - */ - readonly logGroup: awslogs.LogGroup; -} - -/** - * This hook modifies the application container's settings so that - * it routes logs using FireLens. - */ -export class FirelensMutatingHook extends ContainerMutatingHook { - private parentService: Service; - private logGroup: awslogs.LogGroup; - - constructor(props: FirelensProps) { - super(); - this.parentService = props.parentService; - this.logGroup = props.logGroup; - } - - public mutateContainerDefinition(props: ecs.ContainerDefinitionOptions): ecs.ContainerDefinitionOptions { - return { - ...props, - - logging: ecs.LogDrivers.firelens({ - options: { - Name: 'cloudwatch', - region: cdk.Stack.of(this.parentService).region, - log_group_name: this.logGroup.logGroupName, - log_stream_prefix: `${this.parentService.id}/`, - }, - }), - } as ecs.ContainerDefinitionOptions; - } -} - -/** - * This extension adds a FluentBit log router to the task definition - * and does all the configuration necessarily to enable log routing - * for the task using FireLens. - */ -export class FireLensExtension extends ServiceExtension { - private logGroup!: awslogs.LogGroup; - - constructor() { - super('firelens'); - } - - public prehook(service: Service, scope: Construct) { - this.parentService = service; - - // Create a log group for the service, into which FireLens - // will route the service's logs - this.logGroup = new awslogs.LogGroup(scope, `${service.id}-logs`, { - logGroupName: `${service.id}-logs`, - removalPolicy: cdk.RemovalPolicy.DESTROY, - retention: awslogs.RetentionDays.ONE_WEEK, - }); - } - - // Add hooks to the main application extension so that it is modified to - // have logging properties that enable sending logs via the - // Firelens log router container - public addHooks() { - const container = this.parentService.serviceDescription.get('service-container') as Container; - - if (!container) { - throw new Error('Firelens extension requires an application extension'); - } - - container.addContainerMutatingHook(new FirelensMutatingHook({ - parentService: this.parentService, - logGroup: this.logGroup, - })); - } - - public useTaskDefinition(taskDefinition: ecs.TaskDefinition) { - // Manually add a firelens log router, so that we can manually manage the dependencies - // to ensure that the Firelens log router depends on the Envoy proxy - this.container = taskDefinition.addFirelensLogRouter('firelens', { - image: ecs.obtainDefaultFluentBitECRImage(taskDefinition, { - logDriver: 'awsfirelens', - options: { - Name: 'cloudwatch', - }, - }), - firelensConfig: { - type: ecs.FirelensLogRouterType.FLUENTBIT, - }, - logging: new ecs.AwsLogDriver({ streamPrefix: 'firelens' }), - memoryReservationMiB: 50, - user: '0:1338', // Give Firelens a group ID that allows its outbound logs to bypass Envoy - }); - } - - public resolveContainerDependencies() { - if (!this.container) { - throw new Error('The container dependency hook was called before the container was created'); - } - - const appmeshextension = this.parentService.serviceDescription.get('appmesh'); - if (appmeshextension && appmeshextension.container) { - this.container.addContainerDependencies({ - container: appmeshextension.container, - condition: ecs.ContainerDependencyCondition.HEALTHY, - }); - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/http-load-balancer.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/http-load-balancer.ts deleted file mode 100644 index 89787447d681a..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/http-load-balancer.ts +++ /dev/null @@ -1,81 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as alb from '@aws-cdk/aws-elasticloadbalancingv2'; -import * as cdk from '@aws-cdk/core'; -import { Construct } from 'constructs'; -import { Service } from '../service'; -import { ServiceExtension, ServiceBuild } from './extension-interfaces'; - -export interface HttpLoadBalancerProps { - /** - * The number of ALB requests per target. - */ - readonly requestsPerTarget?: number; -} - -/** - * This extension add a public facing load balancer for sending traffic - * to one or more replicas of the application container. - */ -export class HttpLoadBalancerExtension extends ServiceExtension { - private loadBalancer!: alb.IApplicationLoadBalancer; - private listener!: alb.IApplicationListener; - private requestsPerTarget?: number; - - constructor(props: HttpLoadBalancerProps = {}) { - super('load-balancer'); - this.requestsPerTarget = props.requestsPerTarget; - } - - // Before the service is created, go ahead and create the load balancer itself. - public prehook(service: Service, scope: Construct) { - this.parentService = service; - - this.loadBalancer = new alb.ApplicationLoadBalancer(scope, `${this.parentService.id}-load-balancer`, { - vpc: this.parentService.vpc, - internetFacing: true, - }); - - this.listener = this.loadBalancer.addListener(`${this.parentService.id}-listener`, { - port: 80, - open: true, - }); - - // Automatically create an output - new cdk.CfnOutput(scope, `${this.parentService.id}-load-balancer-dns-output`, { - value: this.loadBalancer.loadBalancerDnsName, - }); - } - - // Minor service configuration tweaks to work better with a load balancer - public modifyServiceProps(props: ServiceBuild): ServiceBuild { - return { - ...props, - - // Give the task a little bit of grace time to start passing - // healthchecks. Without this it is possible for a slow starting task - // to cause the ALB to consider the task unhealthy, causing ECS to stop - // the task before it actually has a chance to finish starting up - healthCheckGracePeriod: cdk.Duration.minutes(1), - } as ServiceBuild; - } - - // After the service is created add the service to the load balancer's listener - public useService(service: ecs.Ec2Service | ecs.FargateService) { - const targetGroup = this.listener.addTargets(this.parentService.id, { - deregistrationDelay: cdk.Duration.seconds(10), - port: 80, - targets: [service], - }); - - if (this.requestsPerTarget) { - if (!this.parentService.scalableTaskCount) { - throw Error(`Auto scaling target for the service '${this.parentService.id}' hasn't been configured. Please use Service construct to configure 'minTaskCount' and 'maxTaskCount'.`); - } - this.parentService.scalableTaskCount.scaleOnRequestCount(`${this.parentService.id}-target-request-count-${this.requestsPerTarget}`, { - requestsPerTarget: this.requestsPerTarget, - targetGroup, - }); - this.parentService.enableAutoScalingPolicy(); - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/index.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/index.ts deleted file mode 100644 index 2a7a55bb348ec..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './container'; -export * from './firelens'; -export * from './appmesh'; -export * from './http-load-balancer'; -export * from './cloudwatch-agent'; -export * from './scale-on-cpu-utilization'; -export * from './xray'; -export * from './assign-public-ip'; -export * from './queue/queue'; -export * from './injecter'; diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/injecter.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/injecter.ts deleted file mode 100644 index a6b54464c0e9c..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/injecter.ts +++ /dev/null @@ -1,151 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as sns from '@aws-cdk/aws-sns'; -import { Construct } from 'constructs'; -import { Service } from '../service'; -import { Container } from './container'; -import { ContainerMutatingHook, ServiceExtension } from './extension-interfaces'; - -/** - * An interface that will be implemented by all the resources that can be published events or written data to. - */ -export interface Injectable { - environmentVariables(): { [key: string]: string }; -} - -/** - * An interface that will be implemented by all the injectable resources that need to grant permissions to the task role. - */ -export interface GrantInjectable extends Injectable { - grant(taskDefinition: ecs.TaskDefinition): void; -} - -/** - * The settings for the `InjectableTopic` class. - */ -export interface InjectableTopicProps { - /** - * The SNS Topic to publish events to. - */ - readonly topic: sns.ITopic; -} - -/** - * The `InjectableTopic` class represents SNS Topic resource that can be published events to by the parent service. - */ - -export class InjectableTopic implements GrantInjectable { - public readonly topic: sns.ITopic; - - constructor(props: InjectableTopicProps) { - this.topic = props.topic; - } - - public grant(taskDefinition: ecs.TaskDefinition) { - this.topic.grantPublish(taskDefinition.taskRole); - } - - public environmentVariables(): { [key: string]: string } { - let environment: { [key: string]: string } = {}; - environment[`${this.topic.node.id.toUpperCase()}_TOPIC_ARN`] = this.topic.topicArn; - return environment; - } -} - -/** - * The settings for the Injecter extension. - */ -export interface InjecterExtensionProps { - /** - * The list of injectable resources for this service. - */ - readonly injectables: Injectable[]; -} - -/** - * Settings for the hook which mutates the application container - * to add the injectable resource environment variables. - */ -interface ContainerMutatingProps { - /** - * The resource environment variables to be added to the container environment. - */ - readonly environment: { [key: string]: string }; -} - -/** - * This hook modifies the application container's environment to - * add the injectable resource environment variables. - */ -class InjecterExtensionMutatingHook extends ContainerMutatingHook { - private environment: { [key: string]: string }; - - constructor(props: ContainerMutatingProps) { - super(); - this.environment = props.environment; - } - - public mutateContainerDefinition(props: ecs.ContainerDefinitionOptions): ecs.ContainerDefinitionOptions { - return { - ...props, - - environment: { ...(props.environment || {}), ...this.environment }, - } as ecs.ContainerDefinitionOptions; - } -} - -/** - * This extension accepts a list of `Injectable` resources that the parent service can publish events or write data to. - * It sets up the corresponding permissions for the task role of the parent service. - */ -export class InjecterExtension extends ServiceExtension { - private props: InjecterExtensionProps; - - private environment: { [key: string]: string } = {}; - - constructor(props: InjecterExtensionProps) { - super('injecter'); - - this.props = props; - } - - // @ts-ignore - Ignore unused params that are required for abstract class extend - public prehook(service: Service, scope: Construct) { - this.parentService = service; - - for (const injectable of this.props.injectables) { - for (const [key, val] of Object.entries(injectable.environmentVariables())) { - this.environment[key] = val; - } - } - } - - /** - * Add hooks to the main application extension so that it is modified to - * add the injectable resource environment variables to the container environment. - */ - public addHooks() { - const container = this.parentService.serviceDescription.get('service-container') as Container; - - if (!container) { - throw new Error('Injecter Extension requires an application extension'); - } - - container.addContainerMutatingHook(new InjecterExtensionMutatingHook({ - environment: this.environment, - })); - } - - /** - * After the task definition has been created, this hook grants the required permissions to the task role for the - * parent service. - * - * @param taskDefinition The created task definition - */ - public useTaskDefinition(taskDefinition: ecs.TaskDefinition) { - for (const injectable of this.props.injectables) { - if ((injectable as GrantInjectable).grant !== undefined) { - (injectable as GrantInjectable).grant(taskDefinition); - } - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/index.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/index.ts deleted file mode 100644 index 1abfa1e06c359..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './queue'; \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/lambda/index.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/lambda/index.py deleted file mode 100644 index d24454171e478..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/lambda/index.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -import boto3 -from queue_backlog_calculator import QueueHandler - -def queue_handler(event, context): - """ - Handler for the lambda trigger - """ - - ecs = boto3.client('ecs') - sqs = boto3.client('sqs') - - queue_handler = QueueHandler(ecs_client=ecs, sqs_client=sqs, environ=os.environ) - - return queue_handler.emit() diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/lambda/queue_backlog_calculator.py b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/lambda/queue_backlog_calculator.py deleted file mode 100644 index 5f14d74a76bd2..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/lambda/queue_backlog_calculator.py +++ /dev/null @@ -1,71 +0,0 @@ -from math import ceil -import time -import json - -class QueueHandler: - def __init__(self, ecs_client, sqs_client, environ): - self.ecs = ecs_client - self.sqs = sqs_client - self.cluster_name = environ['CLUSTER_NAME'] - self.service_name = environ['SERVICE_NAME'] - self.namespace = environ['NAMESPACE'] - self.queue_names = environ['QUEUE_NAMES'].split(',') - - def emit(self): - try: - running_count = self.get_running_task_count() - backlogs = [self.get_queue_backlog(queue_name, running_count) for queue_name in self.queue_names] - self.timestamp = int(time.time() * 1000) - for backlog in backlogs: - self.emit_backlog_per_task_metric(backlog['queueName'], backlog['backlogPerTask']) - except Exception as e: - Exception('Exception: {}'.format(e)) - - """ - Write the backlogPerTask metric to the stdout according to the Cloudwatch embedded metric format. - """ - def emit_backlog_per_task_metric(self, queue_name, backlog_per_task): - print(json.dumps({ - "_aws": { - "Timestamp": self.timestamp, - "CloudWatchMetrics": [{ - "Namespace": self.namespace, - "Dimensions": [["QueueName"]], - "Metrics": [{"Name":"BacklogPerTask", "Unit": "Count"}] - }], - }, - "QueueName": queue_name, - "BacklogPerTask": backlog_per_task, - })) - - """ - Get the number of tasks in the 'RUNNING' state for the service 'service_name'. - """ - def get_running_task_count(self): - service_desc = self.ecs.describe_services( - cluster=self.cluster_name, - services=[self.service_name], - ) - if len(service_desc['services']) == 0: - raise Exception('There are no services with name {} in cluster: {}'.format(self.service_name, self.cluster_name)) - return service_desc['services'][0].get('runningCount', 0) - - """ - This method calculates and returns the backlogPerTask metric for the given queue. - """ - def get_queue_backlog(self, queue_name, count): - queue_url = self.sqs.get_queue_url(QueueName=queue_name) - running_count = 1 if count == 0 else count - - def get_backlog_per_task(): - queue_attributes = self.sqs.get_queue_attributes( - QueueUrl=queue_url['QueueUrl'], - AttributeNames=['ApproximateNumberOfMessages'] - ) - num_of_msgs = int(queue_attributes['Attributes'].get('ApproximateNumberOfMessages', 0)) - return ceil(num_of_msgs/running_count) - - return { - 'queueName': queue_name, - 'backlogPerTask': get_backlog_per_task() - } \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/queue.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/queue.ts deleted file mode 100644 index 8fff61170176d..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue/queue.ts +++ /dev/null @@ -1,415 +0,0 @@ -import * as path from 'path'; -import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as events from '@aws-cdk/aws-events'; -import * as events_targets from '@aws-cdk/aws-events-targets'; -import * as iam from '@aws-cdk/aws-iam'; -import * as lambda from '@aws-cdk/aws-lambda'; -import * as logs from '@aws-cdk/aws-logs'; -import * as sns from '@aws-cdk/aws-sns'; -import * as subscription from '@aws-cdk/aws-sns-subscriptions'; -import * as sqs from '@aws-cdk/aws-sqs'; -import * as cdk from '@aws-cdk/core'; -import { Construct } from 'constructs'; -import { Service } from '../../service'; -import { Container } from '../container'; -import { ContainerMutatingHook, ServiceExtension } from '../extension-interfaces'; - -/** - * An interface that will be implemented by all the resources that can be subscribed to. - */ -export interface ISubscribable { - /** - * The `SubscriptionQueue` object for the `ISubscribable` object. - * - * @default none - */ - readonly subscriptionQueue?: SubscriptionQueue; - - /** - * All classes implementing this interface must also implement the `subscribe()` method - */ - subscribe(extension: QueueExtension): sqs.IQueue; -} - -/** - * The settings for the Queue extension. - */ -export interface QueueExtensionProps { - /** - * The list of subscriptions for this service. - * - * @default none - */ - readonly subscriptions?: ISubscribable[]; - - /** - * The user-provided default queue for this service. - * If the `eventsQueue` is not provided, a default SQS Queue is created for the service. - * - * @default none - */ - readonly eventsQueue?: sqs.IQueue; - - /** - * The user-provided queue delay fields to configure auto scaling for the default queue. - * - * @default none - */ - readonly scaleOnLatency?: QueueAutoScalingOptions; -} - -/** - * The topic-specific settings for creating the queue subscriptions. - */ -export interface TopicSubscriptionProps { - /** - * The SNS Topic to subscribe to. - */ - readonly topic: sns.ITopic; - - /** - * The user-provided queue to subscribe to the given topic. - * - * @default none - * @deprecated use `topicSubscriptionQueue` - */ - readonly queue?: sqs.IQueue; - - /** - * The object representing topic-specific queue and corresponding queue delay fields to configure auto scaling. - * If not provided, the default `eventsQueue` will subscribe to the given topic. - * - * @default none - */ - readonly topicSubscriptionQueue?: SubscriptionQueue; -} - -/** - * `SubscriptionQueue` represents the subscription queue object which includes the topic-specific queue and its - * corresponding auto scaling fields. - */ -interface SubscriptionQueue { - /** - * The user-provided queue to subscribe to the given topic. - */ - readonly queue: sqs.IQueue; - - /** - * The user-provided queue delay fields to configure auto scaling for the topic-specific queue. - * - * @default none - */ - readonly scaleOnLatency?: QueueAutoScalingOptions; -} - -/** - * Options for configuring SQS Queue auto scaling. - */ -interface QueueAutoScalingOptions { - /** - * Average amount of time for processing a single message in the queue. - */ - readonly messageProcessingTime: cdk.Duration; - - /** - * Acceptable amount of time a message can sit in the queue (including the time required to process it). - */ - readonly acceptableLatency: cdk.Duration; -} - -/** - * The `TopicSubscription` class represents an SNS Topic resource that can be subscribed to by the service queues. - */ -export class TopicSubscription implements ISubscribable { - public readonly topic: sns.ITopic; - - /** - * The queue that subscribes to the given topic. - * - * @default none - * @deprecated use `subscriptionQueue` - */ - public readonly queue?: sqs.IQueue; - - /** - * The subscription queue object for this subscription. - * - * @default none - */ - public readonly subscriptionQueue?: SubscriptionQueue; - - constructor(props: TopicSubscriptionProps) { - this.topic = props.topic; - - if (props.topicSubscriptionQueue && props.queue) { - throw Error('Either provide the `subscriptionQueue` or the `queue` (deprecated) for the topic subscription, but not both.'); - } - this.subscriptionQueue = props.topicSubscriptionQueue; - this.queue = props.queue ?? props.topicSubscriptionQueue?.queue; - } - - /** - * This method sets up SNS Topic subscriptions for the SQS queue provided by the user. If a `queue` is not provided, - * the default `eventsQueue` subscribes to the given topic. - * - * @param extension `QueueExtension` added to the service - * @returns the queue subscribed to the given topic - */ - public subscribe(extension: QueueExtension) : sqs.IQueue { - const queue = this.subscriptionQueue?.queue ?? this.queue ?? extension.eventsQueue; - this.topic.addSubscription(new subscription.SqsSubscription(queue)); - return queue; - } -} - -/** - * Settings for the hook which mutates the application container - * to add the events queue URI to its environment. - */ -interface ContainerMutatingProps { - /** - * The events queue name and URI to be added to the container environment. - */ - readonly environment: { [key: string]: string }; -} - -/** - * This hook modifies the application container's environment to - * add the queue URL for the events queue of the service. - */ -class QueueExtensionMutatingHook extends ContainerMutatingHook { - private environment: { [key: string]: string }; - - constructor(props: ContainerMutatingProps) { - super(); - this.environment = props.environment; - } - - public mutateContainerDefinition(props: ecs.ContainerDefinitionOptions): ecs.ContainerDefinitionOptions { - return { - ...props, - - environment: { ...(props.environment || {}), ...this.environment }, - } as ecs.ContainerDefinitionOptions; - } -} - -/** - * This extension creates a default `eventsQueue` for the service (if not provided) and accepts a list of objects of - * type `ISubscribable` that the `eventsQueue` subscribes to. It creates the subscriptions and sets up permissions - * for the service to consume messages from the SQS Queues. - * - * It also configures a target tracking scaling policy for the service to maintain an acceptable queue latency by tracking - * the backlog per task. For more information, please refer: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-using-sqs-queue.html . - * - * The default queue for this service can be accessed using the getter `.eventsQueue`. - */ -export class QueueExtension extends ServiceExtension { - private _eventsQueue!: sqs.IQueue; - - private _autoscalingOptions?: QueueAutoScalingOptions; - - private subscriptionQueues = new Set(); - - private environment: { [key: string]: string } = {}; - - private props?: QueueExtensionProps; - - /** - * The log group created by the extension where the AWS Lambda function logs are stored. - */ - public logGroup?: logs.ILogGroup; - - constructor(props?: QueueExtensionProps) { - super('queue'); - - this.props = props; - } - - /** - * This hook creates (if required) and sets the default queue `eventsQueue`. It also sets up the subscriptions for - * the provided `ISubscribable` objects. - * - * @param service The parent service which this extension has been added to - * @param scope The scope that this extension should create resources in - */ - public prehook(service: Service, scope: Construct) { - this.parentService = service; - this.scope = scope; - - let eventsQueue = this.props?.eventsQueue; - if (!eventsQueue) { - const deadLetterQueue = new sqs.Queue(this.scope, 'EventsDeadLetterQueue', { - retentionPeriod: cdk.Duration.days(14), - }); - - eventsQueue = new sqs.Queue(this.scope, 'EventsQueue', { - deadLetterQueue: { - queue: deadLetterQueue, - maxReceiveCount: 3, - }, - }); - } - this._eventsQueue = eventsQueue; - this._autoscalingOptions = this.props?.scaleOnLatency; - - this.environment[`${this.parentService.id.toUpperCase()}_QUEUE_URI`] = this._eventsQueue.queueUrl; - - if (this.props?.subscriptions) { - for (const subs of this.props.subscriptions) { - const subsQueue = subs.subscribe(this); - if (subsQueue !== this._eventsQueue) { - if (subs.subscriptionQueue?.scaleOnLatency && !this._autoscalingOptions) { - throw Error(`Autoscaling for a topic-specific queue cannot be configured as autoscaling based on SQS Queues hasn’t been set up for the service '${this.parentService.id}'. If you want to enable autoscaling for this service, please also specify 'scaleOnLatency' in the 'QueueExtension'.`); - } - const subscriptionQueue = subs.subscriptionQueue ?? { - queue: subsQueue, - } as SubscriptionQueue; - this.subscriptionQueues.add(subscriptionQueue); - } - } - } - } - - /** - * Add hooks to the main application extension so that it is modified to - * add the events queue URL to the container environment. - */ - public addHooks() { - const container = this.parentService.serviceDescription.get('service-container') as Container; - - if (!container) { - throw new Error('Queue Extension requires an application extension'); - } - - container.addContainerMutatingHook(new QueueExtensionMutatingHook({ - environment: this.environment, - })); - } - - /** - * After the task definition has been created, this hook grants SQS permissions to the task role. - * - * @param taskDefinition The created task definition - */ - public useTaskDefinition(taskDefinition: ecs.TaskDefinition) { - this._eventsQueue.grantConsumeMessages(taskDefinition.taskRole); - for (const subsQueue of this.subscriptionQueues) { - subsQueue.queue.grantConsumeMessages(taskDefinition.taskRole); - } - } - - /** - * When this hook is implemented by extension, it allows the extension - * to use the service which has been created. It is used to add target tracking - * scaling policies for the SQS Queues of the service. It also creates an AWS Lambda - * Function for calculating the backlog per task metric. - * - * @param service - The generated service. - */ - public useService(service: ecs.Ec2Service | ecs.FargateService) { - if (!this._autoscalingOptions) { - return; - } - if (!this.parentService.scalableTaskCount) { - throw Error(`Auto scaling target for the service '${this.parentService.id}' hasn't been configured. Please use Service construct to configure 'minTaskCount' and 'maxTaskCount'.`); - } - - this.addQueueScalingPolicy(this._eventsQueue, this._autoscalingOptions); - for (const subsQueue of this.subscriptionQueues) { - const autoscalingOpts = subsQueue.scaleOnLatency ?? this._autoscalingOptions; - this.addQueueScalingPolicy(subsQueue.queue, autoscalingOpts!); - } - this.parentService.enableAutoScalingPolicy(); - - this.createLambdaFunction(service); - } - - /** - * This method adds a target tracking policy based on the backlog per task custom metric - * to the auto scaling target configured for this service. - * - * @param queue The queue for which backlog per task metric is being configured - * @param queueDelay The auto scaling options for the queue - */ - private addQueueScalingPolicy(queue: sqs.IQueue, queueDelay: QueueAutoScalingOptions) { - const messageProcessingTime = queueDelay.messageProcessingTime.toSeconds(); - const acceptableLatency = queueDelay.acceptableLatency.toSeconds(); - if (messageProcessingTime > acceptableLatency) { - throw Error(`Message processing time (${messageProcessingTime}s) for the queue cannot be greater acceptable queue latency (${acceptableLatency}s).`); - } - const acceptableBacklog = acceptableLatency/messageProcessingTime; - - this.parentService.scalableTaskCount?.scaleToTrackCustomMetric(`${queue.node.id}-autoscaling-policy`, { - metric: new cloudwatch.Metric({ - namespace: `${this.parentService.environment.id}-${this.parentService.id}`, - metricName: 'BacklogPerTask', - dimensionsMap: { QueueName: queue.queueName }, - unit: cloudwatch.Unit.COUNT, - }), - targetValue: acceptableBacklog, - }); - } - - /** - * This method is used to create the AWS Lambda Function for calculating backlog - * per task metric and a Cloudwatch event trigger for this function. - * - * @param service - The generated service. - */ - private createLambdaFunction(service: ecs.Ec2Service | ecs.FargateService) { - const queueNames = [this._eventsQueue.queueName]; - this.subscriptionQueues.forEach(subs => queueNames.push(subs.queue.queueName)); - - const backLogPerTaskCalculator = new lambda.Function(this.scope, 'BackLogPerTaskCalculatorFunction', { - runtime: lambda.Runtime.PYTHON_3_9, - code: lambda.Code.fromAsset(path.join(__dirname, 'lambda')), - handler: 'index.queue_handler', - environment: { - CLUSTER_NAME: this.parentService.cluster.clusterName, - SERVICE_NAME: service.serviceName, - NAMESPACE: `${this.parentService.environment.id}-${this.parentService.id}`, - QUEUE_NAMES: queueNames.join(','), - }, - initialPolicy: [new iam.PolicyStatement({ - actions: ['ecs:DescribeServices'], - resources: [`${service.serviceArn}`], - conditions: { - ArnEquals: { - 'ecs:cluster': this.parentService.cluster.clusterArn, - }, - }, - })], - }); - - const queueArns = [this._eventsQueue.queueArn]; - this.subscriptionQueues.forEach(subs => queueArns.push(subs.queue.queueArn)); - backLogPerTaskCalculator.grantPrincipal.addToPrincipalPolicy(new iam.PolicyStatement({ - actions: [ - 'sqs:GetQueueAttributes', - 'sqs:GetQueueUrl', - ], - resources: queueArns, - })); - - new events.Rule(this.scope, 'BacklogPerTaskScheduledRule', { - schedule: events.Schedule.rate(cdk.Duration.seconds(60)), - targets: [new events_targets.LambdaFunction(backLogPerTaskCalculator)], - }); - - this.logGroup = new logs.LogGroup(this.scope, `${this.parentService.id}-BackLogPerTaskCalculatorLogs`, { - logGroupName: `/aws/lambda/${backLogPerTaskCalculator.functionName}`, - removalPolicy: cdk.RemovalPolicy.DESTROY, - retention: logs.RetentionDays.THREE_DAYS, - }); - } - - public get eventsQueue() : sqs.IQueue { - return this._eventsQueue; - } - - public get autoscalingOptions() : QueueAutoScalingOptions | undefined { - return this._autoscalingOptions; - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/scale-on-cpu-utilization.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/scale-on-cpu-utilization.ts deleted file mode 100644 index 4c3661424f52f..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/scale-on-cpu-utilization.ts +++ /dev/null @@ -1,152 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { ServiceExtension, ServiceBuild } from './extension-interfaces'; - - -/** - * The autoscaling settings. - * - * @deprecated use the `minTaskCount` and `maxTaskCount` properties of `autoScaleTaskCount` in the `Service` construct - * to configure the auto scaling target for the service. For more information, please refer - * https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . - */ -export interface CpuScalingProps { - /** - * How many tasks to launch initially. - * - * @default - 2 - */ - readonly initialTaskCount?: number; - - /** - * The minimum number of tasks when scaling in. - * - * @default - 2 - */ - readonly minTaskCount?: number; - - /** - * The maximum number of tasks when scaling out. - * - * @default - 8 - */ - readonly maxTaskCount?: number; - - /** - * The CPU utilization to try ot maintain. - * - * @default - 50% - */ - readonly targetCpuUtilization?: number; - - /** - * How long to wait between scale out actions. - * - * @default - 60 seconds - */ - readonly scaleOutCooldown?: cdk.Duration; - - /** - * How long to wait between scale in actions. - * - * @default - 60 seconds - */ - readonly scaleInCooldown?: cdk.Duration; -} - -// The default autoscaling settings -const cpuScalingPropsDefault = { - initialTaskCount: 2, - minTaskCount: 2, - maxTaskCount: 8, - targetCpuUtilization: 50, - scaleOutCooldown: cdk.Duration.seconds(60), - scaleInCooldown: cdk.Duration.seconds(60), -}; - -/** - * This extension helps you scale your service according to CPU utilization. - * - * @deprecated To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. - * For more information, please refer https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . - */ -export class ScaleOnCpuUtilization extends ServiceExtension { - /** - * How many tasks to launch initially. - */ - public readonly initialTaskCount: number; - - /** - * The minimum number of tasks when scaling in. - */ - public readonly minTaskCount: number; - - /** - * The maximum number of tasks when scaling out. - */ - public readonly maxTaskCount: number; - - /** - * The CPU utilization to try ot maintain. - */ - public readonly targetCpuUtilization: number; - - /** - * How long to wait between scale out actions. - */ - public readonly scaleOutCooldown: cdk.Duration; - - /** - * How long to wait between scale in actions. - */ - public readonly scaleInCooldown: cdk.Duration; - - constructor(props?: CpuScalingProps) { - super('scale-on-cpu-utilization'); - - let combinedProps = { - ...cpuScalingPropsDefault, - ...props, - }; - - this.initialTaskCount = combinedProps.initialTaskCount; - this.minTaskCount = combinedProps.minTaskCount; - this.maxTaskCount = combinedProps.maxTaskCount; - this.targetCpuUtilization = combinedProps.targetCpuUtilization; - this.scaleOutCooldown = combinedProps.scaleOutCooldown; - this.scaleInCooldown = combinedProps.scaleInCooldown; - } - - // This service modifies properties of the service prior - // to construct creation. - public modifyServiceProps(props: ServiceBuild): ServiceBuild { - return { - ...props, - - // Launch an initial number of tasks - // In the future we should change this to use a custom resource - // to read the current task count set by autoscaling, so that the task - // count doesn't rollback to the initial level on each deploy. - desiredCount: this.initialTaskCount, - } as ServiceBuild; - } - - // This hook utilizes the resulting service construct - // once it is created. - public useService(service: ecs.Ec2Service | ecs.FargateService) { - if (this.parentService.scalableTaskCount) { - throw Error('Cannot specify \'autoScaleTaskCount\' in the Service construct and also provide a \'ScaleOnCpuUtilization\' extension. \'ScaleOnCpuUtilization\' is deprecated. Please only provide \'autoScaleTaskCount\'.'); - } - const scalingTarget = service.autoScaleTaskCount({ - minCapacity: this.minTaskCount, - maxCapacity: this.maxTaskCount, - }); - - scalingTarget.scaleOnCpuUtilization(`${this.parentService.id}-target-cpu-utilization-${this.targetCpuUtilization}`, { - targetUtilizationPercent: this.targetCpuUtilization, - scaleInCooldown: this.scaleInCooldown, - scaleOutCooldown: this.scaleOutCooldown, - }); - this.parentService.enableAutoScalingPolicy(); - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/xray.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/xray.ts deleted file mode 100644 index 1950360b2e17c..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/xray.ts +++ /dev/null @@ -1,67 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as iam from '@aws-cdk/aws-iam'; -import * as cdk from '@aws-cdk/core'; -import { Construct } from 'constructs'; -import { Service } from '../service'; -import { ServiceExtension } from './extension-interfaces'; - -const XRAY_DAEMON_IMAGE = 'amazon/aws-xray-daemon:latest'; - -/** - * This extension adds an X-Ray daemon inside the task definition for - * capturing application trace spans and submitting them to the AWS - * X-Ray service. - */ -export class XRayExtension extends ServiceExtension { - constructor() { - super('xray'); - } - - // @ts-ignore - Ignore unused params that are required for abstract class extend - public prehook(service: Service, scope: Construct) { - this.parentService = service; - } - - public useTaskDefinition(taskDefinition: ecs.TaskDefinition) { - // Add the XRay Daemon to the task - this.container = taskDefinition.addContainer('xray', { - image: ecs.ContainerImage.fromRegistry(XRAY_DAEMON_IMAGE), - essential: true, - memoryReservationMiB: 256, - environment: { - AWS_REGION: cdk.Stack.of(this.parentService).region, - }, - healthCheck: { - command: [ - 'CMD-SHELL', - 'curl -s http://localhost:2000', - ], - startPeriod: cdk.Duration.seconds(10), - interval: cdk.Duration.seconds(5), - timeout: cdk.Duration.seconds(2), - retries: 3, - }, - logging: new ecs.AwsLogDriver({ streamPrefix: 'xray' }), - user: '1337', // X-Ray traffic should not go through Envoy proxy - }); - - // Add permissions to this task to allow it to talk to X-Ray - taskDefinition.taskRole.addManagedPolicy( - iam.ManagedPolicy.fromAwsManagedPolicyName('AWSXRayDaemonWriteAccess'), - ); - } - - public resolveContainerDependencies() { - if (!this.container) { - throw new Error('The container dependency hook was called before the container was created'); - } - - const appmeshextension = this.parentService.serviceDescription.get('appmesh'); - if (appmeshextension && appmeshextension.container) { - this.container.addContainerDependencies({ - container: appmeshextension.container, - condition: ecs.ContainerDependencyCondition.HEALTHY, - }); - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/index.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/index.ts deleted file mode 100644 index 04a891f556dd7..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './service'; -export * from './service-description'; -export * from './environment'; -export * from './extensions'; -export * from './extensions/extension-interfaces'; \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/service-description.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/service-description.ts deleted file mode 100644 index eb26905a5baa9..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/service-description.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { ServiceExtension } from './extensions/extension-interfaces'; - -/** - * A ServiceDescription is a wrapper for all of the extensions that a user wants - * to add to an ECS Service. It collects all of the extensions that are added - * to a service, allowing each extension to query the full list of extensions - * added to a service to determine information about how to self-configure. - */ -export class ServiceDescription { - /** - * The list of extensions that have been registered to run when - * preparing this service. - */ - public extensions: Record = {}; - - /** - * Adds a new extension to the service. The extensions mutate a service - * to add resources to or configure properties for the service. - * - * @param extension - The extension that you wish to add - */ - public add(extension: ServiceExtension) { - if (this.extensions[extension.name]) { - throw new Error(`An extension called ${extension.name} has already been added`); - } - - this.extensions[extension.name] = extension; - - return this; - } - - /** - * Get the extension with a specific name. This is generally used by - * extensions in order to discover each other. - * - * @param name - */ - public get(name: string) { - return this.extensions[name]; - } -}; diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts deleted file mode 100644 index 41b90085953a3..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts +++ /dev/null @@ -1,372 +0,0 @@ -import * as ec2 from '@aws-cdk/aws-ec2'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from 'constructs'; -import { IEnvironment } from './environment'; -import { EnvironmentCapacityType, ServiceBuild } from './extensions/extension-interfaces'; -import { ServiceDescription } from './service-description'; - -/** - * connectToProps will have all the extra parameters which are required for connecting services. - */ -export interface ConnectToProps { - /** - * local_bind_port is the local port that this application should - * use when calling the upstream service in ECS Consul Mesh Extension - * Currently, this parameter will only be used in the ECSConsulMeshExtension - * https://github.com/aws-ia/ecs-consul-mesh-extension - */ - readonly local_bind_port?: number; -} - -/** - * The settings for an ECS Service. - */ -export interface ServiceProps { - /** - * The ServiceDescription used to build the service. - */ - readonly serviceDescription: ServiceDescription; - - /** - * The environment to launch the service in. - */ - readonly environment: IEnvironment - - /** - * The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. - * - * @default - A task role is automatically created for you. - */ - readonly taskRole?: iam.IRole; - - /** - * The desired number of instantiations of the task definition to keep running on the service. - * - * @default - When creating the service, default is 1; when updating the service, default uses - * the current task number. - */ - readonly desiredCount?: number; - - /** - * The options for configuring the auto scaling target. - * - * @default none - */ - readonly autoScaleTaskCount?: AutoScalingOptions; -} - -export interface AutoScalingOptions { - /** - * The minimum number of tasks when scaling in. - * - * @default - 1 - */ - readonly minTaskCount?: number; - - /** - * The maximum number of tasks when scaling out. - */ - readonly maxTaskCount: number; - - /** - * The target value for CPU utilization across all tasks in the service. - */ - readonly targetCpuUtilization?: number; - - /** - * The target value for memory utilization across all tasks in the service. - */ - readonly targetMemoryUtilization?: number; -} - -/** - * This Service construct serves as a Builder class for an ECS service. It - * supports various extensions and keeps track of any mutating state, allowing - * it to build up an ECS service progressively. - */ -export class Service extends Construct { - /** - * The underlying ECS service that was created. - */ - public ecsService!: ecs.Ec2Service | ecs.FargateService; - - /** - * The name of the service. - */ - public readonly id: string; - - /** - * The VPC where this service should be placed. - */ - public readonly vpc: ec2.IVpc; - - /** - * The cluster that is providing capacity for this service. - * [disable-awslint:ref-via-interface] - */ - public readonly cluster: ecs.ICluster; - - /** - * The capacity type that this service will use. - * Valid values are EC2 or FARGATE. - */ - public readonly capacityType: EnvironmentCapacityType; - - /** - * The ServiceDescription used to build this service. - */ - public readonly serviceDescription: ServiceDescription; - - /** - * The environment where this service was launched. - */ - public readonly environment: IEnvironment; - - /** - * The scalable attribute representing task count. - */ - public readonly scalableTaskCount?: ecs.ScalableTaskCount; - - /** - * The flag to track if auto scaling policies have been configured - * for the service. - */ - private autoScalingPoliciesEnabled: boolean = false; - - /** - * The generated task definition for this service. It is only - * generated after .prepare() has been executed. - */ - protected taskDefinition!: ecs.TaskDefinition; - - /** - * The list of URLs associated with this service. - */ - private urls: Record = {}; - - private readonly scope: Construct; - - constructor(scope: Construct, id: string, props: ServiceProps) { - super(scope, id); - - this.scope = scope; - this.id = id; - this.environment = props.environment; - this.vpc = props.environment.vpc; - this.cluster = props.environment.cluster; - this.capacityType = props.environment.capacityType; - this.serviceDescription = props.serviceDescription; - - // Check to make sure that the user has actually added a container - const containerextension = this.serviceDescription.get('service-container'); - - if (!containerextension) { - throw new Error(`Service '${this.id}' must have a Container extension`); - } - - // First set the scope for all the extensions - for (const extensions in this.serviceDescription.extensions) { - if (this.serviceDescription.extensions[extensions]) { - this.serviceDescription.extensions[extensions].prehook(this, this.scope); - } - } - - // At the point of preparation all extensions have been defined on the service - // so give each extension a chance to now add hooks to other extensions if - // needed - for (const extensions in this.serviceDescription.extensions) { - if (this.serviceDescription.extensions[extensions]) { - this.serviceDescription.extensions[extensions].addHooks(); - } - } - - // Give each extension a chance to mutate the task def creation properties - let taskDefProps = { - // Default CPU and memory - cpu: '256', - memory: '512', - - // Allow user to pre-define the taskRole so that it can be used in resource policies that may - // be defined before the ECS service exists in a CDK application - taskRole: props.taskRole, - - // Ensure that the task definition supports both EC2 and Fargate - compatibility: ecs.Compatibility.EC2_AND_FARGATE, - } as ecs.TaskDefinitionProps; - for (const extensions in this.serviceDescription.extensions) { - if (this.serviceDescription.extensions[extensions]) { - taskDefProps = this.serviceDescription.extensions[extensions].modifyTaskDefinitionProps(taskDefProps); - } - } - - // Now that the task definition properties are assembled, create it - this.taskDefinition = new ecs.TaskDefinition(this.scope, `${this.id}-task-definition`, taskDefProps); - - // Now give each extension a chance to use the task definition - for (const extensions in this.serviceDescription.extensions) { - if (this.serviceDescription.extensions[extensions]) { - this.serviceDescription.extensions[extensions].useTaskDefinition(this.taskDefinition); - } - } - - // Now that all containers are created, give each extension a chance - // to bake its dependency graph - for (const extensions in this.serviceDescription.extensions) { - if (this.serviceDescription.extensions[extensions]) { - this.serviceDescription.extensions[extensions].resolveContainerDependencies(); - } - } - - // Give each extension a chance to mutate the service props before - // service creation - let serviceProps = { - cluster: this.cluster, - taskDefinition: this.taskDefinition, - minHealthyPercent: 100, - maxHealthyPercent: 200, - desiredCount: props.desiredCount ?? 1, - } as ServiceBuild; - - for (const extensions in this.serviceDescription.extensions) { - if (this.serviceDescription.extensions[extensions]) { - serviceProps = this.serviceDescription.extensions[extensions].modifyServiceProps(serviceProps); - } - } - - // If a maxHealthyPercent and desired count has been set while minHealthyPercent == 100% then we - // need to do some failsafe checking to ensure that the maxHealthyPercent - // actually allows a rolling deploy. Otherwise it is possible to end up with - // blocked deploys that can take no action because minHealtyhPercent == 100% - // prevents running, healthy tasks from being stopped, but a low maxHealthyPercent - // can also prevents new parallel tasks from being started. - if (serviceProps.maxHealthyPercent && serviceProps.desiredCount && serviceProps.minHealthyPercent && serviceProps.minHealthyPercent == 100) { - if (serviceProps.desiredCount == 1) { - // If there is one task then we must allow max percentage to be at - // least 200% for another replacement task to be added - serviceProps = { - ...serviceProps, - maxHealthyPercent: Math.max(200, serviceProps.maxHealthyPercent), - }; - } else if (serviceProps.desiredCount <= 3) { - // If task count is 2 or 3 then max percent must be at least 150% to - // allow one replacement task to be launched at a time. - serviceProps = { - ...serviceProps, - maxHealthyPercent: Math.max(150, serviceProps.maxHealthyPercent), - }; - } else { - // For anything higher than 3 tasks set max percent to at least 125% - // For 4 tasks this will allow exactly one extra replacement task - // at a time, for any higher task count it will allow 25% of the tasks - // to be replaced at a time. - serviceProps = { - ...serviceProps, - maxHealthyPercent: Math.max(125, serviceProps.maxHealthyPercent), - }; - } - } - - // Set desiredCount to `undefined` if auto scaling is configured for the service - if (props.autoScaleTaskCount || this.autoScalingPoliciesEnabled) { - serviceProps = { - ...serviceProps, - desiredCount: undefined, - }; - } - - // Now that the service props are determined we can create - // the service - if (this.capacityType === EnvironmentCapacityType.EC2) { - this.ecsService = new ecs.Ec2Service(this.scope, `${this.id}-service`, serviceProps); - } else if (this.capacityType === EnvironmentCapacityType.FARGATE) { - this.ecsService = new ecs.FargateService(this.scope, `${this.id}-service`, serviceProps); - } else { - throw new Error(`Unknown capacity type for service ${this.id}`); - } - - // Create the auto scaling target and configure target tracking policies after the service is created - if (props.autoScaleTaskCount) { - this.scalableTaskCount = this.ecsService.autoScaleTaskCount({ - maxCapacity: props.autoScaleTaskCount.maxTaskCount, - minCapacity: props.autoScaleTaskCount.minTaskCount, - }); - - if (props.autoScaleTaskCount.targetCpuUtilization) { - const targetCpuUtilizationPercent = props.autoScaleTaskCount.targetCpuUtilization; - this.scalableTaskCount.scaleOnCpuUtilization(`${this.id}-target-cpu-utilization-${targetCpuUtilizationPercent}`, { - targetUtilizationPercent: targetCpuUtilizationPercent, - }); - this.enableAutoScalingPolicy(); - } - - if (props.autoScaleTaskCount.targetMemoryUtilization) { - const targetMemoryUtilizationPercent = props.autoScaleTaskCount.targetMemoryUtilization; - this.scalableTaskCount.scaleOnMemoryUtilization(`${this.id}-target-memory-utilization-${targetMemoryUtilizationPercent}`, { - targetUtilizationPercent: targetMemoryUtilizationPercent, - }); - this.enableAutoScalingPolicy(); - } - } - - // Now give all extensions a chance to use the service - for (const extensions in this.serviceDescription.extensions) { - if (this.serviceDescription.extensions[extensions]) { - this.serviceDescription.extensions[extensions].useService(this.ecsService); - } - } - - // Error out if the auto scaling target is created but no scaling policies have been configured - if (this.scalableTaskCount && !this.autoScalingPoliciesEnabled) { - throw Error(`The auto scaling target for the service '${this.id}' has been created but no auto scaling policies have been configured.`); - } - } - - /** - * Tell extensions from one service to connect to extensions from - * another sevice if they have implemented a hook for it. - * - * @param service - */ - public connectTo(service: Service, connectToProps: ConnectToProps = {}) { - for (const extensions in this.serviceDescription.extensions) { - if (this.serviceDescription.extensions[extensions]) { - this.serviceDescription.extensions[extensions].connectToService(service, connectToProps); - } - } - } - - /** - * This method adds a new URL for the service. This allows extensions to - * submit a URL for the service. For example, a load balancer might add its - * URL, or App Mesh can add its DNS name for the service. - * - * @param urlName - The identifier name for this URL - * @param url - The URL itself. - */ - public addURL(urlName: string, url: string) { - this.urls[urlName] = url; - } - - /** - * Retrieve a URL for the service. The URL must have previously been - * stored by one of the URL providing extensions. - * - * @param urlName - The URL to look up. - */ - public getURL(urlName: string) { - if (!this.urls[urlName]) { - throw new Error(`Unable to find a URL with name '${urlName}'`); - } - - return this.urls[urlName]; - } - - /** - * This helper method is used to set the `autoScalingPoliciesEnabled` attribute - * whenever an auto scaling policy is configured for the service. - */ - public enableAutoScalingPolicy() { - this.autoScalingPoliciesEnabled = true; - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/package.json b/packages/@aws-cdk-containers/ecs-service-extensions/package.json deleted file mode 100644 index c75e2ec6b364e..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "name": "@aws-cdk-containers/ecs-service-extensions", - "version": "0.0.0", - "private": true, - "description": "The CDK Construct Library that helps you build ECS services using simple extensions", - "main": "lib/index.js", - "types": "lib/index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/aws/aws-cdk.git", - "directory": "packages/@aws-cdk-containers/ecs-service-extensions" - }, - "scripts": { - "build": "cdk-build", - "watch": "cdk-watch", - "lint": "cdk-lint", - "test": "cdk-test", - "integ": "integ-runner", - "pkglint": "pkglint -f", - "package": "cdk-package", - "awslint": "cdk-awslint", - "build+test+package": "yarn build+test && yarn package", - "build+test": "yarn build && yarn test", - "compat": "cdk-compat", - "build+extract": "yarn build", - "build+test+extract": "yarn build+test" - }, - "keywords": [ - "aws", - "cdk", - "constructs", - "ecs" - ], - "author": { - "name": "Amazon Web Services", - "url": "https://aws.amazon.com", - "organization": true - }, - "license": "Apache-2.0", - "devDependencies": { - "@types/jest": "^27.5.2", - "@aws-cdk/cdk-build-tools": "0.0.0", - "@aws-cdk/integ-runner": "0.0.0", - "@aws-cdk/aws-autoscaling": "0.0.0", - "@aws-cdk/cfn2ts": "0.0.0", - "jest": "^27.5.1", - "@aws-cdk/pkglint": "0.0.0", - "@aws-cdk/assertions": "0.0.0" - }, - "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "0.0.0", - "@aws-cdk/aws-appmesh": "0.0.0", - "@aws-cdk/aws-certificatemanager": "0.0.0", - "@aws-cdk/aws-cloudwatch": "0.0.0", - "@aws-cdk/aws-dynamodb": "0.0.0", - "@aws-cdk/aws-ec2": "0.0.0", - "@aws-cdk/aws-ecr": "0.0.0", - "@aws-cdk/aws-ecs": "0.0.0", - "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", - "@aws-cdk/aws-events": "0.0.0", - "@aws-cdk/aws-events-targets": "0.0.0", - "@aws-cdk/aws-iam": "0.0.0", - "@aws-cdk/aws-lambda": "0.0.0", - "@aws-cdk/aws-lambda-event-sources": "0.0.0", - "@aws-cdk/aws-logs": "0.0.0", - "@aws-cdk/aws-route53": "0.0.0", - "@aws-cdk/aws-route53-targets": "0.0.0", - "@aws-cdk/aws-servicediscovery": "0.0.0", - "@aws-cdk/aws-sns": "0.0.0", - "@aws-cdk/aws-sns-subscriptions": "0.0.0", - "@aws-cdk/aws-sqs": "0.0.0", - "@aws-cdk/core": "0.0.0", - "@aws-cdk/custom-resources": "0.0.0", - "@aws-cdk/cx-api": "0.0.0", - "@aws-cdk/region-info": "0.0.0", - "constructs": "^10.0.0" - }, - "homepage": "https://github.com/aws/aws-cdk", - "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "0.0.0", - "@aws-cdk/aws-appmesh": "0.0.0", - "@aws-cdk/aws-certificatemanager": "0.0.0", - "@aws-cdk/aws-cloudwatch": "0.0.0", - "@aws-cdk/aws-dynamodb": "0.0.0", - "@aws-cdk/aws-ec2": "0.0.0", - "@aws-cdk/aws-ecr": "0.0.0", - "@aws-cdk/aws-ecs": "0.0.0", - "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", - "@aws-cdk/aws-events": "0.0.0", - "@aws-cdk/aws-events-targets": "0.0.0", - "@aws-cdk/aws-iam": "0.0.0", - "@aws-cdk/aws-lambda": "0.0.0", - "@aws-cdk/aws-lambda-event-sources": "0.0.0", - "@aws-cdk/aws-logs": "0.0.0", - "@aws-cdk/aws-route53": "0.0.0", - "@aws-cdk/aws-route53-targets": "0.0.0", - "@aws-cdk/aws-servicediscovery": "0.0.0", - "@aws-cdk/aws-sns": "0.0.0", - "@aws-cdk/aws-sns-subscriptions": "0.0.0", - "@aws-cdk/aws-sqs": "0.0.0", - "@aws-cdk/core": "0.0.0", - "@aws-cdk/custom-resources": "0.0.0", - "@aws-cdk/cx-api": "0.0.0", - "@aws-cdk/region-info": "0.0.0", - "constructs": "^10.0.0" - }, - "engines": { - "node": ">= 14.15.0" - }, - "awscdkio": { - "announce": false - }, - "maturity": "stable", - "stability": "stable", - "publishConfig": { - "tag": "latest" - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/aws-ecs-integ.assets.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/aws-ecs-integ.assets.json deleted file mode 100644 index d4a8ca27c5381..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/aws-ecs-integ.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "20.0.0", - "files": { - "ad006ddc477f947f0d63b6eb67b02371ef18c9f3cb86353a3cab3704778a8be1": { - "source": { - "path": "aws-ecs-integ.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ad006ddc477f947f0d63b6eb67b02371ef18c9f3cb86353a3cab3704778a8be1.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/aws-ecs-integ.template.json deleted file mode 100644 index 4cde019057409..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/aws-ecs-integ.template.json +++ /dev/null @@ -1,3321 +0,0 @@ -{ - "Resources": { - "mymeshEA67EDEF": { - "Type": "AWS::AppMesh::Mesh", - "Properties": { - "MeshName": "awsecsintegmymeshFCC0D554", - "Spec": {} - } - }, - "productionenvironmentvpcAEB47DF7": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1Subnet8D92C089": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet1EIP54BA88DB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D", - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374" - ] - }, - "productionenvironmentvpcPublicSubnet2Subnet298E6C31": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.64.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTable842A68D7": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet2EIP14CA46AA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D", - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - ] - }, - "productionenvironmentvpcPrivateSubnet1Subnet53F632E6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "productionenvironmentvpcPrivateSubnet2Subnet756FB93C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.192.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "productionenvironmentvpcIGWE7C39890": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcVPCGW1B428D07": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "InternetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D": { - "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "Properties": { - "Name": "production", - "Vpc": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "namelogsF4B17D31": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-logs", - "RetentionInDays": 7 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nametaskdefinitionTaskRole50FE844E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "nametaskdefinitionTaskRoleDefaultPolicyE66EDC68": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nametaskdefinitionTaskRoleDefaultPolicyE66EDC68", - "Roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "nametaskdefinition690762BB": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "START", - "ContainerName": "firelens" - }, - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - }, - { - "Condition": "START", - "ContainerName": "cloudwatch-agent" - }, - { - "Condition": "HEALTHY", - "ContainerName": "xray" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awsfirelens", - "Options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "namelogsF4B17D31" - }, - "log_stream_prefix": "name/" - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/name" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "nameenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nametaskdefinitionenvoyLogGroup258B673B" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Essential": true, - "FirelensConfiguration": { - "Type": "fluentbit" - }, - "Image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nametaskdefinitionfirelensLogGroup80DDA60F" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "firelens", - "User": "0:1338" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": "amazon/aws-xray-daemon:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nametaskdefinitionxrayLogGroup4AF4CA37" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 256, - "Name": "xray", - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "CW_CONFIG_CONTENT", - "Value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ], - "Essential": true, - "Image": "amazon/cloudwatch-agent:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nametaskdefinitioncloudwatchagentLogGroup78DDC685" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "cloudwatch-agent", - "User": "0:1338" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "Family": "awsecsintegnametaskdefinition0EA6A1A0", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - } - }, - "nametaskdefinitionenvoyLogGroup258B673B": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nametaskdefinitionExecutionRole45AC5C9A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "nameenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nametaskdefinitioncloudwatchagentLogGroup78DDC685", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionenvoyLogGroup258B673B", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionfirelensLogGroup80DDA60F", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionxrayLogGroup4AF4CA37", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "Roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - } - }, - "nametaskdefinitionfirelensLogGroup80DDA60F": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nametaskdefinitionxrayLogGroup4AF4CA37": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nametaskdefinitioncloudwatchagentLogGroup78DDC685": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nameenvoytoappmesh2767D3E6": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameenvoytoappmesh2767D3E6", - "Roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "namepublishmetricsF329C7AE": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "namepublishmetricsF329C7AE", - "Roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "nameserviceService8015C8D6": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 150, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 2, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "nameserviceCloudmapService3D5B0548", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "nameserviceCloudmapService3D5B0548": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "name", - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "nameserviceSecurityGroup33F4662C": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "nameserviceSecurityGroupfromawsecsinteggreeterserviceSecurityGroup055DC23B8048057EFF": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "IpProtocol": "tcp", - "Description": "Accept inbound traffic from greeter", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - }, - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "ToPort": 80 - } - }, - "nameserviceTaskCountTarget366C2B3A": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 8, - "MinCapacity": 2, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "nameserviceTaskCountTargetnametargetcpuutilization5018B16243": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsintegnameserviceTaskCountTargetnametargetcpuutilization50CAB59E05", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "nameserviceTaskCountTarget366C2B3A" - }, - "TargetTrackingScalingPolicyConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "ScaleInCooldown": 60, - "ScaleOutCooldown": 60, - "TargetValue": 50 - } - } - }, - "namevirtualnode6C99CB14": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "production", - "ServiceName": { - "Fn::GetAtt": [ - "nameserviceCloudmapService3D5B0548", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "name" - } - }, - "namevirtualrouterC00E1ACE": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "name" - } - }, - "namevirtualrouternamerouteDCDF3715": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "namevirtualnode6C99CB14", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "namevirtualrouterC00E1ACE", - "VirtualRouterName" - ] - }, - "RouteName": "name-route" - } - }, - "namevirtualservice3DDDDF1E": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "namevirtualrouterC00E1ACE", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "name.production" - } - }, - "greetinglogsCC360934": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "greeting-logs", - "RetentionInDays": 7 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "greetingtaskdefinitionTaskRole9179DA4A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "greetingtaskdefinitionTaskRoleDefaultPolicy5DB4510A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetingtaskdefinitionTaskRoleDefaultPolicy5DB4510A", - "Roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "greetingtaskdefinition31690093": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "START", - "ContainerName": "firelens" - }, - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - }, - { - "Condition": "START", - "ContainerName": "cloudwatch-agent" - }, - { - "Condition": "HEALTHY", - "ContainerName": "xray" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/greeting", - "LogConfiguration": { - "LogDriver": "awsfirelens", - "Options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "greetinglogsCC360934" - }, - "log_stream_prefix": "greeting/" - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/greeting" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "greetingenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionenvoyLogGroup6556AC35" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Essential": true, - "FirelensConfiguration": { - "Type": "fluentbit" - }, - "Image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionfirelensLogGroupD7A398A7" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "firelens", - "User": "0:1338" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": "amazon/aws-xray-daemon:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionxrayLogGroupD25C072D" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 256, - "Name": "xray", - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "CW_CONFIG_CONTENT", - "Value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ], - "Essential": true, - "Image": "amazon/cloudwatch-agent:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "cloudwatch-agent", - "User": "0:1338" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "greetingtaskdefinitionExecutionRole9E3A7CF3", - "Arn" - ] - }, - "Family": "awsecsinteggreetingtaskdefinitionA6E8A57B", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "greetingtaskdefinitionTaskRole9179DA4A", - "Arn" - ] - } - } - }, - "greetingtaskdefinitionenvoyLogGroup6556AC35": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetingtaskdefinitionExecutionRole9E3A7CF3": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "greetingtaskdefinitionExecutionRoleDefaultPolicy31B93022": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "greetingenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionenvoyLogGroup6556AC35", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionfirelensLogGroupD7A398A7", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionxrayLogGroupD25C072D", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetingtaskdefinitionExecutionRoleDefaultPolicy31B93022", - "Roles": [ - { - "Ref": "greetingtaskdefinitionExecutionRole9E3A7CF3" - } - ] - } - }, - "greetingtaskdefinitionfirelensLogGroupD7A398A7": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetingtaskdefinitionxrayLogGroupD25C072D": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetingenvoytoappmesh97051B23": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetingenvoytoappmesh97051B23", - "Roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "greetingpublishmetricsF17124EF": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetingpublishmetricsF17124EF", - "Roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "greetingserviceService8DA58640": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 150, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 2, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "greetingserviceSecurityGroupE9BE665B", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "greetingserviceCloudmapService0A2D7385", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "greetingtaskdefinition31690093" - } - } - }, - "greetingserviceCloudmapService0A2D7385": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "greeting", - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "greetingserviceSecurityGroupE9BE665B": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/greeting-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "greetingserviceSecurityGroupfromawsecsinteggreeterserviceSecurityGroup055DC23B807B9C4357": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "IpProtocol": "tcp", - "Description": "Accept inbound traffic from greeter", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "greetingserviceSecurityGroupE9BE665B", - "GroupId" - ] - }, - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "ToPort": 80 - } - }, - "greetingserviceTaskCountTargetA036048C": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 8, - "MinCapacity": 2, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "greetingserviceService8DA58640", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "greetingserviceTaskCountTargetgreetingtargetcpuutilization50FEAF6434": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsinteggreetingserviceTaskCountTargetgreetingtargetcpuutilization504C76B1F4", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "greetingserviceTaskCountTargetA036048C" - }, - "TargetTrackingScalingPolicyConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "ScaleInCooldown": 60, - "ScaleOutCooldown": 60, - "TargetValue": 50 - } - } - }, - "greetingvirtualnodeC4A2C517": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "production", - "ServiceName": { - "Fn::GetAtt": [ - "greetingserviceCloudmapService0A2D7385", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "greeting" - } - }, - "greetingvirtualrouter0F898D1A": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "greeting" - } - }, - "greetingvirtualroutergreetingroute46305F50": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "greetingvirtualnodeC4A2C517", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "greetingvirtualrouter0F898D1A", - "VirtualRouterName" - ] - }, - "RouteName": "greeting-route" - } - }, - "greetingvirtualservice60AD3AD9": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "greetingvirtualrouter0F898D1A", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "greeting.production" - } - }, - "greeterlogsCCD2F8B2": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "greeter-logs", - "RetentionInDays": 7 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "greeterloadbalancer85256741": { - "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "Properties": { - "LoadBalancerAttributes": [ - { - "Key": "deletion_protection.enabled", - "Value": "false" - } - ], - "Scheme": "internet-facing", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - ], - "Type": "application" - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D", - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374", - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D", - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - ] - }, - "greeterloadbalancerSecurityGroupEE1B20F3": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Automatically created Security Group for ELB awsecsinteggreeterloadbalancer147D1D5C", - "SecurityGroupIngress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow from anyone on port 80", - "FromPort": 80, - "IpProtocol": "tcp", - "ToPort": 80 - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "greeterloadbalancerSecurityGrouptoawsecsinteggreeterserviceSecurityGroup055DC23B803EEF3320": { - "Type": "AWS::EC2::SecurityGroupEgress", - "Properties": { - "GroupId": { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - }, - "IpProtocol": "tcp", - "Description": "Load balancer to target", - "DestinationSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "FromPort": 80, - "ToPort": 80 - } - }, - "greeterloadbalancergreeterlistener952E028B": { - "Type": "AWS::ElasticLoadBalancingV2::Listener", - "Properties": { - "DefaultActions": [ - { - "TargetGroupArn": { - "Ref": "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2" - }, - "Type": "forward" - } - ], - "LoadBalancerArn": { - "Ref": "greeterloadbalancer85256741" - }, - "Port": 80, - "Protocol": "HTTP" - } - }, - "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2": { - "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "Properties": { - "Port": 80, - "Protocol": "HTTP", - "TargetGroupAttributes": [ - { - "Key": "deregistration_delay.timeout_seconds", - "Value": "10" - }, - { - "Key": "stickiness.enabled", - "Value": "false" - } - ], - "TargetType": "ip", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "greetertaskdefinitionTaskRole2A098ACC": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "greetertaskdefinitionTaskRoleDefaultPolicyD0F53B1C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetertaskdefinitionTaskRoleDefaultPolicyD0F53B1C", - "Roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "greetertaskdefinitionE956EEA2": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "START", - "ContainerName": "firelens" - }, - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - }, - { - "Condition": "START", - "ContainerName": "cloudwatch-agent" - }, - { - "Condition": "HEALTHY", - "ContainerName": "xray" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - }, - { - "Name": "GREETING_URL", - "Value": "http://greeting.production" - }, - { - "Name": "NAME_URL", - "Value": "http://name.production" - } - ], - "Essential": true, - "Image": "nathanpeck/greeter", - "LogConfiguration": { - "LogDriver": "awsfirelens", - "Options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "greeterlogsCCD2F8B2" - }, - "log_stream_prefix": "greeter/" - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/greeter" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "greeterenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionenvoyLogGroup6E10B93E" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Essential": true, - "FirelensConfiguration": { - "Type": "fluentbit" - }, - "Image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionfirelensLogGroupD5BAAC35" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "firelens", - "User": "0:1338" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": "amazon/aws-xray-daemon:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionxrayLogGroupBC1558B6" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 256, - "Name": "xray", - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "CW_CONFIG_CONTENT", - "Value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ], - "Essential": true, - "Image": "amazon/cloudwatch-agent:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "cloudwatch-agent", - "User": "0:1338" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "greetertaskdefinitionExecutionRoleAED0EC79", - "Arn" - ] - }, - "Family": "awsecsinteggreetertaskdefinitionB95239FB", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "greetertaskdefinitionTaskRole2A098ACC", - "Arn" - ] - } - } - }, - "greetertaskdefinitionenvoyLogGroup6E10B93E": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetertaskdefinitionExecutionRoleAED0EC79": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "greetertaskdefinitionExecutionRoleDefaultPolicy0D8E9106": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "greeterenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionenvoyLogGroup6E10B93E", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionfirelensLogGroupD5BAAC35", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionxrayLogGroupBC1558B6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetertaskdefinitionExecutionRoleDefaultPolicy0D8E9106", - "Roles": [ - { - "Ref": "greetertaskdefinitionExecutionRoleAED0EC79" - } - ] - } - }, - "greetertaskdefinitionfirelensLogGroupD5BAAC35": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetertaskdefinitionxrayLogGroupBC1558B6": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greeterenvoytoappmesh1A94938B": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greeterenvoytoappmesh1A94938B", - "Roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "greeterpublishmetrics0CCA359A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greeterpublishmetrics0CCA359A", - "Roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "greeterserviceService8EDD3244": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 150, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 2, - "EnableECSManagedTags": false, - "HealthCheckGracePeriodSeconds": 60, - "LaunchType": "FARGATE", - "LoadBalancers": [ - { - "ContainerName": "app", - "ContainerPort": 80, - "TargetGroupArn": { - "Ref": "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2" - } - } - ], - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "greeterserviceCloudmapServiceEE292978", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "greetertaskdefinitionE956EEA2" - } - }, - "DependsOn": [ - "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2", - "greeterloadbalancergreeterlistener952E028B" - ] - }, - "greeterserviceCloudmapServiceEE292978": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "greeter", - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "greeterserviceSecurityGroupDB4AC3A9": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/greeter-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "greeterserviceSecurityGroupfromawsecsinteggreeterloadbalancerSecurityGroupF791FA838037FDF8F5": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "IpProtocol": "tcp", - "Description": "Load balancer to target", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - }, - "ToPort": 80 - } - }, - "greeterserviceTaskCountTargetAB95B3D0": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 8, - "MinCapacity": 2, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "greeterserviceService8EDD3244", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "greeterserviceTaskCountTargetgreetertargetcpuutilization50299508D1": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsinteggreeterserviceTaskCountTargetgreetertargetcpuutilization50A75D0C0D", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "greeterserviceTaskCountTargetAB95B3D0" - }, - "TargetTrackingScalingPolicyConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "ScaleInCooldown": 60, - "ScaleOutCooldown": 60, - "TargetValue": 50 - } - } - }, - "greetervirtualnode21EA7CC9": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Backends": [ - { - "VirtualService": { - "VirtualServiceName": "name.production" - } - }, - { - "VirtualService": { - "VirtualServiceName": "greeting.production" - } - } - ], - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "production", - "ServiceName": { - "Fn::GetAtt": [ - "greeterserviceCloudmapServiceEE292978", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "greeter" - } - }, - "greetervirtualrouter193840BB": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "greeter" - } - }, - "greetervirtualroutergreeterroute3EC6ACB0": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "greetervirtualnode21EA7CC9", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "greetervirtualrouter193840BB", - "VirtualRouterName" - ] - }, - "RouteName": "greeter-route" - } - }, - "greetervirtualservice6559950C": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "greetervirtualrouter193840BB", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "greeter.production" - } - } - }, - "Mappings": { - "nameenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - }, - "greetingenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - }, - "greeterenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - } - }, - "Parameters": { - "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/aws/service/aws-for-fluent-bit/latest" - } - }, - "Outputs": { - "greeterloadbalancerdnsoutput": { - "Value": { - "Fn::GetAtt": [ - "greeterloadbalancer85256741", - "DNSName" - ] - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/cdk.out b/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/cdk.out deleted file mode 100644 index 588d7b269d34f..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/integ.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/integ.json deleted file mode 100644 index ac45f4b794326..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/integ.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "20.0.0", - "testCases": { - "integ.all-service-addons": { - "stacks": [ - "aws-ecs-integ" - ], - "diffAssets": false, - "stackUpdateWorkflow": true - } - }, - "synthContext": {}, - "enableLookups": false -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/manifest.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/manifest.json deleted file mode 100644 index 11a8c51ac58ac..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/manifest.json +++ /dev/null @@ -1,644 +0,0 @@ -{ - "version": "20.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "aws-ecs-integ": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "aws-ecs-integ.template.json", - "validateOnSynth": false - }, - "metadata": { - "/aws-ecs-integ/my-mesh/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "mymeshEA67EDEF" - } - ], - "/aws-ecs-integ/production-environment-vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcAEB47DF7" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1EIP54BA88DB" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2EIP14CA46AA" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1" - } - ], - "/aws-ecs-integ/production-environment-vpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcIGWE7C39890" - } - ], - "/aws-ecs-integ/production-environment-vpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcVPCGW1B428D07" - } - ], - "/aws-ecs-integ/production-environment-cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentclusterC6599D2D" - } - ], - "/aws-ecs-integ/production-environment-cluster/DefaultServiceDiscoveryNamespace/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D" - } - ], - "/aws-ecs-integ/name-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namelogsF4B17D31" - } - ], - "/aws-ecs-integ/name-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionTaskRole50FE844E" - } - ], - "/aws-ecs-integ/name-task-definition/TaskRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionTaskRoleDefaultPolicyE66EDC68" - } - ], - "/aws-ecs-integ/name-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinition690762BB" - } - ], - "/aws-ecs-integ/name-task-definition/envoy/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionenvoyLogGroup258B673B" - } - ], - "/aws-ecs-integ/name-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionExecutionRole45AC5C9A" - } - ], - "/aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20" - } - ], - "/aws-ecs-integ/name-task-definition/firelens/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionfirelensLogGroup80DDA60F" - } - ], - "/aws-ecs-integ/name-task-definition/xray/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionxrayLogGroup4AF4CA37" - } - ], - "/aws-ecs-integ/name-task-definition/cloudwatch-agent/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitioncloudwatchagentLogGroup78DDC685" - } - ], - "/aws-ecs-integ/name-envoy-image-account-mapping": [ - { - "type": "aws:cdk:logicalId", - "data": "nameenvoyimageaccountmapping" - } - ], - "/aws-ecs-integ/name-envoy-to-appmesh/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameenvoytoappmesh2767D3E6" - } - ], - "/aws-ecs-integ/SsmParameterValue:--aws--service--aws-for-fluent-bit--latest:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ - { - "type": "aws:cdk:logicalId", - "data": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - } - ], - "/aws-ecs-integ/name-publish-metrics/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namepublishmetricsF329C7AE" - } - ], - "/aws-ecs-integ/name-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceService8015C8D6" - } - ], - "/aws-ecs-integ/name-service/CloudmapService/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceCloudmapService3D5B0548" - } - ], - "/aws-ecs-integ/name-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceSecurityGroup33F4662C" - } - ], - "/aws-ecs-integ/name-service/SecurityGroup/from awsecsinteggreeterserviceSecurityGroup055DC23B:80": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceSecurityGroupfromawsecsinteggreeterserviceSecurityGroup055DC23B8048057EFF" - } - ], - "/aws-ecs-integ/name-service/TaskCount/Target/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskCountTarget366C2B3A" - } - ], - "/aws-ecs-integ/name-service/TaskCount/Target/name-target-cpu-utilization-50/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskCountTargetnametargetcpuutilization5018B16243" - } - ], - "/aws-ecs-integ/name-virtual-node/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namevirtualnode6C99CB14" - } - ], - "/aws-ecs-integ/name-virtual-router/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namevirtualrouterC00E1ACE" - } - ], - "/aws-ecs-integ/name-virtual-router/name-route/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namevirtualrouternamerouteDCDF3715" - } - ], - "/aws-ecs-integ/name-virtual-service/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namevirtualservice3DDDDF1E" - } - ], - "/aws-ecs-integ/greeting-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetinglogsCC360934" - } - ], - "/aws-ecs-integ/greeting-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinitionTaskRole9179DA4A" - } - ], - "/aws-ecs-integ/greeting-task-definition/TaskRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinitionTaskRoleDefaultPolicy5DB4510A" - } - ], - "/aws-ecs-integ/greeting-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinition31690093" - } - ], - "/aws-ecs-integ/greeting-task-definition/envoy/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinitionenvoyLogGroup6556AC35" - } - ], - "/aws-ecs-integ/greeting-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinitionExecutionRole9E3A7CF3" - } - ], - "/aws-ecs-integ/greeting-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinitionExecutionRoleDefaultPolicy31B93022" - } - ], - "/aws-ecs-integ/greeting-task-definition/firelens/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinitionfirelensLogGroupD7A398A7" - } - ], - "/aws-ecs-integ/greeting-task-definition/xray/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinitionxrayLogGroupD25C072D" - } - ], - "/aws-ecs-integ/greeting-task-definition/cloudwatch-agent/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742" - } - ], - "/aws-ecs-integ/greeting-envoy-image-account-mapping": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingenvoyimageaccountmapping" - } - ], - "/aws-ecs-integ/greeting-envoy-to-appmesh/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingenvoytoappmesh97051B23" - } - ], - "/aws-ecs-integ/greeting-publish-metrics/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingpublishmetricsF17124EF" - } - ], - "/aws-ecs-integ/greeting-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingserviceService8DA58640" - } - ], - "/aws-ecs-integ/greeting-service/CloudmapService/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingserviceCloudmapService0A2D7385" - } - ], - "/aws-ecs-integ/greeting-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingserviceSecurityGroupE9BE665B" - } - ], - "/aws-ecs-integ/greeting-service/SecurityGroup/from awsecsinteggreeterserviceSecurityGroup055DC23B:80": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingserviceSecurityGroupfromawsecsinteggreeterserviceSecurityGroup055DC23B807B9C4357" - } - ], - "/aws-ecs-integ/greeting-service/TaskCount/Target/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingserviceTaskCountTargetA036048C" - } - ], - "/aws-ecs-integ/greeting-service/TaskCount/Target/greeting-target-cpu-utilization-50/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingserviceTaskCountTargetgreetingtargetcpuutilization50FEAF6434" - } - ], - "/aws-ecs-integ/greeting-virtual-node/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingvirtualnodeC4A2C517" - } - ], - "/aws-ecs-integ/greeting-virtual-router/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingvirtualrouter0F898D1A" - } - ], - "/aws-ecs-integ/greeting-virtual-router/greeting-route/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingvirtualroutergreetingroute46305F50" - } - ], - "/aws-ecs-integ/greeting-virtual-service/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetingvirtualservice60AD3AD9" - } - ], - "/aws-ecs-integ/greeter-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterlogsCCD2F8B2" - } - ], - "/aws-ecs-integ/greeter-load-balancer/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterloadbalancer85256741" - } - ], - "/aws-ecs-integ/greeter-load-balancer/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterloadbalancerSecurityGroupEE1B20F3" - } - ], - "/aws-ecs-integ/greeter-load-balancer/SecurityGroup/to awsecsinteggreeterserviceSecurityGroup055DC23B:80": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterloadbalancerSecurityGrouptoawsecsinteggreeterserviceSecurityGroup055DC23B803EEF3320" - } - ], - "/aws-ecs-integ/greeter-load-balancer/greeter-listener/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterloadbalancergreeterlistener952E028B" - } - ], - "/aws-ecs-integ/greeter-load-balancer/greeter-listener/greeterGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2" - } - ], - "/aws-ecs-integ/greeter-load-balancer-dns-output": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterloadbalancerdnsoutput" - } - ], - "/aws-ecs-integ/greeter-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitionTaskRole2A098ACC" - } - ], - "/aws-ecs-integ/greeter-task-definition/TaskRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitionTaskRoleDefaultPolicyD0F53B1C" - } - ], - "/aws-ecs-integ/greeter-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitionE956EEA2" - } - ], - "/aws-ecs-integ/greeter-task-definition/envoy/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitionenvoyLogGroup6E10B93E" - } - ], - "/aws-ecs-integ/greeter-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitionExecutionRoleAED0EC79" - } - ], - "/aws-ecs-integ/greeter-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitionExecutionRoleDefaultPolicy0D8E9106" - } - ], - "/aws-ecs-integ/greeter-task-definition/firelens/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitionfirelensLogGroupD5BAAC35" - } - ], - "/aws-ecs-integ/greeter-task-definition/xray/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitionxrayLogGroupBC1558B6" - } - ], - "/aws-ecs-integ/greeter-task-definition/cloudwatch-agent/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327" - } - ], - "/aws-ecs-integ/greeter-envoy-image-account-mapping": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterenvoyimageaccountmapping" - } - ], - "/aws-ecs-integ/greeter-envoy-to-appmesh/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterenvoytoappmesh1A94938B" - } - ], - "/aws-ecs-integ/greeter-publish-metrics/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterpublishmetrics0CCA359A" - } - ], - "/aws-ecs-integ/greeter-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterserviceService8EDD3244" - } - ], - "/aws-ecs-integ/greeter-service/CloudmapService/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterserviceCloudmapServiceEE292978" - } - ], - "/aws-ecs-integ/greeter-service/SecurityGroup": [ - { - "type": "aws:cdk:warning", - "data": "Ignoring Egress rule since 'allowAllOutbound' is set to true; To add customized rules, set allowAllOutbound=false on the SecurityGroup" - }, - { - "type": "aws:cdk:warning", - "data": "Ignoring Egress rule since 'allowAllOutbound' is set to true; To add customized rules, set allowAllOutbound=false on the SecurityGroup" - } - ], - "/aws-ecs-integ/greeter-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterserviceSecurityGroupDB4AC3A9" - } - ], - "/aws-ecs-integ/greeter-service/SecurityGroup/from awsecsinteggreeterloadbalancerSecurityGroupF791FA83:80": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterserviceSecurityGroupfromawsecsinteggreeterloadbalancerSecurityGroupF791FA838037FDF8F5" - } - ], - "/aws-ecs-integ/greeter-service/TaskCount/Target/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterserviceTaskCountTargetAB95B3D0" - } - ], - "/aws-ecs-integ/greeter-service/TaskCount/Target/greeter-target-cpu-utilization-50/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greeterserviceTaskCountTargetgreetertargetcpuutilization50299508D1" - } - ], - "/aws-ecs-integ/greeter-virtual-node/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetervirtualnode21EA7CC9" - } - ], - "/aws-ecs-integ/greeter-virtual-router/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetervirtualrouter193840BB" - } - ], - "/aws-ecs-integ/greeter-virtual-router/greeter-route/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetervirtualroutergreeterroute3EC6ACB0" - } - ], - "/aws-ecs-integ/greeter-virtual-service/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "greetervirtualservice6559950C" - } - ] - }, - "displayName": "aws-ecs-integ" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/tree.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/tree.json deleted file mode 100644 index 3a7fcab3b79a5..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/all-service-addons.integ.snapshot/tree.json +++ /dev/null @@ -1,4945 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "aws-ecs-integ": { - "id": "aws-ecs-integ", - "path": "aws-ecs-integ", - "children": { - "my-mesh": { - "id": "my-mesh", - "path": "aws-ecs-integ/my-mesh", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/my-mesh/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::Mesh", - "aws:cdk:cloudformation:props": { - "meshName": "awsecsintegmymeshFCC0D554", - "spec": {} - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnMesh", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.Mesh", - "version": "0.0.0" - } - }, - "production": { - "id": "production", - "path": "aws-ecs-integ/production", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "production-environment-vpc": { - "id": "production-environment-vpc", - "path": "aws-ecs-integ/production-environment-vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "allocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.64.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "allocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.192.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "aws-ecs-integ/production-environment-vpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "aws-ecs-integ/production-environment-vpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "internetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "production-environment-cluster": { - "id": "production-environment-cluster", - "path": "aws-ecs-integ/production-environment-cluster", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnCluster", - "version": "0.0.0" - } - }, - "DefaultServiceDiscoveryNamespace": { - "id": "DefaultServiceDiscoveryNamespace", - "path": "aws-ecs-integ/production-environment-cluster/DefaultServiceDiscoveryNamespace", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-cluster/DefaultServiceDiscoveryNamespace/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "aws:cdk:cloudformation:props": { - "name": "production", - "vpc": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnPrivateDnsNamespace", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.PrivateDnsNamespace", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.Cluster", - "version": "0.0.0" - } - }, - "name": { - "id": "name", - "path": "aws-ecs-integ/name", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "name-logs": { - "id": "name-logs", - "path": "aws-ecs-integ/name-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "name-logs", - "retentionInDays": 7 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "name-task-definition": { - "id": "name-task-definition", - "path": "aws-ecs-integ/name-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/name-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-task-definition/TaskRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/TaskRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "nametaskdefinitionTaskRoleDefaultPolicyE66EDC68", - "roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 1024, - "dependsOn": [ - { - "containerName": "firelens", - "condition": "START" - }, - { - "containerName": "envoy", - "condition": "HEALTHY" - }, - { - "containerName": "cloudwatch-agent", - "condition": "START" - }, - { - "containerName": "xray", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "nathanpeck/name", - "memory": 2048, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awsfirelens", - "options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "namelogsF4B17D31" - }, - "log_stream_prefix": "name/" - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - } - ] - }, - { - "essential": true, - "image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "nameenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "memoryReservation": 128, - "name": "envoy", - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "user": "1337", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "nametaskdefinitionenvoyLogGroup258B673B" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "APPMESH_VIRTUAL_NODE_NAME", - "value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/name" - ] - ] - } - }, - { - "name": "AWS_REGION", - "value": { - "Ref": "AWS::Region" - } - }, - { - "name": "ENABLE_ENVOY_STATS_TAGS", - "value": "1" - }, - { - "name": "ENABLE_ENVOY_DOG_STATSD", - "value": "1" - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "interval": 5, - "retries": 3, - "startPeriod": 10, - "timeout": 2 - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "memoryReservation": 50, - "name": "firelens", - "user": "0:1338", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "nametaskdefinitionfirelensLogGroup80DDA60F" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "firelensConfiguration": { - "type": "fluentbit" - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "amazon/aws-xray-daemon:latest", - "memoryReservation": 256, - "name": "xray", - "user": "1337", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "nametaskdefinitionxrayLogGroup4AF4CA37" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "AWS_REGION", - "value": { - "Ref": "AWS::Region" - } - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "interval": 5, - "retries": 3, - "startPeriod": 10, - "timeout": 2 - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "amazon/cloudwatch-agent:latest", - "memoryReservation": 50, - "name": "cloudwatch-agent", - "user": "0:1338", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "nametaskdefinitioncloudwatchagentLogGroup78DDC685" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "CW_CONFIG_CONTENT", - "value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ] - } - ], - "cpu": "1024", - "executionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "family": "awsecsintegnametaskdefinition0EA6A1A0", - "memory": "2048", - "networkMode": "awsvpc", - "proxyConfiguration": { - "containerName": "envoy", - "proxyConfigurationProperties": [ - { - "name": "AppPorts", - "value": "80" - }, - { - "name": "ProxyEgressPort", - "value": "15001" - }, - { - "name": "ProxyIngressPort", - "value": "15000" - }, - { - "name": "IgnoredUID", - "value": "1337" - }, - { - "name": "IgnoredGID", - "value": "1338" - }, - { - "name": "EgressIgnoredIPs", - "value": "169.254.170.2,169.254.169.254" - } - ], - "type": "APPMESH" - }, - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/name-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "envoy": { - "id": "envoy", - "path": "aws-ecs-integ/name-task-definition/envoy", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/name-task-definition/envoy/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/envoy/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "nameenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nametaskdefinitioncloudwatchagentLogGroup78DDC685", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionenvoyLogGroup258B673B", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionfirelensLogGroup80DDA60F", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionxrayLogGroup4AF4CA37", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "firelens": { - "id": "firelens", - "path": "aws-ecs-integ/name-task-definition/firelens", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/name-task-definition/firelens/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/firelens/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FirelensLogRouter", - "version": "0.0.0" - } - }, - "xray": { - "id": "xray", - "path": "aws-ecs-integ/name-task-definition/xray", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/name-task-definition/xray/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/xray/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "cloudwatch-agent": { - "id": "cloudwatch-agent", - "path": "aws-ecs-integ/name-task-definition/cloudwatch-agent", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/name-task-definition/cloudwatch-agent/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/cloudwatch-agent/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "name-envoy-image-account-mapping": { - "id": "name-envoy-image-account-mapping", - "path": "aws-ecs-integ/name-envoy-image-account-mapping", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnMapping", - "version": "0.0.0" - } - }, - "name-envoy-repo": { - "id": "name-envoy-repo", - "path": "aws-ecs-integ/name-envoy-repo", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecr.RepositoryBase", - "version": "0.0.0" - } - }, - "name-envoy-to-appmesh": { - "id": "name-envoy-to-appmesh", - "path": "aws-ecs-integ/name-envoy-to-appmesh", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-envoy-to-appmesh/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "nameenvoytoappmesh2767D3E6", - "roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "SsmParameterValue:--aws--service--aws-for-fluent-bit--latest:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { - "id": "SsmParameterValue:--aws--service--aws-for-fluent-bit--latest:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-ecs-integ/SsmParameterValue:--aws--service--aws-for-fluent-bit--latest:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "SsmParameterValue:--aws--service--aws-for-fluent-bit--latest:C96584B6-F00A-464E-AD19-53AFF4B05118": { - "id": "SsmParameterValue:--aws--service--aws-for-fluent-bit--latest:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-ecs-integ/SsmParameterValue:--aws--service--aws-for-fluent-bit--latest:C96584B6-F00A-464E-AD19-53AFF4B05118", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "name-publish-metrics": { - "id": "name-publish-metrics", - "path": "aws-ecs-integ/name-publish-metrics", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-publish-metrics/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "namepublishmetricsF329C7AE", - "roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "name-service": { - "id": "name-service", - "path": "aws-ecs-integ/name-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/name-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "deploymentConfiguration": { - "maximumPercent": 150, - "minimumHealthyPercent": 100 - }, - "desiredCount": 2, - "enableEcsManagedTags": false, - "launchType": "FARGATE", - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ] - } - }, - "serviceRegistries": [ - { - "registryArn": { - "Fn::GetAtt": [ - "nameserviceCloudmapService3D5B0548", - "Arn" - ] - } - } - ], - "taskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "CloudmapService": { - "id": "CloudmapService", - "path": "aws-ecs-integ/name-service/CloudmapService", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/CloudmapService/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::Service", - "aws:cdk:cloudformation:props": { - "dnsConfig": { - "dnsRecords": [ - { - "type": "A", - "ttl": 10 - } - ], - "namespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "routingPolicy": "MULTIVALUE" - }, - "healthCheckCustomConfig": { - "failureThreshold": 2 - }, - "name": "name", - "namespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.Service", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/name-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - }, - "from awsecsinteggreeterserviceSecurityGroup055DC23B:80": { - "id": "from awsecsinteggreeterserviceSecurityGroup055DC23B:80", - "path": "aws-ecs-integ/name-service/SecurityGroup/from awsecsinteggreeterserviceSecurityGroup055DC23B:80", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", - "aws:cdk:cloudformation:props": { - "ipProtocol": "tcp", - "description": "Accept inbound traffic from greeter", - "fromPort": 80, - "groupId": { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - }, - "sourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "toPort": 80 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroupIngress", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "ScalingRole": { - "id": "ScalingRole", - "path": "aws-ecs-integ/name-service/ScalingRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "TaskCount": { - "id": "TaskCount", - "path": "aws-ecs-integ/name-service/TaskCount", - "children": { - "Target": { - "id": "Target", - "path": "aws-ecs-integ/name-service/TaskCount/Target", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskCount/Target/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalableTarget", - "aws:cdk:cloudformation:props": { - "maxCapacity": 8, - "minCapacity": 2, - "resourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - ] - ] - }, - "roleArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "scalableDimension": "ecs:service:DesiredCount", - "serviceNamespace": "ecs" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalableTarget", - "version": "0.0.0" - } - }, - "name-target-cpu-utilization-50": { - "id": "name-target-cpu-utilization-50", - "path": "aws-ecs-integ/name-service/TaskCount/Target/name-target-cpu-utilization-50", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskCount/Target/name-target-cpu-utilization-50/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "aws:cdk:cloudformation:props": { - "policyName": "awsecsintegnameserviceTaskCountTargetnametargetcpuutilization50CAB59E05", - "policyType": "TargetTrackingScaling", - "scalingTargetId": { - "Ref": "nameserviceTaskCountTarget366C2B3A" - }, - "targetTrackingScalingPolicyConfiguration": { - "predefinedMetricSpecification": { - "predefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "scaleInCooldown": 60, - "scaleOutCooldown": 60, - "targetValue": 50 - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.ScalableTarget", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ScalableTaskCount", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - }, - "name-virtual-node": { - "id": "name-virtual-node", - "path": "aws-ecs-integ/name-virtual-node", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-virtual-node/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualNode", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ], - "serviceDiscovery": { - "awsCloudMap": { - "namespaceName": "production", - "serviceName": { - "Fn::GetAtt": [ - "nameserviceCloudmapService3D5B0548", - "Name" - ] - } - } - } - }, - "virtualNodeName": "name" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualNode", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualNode", - "version": "0.0.0" - } - }, - "name-virtual-router": { - "id": "name-virtual-router", - "path": "aws-ecs-integ/name-virtual-router", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-virtual-router/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualRouter", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ] - }, - "virtualRouterName": "name" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualRouter", - "version": "0.0.0" - } - }, - "name-route": { - "id": "name-route", - "path": "aws-ecs-integ/name-virtual-router/name-route", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-virtual-router/name-route/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::Route", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "httpRoute": { - "action": { - "weightedTargets": [ - { - "virtualNode": { - "Fn::GetAtt": [ - "namevirtualnode6C99CB14", - "VirtualNodeName" - ] - }, - "weight": 1 - } - ] - }, - "match": { - "prefix": "/" - } - } - }, - "virtualRouterName": { - "Fn::GetAtt": [ - "namevirtualrouterC00E1ACE", - "VirtualRouterName" - ] - }, - "routeName": "name-route" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.Route", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualRouter", - "version": "0.0.0" - } - }, - "name-virtual-service": { - "id": "name-virtual-service", - "path": "aws-ecs-integ/name-virtual-service", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-virtual-service/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualService", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "provider": { - "virtualRouter": { - "virtualRouterName": { - "Fn::GetAtt": [ - "namevirtualrouterC00E1ACE", - "VirtualRouterName" - ] - } - } - } - }, - "virtualServiceName": "name.production" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualService", - "version": "0.0.0" - } - }, - "greeting": { - "id": "greeting", - "path": "aws-ecs-integ/greeting", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "greeting-logs": { - "id": "greeting-logs", - "path": "aws-ecs-integ/greeting-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "greeting-logs", - "retentionInDays": 7 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "greeting-task-definition": { - "id": "greeting-task-definition", - "path": "aws-ecs-integ/greeting-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/greeting-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/greeting-task-definition/TaskRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/TaskRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "greetingtaskdefinitionTaskRoleDefaultPolicy5DB4510A", - "roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 1024, - "dependsOn": [ - { - "containerName": "firelens", - "condition": "START" - }, - { - "containerName": "envoy", - "condition": "HEALTHY" - }, - { - "containerName": "cloudwatch-agent", - "condition": "START" - }, - { - "containerName": "xray", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "nathanpeck/greeting", - "memory": 2048, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awsfirelens", - "options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "greetinglogsCC360934" - }, - "log_stream_prefix": "greeting/" - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - } - ] - }, - { - "essential": true, - "image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "greetingenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "memoryReservation": 128, - "name": "envoy", - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "user": "1337", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionenvoyLogGroup6556AC35" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "APPMESH_VIRTUAL_NODE_NAME", - "value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/greeting" - ] - ] - } - }, - { - "name": "AWS_REGION", - "value": { - "Ref": "AWS::Region" - } - }, - { - "name": "ENABLE_ENVOY_STATS_TAGS", - "value": "1" - }, - { - "name": "ENABLE_ENVOY_DOG_STATSD", - "value": "1" - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "interval": 5, - "retries": 3, - "startPeriod": 10, - "timeout": 2 - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "memoryReservation": 50, - "name": "firelens", - "user": "0:1338", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionfirelensLogGroupD7A398A7" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "firelensConfiguration": { - "type": "fluentbit" - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "amazon/aws-xray-daemon:latest", - "memoryReservation": 256, - "name": "xray", - "user": "1337", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionxrayLogGroupD25C072D" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "AWS_REGION", - "value": { - "Ref": "AWS::Region" - } - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "interval": 5, - "retries": 3, - "startPeriod": 10, - "timeout": 2 - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "amazon/cloudwatch-agent:latest", - "memoryReservation": 50, - "name": "cloudwatch-agent", - "user": "0:1338", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "CW_CONFIG_CONTENT", - "value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ] - } - ], - "cpu": "1024", - "executionRoleArn": { - "Fn::GetAtt": [ - "greetingtaskdefinitionExecutionRole9E3A7CF3", - "Arn" - ] - }, - "family": "awsecsinteggreetingtaskdefinitionA6E8A57B", - "memory": "2048", - "networkMode": "awsvpc", - "proxyConfiguration": { - "containerName": "envoy", - "proxyConfigurationProperties": [ - { - "name": "AppPorts", - "value": "80" - }, - { - "name": "ProxyEgressPort", - "value": "15001" - }, - { - "name": "ProxyIngressPort", - "value": "15000" - }, - { - "name": "IgnoredUID", - "value": "1337" - }, - { - "name": "IgnoredGID", - "value": "1338" - }, - { - "name": "EgressIgnoredIPs", - "value": "169.254.170.2,169.254.169.254" - } - ], - "type": "APPMESH" - }, - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "greetingtaskdefinitionTaskRole9179DA4A", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/greeting-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "envoy": { - "id": "envoy", - "path": "aws-ecs-integ/greeting-task-definition/envoy", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/greeting-task-definition/envoy/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/envoy/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/greeting-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/greeting-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "greetingenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionenvoyLogGroup6556AC35", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionfirelensLogGroupD7A398A7", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionxrayLogGroupD25C072D", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "greetingtaskdefinitionExecutionRoleDefaultPolicy31B93022", - "roles": [ - { - "Ref": "greetingtaskdefinitionExecutionRole9E3A7CF3" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "firelens": { - "id": "firelens", - "path": "aws-ecs-integ/greeting-task-definition/firelens", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/greeting-task-definition/firelens/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/firelens/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FirelensLogRouter", - "version": "0.0.0" - } - }, - "xray": { - "id": "xray", - "path": "aws-ecs-integ/greeting-task-definition/xray", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/greeting-task-definition/xray/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/xray/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "cloudwatch-agent": { - "id": "cloudwatch-agent", - "path": "aws-ecs-integ/greeting-task-definition/cloudwatch-agent", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/greeting-task-definition/cloudwatch-agent/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-task-definition/cloudwatch-agent/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "greeting-envoy-image-account-mapping": { - "id": "greeting-envoy-image-account-mapping", - "path": "aws-ecs-integ/greeting-envoy-image-account-mapping", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnMapping", - "version": "0.0.0" - } - }, - "greeting-envoy-repo": { - "id": "greeting-envoy-repo", - "path": "aws-ecs-integ/greeting-envoy-repo", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecr.RepositoryBase", - "version": "0.0.0" - } - }, - "greeting-envoy-to-appmesh": { - "id": "greeting-envoy-to-appmesh", - "path": "aws-ecs-integ/greeting-envoy-to-appmesh", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-envoy-to-appmesh/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "greetingenvoytoappmesh97051B23", - "roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "greeting-publish-metrics": { - "id": "greeting-publish-metrics", - "path": "aws-ecs-integ/greeting-publish-metrics", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-publish-metrics/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "greetingpublishmetricsF17124EF", - "roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "greeting-service": { - "id": "greeting-service", - "path": "aws-ecs-integ/greeting-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/greeting-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "deploymentConfiguration": { - "maximumPercent": 150, - "minimumHealthyPercent": 100 - }, - "desiredCount": 2, - "enableEcsManagedTags": false, - "launchType": "FARGATE", - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "greetingserviceSecurityGroupE9BE665B", - "GroupId" - ] - } - ] - } - }, - "serviceRegistries": [ - { - "registryArn": { - "Fn::GetAtt": [ - "greetingserviceCloudmapService0A2D7385", - "Arn" - ] - } - } - ], - "taskDefinition": { - "Ref": "greetingtaskdefinition31690093" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "CloudmapService": { - "id": "CloudmapService", - "path": "aws-ecs-integ/greeting-service/CloudmapService", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-service/CloudmapService/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::Service", - "aws:cdk:cloudformation:props": { - "dnsConfig": { - "dnsRecords": [ - { - "type": "A", - "ttl": 10 - } - ], - "namespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "routingPolicy": "MULTIVALUE" - }, - "healthCheckCustomConfig": { - "failureThreshold": 2 - }, - "name": "greeting", - "namespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.Service", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/greeting-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/greeting-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - }, - "from awsecsinteggreeterserviceSecurityGroup055DC23B:80": { - "id": "from awsecsinteggreeterserviceSecurityGroup055DC23B:80", - "path": "aws-ecs-integ/greeting-service/SecurityGroup/from awsecsinteggreeterserviceSecurityGroup055DC23B:80", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", - "aws:cdk:cloudformation:props": { - "ipProtocol": "tcp", - "description": "Accept inbound traffic from greeter", - "fromPort": 80, - "groupId": { - "Fn::GetAtt": [ - "greetingserviceSecurityGroupE9BE665B", - "GroupId" - ] - }, - "sourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "toPort": 80 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroupIngress", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "ScalingRole": { - "id": "ScalingRole", - "path": "aws-ecs-integ/greeting-service/ScalingRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "TaskCount": { - "id": "TaskCount", - "path": "aws-ecs-integ/greeting-service/TaskCount", - "children": { - "Target": { - "id": "Target", - "path": "aws-ecs-integ/greeting-service/TaskCount/Target", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-service/TaskCount/Target/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalableTarget", - "aws:cdk:cloudformation:props": { - "maxCapacity": 8, - "minCapacity": 2, - "resourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "greetingserviceService8DA58640", - "Name" - ] - } - ] - ] - }, - "roleArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "scalableDimension": "ecs:service:DesiredCount", - "serviceNamespace": "ecs" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalableTarget", - "version": "0.0.0" - } - }, - "greeting-target-cpu-utilization-50": { - "id": "greeting-target-cpu-utilization-50", - "path": "aws-ecs-integ/greeting-service/TaskCount/Target/greeting-target-cpu-utilization-50", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-service/TaskCount/Target/greeting-target-cpu-utilization-50/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "aws:cdk:cloudformation:props": { - "policyName": "awsecsinteggreetingserviceTaskCountTargetgreetingtargetcpuutilization504C76B1F4", - "policyType": "TargetTrackingScaling", - "scalingTargetId": { - "Ref": "greetingserviceTaskCountTargetA036048C" - }, - "targetTrackingScalingPolicyConfiguration": { - "predefinedMetricSpecification": { - "predefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "scaleInCooldown": 60, - "scaleOutCooldown": 60, - "targetValue": 50 - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.ScalableTarget", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ScalableTaskCount", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - }, - "greeting-virtual-node": { - "id": "greeting-virtual-node", - "path": "aws-ecs-integ/greeting-virtual-node", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-virtual-node/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualNode", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ], - "serviceDiscovery": { - "awsCloudMap": { - "namespaceName": "production", - "serviceName": { - "Fn::GetAtt": [ - "greetingserviceCloudmapService0A2D7385", - "Name" - ] - } - } - } - }, - "virtualNodeName": "greeting" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualNode", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualNode", - "version": "0.0.0" - } - }, - "greeting-virtual-router": { - "id": "greeting-virtual-router", - "path": "aws-ecs-integ/greeting-virtual-router", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-virtual-router/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualRouter", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ] - }, - "virtualRouterName": "greeting" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualRouter", - "version": "0.0.0" - } - }, - "greeting-route": { - "id": "greeting-route", - "path": "aws-ecs-integ/greeting-virtual-router/greeting-route", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-virtual-router/greeting-route/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::Route", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "httpRoute": { - "action": { - "weightedTargets": [ - { - "virtualNode": { - "Fn::GetAtt": [ - "greetingvirtualnodeC4A2C517", - "VirtualNodeName" - ] - }, - "weight": 1 - } - ] - }, - "match": { - "prefix": "/" - } - } - }, - "virtualRouterName": { - "Fn::GetAtt": [ - "greetingvirtualrouter0F898D1A", - "VirtualRouterName" - ] - }, - "routeName": "greeting-route" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.Route", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualRouter", - "version": "0.0.0" - } - }, - "greeting-virtual-service": { - "id": "greeting-virtual-service", - "path": "aws-ecs-integ/greeting-virtual-service", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeting-virtual-service/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualService", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "provider": { - "virtualRouter": { - "virtualRouterName": { - "Fn::GetAtt": [ - "greetingvirtualrouter0F898D1A", - "VirtualRouterName" - ] - } - } - } - }, - "virtualServiceName": "greeting.production" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualService", - "version": "0.0.0" - } - }, - "greeter": { - "id": "greeter", - "path": "aws-ecs-integ/greeter", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "greeter-logs": { - "id": "greeter-logs", - "path": "aws-ecs-integ/greeter-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "greeter-logs", - "retentionInDays": 7 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "greeter-load-balancer": { - "id": "greeter-load-balancer", - "path": "aws-ecs-integ/greeter-load-balancer", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-load-balancer/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "aws:cdk:cloudformation:props": { - "loadBalancerAttributes": [ - { - "key": "deletion_protection.enabled", - "value": "false" - } - ], - "scheme": "internet-facing", - "securityGroups": [ - { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - } - ], - "subnets": [ - { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - ], - "type": "application" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-elasticloadbalancingv2.CfnLoadBalancer", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/greeter-load-balancer/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-load-balancer/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "Automatically created Security Group for ELB awsecsinteggreeterloadbalancer147D1D5C", - "securityGroupIngress": [ - { - "cidrIp": "0.0.0.0/0", - "ipProtocol": "tcp", - "fromPort": 80, - "toPort": 80, - "description": "Allow from anyone on port 80" - } - ], - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - }, - "to awsecsinteggreeterserviceSecurityGroup055DC23B:80": { - "id": "to awsecsinteggreeterserviceSecurityGroup055DC23B:80", - "path": "aws-ecs-integ/greeter-load-balancer/SecurityGroup/to awsecsinteggreeterserviceSecurityGroup055DC23B:80", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupEgress", - "aws:cdk:cloudformation:props": { - "groupId": { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - }, - "ipProtocol": "tcp", - "description": "Load balancer to target", - "destinationSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "fromPort": 80, - "toPort": 80 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroupEgress", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "greeter-listener": { - "id": "greeter-listener", - "path": "aws-ecs-integ/greeter-load-balancer/greeter-listener", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-load-balancer/greeter-listener/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::Listener", - "aws:cdk:cloudformation:props": { - "defaultActions": [ - { - "type": "forward", - "targetGroupArn": { - "Ref": "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2" - } - } - ], - "loadBalancerArn": { - "Ref": "greeterloadbalancer85256741" - }, - "port": 80, - "protocol": "HTTP" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-elasticloadbalancingv2.CfnListener", - "version": "0.0.0" - } - }, - "greeterGroup": { - "id": "greeterGroup", - "path": "aws-ecs-integ/greeter-load-balancer/greeter-listener/greeterGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-load-balancer/greeter-listener/greeterGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "aws:cdk:cloudformation:props": { - "port": 80, - "protocol": "HTTP", - "targetGroupAttributes": [ - { - "key": "deregistration_delay.timeout_seconds", - "value": "10" - }, - { - "key": "stickiness.enabled", - "value": "false" - } - ], - "targetType": "ip", - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-elasticloadbalancingv2.CfnTargetGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-elasticloadbalancingv2.ApplicationListener", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-elasticloadbalancingv2.ApplicationLoadBalancer", - "version": "0.0.0" - } - }, - "greeter-load-balancer-dns-output": { - "id": "greeter-load-balancer-dns-output", - "path": "aws-ecs-integ/greeter-load-balancer-dns-output", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "greeter-task-definition": { - "id": "greeter-task-definition", - "path": "aws-ecs-integ/greeter-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/greeter-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/greeter-task-definition/TaskRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/TaskRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "greetertaskdefinitionTaskRoleDefaultPolicyD0F53B1C", - "roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 1024, - "dependsOn": [ - { - "containerName": "firelens", - "condition": "START" - }, - { - "containerName": "envoy", - "condition": "HEALTHY" - }, - { - "containerName": "cloudwatch-agent", - "condition": "START" - }, - { - "containerName": "xray", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "nathanpeck/greeter", - "memory": 2048, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awsfirelens", - "options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "greeterlogsCCD2F8B2" - }, - "log_stream_prefix": "greeter/" - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - }, - { - "name": "GREETING_URL", - "value": "http://greeting.production" - }, - { - "name": "NAME_URL", - "value": "http://name.production" - } - ] - }, - { - "essential": true, - "image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "greeterenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "memoryReservation": 128, - "name": "envoy", - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "user": "1337", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionenvoyLogGroup6E10B93E" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "APPMESH_VIRTUAL_NODE_NAME", - "value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/greeter" - ] - ] - } - }, - { - "name": "AWS_REGION", - "value": { - "Ref": "AWS::Region" - } - }, - { - "name": "ENABLE_ENVOY_STATS_TAGS", - "value": "1" - }, - { - "name": "ENABLE_ENVOY_DOG_STATSD", - "value": "1" - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "interval": 5, - "retries": 3, - "startPeriod": 10, - "timeout": 2 - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "memoryReservation": 50, - "name": "firelens", - "user": "0:1338", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionfirelensLogGroupD5BAAC35" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "firelensConfiguration": { - "type": "fluentbit" - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "amazon/aws-xray-daemon:latest", - "memoryReservation": 256, - "name": "xray", - "user": "1337", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionxrayLogGroupBC1558B6" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "AWS_REGION", - "value": { - "Ref": "AWS::Region" - } - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "interval": 5, - "retries": 3, - "startPeriod": 10, - "timeout": 2 - } - }, - { - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "amazon/cloudwatch-agent:latest", - "memoryReservation": 50, - "name": "cloudwatch-agent", - "user": "0:1338", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "CW_CONFIG_CONTENT", - "value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ] - } - ], - "cpu": "1024", - "executionRoleArn": { - "Fn::GetAtt": [ - "greetertaskdefinitionExecutionRoleAED0EC79", - "Arn" - ] - }, - "family": "awsecsinteggreetertaskdefinitionB95239FB", - "memory": "2048", - "networkMode": "awsvpc", - "proxyConfiguration": { - "containerName": "envoy", - "proxyConfigurationProperties": [ - { - "name": "AppPorts", - "value": "80" - }, - { - "name": "ProxyEgressPort", - "value": "15001" - }, - { - "name": "ProxyIngressPort", - "value": "15000" - }, - { - "name": "IgnoredUID", - "value": "1337" - }, - { - "name": "IgnoredGID", - "value": "1338" - }, - { - "name": "EgressIgnoredIPs", - "value": "169.254.170.2,169.254.169.254" - } - ], - "type": "APPMESH" - }, - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "greetertaskdefinitionTaskRole2A098ACC", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/greeter-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "envoy": { - "id": "envoy", - "path": "aws-ecs-integ/greeter-task-definition/envoy", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/greeter-task-definition/envoy/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/envoy/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/greeter-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/greeter-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "greeterenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionenvoyLogGroup6E10B93E", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionfirelensLogGroupD5BAAC35", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionxrayLogGroupBC1558B6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "greetertaskdefinitionExecutionRoleDefaultPolicy0D8E9106", - "roles": [ - { - "Ref": "greetertaskdefinitionExecutionRoleAED0EC79" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "firelens": { - "id": "firelens", - "path": "aws-ecs-integ/greeter-task-definition/firelens", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/greeter-task-definition/firelens/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/firelens/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FirelensLogRouter", - "version": "0.0.0" - } - }, - "xray": { - "id": "xray", - "path": "aws-ecs-integ/greeter-task-definition/xray", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/greeter-task-definition/xray/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/xray/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "cloudwatch-agent": { - "id": "cloudwatch-agent", - "path": "aws-ecs-integ/greeter-task-definition/cloudwatch-agent", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/greeter-task-definition/cloudwatch-agent/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-task-definition/cloudwatch-agent/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "greeter-envoy-image-account-mapping": { - "id": "greeter-envoy-image-account-mapping", - "path": "aws-ecs-integ/greeter-envoy-image-account-mapping", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnMapping", - "version": "0.0.0" - } - }, - "greeter-envoy-repo": { - "id": "greeter-envoy-repo", - "path": "aws-ecs-integ/greeter-envoy-repo", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecr.RepositoryBase", - "version": "0.0.0" - } - }, - "greeter-envoy-to-appmesh": { - "id": "greeter-envoy-to-appmesh", - "path": "aws-ecs-integ/greeter-envoy-to-appmesh", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-envoy-to-appmesh/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "greeterenvoytoappmesh1A94938B", - "roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "greeter-publish-metrics": { - "id": "greeter-publish-metrics", - "path": "aws-ecs-integ/greeter-publish-metrics", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-publish-metrics/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "greeterpublishmetrics0CCA359A", - "roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "greeter-service": { - "id": "greeter-service", - "path": "aws-ecs-integ/greeter-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/greeter-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "deploymentConfiguration": { - "maximumPercent": 150, - "minimumHealthyPercent": 100 - }, - "desiredCount": 2, - "enableEcsManagedTags": false, - "healthCheckGracePeriodSeconds": 60, - "launchType": "FARGATE", - "loadBalancers": [ - { - "targetGroupArn": { - "Ref": "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2" - }, - "containerName": "app", - "containerPort": 80 - } - ], - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - } - ] - } - }, - "serviceRegistries": [ - { - "registryArn": { - "Fn::GetAtt": [ - "greeterserviceCloudmapServiceEE292978", - "Arn" - ] - } - } - ], - "taskDefinition": { - "Ref": "greetertaskdefinitionE956EEA2" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "CloudmapService": { - "id": "CloudmapService", - "path": "aws-ecs-integ/greeter-service/CloudmapService", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-service/CloudmapService/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::Service", - "aws:cdk:cloudformation:props": { - "dnsConfig": { - "dnsRecords": [ - { - "type": "A", - "ttl": 10 - } - ], - "namespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "routingPolicy": "MULTIVALUE" - }, - "healthCheckCustomConfig": { - "failureThreshold": 2 - }, - "name": "greeter", - "namespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.Service", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/greeter-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/greeter-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - }, - "from awsecsinteggreeterloadbalancerSecurityGroupF791FA83:80": { - "id": "from awsecsinteggreeterloadbalancerSecurityGroupF791FA83:80", - "path": "aws-ecs-integ/greeter-service/SecurityGroup/from awsecsinteggreeterloadbalancerSecurityGroupF791FA83:80", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", - "aws:cdk:cloudformation:props": { - "ipProtocol": "tcp", - "description": "Load balancer to target", - "fromPort": 80, - "groupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "sourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - }, - "toPort": 80 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroupIngress", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "ScalingRole": { - "id": "ScalingRole", - "path": "aws-ecs-integ/greeter-service/ScalingRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "TaskCount": { - "id": "TaskCount", - "path": "aws-ecs-integ/greeter-service/TaskCount", - "children": { - "Target": { - "id": "Target", - "path": "aws-ecs-integ/greeter-service/TaskCount/Target", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-service/TaskCount/Target/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalableTarget", - "aws:cdk:cloudformation:props": { - "maxCapacity": 8, - "minCapacity": 2, - "resourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "greeterserviceService8EDD3244", - "Name" - ] - } - ] - ] - }, - "roleArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "scalableDimension": "ecs:service:DesiredCount", - "serviceNamespace": "ecs" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalableTarget", - "version": "0.0.0" - } - }, - "greeter-target-cpu-utilization-50": { - "id": "greeter-target-cpu-utilization-50", - "path": "aws-ecs-integ/greeter-service/TaskCount/Target/greeter-target-cpu-utilization-50", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-service/TaskCount/Target/greeter-target-cpu-utilization-50/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "aws:cdk:cloudformation:props": { - "policyName": "awsecsinteggreeterserviceTaskCountTargetgreetertargetcpuutilization50A75D0C0D", - "policyType": "TargetTrackingScaling", - "scalingTargetId": { - "Ref": "greeterserviceTaskCountTargetAB95B3D0" - }, - "targetTrackingScalingPolicyConfiguration": { - "predefinedMetricSpecification": { - "predefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "scaleInCooldown": 60, - "scaleOutCooldown": 60, - "targetValue": 50 - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.ScalableTarget", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ScalableTaskCount", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - }, - "greeter-virtual-node": { - "id": "greeter-virtual-node", - "path": "aws-ecs-integ/greeter-virtual-node", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-virtual-node/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualNode", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "backends": [ - { - "virtualService": { - "virtualServiceName": "name.production" - } - }, - { - "virtualService": { - "virtualServiceName": "greeting.production" - } - } - ], - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ], - "serviceDiscovery": { - "awsCloudMap": { - "namespaceName": "production", - "serviceName": { - "Fn::GetAtt": [ - "greeterserviceCloudmapServiceEE292978", - "Name" - ] - } - } - } - }, - "virtualNodeName": "greeter" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualNode", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualNode", - "version": "0.0.0" - } - }, - "greeter-virtual-router": { - "id": "greeter-virtual-router", - "path": "aws-ecs-integ/greeter-virtual-router", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-virtual-router/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualRouter", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ] - }, - "virtualRouterName": "greeter" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualRouter", - "version": "0.0.0" - } - }, - "greeter-route": { - "id": "greeter-route", - "path": "aws-ecs-integ/greeter-virtual-router/greeter-route", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-virtual-router/greeter-route/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::Route", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "httpRoute": { - "action": { - "weightedTargets": [ - { - "virtualNode": { - "Fn::GetAtt": [ - "greetervirtualnode21EA7CC9", - "VirtualNodeName" - ] - }, - "weight": 1 - } - ] - }, - "match": { - "prefix": "/" - } - } - }, - "virtualRouterName": { - "Fn::GetAtt": [ - "greetervirtualrouter193840BB", - "VirtualRouterName" - ] - }, - "routeName": "greeter-route" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.Route", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualRouter", - "version": "0.0.0" - } - }, - "greeter-virtual-service": { - "id": "greeter-virtual-service", - "path": "aws-ecs-integ/greeter-virtual-service", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/greeter-virtual-service/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualService", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "spec": { - "provider": { - "virtualRouter": { - "virtualRouterName": { - "Fn::GetAtt": [ - "greetervirtualrouter193840BB", - "VirtualRouterName" - ] - } - } - } - }, - "virtualServiceName": "greeter.production" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/appmesh.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/appmesh.test.ts deleted file mode 100644 index 02a572e9e2ced..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/appmesh.test.ts +++ /dev/null @@ -1,562 +0,0 @@ -import { Match, Template } from '@aws-cdk/assertions'; -import * as appmesh from '@aws-cdk/aws-appmesh'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { AppMeshExtension, Container, Environment, ServiceDescription, Service } from '../lib'; - -describe('appmesh', () => { - test('should be able to add AWS App Mesh to a service', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const mesh = new appmesh.Mesh(stack, 'my-mesh'); - - serviceDescription.add(new AppMeshExtension({ - mesh, - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - // Ensure that task has an App Mesh sidecar - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - DependsOn: [ - { - Condition: 'HEALTHY', - ContainerName: 'envoy', - }, - ], - Essential: true, - Image: 'nathanpeck/name', - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - { - Environment: [ - { - Name: 'APPMESH_VIRTUAL_NODE_NAME', - Value: { - 'Fn::Join': [ - '', - [ - 'mesh/', - { - 'Fn::GetAtt': [ - 'mymeshEA67EDEF', - 'MeshName', - ], - }, - '/virtualNode/my-service', - ], - ], - }, - }, - { - Name: 'AWS_REGION', - Value: { - Ref: 'AWS::Region', - }, - }, - { - Name: 'ENABLE_ENVOY_STATS_TAGS', - Value: '1', - }, - { - Name: 'ENABLE_ENVOY_DOG_STATSD', - Value: '1', - }, - ], - Essential: true, - HealthCheck: { - Command: [ - 'CMD-SHELL', - 'curl -s http://localhost:9901/server_info | grep state | grep -q LIVE', - ], - Interval: 5, - Retries: 3, - StartPeriod: 10, - Timeout: 2, - }, - Image: { - 'Fn::Join': [ - '', - [ - { - 'Fn::FindInMap': [ - 'myserviceenvoyimageaccountmapping', - { - Ref: 'AWS::Region', - }, - 'ecrRepo', - ], - }, - '.dkr.ecr.', - { - Ref: 'AWS::Region', - }, - '.', - { - Ref: 'AWS::URLSuffix', - }, - '/aws-appmesh-envoy:v1.15.1.0-prod', - ], - ], - }, - LogConfiguration: { - LogDriver: 'awslogs', - Options: { - 'awslogs-group': { - Ref: 'myservicetaskdefinitionenvoyLogGroup0C27EBDB', - }, - 'awslogs-stream-prefix': 'envoy', - 'awslogs-region': { - Ref: 'AWS::Region', - }, - }, - }, - MemoryReservation: 128, - Name: 'envoy', - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - User: '1337', - }, - ], - Cpu: '256', - ExecutionRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionExecutionRole0CE74AD0', - 'Arn', - ], - }, - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - ProxyConfiguration: { - ContainerName: 'envoy', - ProxyConfigurationProperties: [ - { - Name: 'AppPorts', - Value: '80', - }, - { - Name: 'ProxyEgressPort', - Value: '15001', - }, - { - Name: 'ProxyIngressPort', - Value: '15000', - }, - { - Name: 'IgnoredUID', - Value: '1337', - }, - { - Name: 'IgnoredGID', - Value: '1338', - }, - { - Name: 'EgressIgnoredIPs', - Value: '169.254.170.2,169.254.169.254', - }, - ], - Type: 'APPMESH', - }, - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionTaskRole92ACD903', - 'Arn', - ], - }, - }); - - // Ensure that the service has the right settings - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - Cluster: { - Ref: 'productionenvironmentclusterC6599D2D', - }, - DeploymentConfiguration: { - MaximumPercent: 200, - MinimumHealthyPercent: 100, - }, - DesiredCount: 1, - EnableECSManagedTags: false, - LaunchType: 'FARGATE', - NetworkConfiguration: { - AwsvpcConfiguration: { - AssignPublicIp: 'DISABLED', - SecurityGroups: [ - { - 'Fn::GetAtt': [ - 'myserviceserviceSecurityGroup3A44A969', - 'GroupId', - ], - }, - ], - Subnets: [ - { - Ref: 'productionenvironmentvpcPrivateSubnet1Subnet53F632E6', - }, - { - Ref: 'productionenvironmentvpcPrivateSubnet2Subnet756FB93C', - }, - ], - }, - }, - ServiceRegistries: [ - { - RegistryArn: { - 'Fn::GetAtt': [ - 'myserviceserviceCloudmapService32F63163', - 'Arn', - ], - }, - }, - ], - TaskDefinition: { - Ref: 'myservicetaskdefinitionF3E2D86F', - }, - }); - }); - - test('should have the right maximumPercentage at desired count == 1', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const mesh = new appmesh.Mesh(stack, 'my-mesh'); - - serviceDescription.add(new AppMeshExtension({ - mesh, - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - desiredCount: 1, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DeploymentConfiguration: { - MaximumPercent: 200, - MinimumHealthyPercent: 100, - }, - DesiredCount: 1, - }); - }); - - test('should have the right maximumPercentage at desired count == 2', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const mesh = new appmesh.Mesh(stack, 'my-mesh'); - - serviceDescription.add(new AppMeshExtension({ - mesh, - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - desiredCount: 2, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DeploymentConfiguration: { - MaximumPercent: 150, - MinimumHealthyPercent: 100, - }, - DesiredCount: 2, - }); - }); - - test('should have the right maximumPercentage at desired count == 3', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const mesh = new appmesh.Mesh(stack, 'my-mesh'); - - serviceDescription.add(new AppMeshExtension({ - mesh, - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - desiredCount: 3, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DeploymentConfiguration: { - MaximumPercent: 150, - MinimumHealthyPercent: 100, - }, - DesiredCount: 3, - }); - }); - - test('should have the right maximumPercentage at desired count == 4', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const mesh = new appmesh.Mesh(stack, 'my-mesh'); - - serviceDescription.add(new AppMeshExtension({ - mesh, - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - desiredCount: 4, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DeploymentConfiguration: { - MaximumPercent: 125, - MinimumHealthyPercent: 100, - }, - DesiredCount: 4, - }); - }); - - test('should have the right maximumPercentage at desired count > 4', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const mesh = new appmesh.Mesh(stack, 'my-mesh'); - - serviceDescription.add(new AppMeshExtension({ - mesh, - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - desiredCount: 8, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DeploymentConfiguration: { - MaximumPercent: 125, - MinimumHealthyPercent: 100, - }, - DesiredCount: 8, - }); - }); - - test('should be able to create multiple App Mesh enabled services and connect', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const mesh = new appmesh.Mesh(stack, 'my-mesh'); - const environment = new Environment(stack, 'production'); - - const nameDescription = new ServiceDescription(); - nameDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, - })); - nameDescription.add(new AppMeshExtension({ mesh })); - - const greetingDescription = new ServiceDescription(); - greetingDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/greeting'), - environment: { - PORT: '80', - }, - })); - greetingDescription.add(new AppMeshExtension({ mesh })); - - const greeterDescription = new ServiceDescription(); - greeterDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/greeter'), - environment: { - PORT: '80', - }, - })); - greeterDescription.add(new AppMeshExtension({ mesh })); - - const greeterService = new Service(stack, 'greeter', { - environment, - serviceDescription: greeterDescription, - }); - const greetingService = new Service(stack, 'greeting', { - environment, - serviceDescription: greetingDescription, - }); - const nameService = new Service(stack, 'name', { - environment, - serviceDescription: nameDescription, - }); - - greeterService.connectTo(nameService); - greeterService.connectTo(greetingService); - - // THEN - Template.fromStack(stack).hasResource('AWS::ECS::TaskDefinition', Match.anyValue()); - }); - - test('should detect when attempting to connect services from two different envs', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const production = new Environment(stack, 'production'); - const development = new Environment(stack, 'development'); - - const productionMesh = new appmesh.Mesh(stack, 'production-mesh'); - const developmentMesh = new appmesh.Mesh(stack, 'development-mesh'); - - /** Production name service */ - const productionNameDescription = new ServiceDescription(); - productionNameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, - })); - productionNameDescription.add(new AppMeshExtension({ mesh: productionMesh })); - - const productionNameService = new Service(stack, 'name-production', { - environment: production, - serviceDescription: productionNameDescription, - }); - - /** Development name service */ - const developmentNameDescription = new ServiceDescription(); - developmentNameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, - })); - developmentNameDescription.add(new AppMeshExtension({ mesh: developmentMesh })); - - const developmentNameService = new Service(stack, 'name-development', { - environment: development, - serviceDescription: developmentNameDescription, - }); - - // THEN - expect(() => { - developmentNameService.connectTo(productionNameService); - }).toThrow(/Unable to connect service 'name-development' in environment 'development' to service 'name-production' in environment 'production' because services can not be connected across environment boundaries/); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/cfn-response.js b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/cfn-response.js deleted file mode 100644 index 63bdaab149314..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/cfn-response.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Retry = exports.safeHandler = exports.includeStackTraces = exports.submitResponse = exports.MISSING_PHYSICAL_ID_MARKER = exports.CREATE_FAILED_PHYSICAL_ID_MARKER = void 0; -/* eslint-disable max-len */ -/* eslint-disable no-console */ -const url = require("url"); -const outbound_1 = require("./outbound"); -const util_1 = require("./util"); -exports.CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; -exports.MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; -async function submitResponse(status, event, options = {}) { - const json = { - Status: status, - Reason: options.reason || status, - StackId: event.StackId, - RequestId: event.RequestId, - PhysicalResourceId: event.PhysicalResourceId || exports.MISSING_PHYSICAL_ID_MARKER, - LogicalResourceId: event.LogicalResourceId, - NoEcho: options.noEcho, - Data: event.Data, - }; - util_1.log('submit response to cloudformation', json); - const responseBody = JSON.stringify(json); - const parsedUrl = url.parse(event.ResponseURL); - await outbound_1.httpRequest({ - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': responseBody.length, - }, - }, responseBody); -} -exports.submitResponse = submitResponse; -exports.includeStackTraces = true; // for unit tests -function safeHandler(block) { - return async (event) => { - // ignore DELETE event when the physical resource ID is the marker that - // indicates that this DELETE is a subsequent DELETE to a failed CREATE - // operation. - if (event.RequestType === 'Delete' && event.PhysicalResourceId === exports.CREATE_FAILED_PHYSICAL_ID_MARKER) { - util_1.log('ignoring DELETE event caused by a failed CREATE event'); - await submitResponse('SUCCESS', event); - return; - } - try { - await block(event); - } - catch (e) { - // tell waiter state machine to retry - if (e instanceof Retry) { - util_1.log('retry requested by handler'); - throw e; - } - if (!event.PhysicalResourceId) { - // special case: if CREATE fails, which usually implies, we usually don't - // have a physical resource id. in this case, the subsequent DELETE - // operation does not have any meaning, and will likely fail as well. to - // address this, we use a marker so the provider framework can simply - // ignore the subsequent DELETE. - if (event.RequestType === 'Create') { - util_1.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); - event.PhysicalResourceId = exports.CREATE_FAILED_PHYSICAL_ID_MARKER; - } - else { - // otherwise, if PhysicalResourceId is not specified, something is - // terribly wrong because all other events should have an ID. - util_1.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); - } - } - // this is an actual error, fail the activity altogether and exist. - await submitResponse('FAILED', event, { - reason: exports.includeStackTraces ? e.stack : e.message, - }); - } - }; -} -exports.safeHandler = safeHandler; -class Retry extends Error { -} -exports.Retry = Retry; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2ZuLXJlc3BvbnNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2ZuLXJlc3BvbnNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDRCQUE0QjtBQUM1QiwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBQzNCLHlDQUF5QztBQUN6QyxpQ0FBNkI7QUFFaEIsUUFBQSxnQ0FBZ0MsR0FBRyx3REFBd0QsQ0FBQztBQUM1RixRQUFBLDBCQUEwQixHQUFHLDhEQUE4RCxDQUFDO0FBZ0JsRyxLQUFLLFVBQVUsY0FBYyxDQUFDLE1BQTRCLEVBQUUsS0FBaUMsRUFBRSxVQUF5QyxFQUFHO0lBQ2hKLE1BQU0sSUFBSSxHQUFtRDtRQUMzRCxNQUFNLEVBQUUsTUFBTTtRQUNkLE1BQU0sRUFBRSxPQUFPLENBQUMsTUFBTSxJQUFJLE1BQU07UUFDaEMsT0FBTyxFQUFFLEtBQUssQ0FBQyxPQUFPO1FBQ3RCLFNBQVMsRUFBRSxLQUFLLENBQUMsU0FBUztRQUMxQixrQkFBa0IsRUFBRSxLQUFLLENBQUMsa0JBQWtCLElBQUksa0NBQTBCO1FBQzFFLGlCQUFpQixFQUFFLEtBQUssQ0FBQyxpQkFBaUI7UUFDMUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxNQUFNO1FBQ3RCLElBQUksRUFBRSxLQUFLLENBQUMsSUFBSTtLQUNqQixDQUFDO0lBRUYsVUFBRyxDQUFDLG1DQUFtQyxFQUFFLElBQUksQ0FBQyxDQUFDO0lBRS9DLE1BQU0sWUFBWSxHQUFHLElBQUksQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLENBQUM7SUFFMUMsTUFBTSxTQUFTLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUM7SUFDL0MsTUFBTSxzQkFBVyxDQUFDO1FBQ2hCLFFBQVEsRUFBRSxTQUFTLENBQUMsUUFBUTtRQUM1QixJQUFJLEVBQUUsU0FBUyxDQUFDLElBQUk7UUFDcEIsTUFBTSxFQUFFLEtBQUs7UUFDYixPQUFPLEVBQUU7WUFDUCxjQUFjLEVBQUUsRUFBRTtZQUNsQixnQkFBZ0IsRUFBRSxZQUFZLENBQUMsTUFBTTtTQUN0QztLQUNGLEVBQUUsWUFBWSxDQUFDLENBQUM7QUFDbkIsQ0FBQztBQTFCRCx3Q0EwQkM7QUFFVSxRQUFBLGtCQUFrQixHQUFHLElBQUksQ0FBQyxDQUFDLGlCQUFpQjtBQUV2RCxTQUFnQixXQUFXLENBQUMsS0FBb0M7SUFDOUQsT0FBTyxLQUFLLEVBQUUsS0FBVSxFQUFFLEVBQUU7UUFFMUIsdUVBQXVFO1FBQ3ZFLHVFQUF1RTtRQUN2RSxhQUFhO1FBQ2IsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsSUFBSSxLQUFLLENBQUMsa0JBQWtCLEtBQUssd0NBQWdDLEVBQUU7WUFDbkcsVUFBRyxDQUFDLHVEQUF1RCxDQUFDLENBQUM7WUFDN0QsTUFBTSxjQUFjLENBQUMsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFDO1lBQ3ZDLE9BQU87U0FDUjtRQUVELElBQUk7WUFDRixNQUFNLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQztTQUNwQjtRQUFDLE9BQU8sQ0FBQyxFQUFFO1lBQ1YscUNBQXFDO1lBQ3JDLElBQUksQ0FBQyxZQUFZLEtBQUssRUFBRTtnQkFDdEIsVUFBRyxDQUFDLDRCQUE0QixDQUFDLENBQUM7Z0JBQ2xDLE1BQU0sQ0FBQyxDQUFDO2FBQ1Q7WUFFRCxJQUFJLENBQUMsS0FBSyxDQUFDLGtCQUFrQixFQUFFO2dCQUM3Qix5RUFBeUU7Z0JBQ3pFLG1FQUFtRTtnQkFDbkUsd0VBQXdFO2dCQUN4RSxxRUFBcUU7Z0JBQ3JFLGdDQUFnQztnQkFDaEMsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtvQkFDbEMsVUFBRyxDQUFDLDRHQUE0RyxDQUFDLENBQUM7b0JBQ2xILEtBQUssQ0FBQyxrQkFBa0IsR0FBRyx3Q0FBZ0MsQ0FBQztpQkFDN0Q7cUJBQU07b0JBQ0wsa0VBQWtFO29CQUNsRSw2REFBNkQ7b0JBQzdELFVBQUcsQ0FBQyw2REFBNkQsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLENBQUM7aUJBQzNGO2FBQ0Y7WUFFRCxtRUFBbUU7WUFDbkUsTUFBTSxjQUFjLENBQUMsUUFBUSxFQUFFLEtBQUssRUFBRTtnQkFDcEMsTUFBTSxFQUFFLDBCQUFrQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsT0FBTzthQUNqRCxDQUFDLENBQUM7U0FDSjtJQUNILENBQUMsQ0FBQztBQUNKLENBQUM7QUEzQ0Qsa0NBMkNDO0FBRUQsTUFBYSxLQUFNLFNBQVEsS0FBSztDQUFJO0FBQXBDLHNCQUFvQyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG1heC1sZW4gKi9cbi8qIGVzbGludC1kaXNhYmxlIG5vLWNvbnNvbGUgKi9cbmltcG9ydCAqIGFzIHVybCBmcm9tICd1cmwnO1xuaW1wb3J0IHsgaHR0cFJlcXVlc3QgfSBmcm9tICcuL291dGJvdW5kJztcbmltcG9ydCB7IGxvZyB9IGZyb20gJy4vdXRpbCc7XG5cbmV4cG9ydCBjb25zdCBDUkVBVEVfRkFJTEVEX1BIWVNJQ0FMX0lEX01BUktFUiA9ICdBV1NDREs6OkN1c3RvbVJlc291cmNlUHJvdmlkZXJGcmFtZXdvcms6OkNSRUFURV9GQUlMRUQnO1xuZXhwb3J0IGNvbnN0IE1JU1NJTkdfUEhZU0lDQUxfSURfTUFSS0VSID0gJ0FXU0NESzo6Q3VzdG9tUmVzb3VyY2VQcm92aWRlckZyYW1ld29yazo6TUlTU0lOR19QSFlTSUNBTF9JRCc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgQ2xvdWRGb3JtYXRpb25SZXNwb25zZU9wdGlvbnMge1xuICByZWFkb25seSByZWFzb24/OiBzdHJpbmc7XG4gIHJlYWRvbmx5IG5vRWNobz86IGJvb2xlYW47XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgQ2xvdWRGb3JtYXRpb25FdmVudENvbnRleHQge1xuICBTdGFja0lkOiBzdHJpbmc7XG4gIFJlcXVlc3RJZDogc3RyaW5nO1xuICBQaHlzaWNhbFJlc291cmNlSWQ/OiBzdHJpbmc7XG4gIExvZ2ljYWxSZXNvdXJjZUlkOiBzdHJpbmc7XG4gIFJlc3BvbnNlVVJMOiBzdHJpbmc7XG4gIERhdGE/OiBhbnlcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHN1Ym1pdFJlc3BvbnNlKHN0YXR1czogJ1NVQ0NFU1MnIHwgJ0ZBSUxFRCcsIGV2ZW50OiBDbG91ZEZvcm1hdGlvbkV2ZW50Q29udGV4dCwgb3B0aW9uczogQ2xvdWRGb3JtYXRpb25SZXNwb25zZU9wdGlvbnMgPSB7IH0pIHtcbiAgY29uc3QganNvbjogQVdTTGFtYmRhLkNsb3VkRm9ybWF0aW9uQ3VzdG9tUmVzb3VyY2VSZXNwb25zZSA9IHtcbiAgICBTdGF0dXM6IHN0YXR1cyxcbiAgICBSZWFzb246IG9wdGlvbnMucmVhc29uIHx8IHN0YXR1cyxcbiAgICBTdGFja0lkOiBldmVudC5TdGFja0lkLFxuICAgIFJlcXVlc3RJZDogZXZlbnQuUmVxdWVzdElkLFxuICAgIFBoeXNpY2FsUmVzb3VyY2VJZDogZXZlbnQuUGh5c2ljYWxSZXNvdXJjZUlkIHx8IE1JU1NJTkdfUEhZU0lDQUxfSURfTUFSS0VSLFxuICAgIExvZ2ljYWxSZXNvdXJjZUlkOiBldmVudC5Mb2dpY2FsUmVzb3VyY2VJZCxcbiAgICBOb0VjaG86IG9wdGlvbnMubm9FY2hvLFxuICAgIERhdGE6IGV2ZW50LkRhdGEsXG4gIH07XG5cbiAgbG9nKCdzdWJtaXQgcmVzcG9uc2UgdG8gY2xvdWRmb3JtYXRpb24nLCBqc29uKTtcblxuICBjb25zdCByZXNwb25zZUJvZHkgPSBKU09OLnN0cmluZ2lmeShqc29uKTtcblxuICBjb25zdCBwYXJzZWRVcmwgPSB1cmwucGFyc2UoZXZlbnQuUmVzcG9uc2VVUkwpO1xuICBhd2FpdCBodHRwUmVxdWVzdCh7XG4gICAgaG9zdG5hbWU6IHBhcnNlZFVybC5ob3N0bmFtZSxcbiAgICBwYXRoOiBwYXJzZWRVcmwucGF0aCxcbiAgICBtZXRob2Q6ICdQVVQnLFxuICAgIGhlYWRlcnM6IHtcbiAgICAgICdjb250ZW50LXR5cGUnOiAnJyxcbiAgICAgICdjb250ZW50LWxlbmd0aCc6IHJlc3BvbnNlQm9keS5sZW5ndGgsXG4gICAgfSxcbiAgfSwgcmVzcG9uc2VCb2R5KTtcbn1cblxuZXhwb3J0IGxldCBpbmNsdWRlU3RhY2tUcmFjZXMgPSB0cnVlOyAvLyBmb3IgdW5pdCB0ZXN0c1xuXG5leHBvcnQgZnVuY3Rpb24gc2FmZUhhbmRsZXIoYmxvY2s6IChldmVudDogYW55KSA9PiBQcm9taXNlPHZvaWQ+KSB7XG4gIHJldHVybiBhc3luYyAoZXZlbnQ6IGFueSkgPT4ge1xuXG4gICAgLy8gaWdub3JlIERFTEVURSBldmVudCB3aGVuIHRoZSBwaHlzaWNhbCByZXNvdXJjZSBJRCBpcyB0aGUgbWFya2VyIHRoYXRcbiAgICAvLyBpbmRpY2F0ZXMgdGhhdCB0aGlzIERFTEVURSBpcyBhIHN1YnNlcXVlbnQgREVMRVRFIHRvIGEgZmFpbGVkIENSRUFURVxuICAgIC8vIG9wZXJhdGlvbi5cbiAgICBpZiAoZXZlbnQuUmVxdWVzdFR5cGUgPT09ICdEZWxldGUnICYmIGV2ZW50LlBoeXNpY2FsUmVzb3VyY2VJZCA9PT0gQ1JFQVRFX0ZBSUxFRF9QSFlTSUNBTF9JRF9NQVJLRVIpIHtcbiAgICAgIGxvZygnaWdub3JpbmcgREVMRVRFIGV2ZW50IGNhdXNlZCBieSBhIGZhaWxlZCBDUkVBVEUgZXZlbnQnKTtcbiAgICAgIGF3YWl0IHN1Ym1pdFJlc3BvbnNlKCdTVUNDRVNTJywgZXZlbnQpO1xuICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIHRyeSB7XG4gICAgICBhd2FpdCBibG9jayhldmVudCk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgLy8gdGVsbCB3YWl0ZXIgc3RhdGUgbWFjaGluZSB0byByZXRyeVxuICAgICAgaWYgKGUgaW5zdGFuY2VvZiBSZXRyeSkge1xuICAgICAgICBsb2coJ3JldHJ5IHJlcXVlc3RlZCBieSBoYW5kbGVyJyk7XG4gICAgICAgIHRocm93IGU7XG4gICAgICB9XG5cbiAgICAgIGlmICghZXZlbnQuUGh5c2ljYWxSZXNvdXJjZUlkKSB7XG4gICAgICAgIC8vIHNwZWNpYWwgY2FzZTogaWYgQ1JFQVRFIGZhaWxzLCB3aGljaCB1c3VhbGx5IGltcGxpZXMsIHdlIHVzdWFsbHkgZG9uJ3RcbiAgICAgICAgLy8gaGF2ZSBhIHBoeXNpY2FsIHJlc291cmNlIGlkLiBpbiB0aGlzIGNhc2UsIHRoZSBzdWJzZXF1ZW50IERFTEVURVxuICAgICAgICAvLyBvcGVyYXRpb24gZG9lcyBub3QgaGF2ZSBhbnkgbWVhbmluZywgYW5kIHdpbGwgbGlrZWx5IGZhaWwgYXMgd2VsbC4gdG9cbiAgICAgICAgLy8gYWRkcmVzcyB0aGlzLCB3ZSB1c2UgYSBtYXJrZXIgc28gdGhlIHByb3ZpZGVyIGZyYW1ld29yayBjYW4gc2ltcGx5XG4gICAgICAgIC8vIGlnbm9yZSB0aGUgc3Vic2VxdWVudCBERUxFVEUuXG4gICAgICAgIGlmIChldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ0NyZWF0ZScpIHtcbiAgICAgICAgICBsb2coJ0NSRUFURSBmYWlsZWQsIHJlc3BvbmRpbmcgd2l0aCBhIG1hcmtlciBwaHlzaWNhbCByZXNvdXJjZSBpZCBzbyB0aGF0IHRoZSBzdWJzZXF1ZW50IERFTEVURSB3aWxsIGJlIGlnbm9yZWQnKTtcbiAgICAgICAgICBldmVudC5QaHlzaWNhbFJlc291cmNlSWQgPSBDUkVBVEVfRkFJTEVEX1BIWVNJQ0FMX0lEX01BUktFUjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBvdGhlcndpc2UsIGlmIFBoeXNpY2FsUmVzb3VyY2VJZCBpcyBub3Qgc3BlY2lmaWVkLCBzb21ldGhpbmcgaXNcbiAgICAgICAgICAvLyB0ZXJyaWJseSB3cm9uZyBiZWNhdXNlIGFsbCBvdGhlciBldmVudHMgc2hvdWxkIGhhdmUgYW4gSUQuXG4gICAgICAgICAgbG9nKGBFUlJPUjogTWFsZm9ybWVkIGV2ZW50LiBcIlBoeXNpY2FsUmVzb3VyY2VJZFwiIGlzIHJlcXVpcmVkOiAke0pTT04uc3RyaW5naWZ5KGV2ZW50KX1gKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyB0aGlzIGlzIGFuIGFjdHVhbCBlcnJvciwgZmFpbCB0aGUgYWN0aXZpdHkgYWx0b2dldGhlciBhbmQgZXhpc3QuXG4gICAgICBhd2FpdCBzdWJtaXRSZXNwb25zZSgnRkFJTEVEJywgZXZlbnQsIHtcbiAgICAgICAgcmVhc29uOiBpbmNsdWRlU3RhY2tUcmFjZXMgPyBlLnN0YWNrIDogZS5tZXNzYWdlLFxuICAgICAgfSk7XG4gICAgfVxuICB9O1xufVxuXG5leHBvcnQgY2xhc3MgUmV0cnkgZXh0ZW5kcyBFcnJvciB7IH1cbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/consts.js b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/consts.js deleted file mode 100644 index 31faa077ae313..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/consts.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FRAMEWORK_ON_TIMEOUT_HANDLER_NAME = exports.FRAMEWORK_IS_COMPLETE_HANDLER_NAME = exports.FRAMEWORK_ON_EVENT_HANDLER_NAME = exports.WAITER_STATE_MACHINE_ARN_ENV = exports.USER_IS_COMPLETE_FUNCTION_ARN_ENV = exports.USER_ON_EVENT_FUNCTION_ARN_ENV = void 0; -exports.USER_ON_EVENT_FUNCTION_ARN_ENV = 'USER_ON_EVENT_FUNCTION_ARN'; -exports.USER_IS_COMPLETE_FUNCTION_ARN_ENV = 'USER_IS_COMPLETE_FUNCTION_ARN'; -exports.WAITER_STATE_MACHINE_ARN_ENV = 'WAITER_STATE_MACHINE_ARN'; -exports.FRAMEWORK_ON_EVENT_HANDLER_NAME = 'onEvent'; -exports.FRAMEWORK_IS_COMPLETE_HANDLER_NAME = 'isComplete'; -exports.FRAMEWORK_ON_TIMEOUT_HANDLER_NAME = 'onTimeout'; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY29uc3RzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFhLFFBQUEsOEJBQThCLEdBQUcsNEJBQTRCLENBQUM7QUFDOUQsUUFBQSxpQ0FBaUMsR0FBRywrQkFBK0IsQ0FBQztBQUNwRSxRQUFBLDRCQUE0QixHQUFHLDBCQUEwQixDQUFDO0FBRTFELFFBQUEsK0JBQStCLEdBQUcsU0FBUyxDQUFDO0FBQzVDLFFBQUEsa0NBQWtDLEdBQUcsWUFBWSxDQUFDO0FBQ2xELFFBQUEsaUNBQWlDLEdBQUcsV0FBVyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IFVTRVJfT05fRVZFTlRfRlVOQ1RJT05fQVJOX0VOViA9ICdVU0VSX09OX0VWRU5UX0ZVTkNUSU9OX0FSTic7XG5leHBvcnQgY29uc3QgVVNFUl9JU19DT01QTEVURV9GVU5DVElPTl9BUk5fRU5WID0gJ1VTRVJfSVNfQ09NUExFVEVfRlVOQ1RJT05fQVJOJztcbmV4cG9ydCBjb25zdCBXQUlURVJfU1RBVEVfTUFDSElORV9BUk5fRU5WID0gJ1dBSVRFUl9TVEFURV9NQUNISU5FX0FSTic7XG5cbmV4cG9ydCBjb25zdCBGUkFNRVdPUktfT05fRVZFTlRfSEFORExFUl9OQU1FID0gJ29uRXZlbnQnO1xuZXhwb3J0IGNvbnN0IEZSQU1FV09SS19JU19DT01QTEVURV9IQU5ETEVSX05BTUUgPSAnaXNDb21wbGV0ZSc7XG5leHBvcnQgY29uc3QgRlJBTUVXT1JLX09OX1RJTUVPVVRfSEFORExFUl9OQU1FID0gJ29uVGltZW91dCc7XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/framework.js b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/framework.js deleted file mode 100644 index 3f09fbdde6480..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/framework.js +++ /dev/null @@ -1,164 +0,0 @@ -"use strict"; -const cfnResponse = require("./cfn-response"); -const consts = require("./consts"); -const outbound_1 = require("./outbound"); -const util_1 = require("./util"); -/** - * The main runtime entrypoint of the async custom resource lambda function. - * - * Any lifecycle event changes to the custom resources will invoke this handler, which will, in turn, - * interact with the user-defined `onEvent` and `isComplete` handlers. - * - * This function will always succeed. If an error occurs - * - * @param cfnRequest The cloudformation custom resource event. - */ -async function onEvent(cfnRequest) { - util_1.log('onEventHandler', cfnRequest); - cfnRequest.ResourceProperties = cfnRequest.ResourceProperties || {}; - const onEventResult = await invokeUserFunction(consts.USER_ON_EVENT_FUNCTION_ARN_ENV, cfnRequest); - util_1.log('onEvent returned:', onEventResult); - // merge the request and the result from onEvent to form the complete resource event - // this also performs validation. - const resourceEvent = createResponseEvent(cfnRequest, onEventResult); - util_1.log('event:', onEventResult); - // determine if this is an async provider based on whether we have an isComplete handler defined. - // if it is not defined, then we are basically ready to return a positive response. - if (!process.env[consts.USER_IS_COMPLETE_FUNCTION_ARN_ENV]) { - return cfnResponse.submitResponse('SUCCESS', resourceEvent, { noEcho: resourceEvent.NoEcho }); - } - // ok, we are not complete, so kick off the waiter workflow - const waiter = { - stateMachineArn: util_1.getEnv(consts.WAITER_STATE_MACHINE_ARN_ENV), - name: resourceEvent.RequestId, - input: JSON.stringify(resourceEvent), - }; - util_1.log('starting waiter', waiter); - // kick off waiter state machine - await outbound_1.startExecution(waiter); -} -// invoked a few times until `complete` is true or until it times out. -async function isComplete(event) { - util_1.log('isComplete', event); - const isCompleteResult = await invokeUserFunction(consts.USER_IS_COMPLETE_FUNCTION_ARN_ENV, event); - util_1.log('user isComplete returned:', isCompleteResult); - // if we are not complete, return false, and don't send a response back. - if (!isCompleteResult.IsComplete) { - if (isCompleteResult.Data && Object.keys(isCompleteResult.Data).length > 0) { - throw new Error('"Data" is not allowed if "IsComplete" is "False"'); - } - throw new cfnResponse.Retry(JSON.stringify(event)); - } - const response = { - ...event, - ...isCompleteResult, - Data: { - ...event.Data, - ...isCompleteResult.Data, - }, - }; - await cfnResponse.submitResponse('SUCCESS', response, { noEcho: event.NoEcho }); -} -// invoked when completion retries are exhaused. -async function onTimeout(timeoutEvent) { - util_1.log('timeoutHandler', timeoutEvent); - const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); - await cfnResponse.submitResponse('FAILED', isCompleteRequest, { - reason: 'Operation timed out', - }); -} -async function invokeUserFunction(functionArnEnv, payload) { - const functionArn = util_1.getEnv(functionArnEnv); - util_1.log(`executing user function ${functionArn} with payload`, payload); - // transient errors such as timeouts, throttling errors (429), and other - // errors that aren't caused by a bad request (500 series) are retried - // automatically by the JavaScript SDK. - const resp = await outbound_1.invokeFunction({ - FunctionName: functionArn, - Payload: JSON.stringify(payload), - }); - util_1.log('user function response:', resp, typeof (resp)); - const jsonPayload = parseJsonPayload(resp.Payload); - if (resp.FunctionError) { - util_1.log('user function threw an error:', resp.FunctionError); - const errorMessage = jsonPayload.errorMessage || 'error'; - // parse function name from arn - // arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName} - const arn = functionArn.split(':'); - const functionName = arn[arn.length - 1]; - // append a reference to the log group. - const message = [ - errorMessage, - '', - `Logs: /aws/lambda/${functionName}`, - '', - ].join('\n'); - const e = new Error(message); - // the output that goes to CFN is what's in `stack`, not the error message. - // if we have a remote trace, construct a nice message with log group information - if (jsonPayload.trace) { - // skip first trace line because it's the message - e.stack = [message, ...jsonPayload.trace.slice(1)].join('\n'); - } - throw e; - } - return jsonPayload; -} -function parseJsonPayload(payload) { - if (!payload) { - return {}; - } - const text = payload.toString(); - try { - return JSON.parse(text); - } - catch (e) { - throw new Error(`return values from user-handlers must be JSON objects. got: "${text}"`); - } -} -function createResponseEvent(cfnRequest, onEventResult) { - // - // validate that onEventResult always includes a PhysicalResourceId - onEventResult = onEventResult || {}; - // if physical ID is not returned, we have some defaults for you based - // on the request type. - const physicalResourceId = onEventResult.PhysicalResourceId || defaultPhysicalResourceId(cfnRequest); - // if we are in DELETE and physical ID was changed, it's an error. - if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { - throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${onEventResult.PhysicalResourceId}" during deletion`); - } - // if we are in UPDATE and physical ID was changed, it's a replacement (just log) - if (cfnRequest.RequestType === 'Update' && physicalResourceId !== cfnRequest.PhysicalResourceId) { - util_1.log(`UPDATE: changing physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${onEventResult.PhysicalResourceId}"`); - } - // merge request event and result event (result prevails). - return { - ...cfnRequest, - ...onEventResult, - PhysicalResourceId: physicalResourceId, - }; -} -/** - * Calculates the default physical resource ID based in case user handler did - * not return a PhysicalResourceId. - * - * For "CREATE", it uses the RequestId. - * For "UPDATE" and "DELETE" and returns the current PhysicalResourceId (the one provided in `event`). - */ -function defaultPhysicalResourceId(req) { - switch (req.RequestType) { - case 'Create': - return req.RequestId; - case 'Update': - case 'Delete': - return req.PhysicalResourceId; - default: - throw new Error(`Invalid "RequestType" in request "${JSON.stringify(req)}"`); - } -} -module.exports = { - [consts.FRAMEWORK_ON_EVENT_HANDLER_NAME]: cfnResponse.safeHandler(onEvent), - [consts.FRAMEWORK_IS_COMPLETE_HANDLER_NAME]: cfnResponse.safeHandler(isComplete), - [consts.FRAMEWORK_ON_TIMEOUT_HANDLER_NAME]: onTimeout, -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJhbWV3b3JrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZnJhbWV3b3JrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFHQSw4Q0FBOEM7QUFDOUMsbUNBQW1DO0FBQ25DLHlDQUE0RDtBQUM1RCxpQ0FBcUM7QUFTckM7Ozs7Ozs7OztHQVNHO0FBQ0gsS0FBSyxVQUFVLE9BQU8sQ0FBQyxVQUF1RDtJQUM1RSxVQUFHLENBQUMsZ0JBQWdCLEVBQUUsVUFBVSxDQUFDLENBQUM7SUFFbEMsVUFBVSxDQUFDLGtCQUFrQixHQUFHLFVBQVUsQ0FBQyxrQkFBa0IsSUFBSSxFQUFHLENBQUM7SUFFckUsTUFBTSxhQUFhLEdBQUcsTUFBTSxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsOEJBQThCLEVBQUUsVUFBVSxDQUFvQixDQUFDO0lBQ3JILFVBQUcsQ0FBQyxtQkFBbUIsRUFBRSxhQUFhLENBQUMsQ0FBQztJQUV4QyxvRkFBb0Y7SUFDcEYsaUNBQWlDO0lBQ2pDLE1BQU0sYUFBYSxHQUFHLG1CQUFtQixDQUFDLFVBQVUsRUFBRSxhQUFhLENBQUMsQ0FBQztJQUNyRSxVQUFHLENBQUMsUUFBUSxFQUFFLGFBQWEsQ0FBQyxDQUFDO0lBRTdCLGlHQUFpRztJQUNqRyxtRkFBbUY7SUFDbkYsSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLGlDQUFpQyxDQUFDLEVBQUU7UUFDMUQsT0FBTyxXQUFXLENBQUMsY0FBYyxDQUFDLFNBQVMsRUFBRSxhQUFhLEVBQUUsRUFBRSxNQUFNLEVBQUUsYUFBYSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7S0FDL0Y7SUFFRCwyREFBMkQ7SUFDM0QsTUFBTSxNQUFNLEdBQUc7UUFDYixlQUFlLEVBQUUsYUFBTSxDQUFDLE1BQU0sQ0FBQyw0QkFBNEIsQ0FBQztRQUM1RCxJQUFJLEVBQUUsYUFBYSxDQUFDLFNBQVM7UUFDN0IsS0FBSyxFQUFFLElBQUksQ0FBQyxTQUFTLENBQUMsYUFBYSxDQUFDO0tBQ3JDLENBQUM7SUFFRixVQUFHLENBQUMsaUJBQWlCLEVBQUUsTUFBTSxDQUFDLENBQUM7SUFFL0IsZ0NBQWdDO0lBQ2hDLE1BQU0seUJBQWMsQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUMvQixDQUFDO0FBRUQsc0VBQXNFO0FBQ3RFLEtBQUssVUFBVSxVQUFVLENBQUMsS0FBa0Q7SUFDMUUsVUFBRyxDQUFDLFlBQVksRUFBRSxLQUFLLENBQUMsQ0FBQztJQUV6QixNQUFNLGdCQUFnQixHQUFHLE1BQU0sa0JBQWtCLENBQUMsTUFBTSxDQUFDLGlDQUFpQyxFQUFFLEtBQUssQ0FBdUIsQ0FBQztJQUN6SCxVQUFHLENBQUMsMkJBQTJCLEVBQUUsZ0JBQWdCLENBQUMsQ0FBQztJQUVuRCx3RUFBd0U7SUFDeEUsSUFBSSxDQUFDLGdCQUFnQixDQUFDLFVBQVUsRUFBRTtRQUNoQyxJQUFJLGdCQUFnQixDQUFDLElBQUksSUFBSSxNQUFNLENBQUMsSUFBSSxDQUFDLGdCQUFnQixDQUFDLElBQUksQ0FBQyxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUU7WUFDMUUsTUFBTSxJQUFJLEtBQUssQ0FBQyxrREFBa0QsQ0FBQyxDQUFDO1NBQ3JFO1FBRUQsTUFBTSxJQUFJLFdBQVcsQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDO0tBQ3BEO0lBRUQsTUFBTSxRQUFRLEdBQUc7UUFDZixHQUFHLEtBQUs7UUFDUixHQUFHLGdCQUFnQjtRQUNuQixJQUFJLEVBQUU7WUFDSixHQUFHLEtBQUssQ0FBQyxJQUFJO1lBQ2IsR0FBRyxnQkFBZ0IsQ0FBQyxJQUFJO1NBQ3pCO0tBQ0YsQ0FBQztJQUVGLE1BQU0sV0FBVyxDQUFDLGNBQWMsQ0FBQyxTQUFTLEVBQUUsUUFBUSxFQUFFLEVBQUUsTUFBTSxFQUFFLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDO0FBQ2xGLENBQUM7QUFFRCxnREFBZ0Q7QUFDaEQsS0FBSyxVQUFVLFNBQVMsQ0FBQyxZQUFpQjtJQUN4QyxVQUFHLENBQUMsZ0JBQWdCLEVBQUUsWUFBWSxDQUFDLENBQUM7SUFFcEMsTUFBTSxpQkFBaUIsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsWUFBWSxDQUFDLEtBQUssQ0FBQyxDQUFDLFlBQVksQ0FBZ0QsQ0FBQztJQUNqSSxNQUFNLFdBQVcsQ0FBQyxjQUFjLENBQUMsUUFBUSxFQUFFLGlCQUFpQixFQUFFO1FBQzVELE1BQU0sRUFBRSxxQkFBcUI7S0FDOUIsQ0FBQyxDQUFDO0FBQ0wsQ0FBQztBQUVELEtBQUssVUFBVSxrQkFBa0IsQ0FBQyxjQUFzQixFQUFFLE9BQVk7SUFDcEUsTUFBTSxXQUFXLEdBQUcsYUFBTSxDQUFDLGNBQWMsQ0FBQyxDQUFDO0lBQzNDLFVBQUcsQ0FBQywyQkFBMkIsV0FBVyxlQUFlLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFFcEUsd0VBQXdFO0lBQ3hFLHNFQUFzRTtJQUN0RSx1Q0FBdUM7SUFDdkMsTUFBTSxJQUFJLEdBQUcsTUFBTSx5QkFBYyxDQUFDO1FBQ2hDLFlBQVksRUFBRSxXQUFXO1FBQ3pCLE9BQU8sRUFBRSxJQUFJLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQztLQUNqQyxDQUFDLENBQUM7SUFFSCxVQUFHLENBQUMseUJBQXlCLEVBQUUsSUFBSSxFQUFFLE9BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO0lBRW5ELE1BQU0sV0FBVyxHQUFHLGdCQUFnQixDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNuRCxJQUFJLElBQUksQ0FBQyxhQUFhLEVBQUU7UUFDdEIsVUFBRyxDQUFDLCtCQUErQixFQUFFLElBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQztRQUV6RCxNQUFNLFlBQVksR0FBRyxXQUFXLENBQUMsWUFBWSxJQUFJLE9BQU8sQ0FBQztRQUV6RCwrQkFBK0I7UUFDL0Isd0VBQXdFO1FBQ3hFLE1BQU0sR0FBRyxHQUFHLFdBQVcsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDbkMsTUFBTSxZQUFZLEdBQUcsR0FBRyxDQUFDLEdBQUcsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDLENBQUM7UUFFekMsdUNBQXVDO1FBQ3ZDLE1BQU0sT0FBTyxHQUFHO1lBQ2QsWUFBWTtZQUNaLEVBQUU7WUFDRixxQkFBcUIsWUFBWSxFQUFFO1lBQ25DLEVBQUU7U0FDSCxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUViLE1BQU0sQ0FBQyxHQUFHLElBQUksS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBRTdCLDJFQUEyRTtRQUMzRSxpRkFBaUY7UUFDakYsSUFBSSxXQUFXLENBQUMsS0FBSyxFQUFFO1lBQ3JCLGlEQUFpRDtZQUNqRCxDQUFDLENBQUMsS0FBSyxHQUFHLENBQUMsT0FBTyxFQUFFLEdBQUcsV0FBVyxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7U0FDL0Q7UUFFRCxNQUFNLENBQUMsQ0FBQztLQUNUO0lBRUQsT0FBTyxXQUFXLENBQUM7QUFDckIsQ0FBQztBQUVELFNBQVMsZ0JBQWdCLENBQUMsT0FBWTtJQUNwQyxJQUFJLENBQUMsT0FBTyxFQUFFO1FBQUUsT0FBTyxFQUFHLENBQUM7S0FBRTtJQUM3QixNQUFNLElBQUksR0FBRyxPQUFPLENBQUMsUUFBUSxFQUFFLENBQUM7SUFDaEMsSUFBSTtRQUNGLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQztLQUN6QjtJQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQ1YsTUFBTSxJQUFJLEtBQUssQ0FBQyxnRUFBZ0UsSUFBSSxHQUFHLENBQUMsQ0FBQztLQUMxRjtBQUNILENBQUM7QUFFRCxTQUFTLG1CQUFtQixDQUFDLFVBQXVELEVBQUUsYUFBOEI7SUFDbEgsRUFBRTtJQUNGLG1FQUFtRTtJQUVuRSxhQUFhLEdBQUcsYUFBYSxJQUFJLEVBQUcsQ0FBQztJQUVyQyxzRUFBc0U7SUFDdEUsdUJBQXVCO0lBQ3ZCLE1BQU0sa0JBQWtCLEdBQUcsYUFBYSxDQUFDLGtCQUFrQixJQUFJLHlCQUF5QixDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBRXJHLGtFQUFrRTtJQUNsRSxJQUFJLFVBQVUsQ0FBQyxXQUFXLEtBQUssUUFBUSxJQUFJLGtCQUFrQixLQUFLLFVBQVUsQ0FBQyxrQkFBa0IsRUFBRTtRQUMvRixNQUFNLElBQUksS0FBSyxDQUFDLHdEQUF3RCxVQUFVLENBQUMsa0JBQWtCLFNBQVMsYUFBYSxDQUFDLGtCQUFrQixtQkFBbUIsQ0FBQyxDQUFDO0tBQ3BLO0lBRUQsaUZBQWlGO0lBQ2pGLElBQUksVUFBVSxDQUFDLFdBQVcsS0FBSyxRQUFRLElBQUksa0JBQWtCLEtBQUssVUFBVSxDQUFDLGtCQUFrQixFQUFFO1FBQy9GLFVBQUcsQ0FBQywrQ0FBK0MsVUFBVSxDQUFDLGtCQUFrQixTQUFTLGFBQWEsQ0FBQyxrQkFBa0IsR0FBRyxDQUFDLENBQUM7S0FDL0g7SUFFRCwwREFBMEQ7SUFDMUQsT0FBTztRQUNMLEdBQUcsVUFBVTtRQUNiLEdBQUcsYUFBYTtRQUNoQixrQkFBa0IsRUFBRSxrQkFBa0I7S0FDdkMsQ0FBQztBQUNKLENBQUM7QUFFRDs7Ozs7O0dBTUc7QUFDSCxTQUFTLHlCQUF5QixDQUFDLEdBQWdEO0lBQ2pGLFFBQVEsR0FBRyxDQUFDLFdBQVcsRUFBRTtRQUN2QixLQUFLLFFBQVE7WUFDWCxPQUFPLEdBQUcsQ0FBQyxTQUFTLENBQUM7UUFFdkIsS0FBSyxRQUFRLENBQUM7UUFDZCxLQUFLLFFBQVE7WUFDWCxPQUFPLEdBQUcsQ0FBQyxrQkFBa0IsQ0FBQztRQUVoQztZQUNFLE1BQU0sSUFBSSxLQUFLLENBQUMscUNBQXFDLElBQUksQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0tBQ2hGO0FBQ0gsQ0FBQztBQS9MRCxpQkFBUztJQUNQLENBQUMsTUFBTSxDQUFDLCtCQUErQixDQUFDLEVBQUUsV0FBVyxDQUFDLFdBQVcsQ0FBQyxPQUFPLENBQUM7SUFDMUUsQ0FBQyxNQUFNLENBQUMsa0NBQWtDLENBQUMsRUFBRSxXQUFXLENBQUMsV0FBVyxDQUFDLFVBQVUsQ0FBQztJQUNoRixDQUFDLE1BQU0sQ0FBQyxpQ0FBaUMsQ0FBQyxFQUFFLFNBQVM7Q0FDdEQsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG1heC1sZW4gKi9cbi8qIGVzbGludC1kaXNhYmxlIG5vLWNvbnNvbGUgKi9cbmltcG9ydCB7IElzQ29tcGxldGVSZXNwb25zZSwgT25FdmVudFJlc3BvbnNlIH0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0ICogYXMgY2ZuUmVzcG9uc2UgZnJvbSAnLi9jZm4tcmVzcG9uc2UnO1xuaW1wb3J0ICogYXMgY29uc3RzIGZyb20gJy4vY29uc3RzJztcbmltcG9ydCB7IGludm9rZUZ1bmN0aW9uLCBzdGFydEV4ZWN1dGlvbiB9IGZyb20gJy4vb3V0Ym91bmQnO1xuaW1wb3J0IHsgZ2V0RW52LCBsb2cgfSBmcm9tICcuL3V0aWwnO1xuXG4vLyB1c2UgY29uc3RzIGZvciBoYW5kbGVyIG5hbWVzIHRvIGNvbXBpbGVyLWVuZm9yY2UgdGhlIGNvdXBsaW5nIHdpdGggY29uc3RydWN0aW9uIGNvZGUuXG5leHBvcnQgPSB7XG4gIFtjb25zdHMuRlJBTUVXT1JLX09OX0VWRU5UX0hBTkRMRVJfTkFNRV06IGNmblJlc3BvbnNlLnNhZmVIYW5kbGVyKG9uRXZlbnQpLFxuICBbY29uc3RzLkZSQU1FV09SS19JU19DT01QTEVURV9IQU5ETEVSX05BTUVdOiBjZm5SZXNwb25zZS5zYWZlSGFuZGxlcihpc0NvbXBsZXRlKSxcbiAgW2NvbnN0cy5GUkFNRVdPUktfT05fVElNRU9VVF9IQU5ETEVSX05BTUVdOiBvblRpbWVvdXQsXG59O1xuXG4vKipcbiAqIFRoZSBtYWluIHJ1bnRpbWUgZW50cnlwb2ludCBvZiB0aGUgYXN5bmMgY3VzdG9tIHJlc291cmNlIGxhbWJkYSBmdW5jdGlvbi5cbiAqXG4gKiBBbnkgbGlmZWN5Y2xlIGV2ZW50IGNoYW5nZXMgdG8gdGhlIGN1c3RvbSByZXNvdXJjZXMgd2lsbCBpbnZva2UgdGhpcyBoYW5kbGVyLCB3aGljaCB3aWxsLCBpbiB0dXJuLFxuICogaW50ZXJhY3Qgd2l0aCB0aGUgdXNlci1kZWZpbmVkIGBvbkV2ZW50YCBhbmQgYGlzQ29tcGxldGVgIGhhbmRsZXJzLlxuICpcbiAqIFRoaXMgZnVuY3Rpb24gd2lsbCBhbHdheXMgc3VjY2VlZC4gSWYgYW4gZXJyb3Igb2NjdXJzXG4gKlxuICogQHBhcmFtIGNmblJlcXVlc3QgVGhlIGNsb3VkZm9ybWF0aW9uIGN1c3RvbSByZXNvdXJjZSBldmVudC5cbiAqL1xuYXN5bmMgZnVuY3Rpb24gb25FdmVudChjZm5SZXF1ZXN0OiBBV1NMYW1iZGEuQ2xvdWRGb3JtYXRpb25DdXN0b21SZXNvdXJjZUV2ZW50KSB7XG4gIGxvZygnb25FdmVudEhhbmRsZXInLCBjZm5SZXF1ZXN0KTtcblxuICBjZm5SZXF1ZXN0LlJlc291cmNlUHJvcGVydGllcyA9IGNmblJlcXVlc3QuUmVzb3VyY2VQcm9wZXJ0aWVzIHx8IHsgfTtcblxuICBjb25zdCBvbkV2ZW50UmVzdWx0ID0gYXdhaXQgaW52b2tlVXNlckZ1bmN0aW9uKGNvbnN0cy5VU0VSX09OX0VWRU5UX0ZVTkNUSU9OX0FSTl9FTlYsIGNmblJlcXVlc3QpIGFzIE9uRXZlbnRSZXNwb25zZTtcbiAgbG9nKCdvbkV2ZW50IHJldHVybmVkOicsIG9uRXZlbnRSZXN1bHQpO1xuXG4gIC8vIG1lcmdlIHRoZSByZXF1ZXN0IGFuZCB0aGUgcmVzdWx0IGZyb20gb25FdmVudCB0byBmb3JtIHRoZSBjb21wbGV0ZSByZXNvdXJjZSBldmVudFxuICAvLyB0aGlzIGFsc28gcGVyZm9ybXMgdmFsaWRhdGlvbi5cbiAgY29uc3QgcmVzb3VyY2VFdmVudCA9IGNyZWF0ZVJlc3BvbnNlRXZlbnQoY2ZuUmVxdWVzdCwgb25FdmVudFJlc3VsdCk7XG4gIGxvZygnZXZlbnQ6Jywgb25FdmVudFJlc3VsdCk7XG5cbiAgLy8gZGV0ZXJtaW5lIGlmIHRoaXMgaXMgYW4gYXN5bmMgcHJvdmlkZXIgYmFzZWQgb24gd2hldGhlciB3ZSBoYXZlIGFuIGlzQ29tcGxldGUgaGFuZGxlciBkZWZpbmVkLlxuICAvLyBpZiBpdCBpcyBub3QgZGVmaW5lZCwgdGhlbiB3ZSBhcmUgYmFzaWNhbGx5IHJlYWR5IHRvIHJldHVybiBhIHBvc2l0aXZlIHJlc3BvbnNlLlxuICBpZiAoIXByb2Nlc3MuZW52W2NvbnN0cy5VU0VSX0lTX0NPTVBMRVRFX0ZVTkNUSU9OX0FSTl9FTlZdKSB7XG4gICAgcmV0dXJuIGNmblJlc3BvbnNlLnN1Ym1pdFJlc3BvbnNlKCdTVUNDRVNTJywgcmVzb3VyY2VFdmVudCwgeyBub0VjaG86IHJlc291cmNlRXZlbnQuTm9FY2hvIH0pO1xuICB9XG5cbiAgLy8gb2ssIHdlIGFyZSBub3QgY29tcGxldGUsIHNvIGtpY2sgb2ZmIHRoZSB3YWl0ZXIgd29ya2Zsb3dcbiAgY29uc3Qgd2FpdGVyID0ge1xuICAgIHN0YXRlTWFjaGluZUFybjogZ2V0RW52KGNvbnN0cy5XQUlURVJfU1RBVEVfTUFDSElORV9BUk5fRU5WKSxcbiAgICBuYW1lOiByZXNvdXJjZUV2ZW50LlJlcXVlc3RJZCxcbiAgICBpbnB1dDogSlNPTi5zdHJpbmdpZnkocmVzb3VyY2VFdmVudCksXG4gIH07XG5cbiAgbG9nKCdzdGFydGluZyB3YWl0ZXInLCB3YWl0ZXIpO1xuXG4gIC8vIGtpY2sgb2ZmIHdhaXRlciBzdGF0ZSBtYWNoaW5lXG4gIGF3YWl0IHN0YXJ0RXhlY3V0aW9uKHdhaXRlcik7XG59XG5cbi8vIGludm9rZWQgYSBmZXcgdGltZXMgdW50aWwgYGNvbXBsZXRlYCBpcyB0cnVlIG9yIHVudGlsIGl0IHRpbWVzIG91dC5cbmFzeW5jIGZ1bmN0aW9uIGlzQ29tcGxldGUoZXZlbnQ6IEFXU0NES0FzeW5jQ3VzdG9tUmVzb3VyY2UuSXNDb21wbGV0ZVJlcXVlc3QpIHtcbiAgbG9nKCdpc0NvbXBsZXRlJywgZXZlbnQpO1xuXG4gIGNvbnN0IGlzQ29tcGxldGVSZXN1bHQgPSBhd2FpdCBpbnZva2VVc2VyRnVuY3Rpb24oY29uc3RzLlVTRVJfSVNfQ09NUExFVEVfRlVOQ1RJT05fQVJOX0VOViwgZXZlbnQpIGFzIElzQ29tcGxldGVSZXNwb25zZTtcbiAgbG9nKCd1c2VyIGlzQ29tcGxldGUgcmV0dXJuZWQ6JywgaXNDb21wbGV0ZVJlc3VsdCk7XG5cbiAgLy8gaWYgd2UgYXJlIG5vdCBjb21wbGV0ZSwgcmV0dXJuIGZhbHNlLCBhbmQgZG9uJ3Qgc2VuZCBhIHJlc3BvbnNlIGJhY2suXG4gIGlmICghaXNDb21wbGV0ZVJlc3VsdC5Jc0NvbXBsZXRlKSB7XG4gICAgaWYgKGlzQ29tcGxldGVSZXN1bHQuRGF0YSAmJiBPYmplY3Qua2V5cyhpc0NvbXBsZXRlUmVzdWx0LkRhdGEpLmxlbmd0aCA+IDApIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignXCJEYXRhXCIgaXMgbm90IGFsbG93ZWQgaWYgXCJJc0NvbXBsZXRlXCIgaXMgXCJGYWxzZVwiJyk7XG4gICAgfVxuXG4gICAgdGhyb3cgbmV3IGNmblJlc3BvbnNlLlJldHJ5KEpTT04uc3RyaW5naWZ5KGV2ZW50KSk7XG4gIH1cblxuICBjb25zdCByZXNwb25zZSA9IHtcbiAgICAuLi5ldmVudCxcbiAgICAuLi5pc0NvbXBsZXRlUmVzdWx0LFxuICAgIERhdGE6IHtcbiAgICAgIC4uLmV2ZW50LkRhdGEsXG4gICAgICAuLi5pc0NvbXBsZXRlUmVzdWx0LkRhdGEsXG4gICAgfSxcbiAgfTtcblxuICBhd2FpdCBjZm5SZXNwb25zZS5zdWJtaXRSZXNwb25zZSgnU1VDQ0VTUycsIHJlc3BvbnNlLCB7IG5vRWNobzogZXZlbnQuTm9FY2hvIH0pO1xufVxuXG4vLyBpbnZva2VkIHdoZW4gY29tcGxldGlvbiByZXRyaWVzIGFyZSBleGhhdXNlZC5cbmFzeW5jIGZ1bmN0aW9uIG9uVGltZW91dCh0aW1lb3V0RXZlbnQ6IGFueSkge1xuICBsb2coJ3RpbWVvdXRIYW5kbGVyJywgdGltZW91dEV2ZW50KTtcblxuICBjb25zdCBpc0NvbXBsZXRlUmVxdWVzdCA9IEpTT04ucGFyc2UoSlNPTi5wYXJzZSh0aW1lb3V0RXZlbnQuQ2F1c2UpLmVycm9yTWVzc2FnZSkgYXMgQVdTQ0RLQXN5bmNDdXN0b21SZXNvdXJjZS5Jc0NvbXBsZXRlUmVxdWVzdDtcbiAgYXdhaXQgY2ZuUmVzcG9uc2Uuc3VibWl0UmVzcG9uc2UoJ0ZBSUxFRCcsIGlzQ29tcGxldGVSZXF1ZXN0LCB7XG4gICAgcmVhc29uOiAnT3BlcmF0aW9uIHRpbWVkIG91dCcsXG4gIH0pO1xufVxuXG5hc3luYyBmdW5jdGlvbiBpbnZva2VVc2VyRnVuY3Rpb24oZnVuY3Rpb25Bcm5FbnY6IHN0cmluZywgcGF5bG9hZDogYW55KSB7XG4gIGNvbnN0IGZ1bmN0aW9uQXJuID0gZ2V0RW52KGZ1bmN0aW9uQXJuRW52KTtcbiAgbG9nKGBleGVjdXRpbmcgdXNlciBmdW5jdGlvbiAke2Z1bmN0aW9uQXJufSB3aXRoIHBheWxvYWRgLCBwYXlsb2FkKTtcblxuICAvLyB0cmFuc2llbnQgZXJyb3JzIHN1Y2ggYXMgdGltZW91dHMsIHRocm90dGxpbmcgZXJyb3JzICg0MjkpLCBhbmQgb3RoZXJcbiAgLy8gZXJyb3JzIHRoYXQgYXJlbid0IGNhdXNlZCBieSBhIGJhZCByZXF1ZXN0ICg1MDAgc2VyaWVzKSBhcmUgcmV0cmllZFxuICAvLyBhdXRvbWF0aWNhbGx5IGJ5IHRoZSBKYXZhU2NyaXB0IFNESy5cbiAgY29uc3QgcmVzcCA9IGF3YWl0IGludm9rZUZ1bmN0aW9uKHtcbiAgICBGdW5jdGlvbk5hbWU6IGZ1bmN0aW9uQXJuLFxuICAgIFBheWxvYWQ6IEpTT04uc3RyaW5naWZ5KHBheWxvYWQpLFxuICB9KTtcblxuICBsb2coJ3VzZXIgZnVuY3Rpb24gcmVzcG9uc2U6JywgcmVzcCwgdHlwZW9mKHJlc3ApKTtcblxuICBjb25zdCBqc29uUGF5bG9hZCA9IHBhcnNlSnNvblBheWxvYWQocmVzcC5QYXlsb2FkKTtcbiAgaWYgKHJlc3AuRnVuY3Rpb25FcnJvcikge1xuICAgIGxvZygndXNlciBmdW5jdGlvbiB0aHJldyBhbiBlcnJvcjonLCByZXNwLkZ1bmN0aW9uRXJyb3IpO1xuXG4gICAgY29uc3QgZXJyb3JNZXNzYWdlID0ganNvblBheWxvYWQuZXJyb3JNZXNzYWdlIHx8ICdlcnJvcic7XG5cbiAgICAvLyBwYXJzZSBmdW5jdGlvbiBuYW1lIGZyb20gYXJuXG4gICAgLy8gYXJuOiR7UGFydGl0aW9ufTpsYW1iZGE6JHtSZWdpb259OiR7QWNjb3VudH06ZnVuY3Rpb246JHtGdW5jdGlvbk5hbWV9XG4gICAgY29uc3QgYXJuID0gZnVuY3Rpb25Bcm4uc3BsaXQoJzonKTtcbiAgICBjb25zdCBmdW5jdGlvbk5hbWUgPSBhcm5bYXJuLmxlbmd0aCAtIDFdO1xuXG4gICAgLy8gYXBwZW5kIGEgcmVmZXJlbmNlIHRvIHRoZSBsb2cgZ3JvdXAuXG4gICAgY29uc3QgbWVzc2FnZSA9IFtcbiAgICAgIGVycm9yTWVzc2FnZSxcbiAgICAgICcnLFxuICAgICAgYExvZ3M6IC9hd3MvbGFtYmRhLyR7ZnVuY3Rpb25OYW1lfWAsIC8vIGNsb3Vkd2F0Y2ggbG9nIGdyb3VwXG4gICAgICAnJyxcbiAgICBdLmpvaW4oJ1xcbicpO1xuXG4gICAgY29uc3QgZSA9IG5ldyBFcnJvcihtZXNzYWdlKTtcblxuICAgIC8vIHRoZSBvdXRwdXQgdGhhdCBnb2VzIHRvIENGTiBpcyB3aGF0J3MgaW4gYHN0YWNrYCwgbm90IHRoZSBlcnJvciBtZXNzYWdlLlxuICAgIC8vIGlmIHdlIGhhdmUgYSByZW1vdGUgdHJhY2UsIGNvbnN0cnVjdCBhIG5pY2UgbWVzc2FnZSB3aXRoIGxvZyBncm91cCBpbmZvcm1hdGlvblxuICAgIGlmIChqc29uUGF5bG9hZC50cmFjZSkge1xuICAgICAgLy8gc2tpcCBmaXJzdCB0cmFjZSBsaW5lIGJlY2F1c2UgaXQncyB0aGUgbWVzc2FnZVxuICAgICAgZS5zdGFjayA9IFttZXNzYWdlLCAuLi5qc29uUGF5bG9hZC50cmFjZS5zbGljZSgxKV0uam9pbignXFxuJyk7XG4gICAgfVxuXG4gICAgdGhyb3cgZTtcbiAgfVxuXG4gIHJldHVybiBqc29uUGF5bG9hZDtcbn1cblxuZnVuY3Rpb24gcGFyc2VKc29uUGF5bG9hZChwYXlsb2FkOiBhbnkpOiBhbnkge1xuICBpZiAoIXBheWxvYWQpIHsgcmV0dXJuIHsgfTsgfVxuICBjb25zdCB0ZXh0ID0gcGF5bG9hZC50b1N0cmluZygpO1xuICB0cnkge1xuICAgIHJldHVybiBKU09OLnBhcnNlKHRleHQpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKGByZXR1cm4gdmFsdWVzIGZyb20gdXNlci1oYW5kbGVycyBtdXN0IGJlIEpTT04gb2JqZWN0cy4gZ290OiBcIiR7dGV4dH1cImApO1xuICB9XG59XG5cbmZ1bmN0aW9uIGNyZWF0ZVJlc3BvbnNlRXZlbnQoY2ZuUmVxdWVzdDogQVdTTGFtYmRhLkNsb3VkRm9ybWF0aW9uQ3VzdG9tUmVzb3VyY2VFdmVudCwgb25FdmVudFJlc3VsdDogT25FdmVudFJlc3BvbnNlKTogQVdTQ0RLQXN5bmNDdXN0b21SZXNvdXJjZS5Jc0NvbXBsZXRlUmVxdWVzdCB7XG4gIC8vXG4gIC8vIHZhbGlkYXRlIHRoYXQgb25FdmVudFJlc3VsdCBhbHdheXMgaW5jbHVkZXMgYSBQaHlzaWNhbFJlc291cmNlSWRcblxuICBvbkV2ZW50UmVzdWx0ID0gb25FdmVudFJlc3VsdCB8fCB7IH07XG5cbiAgLy8gaWYgcGh5c2ljYWwgSUQgaXMgbm90IHJldHVybmVkLCB3ZSBoYXZlIHNvbWUgZGVmYXVsdHMgZm9yIHlvdSBiYXNlZFxuICAvLyBvbiB0aGUgcmVxdWVzdCB0eXBlLlxuICBjb25zdCBwaHlzaWNhbFJlc291cmNlSWQgPSBvbkV2ZW50UmVzdWx0LlBoeXNpY2FsUmVzb3VyY2VJZCB8fCBkZWZhdWx0UGh5c2ljYWxSZXNvdXJjZUlkKGNmblJlcXVlc3QpO1xuXG4gIC8vIGlmIHdlIGFyZSBpbiBERUxFVEUgYW5kIHBoeXNpY2FsIElEIHdhcyBjaGFuZ2VkLCBpdCdzIGFuIGVycm9yLlxuICBpZiAoY2ZuUmVxdWVzdC5SZXF1ZXN0VHlwZSA9PT0gJ0RlbGV0ZScgJiYgcGh5c2ljYWxSZXNvdXJjZUlkICE9PSBjZm5SZXF1ZXN0LlBoeXNpY2FsUmVzb3VyY2VJZCkge1xuICAgIHRocm93IG5ldyBFcnJvcihgREVMRVRFOiBjYW5ub3QgY2hhbmdlIHRoZSBwaHlzaWNhbCByZXNvdXJjZSBJRCBmcm9tIFwiJHtjZm5SZXF1ZXN0LlBoeXNpY2FsUmVzb3VyY2VJZH1cIiB0byBcIiR7b25FdmVudFJlc3VsdC5QaHlzaWNhbFJlc291cmNlSWR9XCIgZHVyaW5nIGRlbGV0aW9uYCk7XG4gIH1cblxuICAvLyBpZiB3ZSBhcmUgaW4gVVBEQVRFIGFuZCBwaHlzaWNhbCBJRCB3YXMgY2hhbmdlZCwgaXQncyBhIHJlcGxhY2VtZW50IChqdXN0IGxvZylcbiAgaWYgKGNmblJlcXVlc3QuUmVxdWVzdFR5cGUgPT09ICdVcGRhdGUnICYmIHBoeXNpY2FsUmVzb3VyY2VJZCAhPT0gY2ZuUmVxdWVzdC5QaHlzaWNhbFJlc291cmNlSWQpIHtcbiAgICBsb2coYFVQREFURTogY2hhbmdpbmcgcGh5c2ljYWwgcmVzb3VyY2UgSUQgZnJvbSBcIiR7Y2ZuUmVxdWVzdC5QaHlzaWNhbFJlc291cmNlSWR9XCIgdG8gXCIke29uRXZlbnRSZXN1bHQuUGh5c2ljYWxSZXNvdXJjZUlkfVwiYCk7XG4gIH1cblxuICAvLyBtZXJnZSByZXF1ZXN0IGV2ZW50IGFuZCByZXN1bHQgZXZlbnQgKHJlc3VsdCBwcmV2YWlscykuXG4gIHJldHVybiB7XG4gICAgLi4uY2ZuUmVxdWVzdCxcbiAgICAuLi5vbkV2ZW50UmVzdWx0LFxuICAgIFBoeXNpY2FsUmVzb3VyY2VJZDogcGh5c2ljYWxSZXNvdXJjZUlkLFxuICB9O1xufVxuXG4vKipcbiAqIENhbGN1bGF0ZXMgdGhlIGRlZmF1bHQgcGh5c2ljYWwgcmVzb3VyY2UgSUQgYmFzZWQgaW4gY2FzZSB1c2VyIGhhbmRsZXIgZGlkXG4gKiBub3QgcmV0dXJuIGEgUGh5c2ljYWxSZXNvdXJjZUlkLlxuICpcbiAqIEZvciBcIkNSRUFURVwiLCBpdCB1c2VzIHRoZSBSZXF1ZXN0SWQuXG4gKiBGb3IgXCJVUERBVEVcIiBhbmQgXCJERUxFVEVcIiBhbmQgcmV0dXJucyB0aGUgY3VycmVudCBQaHlzaWNhbFJlc291cmNlSWQgKHRoZSBvbmUgcHJvdmlkZWQgaW4gYGV2ZW50YCkuXG4gKi9cbmZ1bmN0aW9uIGRlZmF1bHRQaHlzaWNhbFJlc291cmNlSWQocmVxOiBBV1NMYW1iZGEuQ2xvdWRGb3JtYXRpb25DdXN0b21SZXNvdXJjZUV2ZW50KTogc3RyaW5nIHtcbiAgc3dpdGNoIChyZXEuUmVxdWVzdFR5cGUpIHtcbiAgICBjYXNlICdDcmVhdGUnOlxuICAgICAgcmV0dXJuIHJlcS5SZXF1ZXN0SWQ7XG5cbiAgICBjYXNlICdVcGRhdGUnOlxuICAgIGNhc2UgJ0RlbGV0ZSc6XG4gICAgICByZXR1cm4gcmVxLlBoeXNpY2FsUmVzb3VyY2VJZDtcblxuICAgIGRlZmF1bHQ6XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgXCJSZXF1ZXN0VHlwZVwiIGluIHJlcXVlc3QgXCIke0pTT04uc3RyaW5naWZ5KHJlcSl9XCJgKTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/outbound.js b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/outbound.js deleted file mode 100644 index 70203dcc42f3f..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/outbound.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.httpRequest = exports.invokeFunction = exports.startExecution = void 0; -/* istanbul ignore file */ -const https = require("https"); -// eslint-disable-next-line import/no-extraneous-dependencies -const AWS = require("aws-sdk"); -const FRAMEWORK_HANDLER_TIMEOUT = 900000; // 15 minutes -// In order to honor the overall maximum timeout set for the target process, -// the default 2 minutes from AWS SDK has to be overriden: -// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#httpOptions-property -const awsSdkConfig = { - httpOptions: { timeout: FRAMEWORK_HANDLER_TIMEOUT }, -}; -async function defaultHttpRequest(options, responseBody) { - return new Promise((resolve, reject) => { - try { - const request = https.request(options, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -let sfn; -let lambda; -async function defaultStartExecution(req) { - if (!sfn) { - sfn = new AWS.StepFunctions(awsSdkConfig); - } - return sfn.startExecution(req).promise(); -} -async function defaultInvokeFunction(req) { - if (!lambda) { - lambda = new AWS.Lambda(awsSdkConfig); - } - return lambda.invoke(req).promise(); -} -exports.startExecution = defaultStartExecution; -exports.invokeFunction = defaultInvokeFunction; -exports.httpRequest = defaultHttpRequest; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0Ym91bmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvdXRib3VuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQkFBMEI7QUFDMUIsK0JBQStCO0FBQy9CLDZEQUE2RDtBQUM3RCwrQkFBK0I7QUFJL0IsTUFBTSx5QkFBeUIsR0FBRyxNQUFNLENBQUMsQ0FBQyxhQUFhO0FBRXZELDRFQUE0RTtBQUM1RSwwREFBMEQ7QUFDMUQsMkZBQTJGO0FBQzNGLE1BQU0sWUFBWSxHQUF5QjtJQUN6QyxXQUFXLEVBQUUsRUFBRSxPQUFPLEVBQUUseUJBQXlCLEVBQUU7Q0FDcEQsQ0FBQztBQUVGLEtBQUssVUFBVSxrQkFBa0IsQ0FBQyxPQUE2QixFQUFFLFlBQW9CO0lBQ25GLE9BQU8sSUFBSSxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUU7UUFDckMsSUFBSTtZQUNGLE1BQU0sT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO1lBQ2hELE9BQU8sQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFFLE1BQU0sQ0FBQyxDQUFDO1lBQzVCLE9BQU8sQ0FBQyxLQUFLLENBQUMsWUFBWSxDQUFDLENBQUM7WUFDNUIsT0FBTyxDQUFDLEdBQUcsRUFBRSxDQUFDO1NBQ2Y7UUFBQyxPQUFPLENBQUMsRUFBRTtZQUNWLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNYO0lBQ0gsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDO0FBRUQsSUFBSSxHQUFzQixDQUFDO0FBQzNCLElBQUksTUFBa0IsQ0FBQztBQUV2QixLQUFLLFVBQVUscUJBQXFCLENBQUMsR0FBMEM7SUFDN0UsSUFBSSxDQUFDLEdBQUcsRUFBRTtRQUNSLEdBQUcsR0FBRyxJQUFJLEdBQUcsQ0FBQyxhQUFhLENBQUMsWUFBWSxDQUFDLENBQUM7S0FDM0M7SUFFRCxPQUFPLEdBQUcsQ0FBQyxjQUFjLENBQUMsR0FBRyxDQUFDLENBQUMsT0FBTyxFQUFFLENBQUM7QUFDM0MsQ0FBQztBQUVELEtBQUssVUFBVSxxQkFBcUIsQ0FBQyxHQUFpQztJQUNwRSxJQUFJLENBQUMsTUFBTSxFQUFFO1FBQ1gsTUFBTSxHQUFHLElBQUksR0FBRyxDQUFDLE1BQU0sQ0FBQyxZQUFZLENBQUMsQ0FBQztLQUN2QztJQUVELE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxPQUFPLEVBQUUsQ0FBQztBQUN0QyxDQUFDO0FBRVUsUUFBQSxjQUFjLEdBQUcscUJBQXFCLENBQUM7QUFDdkMsUUFBQSxjQUFjLEdBQUcscUJBQXFCLENBQUM7QUFDdkMsUUFBQSxXQUFXLEdBQUcsa0JBQWtCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBpc3RhbmJ1bCBpZ25vcmUgZmlsZSAqL1xuaW1wb3J0ICogYXMgaHR0cHMgZnJvbSAnaHR0cHMnO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llc1xuaW1wb3J0ICogYXMgQVdTIGZyb20gJ2F3cy1zZGsnO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llc1xuaW1wb3J0IHR5cGUgeyBDb25maWd1cmF0aW9uT3B0aW9ucyB9IGZyb20gJ2F3cy1zZGsvbGliL2NvbmZpZy1iYXNlJztcblxuY29uc3QgRlJBTUVXT1JLX0hBTkRMRVJfVElNRU9VVCA9IDkwMDAwMDsgLy8gMTUgbWludXRlc1xuXG4vLyBJbiBvcmRlciB0byBob25vciB0aGUgb3ZlcmFsbCBtYXhpbXVtIHRpbWVvdXQgc2V0IGZvciB0aGUgdGFyZ2V0IHByb2Nlc3MsXG4vLyB0aGUgZGVmYXVsdCAyIG1pbnV0ZXMgZnJvbSBBV1MgU0RLIGhhcyB0byBiZSBvdmVycmlkZW46XG4vLyBodHRwczovL2RvY3MuYXdzLmFtYXpvbi5jb20vQVdTSmF2YVNjcmlwdFNESy9sYXRlc3QvQVdTL0NvbmZpZy5odG1sI2h0dHBPcHRpb25zLXByb3BlcnR5XG5jb25zdCBhd3NTZGtDb25maWc6IENvbmZpZ3VyYXRpb25PcHRpb25zID0ge1xuICBodHRwT3B0aW9uczogeyB0aW1lb3V0OiBGUkFNRVdPUktfSEFORExFUl9USU1FT1VUIH0sXG59O1xuXG5hc3luYyBmdW5jdGlvbiBkZWZhdWx0SHR0cFJlcXVlc3Qob3B0aW9uczogaHR0cHMuUmVxdWVzdE9wdGlvbnMsIHJlc3BvbnNlQm9keTogc3RyaW5nKSB7XG4gIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgdHJ5IHtcbiAgICAgIGNvbnN0IHJlcXVlc3QgPSBodHRwcy5yZXF1ZXN0KG9wdGlvbnMsIHJlc29sdmUpO1xuICAgICAgcmVxdWVzdC5vbignZXJyb3InLCByZWplY3QpO1xuICAgICAgcmVxdWVzdC53cml0ZShyZXNwb25zZUJvZHkpO1xuICAgICAgcmVxdWVzdC5lbmQoKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZWplY3QoZSk7XG4gICAgfVxuICB9KTtcbn1cblxubGV0IHNmbjogQVdTLlN0ZXBGdW5jdGlvbnM7XG5sZXQgbGFtYmRhOiBBV1MuTGFtYmRhO1xuXG5hc3luYyBmdW5jdGlvbiBkZWZhdWx0U3RhcnRFeGVjdXRpb24ocmVxOiBBV1MuU3RlcEZ1bmN0aW9ucy5TdGFydEV4ZWN1dGlvbklucHV0KTogUHJvbWlzZTxBV1MuU3RlcEZ1bmN0aW9ucy5TdGFydEV4ZWN1dGlvbk91dHB1dD4ge1xuICBpZiAoIXNmbikge1xuICAgIHNmbiA9IG5ldyBBV1MuU3RlcEZ1bmN0aW9ucyhhd3NTZGtDb25maWcpO1xuICB9XG5cbiAgcmV0dXJuIHNmbi5zdGFydEV4ZWN1dGlvbihyZXEpLnByb21pc2UoKTtcbn1cblxuYXN5bmMgZnVuY3Rpb24gZGVmYXVsdEludm9rZUZ1bmN0aW9uKHJlcTogQVdTLkxhbWJkYS5JbnZvY2F0aW9uUmVxdWVzdCk6IFByb21pc2U8QVdTLkxhbWJkYS5JbnZvY2F0aW9uUmVzcG9uc2U+IHtcbiAgaWYgKCFsYW1iZGEpIHtcbiAgICBsYW1iZGEgPSBuZXcgQVdTLkxhbWJkYShhd3NTZGtDb25maWcpO1xuICB9XG5cbiAgcmV0dXJuIGxhbWJkYS5pbnZva2UocmVxKS5wcm9taXNlKCk7XG59XG5cbmV4cG9ydCBsZXQgc3RhcnRFeGVjdXRpb24gPSBkZWZhdWx0U3RhcnRFeGVjdXRpb247XG5leHBvcnQgbGV0IGludm9rZUZ1bmN0aW9uID0gZGVmYXVsdEludm9rZUZ1bmN0aW9uO1xuZXhwb3J0IGxldCBodHRwUmVxdWVzdCA9IGRlZmF1bHRIdHRwUmVxdWVzdDtcbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/util.js b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/util.js deleted file mode 100644 index ee4c6e9c9ddeb..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/util.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.log = exports.getEnv = void 0; -function getEnv(name) { - const value = process.env[name]; - if (!value) { - throw new Error(`The environment variable "${name}" is not defined`); - } - return value; -} -exports.getEnv = getEnv; -function log(title, ...args) { - console.log('[provider-framework]', title, ...args.map(x => typeof (x) === 'object' ? JSON.stringify(x, undefined, 2) : x)); -} -exports.log = log; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInV0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLFNBQWdCLE1BQU0sQ0FBQyxJQUFZO0lBQ2pDLE1BQU0sS0FBSyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDaEMsSUFBSSxDQUFDLEtBQUssRUFBRTtRQUNWLE1BQU0sSUFBSSxLQUFLLENBQUMsNkJBQTZCLElBQUksa0JBQWtCLENBQUMsQ0FBQztLQUN0RTtJQUNELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQU5ELHdCQU1DO0FBRUQsU0FBZ0IsR0FBRyxDQUFDLEtBQVUsRUFBRSxHQUFHLElBQVc7SUFDNUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxzQkFBc0IsRUFBRSxLQUFLLEVBQUUsR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsT0FBTSxDQUFDLENBQUMsQ0FBQyxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzdILENBQUM7QUFGRCxrQkFFQyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLWNvbnNvbGUgKi9cblxuZXhwb3J0IGZ1bmN0aW9uIGdldEVudihuYW1lOiBzdHJpbmcpOiBzdHJpbmcge1xuICBjb25zdCB2YWx1ZSA9IHByb2Nlc3MuZW52W25hbWVdO1xuICBpZiAoIXZhbHVlKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKGBUaGUgZW52aXJvbm1lbnQgdmFyaWFibGUgXCIke25hbWV9XCIgaXMgbm90IGRlZmluZWRgKTtcbiAgfVxuICByZXR1cm4gdmFsdWU7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBsb2codGl0bGU6IGFueSwgLi4uYXJnczogYW55W10pIHtcbiAgY29uc29sZS5sb2coJ1twcm92aWRlci1mcmFtZXdvcmtdJywgdGl0bGUsIC4uLmFyZ3MubWFwKHggPT4gdHlwZW9mKHgpID09PSAnb2JqZWN0JyA/IEpTT04uc3RyaW5naWZ5KHgsIHVuZGVmaW5lZCwgMikgOiB4KSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/.style.yapf b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/.style.yapf deleted file mode 100644 index 72e1005523a92..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/.style.yapf +++ /dev/null @@ -1,6 +0,0 @@ -# Format using: yapf -ri . -# Since you're here, unit test using: python -m unittest discover -[style] -based_on_style = pep8 -column_limit = 120 -SPLIT_BEFORE_NAMED_ASSIGNS = False diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/Pipfile b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/Pipfile deleted file mode 100644 index 27927581bc218..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/Pipfile +++ /dev/null @@ -1,14 +0,0 @@ -[[source]] -url = "https://pypi.python.org/simple" -verify_ssl = true -name = "pypi" - -[packages] - -[dev-packages] -yapf = "*" -boto3 = "*" -coverage = "*" - -[requires] -python_version = "3.8" diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/Pipfile.lock b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/Pipfile.lock deleted file mode 100644 index 37b1c47e3d5e7..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/Pipfile.lock +++ /dev/null @@ -1,138 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "62f31cd5a0266aa03d564dff455c3c2fd49b3e086ede177a42d574a15789fbda" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.8" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.python.org/simple", - "verify_ssl": true - } - ] - }, - "default": {}, - "develop": { - "boto3": { - "hashes": [ - "sha256:76b3ee0d1dd860c9218bc864cd29f1ee986f6e1e75e8669725dd3c411039379e", - "sha256:c39cb6ed376ba1d4689ac8f6759a2b2d8a0b0424dbec0cd3af1558079bcf06e8" - ], - "index": "pypi", - "version": "==1.20.23" - }, - "botocore": { - "hashes": [ - "sha256:640b62110aa6d1c25553eceafb5bcd89aedeb84b191598d1f6492ad24374d285", - "sha256:7459766c4594f3b8877e8013f93f0dc6c6486acbeb7d9c9ae488396529cc2e84" - ], - "markers": "python_version >= '3.6'", - "version": "==1.23.23" - }, - "coverage": { - "hashes": [ - "sha256:01774a2c2c729619760320270e42cd9e797427ecfddd32c2a7b639cdc481f3c0", - "sha256:03b20e52b7d31be571c9c06b74746746d4eb82fc260e594dc662ed48145e9efd", - "sha256:0a7726f74ff63f41e95ed3a89fef002916c828bb5fcae83b505b49d81a066884", - "sha256:1219d760ccfafc03c0822ae2e06e3b1248a8e6d1a70928966bafc6838d3c9e48", - "sha256:13362889b2d46e8d9f97c421539c97c963e34031ab0cb89e8ca83a10cc71ac76", - "sha256:174cf9b4bef0db2e8244f82059a5a72bd47e1d40e71c68ab055425172b16b7d0", - "sha256:17e6c11038d4ed6e8af1407d9e89a2904d573be29d51515f14262d7f10ef0a64", - "sha256:215f8afcc02a24c2d9a10d3790b21054b58d71f4b3c6f055d4bb1b15cecce685", - "sha256:22e60a3ca5acba37d1d4a2ee66e051f5b0e1b9ac950b5b0cf4aa5366eda41d47", - "sha256:2641f803ee9f95b1f387f3e8f3bf28d83d9b69a39e9911e5bfee832bea75240d", - "sha256:276651978c94a8c5672ea60a2656e95a3cce2a3f31e9fb2d5ebd4c215d095840", - "sha256:3f7c17209eef285c86f819ff04a6d4cbee9b33ef05cbcaae4c0b4e8e06b3ec8f", - "sha256:3feac4084291642165c3a0d9eaebedf19ffa505016c4d3db15bfe235718d4971", - "sha256:49dbff64961bc9bdd2289a2bda6a3a5a331964ba5497f694e2cbd540d656dc1c", - "sha256:4e547122ca2d244f7c090fe3f4b5a5861255ff66b7ab6d98f44a0222aaf8671a", - "sha256:5829192582c0ec8ca4a2532407bc14c2f338d9878a10442f5d03804a95fac9de", - "sha256:5d6b09c972ce9200264c35a1d53d43ca55ef61836d9ec60f0d44273a31aa9f17", - "sha256:600617008aa82032ddeace2535626d1bc212dfff32b43989539deda63b3f36e4", - "sha256:619346d57c7126ae49ac95b11b0dc8e36c1dd49d148477461bb66c8cf13bb521", - "sha256:63c424e6f5b4ab1cf1e23a43b12f542b0ec2e54f99ec9f11b75382152981df57", - "sha256:6dbc1536e105adda7a6312c778f15aaabe583b0e9a0b0a324990334fd458c94b", - "sha256:6e1394d24d5938e561fbeaa0cd3d356207579c28bd1792f25a068743f2d5b282", - "sha256:86f2e78b1eff847609b1ca8050c9e1fa3bd44ce755b2ec30e70f2d3ba3844644", - "sha256:8bdfe9ff3a4ea37d17f172ac0dff1e1c383aec17a636b9b35906babc9f0f5475", - "sha256:8e2c35a4c1f269704e90888e56f794e2d9c0262fb0c1b1c8c4ee44d9b9e77b5d", - "sha256:92b8c845527eae547a2a6617d336adc56394050c3ed8a6918683646328fbb6da", - "sha256:9365ed5cce5d0cf2c10afc6add145c5037d3148585b8ae0e77cc1efdd6aa2953", - "sha256:9a29311bd6429be317c1f3fe4bc06c4c5ee45e2fa61b2a19d4d1d6111cb94af2", - "sha256:9a2b5b52be0a8626fcbffd7e689781bf8c2ac01613e77feda93d96184949a98e", - "sha256:a4bdeb0a52d1d04123b41d90a4390b096f3ef38eee35e11f0b22c2d031222c6c", - "sha256:a9c8c4283e17690ff1a7427123ffb428ad6a52ed720d550e299e8291e33184dc", - "sha256:b637c57fdb8be84e91fac60d9325a66a5981f8086c954ea2772efe28425eaf64", - "sha256:bf154ba7ee2fd613eb541c2bc03d3d9ac667080a737449d1a3fb342740eb1a74", - "sha256:c254b03032d5a06de049ce8bca8338a5185f07fb76600afff3c161e053d88617", - "sha256:c332d8f8d448ded473b97fefe4a0983265af21917d8b0cdcb8bb06b2afe632c3", - "sha256:c7912d1526299cb04c88288e148c6c87c0df600eca76efd99d84396cfe00ef1d", - "sha256:cfd9386c1d6f13b37e05a91a8583e802f8059bebfccde61a418c5808dea6bbfa", - "sha256:d5d2033d5db1d58ae2d62f095e1aefb6988af65b4b12cb8987af409587cc0739", - "sha256:dca38a21e4423f3edb821292e97cec7ad38086f84313462098568baedf4331f8", - "sha256:e2cad8093172b7d1595b4ad66f24270808658e11acf43a8f95b41276162eb5b8", - "sha256:e3db840a4dee542e37e09f30859f1612da90e1c5239a6a2498c473183a50e781", - "sha256:edcada2e24ed68f019175c2b2af2a8b481d3d084798b8c20d15d34f5c733fa58", - "sha256:f467bbb837691ab5a8ca359199d3429a11a01e6dfb3d9dcc676dc035ca93c0a9", - "sha256:f506af4f27def639ba45789fa6fde45f9a217da0be05f8910458e4557eed020c", - "sha256:f614fc9956d76d8a88a88bb41ddc12709caa755666f580af3a688899721efecd", - "sha256:f9afb5b746781fc2abce26193d1c817b7eb0e11459510fba65d2bd77fe161d9e", - "sha256:fb8b8ee99b3fffe4fd86f4c81b35a6bf7e4462cba019997af2fe679365db0c49" - ], - "index": "pypi", - "version": "==6.2" - }, - "jmespath": { - "hashes": [ - "sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9", - "sha256:cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f" - ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.10.0" - }, - "python-dateutil": { - "hashes": [ - "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", - "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.8.2" - }, - "s3transfer": { - "hashes": [ - "sha256:50ed823e1dc5868ad40c8dc92072f757aa0e653a192845c94a3b676f4a62da4c", - "sha256:9c1dc369814391a6bda20ebbf4b70a0f34630592c9aa520856bf384916af2803" - ], - "markers": "python_version >= '3.6'", - "version": "==0.5.0" - }, - "six": { - "hashes": [ - "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", - "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.16.0" - }, - "urllib3": { - "hashes": [ - "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", - "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.7" - }, - "yapf": { - "hashes": [ - "sha256:408fb9a2b254c302f49db83c59f9aa0b4b0fd0ec25be3a5c51181327922ff63d", - "sha256:e3a234ba8455fe201eaa649cdac872d590089a18b661e39bbac7020978dd9c2e" - ], - "index": "pypi", - "version": "==0.31.0" - } - } -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/index.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/index.py deleted file mode 100644 index 790102022efed..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/index.py +++ /dev/null @@ -1,34 +0,0 @@ -import logging -import os - -import boto3 - -from lib.cleanup_resource_handler import CleanupResourceHandler -from lib.queue_handler import QueueHandler - -logging.getLogger().setLevel(logging.INFO) - - -def queue_handler(event, context): - """ - Handler for the event queue lambda trigger - """ - - ec2_client = boto3.client('ec2') - dynamodb_resource = boto3.resource('dynamodb') - route53_client = boto3.client('route53') - - handler = QueueHandler(ec2_client=ec2_client, dynamodb_resource=dynamodb_resource, route53_client=route53_client, - environ=os.environ) - - return handler.handle(event, context) - - -def cleanup_resource_handler(event, context): - """ - Event handler for the custom resource. - """ - - route53_client = boto3.client('route53') - handler = CleanupResourceHandler(route53_client=route53_client) - handler.handle_event(event, context) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/__init__.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/cleanup_resource_handler.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/cleanup_resource_handler.py deleted file mode 100644 index 1ffde51b261c0..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/cleanup_resource_handler.py +++ /dev/null @@ -1,51 +0,0 @@ -import time -from dataclasses import dataclass -import logging -from typing import Any - -from lib.route53 import Route53RecordSetAccessor, Route53RecordSetLocator - - -@dataclass -class CleanupResourceProperties: - HostedZoneId: str - RecordName: str - ServiceToken: str - - -class CleanupResourceHandler: - route53_client: Any - monitor_interval: int - - def __init__(self, route53_client, monitor_interval=5): - self.record_set_accessor = Route53RecordSetAccessor(route53_client=route53_client) - self.monitor_interval = monitor_interval - - def handle_event(self, event, context): - request_type = event['RequestType'] - resource_properties = event['ResourceProperties'] - logging.info(f'Handling a {request_type} event with properties {resource_properties}') - - # Decode resource properties right away so that mis-configured - # properties will always fail quickly. - resource_properties = CleanupResourceProperties(**resource_properties) - - if request_type == 'Delete': - return self.on_delete(resource_properties) - - def on_delete(self, resource_properties: CleanupResourceProperties): - locator = Route53RecordSetLocator(hosted_zone_id=resource_properties.HostedZoneId, - record_name=resource_properties.RecordName) - - deleted = self.record_set_accessor.delete(locator=locator) - - if deleted: - logging.info(f'Monitoring for the record deletion') - for interval_number in range(1, 10): - if not self.record_set_accessor.exists(locator): - logging.info(f'The record has been deleted') - return - else: - logging.info(f'The record still exists') - if self.monitor_interval > 0: - time.sleep(self.monitor_interval) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/events.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/events.py deleted file mode 100644 index aa34343a00170..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/events.py +++ /dev/null @@ -1,15 +0,0 @@ -from lib.records import TaskInfo, EniInfo - - -def extract_event_task_info(task_description) -> TaskInfo: - arn = task_description['taskArn'] - - # Parse the eni info out of the the attachments - enis = [ - EniInfo(eni_id=detail['value']) for network_interface in task_description['attachments'] - if network_interface['type'] == 'eni' for detail in network_interface['details'] - if detail['name'] == 'networkInterfaceId' - ] - - # Create an object out of the extracted information - return TaskInfo(task_arn=arn, enis=enis) \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/queue_handler.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/queue_handler.py deleted file mode 100644 index db56b4c898264..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/queue_handler.py +++ /dev/null @@ -1,117 +0,0 @@ -import json -import logging -from typing import Any - -from lib.events import extract_event_task_info -from lib.records import DdbRecordKey, DdbRecord -from lib.records_table import RecordsTableAccessor, RecordUpdate -from lib.route53 import Route53RecordSetLocator, Route53RecordSetAccessor -from lib.running_task_collector import RunningTaskCollector - - -class QueueHandler: - def __init__(self, ec2_client, route53_client, dynamodb_resource, environ): - self.ec2_client = ec2_client - self.route53_client = route53_client - - hosted_zone_id = environ['HOSTED_ZONE_ID'] - record_name = environ['RECORD_NAME'] - records_table = environ['RECORDS_TABLE'] - - cluster_arn = environ['CLUSTER_ARN'] - self.service_name = environ['SERVICE_NAME'] - - self.records_table_key = DdbRecordKey(cluster_arn=cluster_arn, service_name=self.service_name) - self.records_table_accessor = RecordsTableAccessor(table_client=dynamodb_resource.Table(records_table)) - - self.record_set_locator = Route53RecordSetLocator(hosted_zone_id=hosted_zone_id, record_name=record_name) - self.record_set_accessor = Route53RecordSetAccessor(route53_client=self.route53_client) - - def handle(self, event, context): - logging.info(f'event = {json.dumps(event)}') - - # Get a reference record from the records table to check for incoming - # event inconsistencies. - reference_record = self.records_table_accessor.get_record(self.records_table_key) - - # Collect running and stopped tasks from the status change events - running_tasks, stopped_tasks = self.collect_event_task_info(event, reference_record) - - # Build up a set of updates for the record - update = RecordUpdate(running_tasks=running_tasks, stopped_tasks=stopped_tasks) - - # Record the current record set locator - update.current_record_set(self.record_set_locator) - - # Clean any extra record sets in case the recordset has moved. - for record_set_locator in reference_record.record_sets: - if not record_set_locator.matches(self.record_set_locator): - update.extra_record_set(record_set_locator) - self.try_to_delete_record(record_set_locator) - - # Introduce some delay - # records_table.optimistic_simulation_delay = 5 - - # Update the record - ddb_record = self.records_table_accessor.put_update(key=self.records_table_key, update=update) - - # Update DNS - self.record_set_accessor.update(locator=self.record_set_locator, ipv4s=ddb_record.ipv4s) - - def collect_event_task_info(self, event, reference_record: DdbRecord): - running_task_collector = RunningTaskCollector(ec2_client=self.ec2_client, reference_record=reference_record) - stopped_tasks = [] - for message in decode_records(event): - if 'details' not in message: - logging.info(f'Received a non-task state message {message}') - continue - - task_description = message['details'] - - group = task_description['group'] - if group != f'service:{self.service_name}': - logging.info(f'Skipping irrelevant task description from group {group}') - continue - - task_info = extract_event_task_info(task_description) - logging.info(f'extracted task_info = {task_info}') - - last_status = task_description['lastStatus'] - if last_status == 'RUNNING': - logging.info(f'Collecting {task_info.task_arn} as running') - running_task_collector.collect(task_info) - - elif last_status == 'STOPPED': - logging.info(f'Collecting {task_info.task_arn} as stopped') - stopped_tasks.append(task_info) - - else: - logging.warning(f'{task_info.task_arn} had an unexpected status: {last_status}') - - # Query the ENIs store-back public IPs. - running_task_collector.fill_eni_info_from_eni_query() - - running_tasks = running_task_collector.tasks - - return running_tasks, stopped_tasks - - def try_to_delete_record(self, record_set_locator: Route53RecordSetLocator): - """ - Try to delete the given record set. This may not be possible if the - record is in a hosted zone we don't have access to. This may happen - when the user changes dns zones at the service extension level. - """ - - try: - self.record_set_accessor.delete(record_set_locator) - - except: - # We give up pretty easily if the record set accessor can't delete - # the extraneous record for any reason that the accessor can't - # handle. - logging.warning(f'Could not delete the extraneous record set {record_set_locator}') - - -def decode_records(sqs_event): - logging.info(f'sqs_event = {json.dumps(sqs_event)}') - return [json.loads(sqs_record['body']) for sqs_record in sqs_event['Records']] diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/records.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/records.py deleted file mode 100644 index a6a1f2a374ab0..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/records.py +++ /dev/null @@ -1,185 +0,0 @@ -from dataclasses import dataclass, field -from datetime import datetime -from typing import Optional, List, Dict, Set - -from boto3.dynamodb.conditions import Key - -from lib.route53 import Route53RecordSetLocator - - -@dataclass -class EniInfo: - eni_id: str - public_ipv4: Optional[str] = None - - -@dataclass -class TaskInfo: - task_arn: str - enis: List[EniInfo] - stopped_datetime: Optional[datetime] = None - - # Tombstone information for the dynamodb record. - - def set_stopped_marker(self): - """ - Mark this task as stopped. - """ - self.stopped_datetime = datetime.utcnow() - - def is_stopped(self): - """ - Check if this task is stopped. - """ - return True if self.stopped_datetime is not None else False - - -@dataclass -class DdbRecordKey: - cluster_arn: str - service_name: str - - def to_composite(self): - return f'{self.cluster_arn}#{self.service_name}' - - @staticmethod - def from_composite(composite: str): - cluster_arn, service_name = composite.split('#') - return DdbRecordKey(cluster_arn=cluster_arn, service_name=service_name) - - -@dataclass -class DdbRecord: - key: DdbRecordKey - ipv4s: Set[str] = field(default_factory=set) - task_info: Dict[str, TaskInfo] = field(default_factory=dict) - record_sets: Set[Route53RecordSetLocator] = field(default_factory=set) - version: int = 0 - - def task_is_stopped(self, task_info: TaskInfo): - """ - Check if a task has already stopped. - """ - - return task_info.task_arn in self.task_info and self.task_info[task_info.task_arn].is_stopped() - - -class DdbRecordEncoding: - PK_NAME = 'cluster_service' - ATTR_VERSION = 'version' - ATTR_IPV4S = 'ipv4s' - ATTR_TASK_INFO = 'task_info' - ATTR_TASK_ARN = 'task_arn' - ATTR_TASK_ENIS = 'enis' - ATTR_TASK_STOPPED_DATETIME = 'stopped_datetime' - ATTR_ENI_ID = 'eni_id' - ATTR_ENI_PUBLIC_IPV4 = 'public_ipv4' - ATTR_RECORD_SETS = 'record_sets' - ATTR_RECORD_SET_ZONE = 'hosted_zone_id' - ATTR_RECORD_SET_NAME = 'record_name' - - def get_identity(self, key: DdbRecordKey): - return {self.PK_NAME: key.to_composite()} - - def get_identity_expression(self, key: DdbRecordKey): - return Key(self.PK_NAME).eq(key.to_composite()) - - def encode(self, record: DdbRecord) -> dict: - data = dict() - data[self.PK_NAME] = record.key.to_composite() - data[self.ATTR_VERSION] = record.version - - if len(record.ipv4s) > 0: - # Sorting only matters here for repeatability in tests, as set ordering - # isn't easily predictable. - data[self.ATTR_IPV4S] = [v for v in sorted(record.ipv4s)] - - if len(record.record_sets) > 0: - data[self.ATTR_RECORD_SETS] = [self.encode_record_set(v) for v in sorted(record.record_sets)] - - if len(record.task_info) > 0: - data[self.ATTR_TASK_INFO] = { - task_info.task_arn: self.encode_task_info(task_info) - for task_info in record.task_info.values() - } - - return data - - def encode_record_set(self, record_set: Route53RecordSetLocator): - return { - self.ATTR_RECORD_SET_ZONE: record_set.hosted_zone_id, - self.ATTR_RECORD_SET_NAME: record_set.record_name, - } - - def encode_task_info(self, task_info: TaskInfo) -> dict: - data = dict() - data[self.ATTR_TASK_ARN] = task_info.task_arn - - if task_info.stopped_datetime is not None: - data[self.ATTR_TASK_STOPPED_DATETIME] = task_info.stopped_datetime.isoformat() - - if len(task_info.enis) > 0: - data[self.ATTR_TASK_ENIS] = [self.encode_eni_info(eni_info) for eni_info in task_info.enis] - - return data - - def encode_eni_info(self, eni_info: EniInfo) -> dict: - data = dict() - data[self.ATTR_ENI_ID] = eni_info.eni_id - if eni_info.public_ipv4 is not None: - data[self.ATTR_ENI_PUBLIC_IPV4] = eni_info.public_ipv4 - - return data - - def decode(self, data: dict) -> DdbRecord: - key = DdbRecordKey.from_composite(data[self.PK_NAME]) - version = int(data[self.ATTR_VERSION]) - - ipv4s = set() - if self.ATTR_IPV4S in data: - ipv4s = {ip for ip in data[self.ATTR_IPV4S]} - - record_sets = set() - if self.ATTR_RECORD_SETS in data: - for record_set_data in data[self.ATTR_RECORD_SETS]: - record_set = self.decode_record_set(record_set_data) - record_sets.add(record_set) - - task_info = dict() - if self.ATTR_TASK_INFO in data: - task_info = { - k: self.decode_task_info(task_info_data) - for (k, task_info_data) in data[self.ATTR_TASK_INFO].items() - } - - record = DdbRecord(key=key, version=version, ipv4s=ipv4s, task_info=task_info, record_sets=record_sets) - - return record - - def decode_record_set(self, data) -> Route53RecordSetLocator: - hosted_zone_id = data[self.ATTR_RECORD_SET_ZONE] - record_name = data[self.ATTR_RECORD_SET_NAME] - - return Route53RecordSetLocator(hosted_zone_id=hosted_zone_id, record_name=record_name) - - def decode_task_info(self, data) -> TaskInfo: - task_arn = data[self.ATTR_TASK_ARN] - - stopped_datetime = None - if self.ATTR_TASK_STOPPED_DATETIME in data: - stopped_datetime = datetime.fromisoformat(data[self.ATTR_TASK_STOPPED_DATETIME]) - - enis = [] - if self.ATTR_TASK_ENIS in data: - enis = [self.decode_eni_info(eni_info_data) for eni_info_data in data[self.ATTR_TASK_ENIS]] - - return TaskInfo(task_arn=task_arn, stopped_datetime=stopped_datetime, enis=enis) - - def decode_eni_info(self, data) -> EniInfo: - eni_id = data[self.ATTR_ENI_ID] - - public_ipv4 = None - if self.ATTR_ENI_PUBLIC_IPV4 in data: - public_ipv4 = data[self.ATTR_ENI_PUBLIC_IPV4] - - return EniInfo(eni_id=eni_id, public_ipv4=public_ipv4) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/records_table.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/records_table.py deleted file mode 100644 index 390ef0066dde5..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/records_table.py +++ /dev/null @@ -1,215 +0,0 @@ -import logging -import time -from dataclasses import dataclass, field -from datetime import datetime, timedelta -from typing import * - -from boto3.dynamodb.conditions import Attr -from botocore.exceptions import ClientError - -from lib.records import DdbRecord, DdbRecordKey, DdbRecordEncoding, TaskInfo -from lib.route53 import Route53RecordSetLocator - - -@dataclass -class RecordUpdate: - running_tasks: List[TaskInfo] = field(default_factory=list) - stopped_tasks: List[TaskInfo] = field(default_factory=list) - record_sets_added: List[Route53RecordSetLocator] = field(default_factory=list) - record_sets_removed: List[Route53RecordSetLocator] = field(default_factory=list) - - def current_record_set(self, record_set: Route53RecordSetLocator): - self.record_sets_added.append(record_set) - - def extra_record_set(self, record_set: Route53RecordSetLocator): - self.record_sets_removed.append(record_set) - - -class RecordsTableAccessor: - """ - Abstracts management of the task records to putting running and stopped tasks. - """ - - table_client: Any - ddb_record_encoding: DdbRecordEncoding - - # Max number of attempts at optimistic put_tasks - max_attempts = 50 - - # Amount of lag to add (if any) to simulate concurrent locking conflicts in - # lambda - optimistic_simulation_delay = 0 - - def __init__(self, table_client): - """ - Initializes a RecordsTable. Provide a boto3.resource - """ - self.table_client = table_client - self.ddb_record_encoding = DdbRecordEncoding() - - def delete(self, key: DdbRecordKey): - """ - Delete a record by record key. - """ - - logging.info(f'Deleting {key}') - self.table_client.delete_item(Key=self.ddb_record_encoding.get_identity(key)) - - def put_update(self, key: DdbRecordKey, update: RecordUpdate) -> DdbRecord: - """ - Retries putting tasks into the table record with optimistic locking. - """ - - for attempt in range(0, self.max_attempts): - try: - logging.info(f'Attempting to put the task optimistically (attempt {attempt+1})') - return self.put_update_optimistically(key=key, update=update) - except ClientError as e: - if e.response['Error']['Code'] == 'ConditionalCheckFailedException': - logging.info(f'Check condition was rejected') - continue - else: - raise - - # Ran out of retries!! - raise Exception('Exceeded maximum retries while optimistically putting changes') - - def get_record(self, key: DdbRecordKey) -> DdbRecord: - """ - Gets the record by key or provides a blank record. - """ - - # Search for the pertinent record - response = self.table_client.query(KeyConditionExpression=self.ddb_record_encoding.get_identity_expression(key)) - - if len(response['Items']) > 0: - # Decode a pre-existing record - logging.info(f'Found a pre-existing record') - return self.ddb_record_encoding.decode(response['Items'][0]) - else: - logging.info(f'Creating a new record') - # Create a new record - return DdbRecord(key=key) - - def put_update_optimistically(self, key: DdbRecordKey, update: RecordUpdate) -> DdbRecord: - """ - Optimistically record running and stopped tasks for this record. - """ - - ddb_record = self.get_record(key=key) - - # Add some lag (if any) to simulate concurrent locking conflicts in lambda - if self.optimistic_simulation_delay > 0: - time.sleep(self.optimistic_simulation_delay) - - # Update the record with the running and stopped task info - update_ddb_record(ddb_record=ddb_record, update=update) - - # Optimistic locking condition - optimistic_lock_condition = Attr(self.ddb_record_encoding.ATTR_VERSION).not_exists() \ - | Attr(self.ddb_record_encoding.ATTR_VERSION).eq(ddb_record.version) - - # Prepare the record for updating - ddb_record.version += 1 - item = self.ddb_record_encoding.encode(ddb_record) - - # Put it up - self.table_client.put_item(Item=item, ConditionExpression=optimistic_lock_condition) - - return ddb_record - - -def update_ddb_record(ddb_record: DdbRecord, update: RecordUpdate) -> DdbRecord: - """ - Updates a DynamoDB record with the list of running and stopped tasks. - """ - - # Add the record sets we want to add - for record_set in update.record_sets_added: - ddb_record.record_sets.add(record_set) - - # Remove the ones we want to remove - for record_set in update.record_sets_removed: - if record_set in ddb_record.record_sets: - ddb_record.record_sets.remove(record_set) - - # Add running task info to the record - for running_task in update.running_tasks: - # Don't add a task as running when it previously stopped (out-of-order receive) - if running_task.task_arn in ddb_record.task_info and ddb_record.task_info[running_task.task_arn].is_stopped(): - logging.info( - f'Received {running_task.task_arn} transition to RUNNING, but it was already stopped. Ignored.') - continue - - # Record info about the running task - ddb_record.task_info[running_task.task_arn] = running_task - - # Add all public ips to the public ip set - for eni in running_task.enis: - if eni.public_ipv4 is not None: - ddb_record.ipv4s.add(eni.public_ipv4) - - logging.info(f'Recorded {running_task.task_arn} as RUNNING.') - - # Remove stopped task ips from the record and set "stopped" markers on the - # stored task info. - for stopped_task in update.stopped_tasks: - # When the stopped task was previously represented in the task info list, - # then we fetch the old representation for its potential ip address info. - if stopped_task.task_arn in ddb_record.task_info: - task_arn = stopped_task.task_arn - stored_task = ddb_record.task_info[task_arn] - - # When the task is not yet marked as stopped, we need to mark it as such - # and remove its eni ips from the ip list. - if not stored_task.is_stopped(): - stored_task.set_stopped_marker() - - for eni in stored_task.enis: - if eni.public_ipv4 is not None and eni.public_ipv4 in ddb_record.ipv4s: - ddb_record.ipv4s.remove(eni.public_ipv4) - - logging.info(f'Recorded {task_arn} as STOPPED.') - - else: - # Stored task already marked as stopped, so the received task is a - # duplicate. Ignore it. - logging.info(f'Received {task_arn} which was already STOPPED. Ignoring.') - pass - - else: - # Stopped task isn't in the task list, so we've received an out-of-order - # STOPPED transition. We don't know this task, but we know that if we - # receive a running task in the future, that we don't want to accept it. - stopped_task.set_stopped_marker() - ddb_record.task_info[stopped_task.task_arn] = stopped_task - logging.info(f'Recorded {stopped_task.task_arn} as STOPPED even though we have never seen it.') - - # Expunge expired tasks. Use a copy of the dict items to avoid errors from the - # dictionary changing while iterating. - for (key, task) in list(ddb_record.task_info.items()): - if task_info_has_expired(task): - logging.info(f'Expunging {task.task_arn} as expired.') - del ddb_record.task_info[key] - - return ddb_record - - -# The the length of time that a task marked as stopped may continue to exist -# in the task info list before it is expunged. -STOPPED_MARKER_EXPIRATION = timedelta(minutes=30) - - -def task_info_has_expired(task_info: TaskInfo): - """ - Determine if this task info can be deleted from the DDB record. If the task - has stopped and the stopped marker expiration has elapsed, then we can - delete, otherwise the task info must be kept to filter out-of-order duplicate - RUNNING state transition events. - """ - - if not task_info.is_stopped(): - return False - - stopped_marker_age = datetime.utcnow() - task_info.stopped_datetime - return True if stopped_marker_age > STOPPED_MARKER_EXPIRATION else False diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/route53.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/route53.py deleted file mode 100644 index df3b23c76a1fe..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/route53.py +++ /dev/null @@ -1,167 +0,0 @@ -from dataclasses import dataclass -import time -from typing import * -import logging - -from botocore.exceptions import ClientError - - -@dataclass -class Route53RecordSetLocator: - hosted_zone_id: str - record_name: str - - def __str__(self): - """String serialization for hashing and comparison""" - return f'{self.hosted_zone_id}#{self.record_name}' - - def __hash__(self): - """Unique hash for this object is based on its string serialization""" - return int.from_bytes(self.__str__().encode(), 'little') - - def __lt__(self, other): - """set() uses this""" - return self.__str__() < other.__str__() - - def get_dot_suffixed_name(self): - return self.record_name + '.' - - def matches_record_set(self, record_set): - return record_set['Name'] == self.get_dot_suffixed_name() - - def matches(self, record_set_locator): - return self.record_name == record_set_locator.record_name and self.hosted_zone_id == record_set_locator.hosted_zone_id - - -class Route53RecordSetAccessor: - route53_client: Any - ttl = 60 - - def __init__(self, route53_client: Any): - self.route53_client = route53_client - - def update(self, locator: Route53RecordSetLocator, ipv4s: Set[str] = None): - ipv4s = set() if ipv4s is None else ipv4s - - record_set, is_new = retry_with_backoff(lambda: self.get_record_set(locator)) - if is_new: - logging.info(f'Found a pre-existing record set: {record_set}') - else: - logging.info('Creating a new record set') - - if len(ipv4s) > 0: - record_set['ResourceRecords'] = map_ips_to_resource_records(ipv4s) - retry_with_backoff(lambda: self.request_upsert(locator, record_set)) - elif not is_new: - retry_with_backoff(lambda: self.request_delete(locator, record_set)) - else: - logging.info('Refusing to do anything with a new but empty recordset') - - def get_record_set(self, locator: Route53RecordSetLocator) -> Tuple[dict, bool]: - record_type = 'A' - result = self.route53_client.list_resource_record_sets(HostedZoneId=locator.hosted_zone_id, - StartRecordName=locator.record_name, - StartRecordType=record_type, MaxItems="1") - - logging.info(f'Query result: {result}') - existing_record_set = find_locator_record_set(locator, record_type, result['ResourceRecordSets']) - if existing_record_set: - return existing_record_set, False - else: - return { - 'Name': locator.get_dot_suffixed_name(), - 'Type': record_type, - 'ResourceRecords': [], - 'TTL': self.ttl - }, True - - def request_upsert(self, locator: Route53RecordSetLocator, record_set): - logging.info(f'Upserting record set {record_set}') - self.route53_client.change_resource_record_sets( - HostedZoneId=locator.hosted_zone_id, ChangeBatch={ - 'Comment': 'Automatic', - 'Changes': [{ - 'Action': 'UPSERT', - 'ResourceRecordSet': record_set - }] - }) - - def delete(self, locator: Route53RecordSetLocator): - """ - Delete the record. Returns true if it found and deleted the record. - Returns false if it didn't need to delete anything. - """ - - logging.info(f'Querying for {locator}') - record_set, is_new = retry_with_backoff(lambda: self.get_record_set(locator)) - - if not is_new: - logging.info(f'Found a record set') - retry_with_backoff(lambda: self.request_delete(locator, record_set)) - logging.info(f'Deleted record set {record_set}') - return True - - else: - logging.info(f'Did not find a record set, so no deletion needed') - return False - - def exists(self, locator: Route53RecordSetLocator): - """ - Returns true if the record exists. False otherwise. - """ - - _, is_new = retry_with_backoff(lambda: self.get_record_set(locator)) - - return not is_new - - def request_delete(self, locator: Route53RecordSetLocator, record_set): - logging.info(f'Deleting record set: {record_set}') - self.route53_client.change_resource_record_sets( - HostedZoneId=locator.hosted_zone_id, ChangeBatch={ - 'Comment': 'Automatic', - 'Changes': [{ - 'Action': 'DELETE', - 'ResourceRecordSet': record_set, - }] - }) - - -def exponential_backoff(attempt: int): - return 2**attempt - - -def retry_with_backoff(call: Callable, attempts=5, backoff=exponential_backoff): - for attempt in range(0, attempts): - try: - return call() - - except ClientError as e: - if e.response['Error']['Code'] == 'Throttling': - backoff_seconds = backoff(attempt) - logging.info(f'Attempt {attempt+1} throttled. Backing off for {backoff_seconds}.') - time.sleep(backoff_seconds) - continue - - if e.response['Error']['Code'] == 'PriorRequestNotComplete': - backoff_seconds = backoff(attempt) - logging.info( - f'Attempt {attempt+1} discovered the prior request is not yet complete. Backing off for {backoff_seconds}.' - ) - time.sleep(backoff_seconds) - continue - - raise - - -def map_ips_to_resource_records(ips: Set[str]): - # Take up to the first 400 ips after sorting as the max recordset record quota is 400 - ips_sorted_limited = sorted(ips)[0:400] - return [{'Value': ip} for ip in ips_sorted_limited] - - -def find_locator_record_set(locator: Route53RecordSetLocator, record_type: str, record_sets: list): - for record_set in record_sets: - if locator.matches_record_set(record_set) and record_set['Type'] == record_type: - return record_set - - return None diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/running_task_collector.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/running_task_collector.py deleted file mode 100644 index a7034d81e5e53..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/lib/running_task_collector.py +++ /dev/null @@ -1,57 +0,0 @@ -import logging -from typing import * - -from lib.records import DdbRecord, EniInfo, TaskInfo - - -class RunningTaskCollector: - """ - Collects information about running tasks. After collecting all task info, - when `fill_eni_info_from_eni_query()` is called, the collector queries - for the ip addresses of the tasks and fills in the appropriate records. - """ - - ec2_client: Any - tasks: List[TaskInfo] - enis_by_id: Dict[str, EniInfo] - - def __init__(self, ec2_client, reference_record: DdbRecord): - self.ec2_client = ec2_client - self.tasks = list() - self.enis_by_id = dict() - self.reference_record = reference_record - - def collect(self, task_info): - # Check to see if the task we've received is already stopped. If so, - # we refuse to collect it on the basis that we'll just get an eni - # doesn't exist error anyway. - if self.reference_record.task_is_stopped(task_info): - logging.info(f'Refusing to collect {task_info.task_arn} as it has already been deleted') - return - - # Append the task info to the master list - self.tasks.append(task_info) - - # Collect enis indexed by their ids - for eni in task_info.enis: - self.enis_by_id[eni.eni_id] = eni - - def fill_eni_info_from_eni_query(self): - for eni_description in self.describe_enis(): - eni_id = eni_description['NetworkInterfaceId'] - - if 'Association' in eni_description: - public_ipv4 = eni_description['Association']['PublicIp'] - if public_ipv4 and eni_id in self.enis_by_id: - self.enis_by_id[eni_id].public_ipv4 = public_ipv4 - - def describe_enis(self): - paginator = self.ec2_client.get_paginator('describe_network_interfaces') - - eni_ids = list(self.enis_by_id.keys()) - for page in paginator.paginate(NetworkInterfaceIds=eni_ids): - for eni in page['NetworkInterfaces']: - yield eni - - def get_ips(self): - return [eni.public_ipv4 for eni in self.enis_by_id.values()] diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/run_test.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/run_test.py deleted file mode 100644 index 7efd5dc08534d..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/run_test.py +++ /dev/null @@ -1,5 +0,0 @@ -import unittest - -if __name__ == "__main__": - test_suite = unittest.defaultTestLoader.discover('.') - unittest.TextTestRunner().run(test_suite) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/__init__.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/__init__.py deleted file mode 100644 index 539bac0f9e2aa..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Keep this file so that python -m unittest discover can find these tests. diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/ddb-record.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/ddb-record.json deleted file mode 100644 index f62cf391abf39..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/ddb-record.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "cluster_service": "CLUSTER_ARN#SERVICE", - "ipv4s": [ - "1.1.2.1", - "1.1.2.2" - ], - "task_info": { - "TASK1_ARN": { - "enis": [ - { - "eni_id": "TASK1_ENI1_ID", - "public_ipv4": "1.1.1.1" - } - ], - "stopped_datetime": "2020-10-04T23:47:36.322158", - "task_arn": "TASK1_ARN" - }, - "TASK2_ARN": { - "enis": [ - { - "eni_id": "TASK2_ENI1_ID", - "public_ipv4": "1.1.2.1" - }, - { - "eni_id": "TASK2_ENI2_ID", - "public_ipv4": "1.1.2.2" - } - ], - "task_arn": "TASK2_ARN" - } - }, - "record_sets": [ - { - "hosted_zone_id": "ABCD", - "record_name": "test-record.myexample.com" - }, - { - "hosted_zone_id": "ABCD", - "record_name": "test-record2.myexample.com" - } - ], - "version": 12 -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/eni_description.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/eni_description.json deleted file mode 100644 index 9e790e455fb99..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/eni_description.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Association": { - "IpOwnerId": "amazon", - "PublicDnsName": "example.com", - "PublicIp": "1.2.3.4" - }, - "Attachment": { - "AttachTime": "2020-10-03T23:42:51+00:00", - "AttachmentId": "eni-attach-0704671692ecf366b", - "DeleteOnTermination": false, - "DeviceIndex": 1, - "InstanceOwnerId": "000000000", - "Status": "attached" - }, - "AvailabilityZone": "test-region-1a", - "Description": "arn:aws:ecs:test-region-1:0000000000:attachment/20d24cce-3d50-493d-b890-32d4f11859f4", - "Groups": [ - { - "GroupName": "aws-ecs-integ-nameserviceSecurityGroup33F4662C-16PM465FOR8L1", - "GroupId": "sg-0b83d6ad2edd8e940" - } - ], - "InterfaceType": "interface", - "Ipv6Addresses": [], - "MacAddress": "02:a4:cb:74:0f:a8", - "NetworkInterfaceId": "eni-abcd", - "OwnerId": "0000000000", - "PrivateDnsName": "ip-10-0-0-19.test-region-1.compute.internal", - "PrivateIpAddress": "10.0.0.19", - "PrivateIpAddresses": [ - { - "Association": { - "IpOwnerId": "amazon", - "PublicDnsName": "example.com", - "PublicIp": "1.2.3.4" - }, - "Primary": true, - "PrivateDnsName": "ip-10-0-0-19.test-region-1.compute.internal", - "PrivateIpAddress": "10.0.0.19" - } - ], - "RequesterId": "0000000000", - "RequesterManaged": true, - "SourceDestCheck": true, - "Status": "in-use", - "SubnetId": "subnet-036b0d1413bb6bd2c", - "TagSet": [], - "VpcId": "vpc-0e63014e689c4b14f" -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/task_description.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/task_description.json deleted file mode 100644 index 7bf19d91893a2..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/fixtures/task_description.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "attachments": [ - { - "id": "", - "type": "eni", - "status": "DELETED", - "details": [ - { - "name": "subnetId", - "value": "subnet-" - }, - { - "name": "networkInterfaceId", - "value": "eni-abcd" - }, - { - "name": "macAddress", - "value": "" - }, - { - "name": "privateIPv4Address", - "value": "10.0.0.52" - } - ] - } - ], - "availabilityZone": "test-region-1a", - "clusterArn": "arn:aws:ecs:test-region-1::cluster/aws-ecs-integ-productionenvironmentclusterC6599D2D-U7W8a2P2HPhC", - "containers": [ - { - "containerArn": "arn:aws:ecs:test-region-1::container/ff3b49f4-5eea-46cd-99c6-069584b3fb8e", - "exitCode": 1, - "lastStatus": "STOPPED", - "name": "app", - "image": "nathanpeck/name", - "runtimeId": "", - "taskArn": "arn:aws:ecs:test-region-1::task/12345678-1234-1234-1234-1234567890AB", - "networkInterfaces": [ - { - "attachmentId": "323eb03f-dedf-44b6-aa5f-d9d7f7b37714", - "privateIpv4Address": "10.0.0.52" - } - ], - "cpu": "256", - "memory": "512" - } - ], - "createdAt": "2020-10-03T22:31:35.117Z", - "launchType": "FARGATE", - "cpu": "256", - "memory": "512", - "desiredStatus": "STOPPED", - "group": "service:aws-ecs-integ-nameserviceService8015C8D6-I4TwUFv4xk2o", - "lastStatus": "STOPPED", - "overrides": { - "containerOverrides": [ - { - "name": "app" - } - ] - }, - "connectivity": "CONNECTED", - "connectivityAt": "2020-10-03T22:31:43.32Z", - "pullStartedAt": "2020-10-03T22:31:46.764Z", - "startedAt": "2020-10-03T22:31:54.764Z", - "startedBy": "ecs-svc/7073659324082574009", - "stoppingAt": "2020-10-03T22:43:06.753Z", - "stoppedAt": "2020-10-03T22:43:31.542Z", - "pullStoppedAt": "2020-10-03T22:31:53.764Z", - "executionStoppedAt": "2020-10-03T22:43:08Z", - "stoppedReason": "Scaling activity initiated by (deployment ecs-svc/7073659324082574009)", - "updatedAt": "2020-10-03T22:43:31.542Z", - "taskArn": "arn:aws:ecs:test-region-1::task/12345678-1234-1234-1234-1234567890AB", - "taskDefinitionArn": "arn:aws:ecs:test-region-1::task-definition/awsecsintegnametaskdefinition0EA6A1A0:3", - "version": 7, - "platformVersion": "1.3.0" -} diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_cleanup_resource_handler.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_cleanup_resource_handler.py deleted file mode 100644 index c5ec1d0cf61ec..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_cleanup_resource_handler.py +++ /dev/null @@ -1,46 +0,0 @@ -import unittest -import unittest.mock as mock - -from lib.cleanup_resource_handler import CleanupResourceHandler -from lib.route53 import Route53RecordSetLocator - - -class TestCleanupResourceHandler(unittest.TestCase): - def test_handler_rejects_invalid_properties(self): - handler = CleanupResourceHandler(route53_client=mock.Mock()) - with self.assertRaises(Exception): - handler.handle_event({'RequestType': 'Delete', 'ResourceProperties': {'Invalid': 'Invalid'}}, {}) - - def test_handling_delete(self): - handler = CleanupResourceHandler(route53_client=mock.Mock(), monitor_interval=0) - record_set_accessor = mock.Mock() - record_set_accessor.delete = mock.Mock(return_value=True) # True = Deleted - - exists_count = 0 - - def exists_side_effect(*args): - nonlocal exists_count - exists_count += 1 - return True if exists_count < 3 else False - - record_set_accessor.exists = mock.Mock(side_effect=exists_side_effect) - - handler.record_set_accessor = record_set_accessor - - event = { - 'RequestType': 'Delete', - 'ResourceProperties': { - 'ServiceToken': 'Something', - 'HostedZoneId': 'ZONE', - 'RecordName': 'something.mydomain.com' - } - } - - # WHEN - handler.handle_event(event, {}) - - # THEN - expected_locator = Route53RecordSetLocator(hosted_zone_id='ZONE', record_name='something.mydomain.com') - record_set_accessor.delete.assert_called_with(locator=expected_locator) - record_set_accessor.exists.assert_called() - self.assertEqual(record_set_accessor.exists.call_count, 3) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_events.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_events.py deleted file mode 100644 index a616bd7999309..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_events.py +++ /dev/null @@ -1,21 +0,0 @@ -import json -import os -import unittest - -from lib.events import extract_event_task_info - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(THIS_DIR, 'fixtures', 'task_description.json')) as f: - TASK_DESCRIPTION = json.loads(f.read()) - - -class TestEvents(unittest.TestCase): - def test_extract_event_task_info(self): - task_info = extract_event_task_info(TASK_DESCRIPTION) - - self.assertEqual(task_info.task_arn, 'arn:aws:ecs:test-region-1::task/12345678-1234-1234-1234-1234567890AB') - self.assertTrue(not task_info.is_stopped()) - - self.assertEqual(len(task_info.enis), 1) - self.assertEqual(task_info.enis[0].eni_id, 'eni-abcd') - self.assertEqual(task_info.enis[0].public_ipv4, None) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_queue_handler.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_queue_handler.py deleted file mode 100644 index 91477451cf72e..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_queue_handler.py +++ /dev/null @@ -1,29 +0,0 @@ -import unittest -import unittest.mock as mock - -from lib.queue_handler import QueueHandler - - -class TestQueueHandler(unittest.TestCase): - def test_queue_handler_sets_up(self): - environ = { - 'HOSTED_ZONE_ID': 'HOSTED_ZONE_ID', - 'RECORD_NAME': 'RECORD_NAME', - 'RECORDS_TABLE': 'RECORDS_TABLE', - 'CLUSTER_ARN': 'CLUSTER_ARN', - 'SERVICE_NAME': 'SERVICE_NAME', - } - - ec2_client = mock.Mock() - route53_client = mock.Mock() - dynamodb_resource = mock.Mock() - - # WHEN - - handler = QueueHandler(ec2_client=ec2_client, route53_client=route53_client, - dynamodb_resource=dynamodb_resource, environ=environ) - - # THEN - dynamodb_resource.Table.called_width('RECORDS_TABLE') - - pass diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_records.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_records.py deleted file mode 100644 index cb2e1e45f6ed4..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_records.py +++ /dev/null @@ -1,46 +0,0 @@ -import json -import os -import unittest -from datetime import datetime - -from lib.records import DdbRecordEncoding, TaskInfo, EniInfo - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(THIS_DIR, 'fixtures', 'ddb-record.json')) as f: - DDB_RECORD_ENCODED = json.loads(f.read()) - - -class TestRecords(unittest.TestCase): - def test_task_info_stopped_marker(self): - task_info = TaskInfo(task_arn='a', enis=[]) - task_info.set_stopped_marker() - self.assertTrue(task_info.is_stopped()) - - def test_ddb_record_encoding(self): - # GIVEN - ddb_record_encoding = DdbRecordEncoding() - - # WHEN - ddb_record = ddb_record_encoding.decode(DDB_RECORD_ENCODED) - ddb_record_reencoded = ddb_record_encoding.encode(ddb_record) - - # THEN - self.assertEqual(ddb_record.key.cluster_arn, 'CLUSTER_ARN') - self.assertEqual(ddb_record.key.service_name, 'SERVICE') - self.assertEqual(sorted(ddb_record.ipv4s), ['1.1.2.1', '1.1.2.2']) - self.assertEqual( - ddb_record.task_info['TASK1_ARN'], - TaskInfo(task_arn='TASK1_ARN', stopped_datetime=datetime(2020, 10, 4, 23, 47, 36, 322158), enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ])) - self.assertEqual( - ddb_record.task_info['TASK2_ARN'], - TaskInfo( - task_arn='TASK2_ARN', enis=[ - EniInfo(eni_id='TASK2_ENI1_ID', public_ipv4='1.1.2.1'), - EniInfo(eni_id='TASK2_ENI2_ID', public_ipv4='1.1.2.2'), - ])) - self.assertEqual(len(ddb_record.record_sets), 2) - - self.maxDiff = 9999999 - self.assertEqual(ddb_record_reencoded, DDB_RECORD_ENCODED) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_records_table.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_records_table.py deleted file mode 100644 index 3429c152a6a35..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_records_table.py +++ /dev/null @@ -1,188 +0,0 @@ -import json -import os -import unittest -import unittest.mock as mock - -from boto3.dynamodb.conditions import ConditionExpressionBuilder -from botocore.exceptions import ClientError - -from lib.records import DdbRecordKey, TaskInfo, EniInfo, DdbRecord -from lib.records_table import RecordsTableAccessor, update_ddb_record, RecordUpdate -from lib.route53 import Route53RecordSetLocator - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(THIS_DIR, 'fixtures', 'ddb-record.json')) as f: - DDB_RECORD_ENCODED = json.loads(f.read()) - - -class TestRecordsTable(unittest.TestCase): - def test_put_tasks_creates_with_optimistic_lock(self): - # GIVEN - table_client = mock.Mock() - table_client.query = mock.Mock(return_value={'Items': []}) - - key = DdbRecordKey(cluster_arn='a', service_name='b') - records_table = RecordsTableAccessor(table_client=table_client) - - running = [TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ])] - - # WHEN - records_table.put_update_optimistically(key=key, update=RecordUpdate(running_tasks=running)) - - # THEN - table_client.put_item.assert_called() - item = table_client.put_item.call_args.kwargs['Item'] - self.assertEqual(item['version'], 1) - - condition_expression = table_client.put_item.call_args.kwargs['ConditionExpression'] - expr, atts, vals = ConditionExpressionBuilder().build_expression(condition_expression) - self.assertEqual(expr, '(attribute_not_exists(#n0) OR #n1 = :v0)') - self.assertEqual(atts, {'#n0': 'version', '#n1': 'version'}) - self.assertEqual(vals, {':v0': 0}) - - def test_put_tasks_updates_with_optimistic_lock(self): - # GIVEN - table_client = mock.Mock() - table_client.query = mock.Mock(return_value={'Items': [dict(DDB_RECORD_ENCODED)]}) - - key = DdbRecordKey(cluster_arn='FOO', service_name='test.myexample.com') - records_table = RecordsTableAccessor(table_client=table_client) - - running = [TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ])] - - # WHEN - records_table.put_update_optimistically(key=key, update=RecordUpdate(running_tasks=running)) - - # THEN - condition_expression = table_client.put_item.call_args.kwargs['ConditionExpression'] - expr, atts, vals = ConditionExpressionBuilder().build_expression(condition_expression) - self.assertEqual(vals, {':v0': 12}) - - def test_put_tasks_retries_optimistically(self): - # GIVEN - table_client = mock.Mock() - table_client.query = mock.Mock(return_value={'Items': []}) - table_client.put_item = mock.Mock( - side_effect=ClientError({'Error': { - 'Code': 'ConditionalCheckFailedException' - }}, 'PutItem')) - - records_table = RecordsTableAccessor(table_client=table_client) - key = DdbRecordKey(cluster_arn='a', service_name='b') - - # WHEN - with self.assertRaisesRegex(Exception, r'Exceeded maximum retries'): - records_table.put_update(key=key, update=RecordUpdate()) - - # THEN - self.assertEqual(table_client.query.call_count, records_table.max_attempts) - self.assertEqual(table_client.put_item.call_count, records_table.max_attempts) - - def test_put_tasks_raises_other_errors(self): - # GIVEN - table_client = mock.Mock() - table_client.query = mock.Mock(return_value={'Items': []}) - table_client.put_item = mock.Mock(side_effect=ClientError({'Error': {'Code': 'SomethingElse'}}, 'PutItem')) - - records_table = RecordsTableAccessor(table_client=table_client) - key = DdbRecordKey(cluster_arn='a', service_name='b') - - # WHEN - with self.assertRaisesRegex(Exception, r'SomethingElse'): - records_table.put_update(key=key, update=RecordUpdate()) - - # THEN - self.assertEqual(table_client.query.call_count, 1) - self.assertEqual(table_client.put_item.call_count, 1) - - def test_delete(self): - # GIVEN - table_client = mock.Mock() - key = DdbRecordKey(cluster_arn='a', service_name='b') - records_table = RecordsTableAccessor(table_client=table_client) - - # WHEN - records_table.delete(key) - - # THEN - table_client.delete_item.called_with(Key='a#b') - - def test_update_ddb_record(self): - # GIVEN - ddb_record = DdbRecord(key=DdbRecordKey(cluster_arn='a', service_name='b')) - - # TASK1->RUNNING, TASK2->RUNNING - ord1_running = [ - TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ]), - TaskInfo(task_arn='TASK2_ARN', enis=[ - EniInfo(eni_id='TASK2_ENI1_ID', public_ipv4='1.1.2.1'), - ]), - ] - # TASK3->STOPPED (out of order) - ord1_stopped = [ - TaskInfo(task_arn='TASK3_ARN', enis=[ - EniInfo(eni_id='TASK3_ENI1_ID'), - ]), - ] - - # TASK1->STOPPED, TASK3->STOPPED (duplicate) - ord2_stopped = [ - # Expected TASK1 transition to STOPPED - TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID'), - ]), - # Duplicate TASK3 transition to STOPPED - TaskInfo(task_arn='TASK3_ARN', enis=[ - EniInfo(eni_id='TASK3_ENI1_ID'), - ]), - ] - - # TASK1->RUNNING (out of order), TASK3->RUNNING (out of order) - ord3_running = [ - TaskInfo(task_arn='TASK1_ARN', enis=[ - EniInfo(eni_id='TASK1_ENI1_ID', public_ipv4='1.1.1.1'), - ]), - TaskInfo(task_arn='TASK3_ARN', enis=[ - EniInfo(eni_id='TASK3_ENI1_ID', public_ipv4='1.1.3.1'), - ]), - ] - - # WHEN - update_ddb_record(ddb_record, RecordUpdate(running_tasks=ord1_running, stopped_tasks=ord1_stopped)) - update_ddb_record(ddb_record, RecordUpdate(stopped_tasks=ord2_stopped)) - update_ddb_record(ddb_record, RecordUpdate(running_tasks=ord3_running)) - - # THEN - self.assertEqual(len(ddb_record.task_info), 3, msg='expected 3 task infos') - self.assertTrue(ddb_record.task_info['TASK1_ARN'].is_stopped()) - self.assertTrue(not ddb_record.task_info['TASK2_ARN'].is_stopped()) - self.assertTrue(ddb_record.task_info['TASK3_ARN'].is_stopped()) - - self.assertFalse('1.1.1.1' in ddb_record.ipv4s, - msg='ord3_running should have been ignored because the task previously stopped') - self.assertEqual(sorted(ddb_record.ipv4s), ['1.1.2.1']) - - def test_update_record_sets(self): - # GIVEN - ddb_record = DdbRecord(key=DdbRecordKey(cluster_arn='a', service_name='b')) - ord1 = [ - Route53RecordSetLocator('a', 'b'), - Route53RecordSetLocator('a', 'c'), - ] - ord2 = [ - Route53RecordSetLocator('a', 'b'), - ] - - # WHEN - update_ddb_record(ddb_record, RecordUpdate(record_sets_added=ord1)) - update_ddb_record(ddb_record, RecordUpdate(record_sets_removed=ord2)) - - # THEN - self.assertEqual(len(ddb_record.record_sets), 1) - self.assertTrue(Route53RecordSetLocator('a', 'c') in ddb_record.record_sets) \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_route53.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_route53.py deleted file mode 100644 index a77093dcf484d..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_route53.py +++ /dev/null @@ -1,281 +0,0 @@ -import unittest -import unittest.mock as mock - -from botocore.exceptions import ClientError - -from lib.route53 import Route53RecordSetLocator, Route53RecordSetAccessor, exponential_backoff, retry_with_backoff, \ - map_ips_to_resource_records, find_locator_record_set - - -class TestRoute53(unittest.TestCase): - def get_route53_client_mock(self): - route53_client = mock.Mock() - record_set_value = None - - route53_client.list_resource_record_sets = mock.Mock( - side_effect=lambda **kwargs: - {'ResourceRecordSets': [record_set_value] if record_set_value is not None else []}) - - def change_resource_record_sets(HostedZoneId, ChangeBatch): - nonlocal record_set_value - change = ChangeBatch['Changes'][0] - change_action = change['Action'] - - if change_action == 'UPSERT': - record_set_value = change['ResourceRecordSet'] - elif change_action == 'DELETE': - record_set_value = None - - route53_client.change_resource_record_sets = mock.Mock(side_effect=change_resource_record_sets) - - return route53_client - - def test_creating_records(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - merger = Route53RecordSetAccessor(route53_client) - - # WHEN - merger.update(locator, ipv4s={'1.1.1.1'}) - - # THEN - route53_client.change_resource_record_sets.assert_called_with( - HostedZoneId='foo', ChangeBatch={ - 'Comment': - 'Automatic', - 'Changes': [{ - 'Action': 'UPSERT', - 'ResourceRecordSet': { - 'Name': 'foo.myexample.com.', - 'Type': 'A', - 'ResourceRecords': [ - { - 'Value': '1.1.1.1' - }, - ], - 'TTL': 60 - } - }] - }) - - def test_creating_empty_records(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - merger = Route53RecordSetAccessor(route53_client) - - # WHEN - merger.update(locator, ipv4s=set()) - - # THEN - route53_client.change_resource_record_sets.assert_not_called() - - def test_deleting_records(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # Set up the mock with a record. - record_set.update(locator, ipv4s={'1.1.1.1'}) - - # WHEN - record_set.update(locator, ipv4s=set()) - - # THEN - route53_client.change_resource_record_sets.assert_called_with( - HostedZoneId='foo', ChangeBatch={ - 'Comment': - 'Automatic', - 'Changes': [{ - 'Action': 'DELETE', - 'ResourceRecordSet': { - 'Name': 'foo.myexample.com.', - 'Type': 'A', - 'ResourceRecords': [ - { - 'Value': '1.1.1.1' - }, - ], - 'TTL': 60 - } - }] - }) - - def test_deleting_records_with_frontend(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # Set up the mock with a record. - record_set.update(locator, ipv4s={'1.1.1.1'}) - - # WHEN - record_set.delete(locator) - - # THEN - self.assertEqual(route53_client.list_resource_record_sets.call_count, 2) - route53_client.change_resource_record_sets.assert_called_with( - HostedZoneId='foo', ChangeBatch={ - 'Comment': - 'Automatic', - 'Changes': [{ - 'Action': 'DELETE', - 'ResourceRecordSet': { - 'Name': 'foo.myexample.com.', - 'Type': 'A', - 'ResourceRecords': [ - { - 'Value': '1.1.1.1' - }, - ], - 'TTL': 60 - } - }] - }) - - def test_deleting_no_records_with_frontend(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # WHEN - record_set.delete(locator) - - # THEN - self.assertEqual(route53_client.list_resource_record_sets.call_count, 1) - route53_client.change_resource_record_sets.assert_not_called() - - def test_checks_not_exists(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # WHEN - exists = record_set.exists(locator) - - # THEN - self.assertTrue(not exists) - - def test_checks_exists(self): - # GIVEN - route53_client = self.get_route53_client_mock() - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='foo.myexample.com') - record_set = Route53RecordSetAccessor(route53_client) - - # WHEN - record_set.update(locator, ipv4s={'1.1.1.1'}) - exists = record_set.exists(locator) - - # THEN - self.assertTrue(exists) - - def test_exponential_backoff(self): - self.assertEqual(exponential_backoff(0), 1) - self.assertEqual(exponential_backoff(1), 2) - self.assertEqual(exponential_backoff(2), 4) - - def test_retry_with_backoff_throttling(self): - # GIVEN - call = mock.Mock(side_effect=ClientError(error_response={'Error': { - 'Code': 'Throttling' - }}, operation_name='any')) - - # WHEN - retry_with_backoff(call, attempts=5, backoff=lambda x: 0) - - # THEN - self.assertEqual(call.call_count, 5) - - def test_retry_with_backoff_prior_request_not_complete(self): - # GIVEN - call = mock.Mock(side_effect=ClientError(error_response={'Error': { - 'Code': 'PriorRequestNotComplete' - }}, operation_name='any')) - - # WHEN - retry_with_backoff(call, attempts=5, backoff=lambda x: 0) - - # THEN - self.assertEqual(call.call_count, 5) - - def test_retry_with_backoff_other_client_errors(self): - # GIVEN - call = mock.Mock(side_effect=ClientError(error_response={'Error': { - 'Code': 'SomethingElse' - }}, operation_name='any')) - - # WHEN/THEN - with self.assertRaisesRegex(ClientError, r'SomethingElse'): - retry_with_backoff(call, attempts=5, backoff=lambda x: 0) - self.assertEqual(call.call_count, 1) - - def test_retry_with_backoff_other_errors(self): - # GIVEN - call = mock.Mock(side_effect=Exception('very good reason')) - - # WHEN/THEN - with self.assertRaisesRegex(Exception, r'very good reason'): - retry_with_backoff(call, attempts=5, backoff=lambda x: 0) - self.assertEqual(call.call_count, 1) - - def test_map_ips_to_resource_records(self): - # GIVEN - ips = {'1.1.1.1', '1.1.1.2'} - - # WHEN - output = map_ips_to_resource_records(ips) - - # THEN - self.assertEqual(output, [{'Value': '1.1.1.1'}, {'Value': '1.1.1.2'}]) - - def test_map_ips_to_resource_records_truncates_to_400(self): - # GIVEN - ips = {f'1.1.{a}.{b}' for a in range(1, 255) for b in range(1, 255)} - - # WHEN - output = map_ips_to_resource_records(ips) - - # THEN - self.assertEqual(len(output), 400) - - def test_find_locator_record_set_ignores_irrelevant_records(self): - # GIVEN - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='test-record.myexample.com') - record_sets = [{ - 'Name': 'u-record.myexample.com.', - 'Type': 'A', - 'TTL': 60, - 'ResourceRecords': [{ - 'Value': '1.1.1.1' - }] - }] - - # WHEN - result = find_locator_record_set(locator, 'A', record_sets) - - # THEN - self.assertIsNone(result) - - def test_find_locator_record_set_finds_it(self): - # GIVEN - locator = Route53RecordSetLocator(hosted_zone_id='foo', record_name='test-record.myexample.com') - matching_record = { - 'Name': 'test-record.myexample.com.', - 'Type': 'A', - 'TTL': 60, - 'ResourceRecords': [{ - 'Value': '1.1.1.1' - }] - } - record_sets = [matching_record] - - # WHEN - result = find_locator_record_set(locator, 'A', record_sets) - - # THEN - self.assertEqual(result, matching_record) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_tasks.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_tasks.py deleted file mode 100644 index b4b491750bcce..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/test/test_tasks.py +++ /dev/null @@ -1,55 +0,0 @@ -import json -import os -import unittest -import unittest.mock as mock -from datetime import datetime - -from lib.events import extract_event_task_info -from lib.records import TaskInfo, DdbRecord, DdbRecordKey -from lib.running_task_collector import RunningTaskCollector - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(THIS_DIR, 'fixtures', 'task_description.json')) as f: - TASK_DESCRIPTION = json.loads(f.read()) -with open(os.path.join(THIS_DIR, 'fixtures', 'eni_description.json')) as f: - ENI_DESCRIPTION = json.loads(f.read()) - - -class TestRunningTasksCollector(unittest.TestCase): - def test_task_collector(self): - # GIVEN - ec2_client = mock.Mock() - paginator = mock.Mock() - paginator.paginate = mock.Mock(return_value=[{'NetworkInterfaces': [ENI_DESCRIPTION]}]) - ec2_client.get_paginator = mock.Mock(return_value=paginator) - - reference_record = DdbRecord(key=DdbRecordKey(cluster_arn="A", service_name="B")) - collector = RunningTaskCollector(ec2_client=ec2_client, reference_record=reference_record) - - # WHEN - task_info = extract_event_task_info(TASK_DESCRIPTION) - collector.collect(task_info) - collector.fill_eni_info_from_eni_query() - - # THEN - paginator.paginate.assert_called_with(NetworkInterfaceIds=['eni-abcd']) - self.assertTrue('1.2.3.4' in collector.get_ips()) - - def test_task_collector_doesnt_collect_stopped_tasks(self): - # GIVEN - ec2_client = mock.Mock() - paginator = mock.Mock() - paginator.paginate = mock.Mock(return_value=[{'NetworkInterfaces': [ENI_DESCRIPTION]}]) - ec2_client.get_paginator = mock.Mock(return_value=paginator) - - task_arn = TASK_DESCRIPTION['taskArn'] - task_info = {task_arn: TaskInfo(task_arn=task_arn, enis=[], stopped_datetime=datetime.utcnow())} - reference_record = DdbRecord(key=DdbRecordKey(cluster_arn="A", service_name="B"), task_info=task_info) - collector = RunningTaskCollector(ec2_client=ec2_client, reference_record=reference_record) - - # WHEN - task_info = extract_event_task_info(TASK_DESCRIPTION) - collector.collect(task_info) - - # THEN - self.assertEqual(len(collector.tasks), 0) diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/index.js b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/index.js deleted file mode 100644 index ddf62f6363bf4..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/asset.9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/index.js +++ /dev/null @@ -1,250 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.handler = exports.forceSdkInstallation = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/* eslint-disable no-console */ -const child_process_1 = require("child_process"); -const fs = require("fs"); -const path_1 = require("path"); -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -let latestSdkInstalled = false; -function forceSdkInstallation() { - latestSdkInstalled = false; -} -exports.forceSdkInstallation = forceSdkInstallation; -/** - * Installs latest AWS SDK v2 - */ -function installLatestSdk() { - console.log('Installing latest AWS SDK v2'); - // Both HOME and --prefix are needed here because /tmp is the only writable location - child_process_1.execSync('HOME=/tmp npm install aws-sdk@2 --production --no-package-lock --no-save --prefix /tmp'); - latestSdkInstalled = true; -} -// no currently patched services -const patchedServices = []; -/** - * Patches the AWS SDK by loading service models in the same manner as the actual SDK - */ -function patchSdk(awsSdk) { - const apiLoader = awsSdk.apiLoader; - patchedServices.forEach(({ serviceName, apiVersions }) => { - const lowerServiceName = serviceName.toLowerCase(); - if (!awsSdk.Service.hasService(lowerServiceName)) { - apiLoader.services[lowerServiceName] = {}; - awsSdk[serviceName] = awsSdk.Service.defineService(lowerServiceName, apiVersions); - } - else { - awsSdk.Service.addVersions(awsSdk[serviceName], apiVersions); - } - apiVersions.forEach(apiVersion => { - Object.defineProperty(apiLoader.services[lowerServiceName], apiVersion, { - get: function get() { - const modelFilePrefix = `aws-sdk-patch/${lowerServiceName}-${apiVersion}`; - const model = JSON.parse(fs.readFileSync(path_1.join(__dirname, `${modelFilePrefix}.service.json`), 'utf-8')); - model.paginators = JSON.parse(fs.readFileSync(path_1.join(__dirname, `${modelFilePrefix}.paginators.json`), 'utf-8')).pagination; - return model; - }, - enumerable: true, - configurable: true, - }); - }); - }); - return awsSdk; -} -/* eslint-disable @typescript-eslint/no-require-imports, import/no-extraneous-dependencies */ -async function handler(event, context) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _l, _m, _o, _p; - try { - let AWS; - if (!latestSdkInstalled && event.ResourceProperties.InstallLatestAwsSdk === 'true') { - try { - installLatestSdk(); - AWS = require('/tmp/node_modules/aws-sdk'); - } - catch (e) { - console.log(`Failed to install latest AWS SDK v2: ${e}`); - AWS = require('aws-sdk'); // Fallback to pre-installed version - } - } - else if (latestSdkInstalled) { - AWS = require('/tmp/node_modules/aws-sdk'); - } - else { - AWS = require('aws-sdk'); - } - try { - AWS = patchSdk(AWS); - } - catch (e) { - console.log(`Failed to patch AWS SDK: ${e}. Proceeding with the installed copy.`); - } - console.log(JSON.stringify(event)); - console.log('AWS SDK VERSION: ' + AWS.VERSION); - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - // Default physical resource id - let physicalResourceId; - switch (event.RequestType) { - case 'Create': - physicalResourceId = (_j = (_f = (_c = (_b = (_a = event.ResourceProperties.Create) === null || _a === void 0 ? void 0 : _a.physicalResourceId) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : (_e = (_d = event.ResourceProperties.Update) === null || _d === void 0 ? void 0 : _d.physicalResourceId) === null || _e === void 0 ? void 0 : _e.id) !== null && _f !== void 0 ? _f : (_h = (_g = event.ResourceProperties.Delete) === null || _g === void 0 ? void 0 : _g.physicalResourceId) === null || _h === void 0 ? void 0 : _h.id) !== null && _j !== void 0 ? _j : event.LogicalResourceId; - break; - case 'Update': - case 'Delete': - physicalResourceId = (_o = (_m = (_l = event.ResourceProperties[event.RequestType]) === null || _l === void 0 ? void 0 : _l.physicalResourceId) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : event.PhysicalResourceId; - break; - } - let flatData = {}; - let data = {}; - const call = event.ResourceProperties[event.RequestType]; - if (call) { - let credentials; - if (call.assumedRoleArn) { - const timestamp = (new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64), - }; - credentials = new AWS.ChainableTemporaryCredentials({ - params: params, - }); - } - if (!Object.prototype.hasOwnProperty.call(AWS, call.service)) { - throw Error(`Service ${call.service} does not exist in AWS SDK version ${AWS.VERSION}.`); - } - const awsService = new AWS[call.service]({ - apiVersion: call.apiVersion, - credentials: credentials, - region: call.region, - }); - try { - const response = await awsService[call.action](call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)).promise(); - flatData = { - apiVersion: awsService.config.apiVersion, - region: awsService.config.region, - ...flatten(response), - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } - else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } - else { - data = flatData; - } - } - catch (e) { - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(e.code)) { - throw e; - } - } - if ((_p = call.physicalResourceId) === null || _p === void 0 ? void 0 : _p.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond('SUCCESS', 'OK', physicalResourceId, data); - } - catch (e) { - console.log(e); - await respond('FAILED', e.message || 'Internal Error', context.logStreamName, {}); - } - function respond(responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { 'content-type': '', 'content-length': responseBody.length }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); - } -} -exports.handler = handler; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsaURBQXlDO0FBQ3pDLHlCQUF5QjtBQUN6QiwrQkFBNEI7QUFTNUI7O0dBRUc7QUFDVSxRQUFBLDhCQUE4QixHQUFHLHNCQUFzQixDQUFDO0FBRXJFOzs7OztHQUtHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLE1BQWM7SUFDcEMsT0FBTyxNQUFNLENBQUMsTUFBTSxDQUNsQixFQUFFLEVBQ0YsR0FBRyxTQUFTLFFBQVEsQ0FBQyxLQUFVLEVBQUUsT0FBaUIsRUFBRTtRQUNsRCxPQUFPLEVBQUUsQ0FBQyxNQUFNLENBQUMsR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQzthQUNuQyxHQUFHLENBQUMsR0FBRyxDQUFDLEVBQUU7WUFDVCxNQUFNLFFBQVEsR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7WUFDeEYsT0FBTyxPQUFPLFFBQVEsS0FBSyxRQUFRLElBQUksUUFBUSxLQUFLLElBQUk7Z0JBQ3RELENBQUMsQ0FBQyxRQUFRLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO2dCQUN4QyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsUUFBUSxFQUFFLENBQUMsQ0FBQztRQUNyRCxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ1IsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUNWLENBQUM7QUFDSixDQUFDO0FBYkQsMEJBYUM7QUFFRDs7R0FFRztBQUNILFNBQVMsbUJBQW1CLENBQUMsTUFBYyxFQUFFLGtCQUEwQjtJQUNyRSxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUNsRCxRQUFRLENBQUMsRUFBRTtZQUNULEtBQUssc0NBQThCO2dCQUNqQyxPQUFPLGtCQUFrQixDQUFDO1lBQzVCO2dCQUNFLE9BQU8sQ0FBQyxDQUFDO1NBQ1o7SUFDSCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUM7QUFFRDs7R0FFRztBQUNILFNBQVMsVUFBVSxDQUFDLE1BQWMsRUFBRSxJQUE4QjtJQUNoRSxPQUFPLE1BQU0sQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDO1NBQzFCLE1BQU0sQ0FDTCxDQUFDLEdBQUcsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztRQUN0QixDQUFDLENBQUMsRUFBRSxHQUFHLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRTtRQUNwQixDQUFDLENBQUMsR0FBRyxFQUNQLEVBQUUsQ0FDSCxDQUFDO0FBQ04sQ0FBQztBQUVELElBQUksa0JBQWtCLEdBQUcsS0FBSyxDQUFDO0FBRS9CLFNBQWdCLG9CQUFvQjtJQUNsQyxrQkFBa0IsR0FBRyxLQUFLLENBQUM7QUFDN0IsQ0FBQztBQUZELG9EQUVDO0FBRUQ7O0dBRUc7QUFDSCxTQUFTLGdCQUFnQjtJQUN2QixPQUFPLENBQUMsR0FBRyxDQUFDLDhCQUE4QixDQUFDLENBQUM7SUFDNUMsb0ZBQW9GO0lBQ3BGLHdCQUFRLENBQUMsd0ZBQXdGLENBQUMsQ0FBQztJQUNuRyxrQkFBa0IsR0FBRyxJQUFJLENBQUM7QUFDNUIsQ0FBQztBQUVELGdDQUFnQztBQUNoQyxNQUFNLGVBQWUsR0FBcUQsRUFBRSxDQUFDO0FBQzdFOztHQUVHO0FBQ0gsU0FBUyxRQUFRLENBQUMsTUFBVztJQUMzQixNQUFNLFNBQVMsR0FBRyxNQUFNLENBQUMsU0FBUyxDQUFDO0lBQ25DLGVBQWUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxFQUFFLFdBQVcsRUFBRSxXQUFXLEVBQUUsRUFBRSxFQUFFO1FBQ3ZELE1BQU0sZ0JBQWdCLEdBQUcsV0FBVyxDQUFDLFdBQVcsRUFBRSxDQUFDO1FBQ25ELElBQUksQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxnQkFBZ0IsQ0FBQyxFQUFFO1lBQ2hELFNBQVMsQ0FBQyxRQUFRLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxFQUFFLENBQUM7WUFDMUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLGdCQUFnQixFQUFFLFdBQVcsQ0FBQyxDQUFDO1NBQ25GO2FBQU07WUFDTCxNQUFNLENBQUMsT0FBTyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLEVBQUUsV0FBVyxDQUFDLENBQUM7U0FDOUQ7UUFDRCxXQUFXLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxFQUFFO1lBQy9CLE1BQU0sQ0FBQyxjQUFjLENBQUMsU0FBUyxDQUFDLFFBQVEsQ0FBQyxnQkFBZ0IsQ0FBQyxFQUFFLFVBQVUsRUFBRTtnQkFDdEUsR0FBRyxFQUFFLFNBQVMsR0FBRztvQkFDZixNQUFNLGVBQWUsR0FBRyxpQkFBaUIsZ0JBQWdCLElBQUksVUFBVSxFQUFFLENBQUM7b0JBQzFFLE1BQU0sS0FBSyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxXQUFJLENBQUMsU0FBUyxFQUFFLEdBQUcsZUFBZSxlQUFlLENBQUMsRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFDO29CQUN2RyxLQUFLLENBQUMsVUFBVSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxXQUFJLENBQUMsU0FBUyxFQUFFLEdBQUcsZUFBZSxrQkFBa0IsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDO29CQUMxSCxPQUFPLEtBQUssQ0FBQztnQkFDZixDQUFDO2dCQUNELFVBQVUsRUFBRSxJQUFJO2dCQUNoQixZQUFZLEVBQUUsSUFBSTthQUNuQixDQUFDLENBQUM7UUFDTCxDQUFDLENBQUMsQ0FBQztJQUNMLENBQUMsQ0FBQyxDQUFDO0lBQ0gsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQztBQUVELDZGQUE2RjtBQUN0RixLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQWtELEVBQUUsT0FBMEI7O0lBQzFHLElBQUk7UUFDRixJQUFJLEdBQVEsQ0FBQztRQUNiLElBQUksQ0FBQyxrQkFBa0IsSUFBSSxLQUFLLENBQUMsa0JBQWtCLENBQUMsbUJBQW1CLEtBQUssTUFBTSxFQUFFO1lBQ2xGLElBQUk7Z0JBQ0YsZ0JBQWdCLEVBQUUsQ0FBQztnQkFDbkIsR0FBRyxHQUFHLE9BQU8sQ0FBQywyQkFBMkIsQ0FBQyxDQUFDO2FBQzVDO1lBQUMsT0FBTyxDQUFDLEVBQUU7Z0JBQ1YsT0FBTyxDQUFDLEdBQUcsQ0FBQyx3Q0FBd0MsQ0FBQyxFQUFFLENBQUMsQ0FBQztnQkFDekQsR0FBRyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLG9DQUFvQzthQUMvRDtTQUNGO2FBQU0sSUFBSSxrQkFBa0IsRUFBRTtZQUM3QixHQUFHLEdBQUcsT0FBTyxDQUFDLDJCQUEyQixDQUFDLENBQUM7U0FDNUM7YUFBTTtZQUNMLEdBQUcsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7U0FDMUI7UUFDRCxJQUFJO1lBQ0YsR0FBRyxHQUFHLFFBQVEsQ0FBQyxHQUFHLENBQUMsQ0FBQztTQUNyQjtRQUFDLE9BQU8sQ0FBQyxFQUFFO1lBQ1YsT0FBTyxDQUFDLEdBQUcsQ0FBQyw0QkFBNEIsQ0FBQyx1Q0FBdUMsQ0FBQyxDQUFDO1NBQ25GO1FBRUQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7UUFDbkMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxtQkFBbUIsR0FBRyxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUM7UUFFL0MsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sR0FBRyxVQUFVLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQzlFLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLEdBQUcsVUFBVSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUM5RSxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxHQUFHLFVBQVUsQ0FBQyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDOUUsK0JBQStCO1FBQy9CLElBQUksa0JBQTBCLENBQUM7UUFDL0IsUUFBUSxLQUFLLENBQUMsV0FBVyxFQUFFO1lBQ3pCLEtBQUssUUFBUTtnQkFDWCxrQkFBa0IsaUNBQUcsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sMENBQUUsa0JBQWtCLDBDQUFFLEVBQUUsK0NBQ3ZELEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLDBDQUFFLGtCQUFrQiwwQ0FBRSxFQUFFLCtDQUN2RCxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSwwQ0FBRSxrQkFBa0IsMENBQUUsRUFBRSxtQ0FDdkQsS0FBSyxDQUFDLGlCQUFpQixDQUFDO2dCQUM3QyxNQUFNO1lBQ1IsS0FBSyxRQUFRLENBQUM7WUFDZCxLQUFLLFFBQVE7Z0JBQ1gsa0JBQWtCLHFCQUFHLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLDBDQUFFLGtCQUFrQiwwQ0FBRSxFQUFFLG1DQUFJLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQztnQkFDckgsTUFBTTtTQUNUO1FBRUQsSUFBSSxRQUFRLEdBQThCLEVBQUUsQ0FBQztRQUM3QyxJQUFJLElBQUksR0FBOEIsRUFBRSxDQUFDO1FBQ3pDLE1BQU0sSUFBSSxHQUEyQixLQUFLLENBQUMsa0JBQWtCLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBRWpGLElBQUksSUFBSSxFQUFFO1lBRVIsSUFBSSxXQUFXLENBQUM7WUFDaEIsSUFBSSxJQUFJLENBQUMsY0FBYyxFQUFFO2dCQUN2QixNQUFNLFNBQVMsR0FBRyxDQUFDLElBQUksSUFBSSxFQUFFLENBQUMsQ0FBQyxPQUFPLEVBQUUsQ0FBQztnQkFFekMsTUFBTSxNQUFNLEdBQUc7b0JBQ2IsT0FBTyxFQUFFLElBQUksQ0FBQyxjQUFjO29CQUM1QixlQUFlLEVBQUUsR0FBRyxTQUFTLElBQUksa0JBQWtCLEVBQUUsQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztpQkFDdkUsQ0FBQztnQkFFRixXQUFXLEdBQUcsSUFBSSxHQUFHLENBQUMsNkJBQTZCLENBQUM7b0JBQ2xELE1BQU0sRUFBRSxNQUFNO2lCQUNmLENBQUMsQ0FBQzthQUNKO1lBRUQsSUFBSSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFO2dCQUM1RCxNQUFNLEtBQUssQ0FBQyxXQUFXLElBQUksQ0FBQyxPQUFPLHNDQUFzQyxHQUFHLENBQUMsT0FBTyxHQUFHLENBQUMsQ0FBQzthQUMxRjtZQUNELE1BQU0sVUFBVSxHQUFHLElBQUssR0FBVyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztnQkFDaEQsVUFBVSxFQUFFLElBQUksQ0FBQyxVQUFVO2dCQUMzQixXQUFXLEVBQUUsV0FBVztnQkFDeEIsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNO2FBQ3BCLENBQUMsQ0FBQztZQUVILElBQUk7Z0JBQ0YsTUFBTSxRQUFRLEdBQUcsTUFBTSxVQUFVLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUM1QyxJQUFJLENBQUMsVUFBVSxJQUFJLG1CQUFtQixDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsa0JBQWtCLENBQUMsQ0FBQyxDQUFDLE9BQU8sRUFBRSxDQUFDO2dCQUN6RixRQUFRLEdBQUc7b0JBQ1QsVUFBVSxFQUFFLFVBQVUsQ0FBQyxNQUFNLENBQUMsVUFBVTtvQkFDeEMsTUFBTSxFQUFFLFVBQVUsQ0FBQyxNQUFNLENBQUMsTUFBTTtvQkFDaEMsR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDO2lCQUNyQixDQUFDO2dCQUVGLElBQUksV0FBaUMsQ0FBQztnQkFDdEMsSUFBSSxJQUFJLENBQUMsVUFBVSxFQUFFO29CQUNuQixXQUFXLEdBQUcsQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUM7aUJBQ2pDO3FCQUFNLElBQUksSUFBSSxDQUFDLFdBQVcsRUFBRTtvQkFDM0IsV0FBVyxHQUFHLElBQUksQ0FBQyxXQUFXLENBQUM7aUJBQ2hDO2dCQUVELElBQUksV0FBVyxFQUFFO29CQUNmLElBQUksR0FBRyxVQUFVLENBQUMsUUFBUSxFQUFFLGVBQWUsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDO2lCQUMzRDtxQkFBTTtvQkFDTCxJQUFJLEdBQUcsUUFBUSxDQUFDO2lCQUNqQjthQUNGO1lBQUMsT0FBTyxDQUFDLEVBQUU7Z0JBQ1YsSUFBSSxDQUFDLElBQUksQ0FBQyx3QkFBd0IsSUFBSSxDQUFDLElBQUksTUFBTSxDQUFDLElBQUksQ0FBQyx3QkFBd0IsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUU7b0JBQzdGLE1BQU0sQ0FBQyxDQUFDO2lCQUNUO2FBQ0Y7WUFFRCxVQUFJLElBQUksQ0FBQyxrQkFBa0IsMENBQUUsWUFBWSxFQUFFO2dCQUN6QyxrQkFBa0IsR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFDLGtCQUFrQixDQUFDLFlBQVksQ0FBQyxDQUFDO2FBQ3JFO1NBQ0Y7UUFFRCxNQUFNLE9BQU8sQ0FBQyxTQUFTLEVBQUUsSUFBSSxFQUFFLGtCQUFrQixFQUFFLElBQUksQ0FBQyxDQUFDO0tBQzFEO0lBQUMsT0FBTyxDQUFDLEVBQUU7UUFDVixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ2YsTUFBTSxPQUFPLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQyxPQUFPLElBQUksZ0JBQWdCLEVBQUUsT0FBTyxDQUFDLGFBQWEsRUFBRSxFQUFFLENBQUMsQ0FBQztLQUNuRjtJQUVELFNBQVMsT0FBTyxDQUFDLGNBQXNCLEVBQUUsTUFBYyxFQUFFLGtCQUEwQixFQUFFLElBQVM7UUFDNUYsTUFBTSxZQUFZLEdBQUcsSUFBSSxDQUFDLFNBQVMsQ0FBQztZQUNsQyxNQUFNLEVBQUUsY0FBYztZQUN0QixNQUFNLEVBQUUsTUFBTTtZQUNkLGtCQUFrQixFQUFFLGtCQUFrQjtZQUN0QyxPQUFPLEVBQUUsS0FBSyxDQUFDLE9BQU87WUFDdEIsU0FBUyxFQUFFLEtBQUssQ0FBQyxTQUFTO1lBQzFCLGlCQUFpQixFQUFFLEtBQUssQ0FBQyxpQkFBaUI7WUFDMUMsTUFBTSxFQUFFLEtBQUs7WUFDYixJQUFJLEVBQUUsSUFBSTtTQUNYLENBQUMsQ0FBQztRQUVILE9BQU8sQ0FBQyxHQUFHLENBQUMsWUFBWSxFQUFFLFlBQVksQ0FBQyxDQUFDO1FBRXhDLGlFQUFpRTtRQUNqRSxNQUFNLFNBQVMsR0FBRyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUMsS0FBSyxDQUFDLEtBQUssQ0FBQyxXQUFXLENBQUMsQ0FBQztRQUMxRCxNQUFNLGNBQWMsR0FBRztZQUNyQixRQUFRLEVBQUUsU0FBUyxDQUFDLFFBQVE7WUFDNUIsSUFBSSxFQUFFLFNBQVMsQ0FBQyxJQUFJO1lBQ3BCLE1BQU0sRUFBRSxLQUFLO1lBQ2IsT0FBTyxFQUFFLEVBQUUsY0FBYyxFQUFFLEVBQUUsRUFBRSxnQkFBZ0IsRUFBRSxZQUFZLENBQUMsTUFBTSxFQUFFO1NBQ3ZFLENBQUM7UUFFRixPQUFPLElBQUksT0FBTyxDQUFDLENBQUMsT0FBTyxFQUFFLE1BQU0sRUFBRSxFQUFFO1lBQ3JDLElBQUk7Z0JBQ0YsaUVBQWlFO2dCQUNqRSxNQUFNLE9BQU8sR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUMsT0FBTyxDQUFDLGNBQWMsRUFBRSxPQUFPLENBQUMsQ0FBQztnQkFDbEUsT0FBTyxDQUFDLEVBQUUsQ0FBQyxPQUFPLEVBQUUsTUFBTSxDQUFDLENBQUM7Z0JBQzVCLE9BQU8sQ0FBQyxLQUFLLENBQUMsWUFBWSxDQUFDLENBQUM7Z0JBQzVCLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQzthQUNmO1lBQUMsT0FBTyxDQUFDLEVBQUU7Z0JBQ1YsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO2FBQ1g7UUFDSCxDQUFDLENBQUMsQ0FBQztJQUNMLENBQUM7QUFDSCxDQUFDO0FBakpELDBCQWlKQztBQUVELFNBQVMsVUFBVSxDQUFDLElBQXdCO0lBQzFDLElBQUksQ0FBQyxJQUFJLEVBQUU7UUFBRSxPQUFPLFNBQVMsQ0FBQztLQUFFO0lBQ2hDLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUMxQixDQUFDO0FBRUQsU0FBUyxlQUFlLENBQUMsYUFBdUI7SUFDOUMsT0FBTyxVQUFTLE1BQWM7UUFDNUIsS0FBSyxNQUFNLFlBQVksSUFBSSxhQUFhLEVBQUU7WUFDeEMsSUFBSSxNQUFNLENBQUMsVUFBVSxDQUFDLFlBQVksQ0FBQyxFQUFFO2dCQUNuQyxPQUFPLElBQUksQ0FBQzthQUNiO1NBQ0Y7UUFDRCxPQUFPLEtBQUssQ0FBQztJQUNmLENBQUMsQ0FBQztBQUNKLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBuby1jb25zb2xlICovXG5pbXBvcnQgeyBleGVjU3luYyB9IGZyb20gJ2NoaWxkX3Byb2Nlc3MnO1xuaW1wb3J0ICogYXMgZnMgZnJvbSAnZnMnO1xuaW1wb3J0IHsgam9pbiB9IGZyb20gJ3BhdGgnO1xuLy8gaW1wb3J0IHRoZSBBV1NMYW1iZGEgcGFja2FnZSBleHBsaWNpdGx5LFxuLy8gd2hpY2ggaXMgZ2xvYmFsbHkgYXZhaWxhYmxlIGluIHRoZSBMYW1iZGEgcnVudGltZSxcbi8vIGFzIG90aGVyd2lzZSBsaW5raW5nIHRoaXMgcmVwb3NpdG9yeSB3aXRoIGxpbmstYWxsLnNoXG4vLyBmYWlscyBpbiB0aGUgQ0RLIGFwcCBleGVjdXRlZCB3aXRoIHRzLW5vZGVcbi8qIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBpbXBvcnQvbm8tZXh0cmFuZW91cy1kZXBlbmRlbmNpZXMsaW1wb3J0L25vLXVucmVzb2x2ZWQgKi9cbmltcG9ydCAqIGFzIEFXU0xhbWJkYSBmcm9tICdhd3MtbGFtYmRhJztcbmltcG9ydCB7IEF3c1Nka0NhbGwgfSBmcm9tICcuLi9hd3MtY3VzdG9tLXJlc291cmNlJztcblxuLyoqXG4gKiBTZXJpYWxpemVkIGZvcm0gb2YgdGhlIHBoeXNpY2FsIHJlc291cmNlIGlkIGZvciB1c2UgaW4gdGhlIG9wZXJhdGlvbiBwYXJhbWV0ZXJzXG4gKi9cbmV4cG9ydCBjb25zdCBQSFlTSUNBTF9SRVNPVVJDRV9JRF9SRUZFUkVOQ0UgPSAnUEhZU0lDQUw6UkVTT1VSQ0VJRDonO1xuXG4vKipcbiAqIEZsYXR0ZW5zIGEgbmVzdGVkIG9iamVjdFxuICpcbiAqIEBwYXJhbSBvYmplY3QgdGhlIG9iamVjdCB0byBiZSBmbGF0dGVuZWRcbiAqIEByZXR1cm5zIGEgZmxhdCBvYmplY3Qgd2l0aCBwYXRoIGFzIGtleXNcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGZsYXR0ZW4ob2JqZWN0OiBvYmplY3QpOiB7IFtrZXk6IHN0cmluZ106IGFueSB9IHtcbiAgcmV0dXJuIE9iamVjdC5hc3NpZ24oXG4gICAge30sXG4gICAgLi4uZnVuY3Rpb24gX2ZsYXR0ZW4oY2hpbGQ6IGFueSwgcGF0aDogc3RyaW5nW10gPSBbXSk6IGFueSB7XG4gICAgICByZXR1cm4gW10uY29uY2F0KC4uLk9iamVjdC5rZXlzKGNoaWxkKVxuICAgICAgICAubWFwKGtleSA9PiB7XG4gICAgICAgICAgY29uc3QgY2hpbGRLZXkgPSBCdWZmZXIuaXNCdWZmZXIoY2hpbGRba2V5XSkgPyBjaGlsZFtrZXldLnRvU3RyaW5nKCd1dGY4JykgOiBjaGlsZFtrZXldO1xuICAgICAgICAgIHJldHVybiB0eXBlb2YgY2hpbGRLZXkgPT09ICdvYmplY3QnICYmIGNoaWxkS2V5ICE9PSBudWxsXG4gICAgICAgICAgICA/IF9mbGF0dGVuKGNoaWxkS2V5LCBwYXRoLmNvbmNhdChba2V5XSkpXG4gICAgICAgICAgICA6ICh7IFtwYXRoLmNvbmNhdChba2V5XSkuam9pbignLicpXTogY2hpbGRLZXkgfSk7XG4gICAgICAgIH0pKTtcbiAgICB9KG9iamVjdCksXG4gICk7XG59XG5cbi8qKlxuICogRGVjb2RlcyBlbmNvZGVkIHNwZWNpYWwgdmFsdWVzIChwaHlzaWNhbFJlc291cmNlSWQpXG4gKi9cbmZ1bmN0aW9uIGRlY29kZVNwZWNpYWxWYWx1ZXMob2JqZWN0OiBvYmplY3QsIHBoeXNpY2FsUmVzb3VyY2VJZDogc3RyaW5nKSB7XG4gIHJldHVybiBKU09OLnBhcnNlKEpTT04uc3RyaW5naWZ5KG9iamVjdCksIChfaywgdikgPT4ge1xuICAgIHN3aXRjaCAodikge1xuICAgICAgY2FzZSBQSFlTSUNBTF9SRVNPVVJDRV9JRF9SRUZFUkVOQ0U6XG4gICAgICAgIHJldHVybiBwaHlzaWNhbFJlc291cmNlSWQ7XG4gICAgICBkZWZhdWx0OlxuICAgICAgICByZXR1cm4gdjtcbiAgICB9XG4gIH0pO1xufVxuXG4vKipcbiAqIEZpbHRlcnMgdGhlIGtleXMgb2YgYW4gb2JqZWN0LlxuICovXG5mdW5jdGlvbiBmaWx0ZXJLZXlzKG9iamVjdDogb2JqZWN0LCBwcmVkOiAoa2V5OiBzdHJpbmcpID0+IGJvb2xlYW4pIHtcbiAgcmV0dXJuIE9iamVjdC5lbnRyaWVzKG9iamVjdClcbiAgICAucmVkdWNlKFxuICAgICAgKGFjYywgW2ssIHZdKSA9PiBwcmVkKGspXG4gICAgICAgID8geyAuLi5hY2MsIFtrXTogdiB9XG4gICAgICAgIDogYWNjLFxuICAgICAge30sXG4gICAgKTtcbn1cblxubGV0IGxhdGVzdFNka0luc3RhbGxlZCA9IGZhbHNlO1xuXG5leHBvcnQgZnVuY3Rpb24gZm9yY2VTZGtJbnN0YWxsYXRpb24oKSB7XG4gIGxhdGVzdFNka0luc3RhbGxlZCA9IGZhbHNlO1xufVxuXG4vKipcbiAqIEluc3RhbGxzIGxhdGVzdCBBV1MgU0RLIHYyXG4gKi9cbmZ1bmN0aW9uIGluc3RhbGxMYXRlc3RTZGsoKTogdm9pZCB7XG4gIGNvbnNvbGUubG9nKCdJbnN0YWxsaW5nIGxhdGVzdCBBV1MgU0RLIHYyJyk7XG4gIC8vIEJvdGggSE9NRSBhbmQgLS1wcmVmaXggYXJlIG5lZWRlZCBoZXJlIGJlY2F1c2UgL3RtcCBpcyB0aGUgb25seSB3cml0YWJsZSBsb2NhdGlvblxuICBleGVjU3luYygnSE9NRT0vdG1wIG5wbSBpbnN0YWxsIGF3cy1zZGtAMiAtLXByb2R1Y3Rpb24gLS1uby1wYWNrYWdlLWxvY2sgLS1uby1zYXZlIC0tcHJlZml4IC90bXAnKTtcbiAgbGF0ZXN0U2RrSW5zdGFsbGVkID0gdHJ1ZTtcbn1cblxuLy8gbm8gY3VycmVudGx5IHBhdGNoZWQgc2VydmljZXNcbmNvbnN0IHBhdGNoZWRTZXJ2aWNlczogeyBzZXJ2aWNlTmFtZTogc3RyaW5nOyBhcGlWZXJzaW9uczogc3RyaW5nW10gfVtdID0gW107XG4vKipcbiAqIFBhdGNoZXMgdGhlIEFXUyBTREsgYnkgbG9hZGluZyBzZXJ2aWNlIG1vZGVscyBpbiB0aGUgc2FtZSBtYW5uZXIgYXMgdGhlIGFjdHVhbCBTREtcbiAqL1xuZnVuY3Rpb24gcGF0Y2hTZGsoYXdzU2RrOiBhbnkpOiBhbnkge1xuICBjb25zdCBhcGlMb2FkZXIgPSBhd3NTZGsuYXBpTG9hZGVyO1xuICBwYXRjaGVkU2VydmljZXMuZm9yRWFjaCgoeyBzZXJ2aWNlTmFtZSwgYXBpVmVyc2lvbnMgfSkgPT4ge1xuICAgIGNvbnN0IGxvd2VyU2VydmljZU5hbWUgPSBzZXJ2aWNlTmFtZS50b0xvd2VyQ2FzZSgpO1xuICAgIGlmICghYXdzU2RrLlNlcnZpY2UuaGFzU2VydmljZShsb3dlclNlcnZpY2VOYW1lKSkge1xuICAgICAgYXBpTG9hZGVyLnNlcnZpY2VzW2xvd2VyU2VydmljZU5hbWVdID0ge307XG4gICAgICBhd3NTZGtbc2VydmljZU5hbWVdID0gYXdzU2RrLlNlcnZpY2UuZGVmaW5lU2VydmljZShsb3dlclNlcnZpY2VOYW1lLCBhcGlWZXJzaW9ucyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIGF3c1Nkay5TZXJ2aWNlLmFkZFZlcnNpb25zKGF3c1Nka1tzZXJ2aWNlTmFtZV0sIGFwaVZlcnNpb25zKTtcbiAgICB9XG4gICAgYXBpVmVyc2lvbnMuZm9yRWFjaChhcGlWZXJzaW9uID0+IHtcbiAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShhcGlMb2FkZXIuc2VydmljZXNbbG93ZXJTZXJ2aWNlTmFtZV0sIGFwaVZlcnNpb24sIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiBnZXQoKSB7XG4gICAgICAgICAgY29uc3QgbW9kZWxGaWxlUHJlZml4ID0gYGF3cy1zZGstcGF0Y2gvJHtsb3dlclNlcnZpY2VOYW1lfS0ke2FwaVZlcnNpb259YDtcbiAgICAgICAgICBjb25zdCBtb2RlbCA9IEpTT04ucGFyc2UoZnMucmVhZEZpbGVTeW5jKGpvaW4oX19kaXJuYW1lLCBgJHttb2RlbEZpbGVQcmVmaXh9LnNlcnZpY2UuanNvbmApLCAndXRmLTgnKSk7XG4gICAgICAgICAgbW9kZWwucGFnaW5hdG9ycyA9IEpTT04ucGFyc2UoZnMucmVhZEZpbGVTeW5jKGpvaW4oX19kaXJuYW1lLCBgJHttb2RlbEZpbGVQcmVmaXh9LnBhZ2luYXRvcnMuanNvbmApLCAndXRmLTgnKSkucGFnaW5hdGlvbjtcbiAgICAgICAgICByZXR1cm4gbW9kZWw7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9KTtcbiAgcmV0dXJuIGF3c1Nkaztcbn1cblxuLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXJlcXVpcmUtaW1wb3J0cywgaW1wb3J0L25vLWV4dHJhbmVvdXMtZGVwZW5kZW5jaWVzICovXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gaGFuZGxlcihldmVudDogQVdTTGFtYmRhLkNsb3VkRm9ybWF0aW9uQ3VzdG9tUmVzb3VyY2VFdmVudCwgY29udGV4dDogQVdTTGFtYmRhLkNvbnRleHQpIHtcbiAgdHJ5IHtcbiAgICBsZXQgQVdTOiBhbnk7XG4gICAgaWYgKCFsYXRlc3RTZGtJbnN0YWxsZWQgJiYgZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLkluc3RhbGxMYXRlc3RBd3NTZGsgPT09ICd0cnVlJykge1xuICAgICAgdHJ5IHtcbiAgICAgICAgaW5zdGFsbExhdGVzdFNkaygpO1xuICAgICAgICBBV1MgPSByZXF1aXJlKCcvdG1wL25vZGVfbW9kdWxlcy9hd3Mtc2RrJyk7XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGNvbnNvbGUubG9nKGBGYWlsZWQgdG8gaW5zdGFsbCBsYXRlc3QgQVdTIFNESyB2MjogJHtlfWApO1xuICAgICAgICBBV1MgPSByZXF1aXJlKCdhd3Mtc2RrJyk7IC8vIEZhbGxiYWNrIHRvIHByZS1pbnN0YWxsZWQgdmVyc2lvblxuICAgICAgfVxuICAgIH0gZWxzZSBpZiAobGF0ZXN0U2RrSW5zdGFsbGVkKSB7XG4gICAgICBBV1MgPSByZXF1aXJlKCcvdG1wL25vZGVfbW9kdWxlcy9hd3Mtc2RrJyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIEFXUyA9IHJlcXVpcmUoJ2F3cy1zZGsnKTtcbiAgICB9XG4gICAgdHJ5IHtcbiAgICAgIEFXUyA9IHBhdGNoU2RrKEFXUyk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgY29uc29sZS5sb2coYEZhaWxlZCB0byBwYXRjaCBBV1MgU0RLOiAke2V9LiBQcm9jZWVkaW5nIHdpdGggdGhlIGluc3RhbGxlZCBjb3B5LmApO1xuICAgIH1cblxuICAgIGNvbnNvbGUubG9nKEpTT04uc3RyaW5naWZ5KGV2ZW50KSk7XG4gICAgY29uc29sZS5sb2coJ0FXUyBTREsgVkVSU0lPTjogJyArIEFXUy5WRVJTSU9OKTtcblxuICAgIGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5DcmVhdGUgPSBkZWNvZGVDYWxsKGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5DcmVhdGUpO1xuICAgIGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5VcGRhdGUgPSBkZWNvZGVDYWxsKGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5VcGRhdGUpO1xuICAgIGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5EZWxldGUgPSBkZWNvZGVDYWxsKGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5EZWxldGUpO1xuICAgIC8vIERlZmF1bHQgcGh5c2ljYWwgcmVzb3VyY2UgaWRcbiAgICBsZXQgcGh5c2ljYWxSZXNvdXJjZUlkOiBzdHJpbmc7XG4gICAgc3dpdGNoIChldmVudC5SZXF1ZXN0VHlwZSkge1xuICAgICAgY2FzZSAnQ3JlYXRlJzpcbiAgICAgICAgcGh5c2ljYWxSZXNvdXJjZUlkID0gZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLkNyZWF0ZT8ucGh5c2ljYWxSZXNvdXJjZUlkPy5pZCA/P1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuVXBkYXRlPy5waHlzaWNhbFJlc291cmNlSWQ/LmlkID8/XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5EZWxldGU/LnBoeXNpY2FsUmVzb3VyY2VJZD8uaWQgPz9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuTG9naWNhbFJlc291cmNlSWQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnVXBkYXRlJzpcbiAgICAgIGNhc2UgJ0RlbGV0ZSc6XG4gICAgICAgIHBoeXNpY2FsUmVzb3VyY2VJZCA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllc1tldmVudC5SZXF1ZXN0VHlwZV0/LnBoeXNpY2FsUmVzb3VyY2VJZD8uaWQgPz8gZXZlbnQuUGh5c2ljYWxSZXNvdXJjZUlkO1xuICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBsZXQgZmxhdERhdGE6IHsgW2tleTogc3RyaW5nXTogc3RyaW5nIH0gPSB7fTtcbiAgICBsZXQgZGF0YTogeyBba2V5OiBzdHJpbmddOiBzdHJpbmcgfSA9IHt9O1xuICAgIGNvbnN0IGNhbGw6IEF3c1Nka0NhbGwgfCB1bmRlZmluZWQgPSBldmVudC5SZXNvdXJjZVByb3BlcnRpZXNbZXZlbnQuUmVxdWVzdFR5cGVdO1xuXG4gICAgaWYgKGNhbGwpIHtcblxuICAgICAgbGV0IGNyZWRlbnRpYWxzO1xuICAgICAgaWYgKGNhbGwuYXNzdW1lZFJvbGVBcm4pIHtcbiAgICAgICAgY29uc3QgdGltZXN0YW1wID0gKG5ldyBEYXRlKCkpLmdldFRpbWUoKTtcblxuICAgICAgICBjb25zdCBwYXJhbXMgPSB7XG4gICAgICAgICAgUm9sZUFybjogY2FsbC5hc3N1bWVkUm9sZUFybixcbiAgICAgICAgICBSb2xlU2Vzc2lvbk5hbWU6IGAke3RpbWVzdGFtcH0tJHtwaHlzaWNhbFJlc291cmNlSWR9YC5zdWJzdHJpbmcoMCwgNjQpLFxuICAgICAgICB9O1xuXG4gICAgICAgIGNyZWRlbnRpYWxzID0gbmV3IEFXUy5DaGFpbmFibGVUZW1wb3JhcnlDcmVkZW50aWFscyh7XG4gICAgICAgICAgcGFyYW1zOiBwYXJhbXMsXG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICBpZiAoIU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChBV1MsIGNhbGwuc2VydmljZSkpIHtcbiAgICAgICAgdGhyb3cgRXJyb3IoYFNlcnZpY2UgJHtjYWxsLnNlcnZpY2V9IGRvZXMgbm90IGV4aXN0IGluIEFXUyBTREsgdmVyc2lvbiAke0FXUy5WRVJTSU9OfS5gKTtcbiAgICAgIH1cbiAgICAgIGNvbnN0IGF3c1NlcnZpY2UgPSBuZXcgKEFXUyBhcyBhbnkpW2NhbGwuc2VydmljZV0oe1xuICAgICAgICBhcGlWZXJzaW9uOiBjYWxsLmFwaVZlcnNpb24sXG4gICAgICAgIGNyZWRlbnRpYWxzOiBjcmVkZW50aWFscyxcbiAgICAgICAgcmVnaW9uOiBjYWxsLnJlZ2lvbixcbiAgICAgIH0pO1xuXG4gICAgICB0cnkge1xuICAgICAgICBjb25zdCByZXNwb25zZSA9IGF3YWl0IGF3c1NlcnZpY2VbY2FsbC5hY3Rpb25dKFxuICAgICAgICAgIGNhbGwucGFyYW1ldGVycyAmJiBkZWNvZGVTcGVjaWFsVmFsdWVzKGNhbGwucGFyYW1ldGVycywgcGh5c2ljYWxSZXNvdXJjZUlkKSkucHJvbWlzZSgpO1xuICAgICAgICBmbGF0RGF0YSA9IHtcbiAgICAgICAgICBhcGlWZXJzaW9uOiBhd3NTZXJ2aWNlLmNvbmZpZy5hcGlWZXJzaW9uLCAvLyBGb3IgdGVzdCBwdXJwb3NlczogY2hlY2sgaWYgYXBpVmVyc2lvbiB3YXMgY29ycmVjdGx5IHBhc3NlZC5cbiAgICAgICAgICByZWdpb246IGF3c1NlcnZpY2UuY29uZmlnLnJlZ2lvbiwgLy8gRm9yIHRlc3QgcHVycG9zZXM6IGNoZWNrIGlmIHJlZ2lvbiB3YXMgY29ycmVjdGx5IHBhc3NlZC5cbiAgICAgICAgICAuLi5mbGF0dGVuKHJlc3BvbnNlKSxcbiAgICAgICAgfTtcblxuICAgICAgICBsZXQgb3V0cHV0UGF0aHM6IHN0cmluZ1tdIHwgdW5kZWZpbmVkO1xuICAgICAgICBpZiAoY2FsbC5vdXRwdXRQYXRoKSB7XG4gICAgICAgICAgb3V0cHV0UGF0aHMgPSBbY2FsbC5vdXRwdXRQYXRoXTtcbiAgICAgICAgfSBlbHNlIGlmIChjYWxsLm91dHB1dFBhdGhzKSB7XG4gICAgICAgICAgb3V0cHV0UGF0aHMgPSBjYWxsLm91dHB1dFBhdGhzO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG91dHB1dFBhdGhzKSB7XG4gICAgICAgICAgZGF0YSA9IGZpbHRlcktleXMoZmxhdERhdGEsIHN0YXJ0c1dpdGhPbmVPZihvdXRwdXRQYXRocykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGRhdGEgPSBmbGF0RGF0YTtcbiAgICAgICAgfVxuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICBpZiAoIWNhbGwuaWdub3JlRXJyb3JDb2Rlc01hdGNoaW5nIHx8ICFuZXcgUmVnRXhwKGNhbGwuaWdub3JlRXJyb3JDb2Rlc01hdGNoaW5nKS50ZXN0KGUuY29kZSkpIHtcbiAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChjYWxsLnBoeXNpY2FsUmVzb3VyY2VJZD8ucmVzcG9uc2VQYXRoKSB7XG4gICAgICAgIHBoeXNpY2FsUmVzb3VyY2VJZCA9IGZsYXREYXRhW2NhbGwucGh5c2ljYWxSZXNvdXJjZUlkLnJlc3BvbnNlUGF0aF07XG4gICAgICB9XG4gICAgfVxuXG4gICAgYXdhaXQgcmVzcG9uZCgnU1VDQ0VTUycsICdPSycsIHBoeXNpY2FsUmVzb3VyY2VJZCwgZGF0YSk7XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICBjb25zb2xlLmxvZyhlKTtcbiAgICBhd2FpdCByZXNwb25kKCdGQUlMRUQnLCBlLm1lc3NhZ2UgfHwgJ0ludGVybmFsIEVycm9yJywgY29udGV4dC5sb2dTdHJlYW1OYW1lLCB7fSk7XG4gIH1cblxuICBmdW5jdGlvbiByZXNwb25kKHJlc3BvbnNlU3RhdHVzOiBzdHJpbmcsIHJlYXNvbjogc3RyaW5nLCBwaHlzaWNhbFJlc291cmNlSWQ6IHN0cmluZywgZGF0YTogYW55KSB7XG4gICAgY29uc3QgcmVzcG9uc2VCb2R5ID0gSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgU3RhdHVzOiByZXNwb25zZVN0YXR1cyxcbiAgICAgIFJlYXNvbjogcmVhc29uLFxuICAgICAgUGh5c2ljYWxSZXNvdXJjZUlkOiBwaHlzaWNhbFJlc291cmNlSWQsXG4gICAgICBTdGFja0lkOiBldmVudC5TdGFja0lkLFxuICAgICAgUmVxdWVzdElkOiBldmVudC5SZXF1ZXN0SWQsXG4gICAgICBMb2dpY2FsUmVzb3VyY2VJZDogZXZlbnQuTG9naWNhbFJlc291cmNlSWQsXG4gICAgICBOb0VjaG86IGZhbHNlLFxuICAgICAgRGF0YTogZGF0YSxcbiAgICB9KTtcblxuICAgIGNvbnNvbGUubG9nKCdSZXNwb25kaW5nJywgcmVzcG9uc2VCb2R5KTtcblxuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tcmVxdWlyZS1pbXBvcnRzXG4gICAgY29uc3QgcGFyc2VkVXJsID0gcmVxdWlyZSgndXJsJykucGFyc2UoZXZlbnQuUmVzcG9uc2VVUkwpO1xuICAgIGNvbnN0IHJlcXVlc3RPcHRpb25zID0ge1xuICAgICAgaG9zdG5hbWU6IHBhcnNlZFVybC5ob3N0bmFtZSxcbiAgICAgIHBhdGg6IHBhcnNlZFVybC5wYXRoLFxuICAgICAgbWV0aG9kOiAnUFVUJyxcbiAgICAgIGhlYWRlcnM6IHsgJ2NvbnRlbnQtdHlwZSc6ICcnLCAnY29udGVudC1sZW5ndGgnOiByZXNwb25zZUJvZHkubGVuZ3RoIH0sXG4gICAgfTtcblxuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICB0cnkge1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXJlcXVpcmUtaW1wb3J0c1xuICAgICAgICBjb25zdCByZXF1ZXN0ID0gcmVxdWlyZSgnaHR0cHMnKS5yZXF1ZXN0KHJlcXVlc3RPcHRpb25zLCByZXNvbHZlKTtcbiAgICAgICAgcmVxdWVzdC5vbignZXJyb3InLCByZWplY3QpO1xuICAgICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICAgIHJlcXVlc3QuZW5kKCk7XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIHJlamVjdChlKTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuXG5mdW5jdGlvbiBkZWNvZGVDYWxsKGNhbGw6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xuICBpZiAoIWNhbGwpIHsgcmV0dXJuIHVuZGVmaW5lZDsgfVxuICByZXR1cm4gSlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZnVuY3Rpb24gc3RhcnRzV2l0aE9uZU9mKHNlYXJjaFN0cmluZ3M6IHN0cmluZ1tdKTogKHN0cmluZzogc3RyaW5nKSA9PiBib29sZWFuIHtcbiAgcmV0dXJuIGZ1bmN0aW9uKHN0cmluZzogc3RyaW5nKTogYm9vbGVhbiB7XG4gICAgZm9yIChjb25zdCBzZWFyY2hTdHJpbmcgb2Ygc2VhcmNoU3RyaW5ncykge1xuICAgICAgaWYgKHN0cmluZy5zdGFydHNXaXRoKHNlYXJjaFN0cmluZykpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbiAgfTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/aws-ecs-integ.assets.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/aws-ecs-integ.assets.json deleted file mode 100644 index 43da15f874cd3..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/aws-ecs-integ.assets.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "version": "20.0.0", - "files": { - "8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d": { - "source": { - "path": "asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9": { - "source": { - "path": "asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90": { - "source": { - "path": "asset.9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "0b2a2f517aed512c15790ab888051365faa60d6c56c60f963b9f68bd63700087": { - "source": { - "path": "aws-ecs-integ.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0b2a2f517aed512c15790ab888051365faa60d6c56c60f963b9f68bd63700087.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/aws-ecs-integ.template.json deleted file mode 100644 index ff45156d14d40..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/aws-ecs-integ.template.json +++ /dev/null @@ -1,1346 +0,0 @@ -{ - "Resources": { - "vpcA2121C38": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc" - } - ] - } - }, - "vpcpublicSubnet1SubnetA635257E": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/24", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet1" - } - ] - } - }, - "vpcpublicSubnet1RouteTableA38152FE": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet1" - } - ] - } - }, - "vpcpublicSubnet1RouteTableAssociationB46101B8": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet1RouteTableA38152FE" - }, - "SubnetId": { - "Ref": "vpcpublicSubnet1SubnetA635257E" - } - } - }, - "vpcpublicSubnet1DefaultRouteF0973989": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet1RouteTableA38152FE" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - }, - "DependsOn": [ - "vpcVPCGW7984C166" - ] - }, - "vpcpublicSubnet2Subnet027D165B": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.1.0/24", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet2" - } - ] - } - }, - "vpcpublicSubnet2RouteTableA6135437": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet2" - } - ] - } - }, - "vpcpublicSubnet2RouteTableAssociation73F6478A": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet2RouteTableA6135437" - }, - "SubnetId": { - "Ref": "vpcpublicSubnet2Subnet027D165B" - } - } - }, - "vpcpublicSubnet2DefaultRoute13685A07": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet2RouteTableA6135437" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - }, - "DependsOn": [ - "vpcVPCGW7984C166" - ] - }, - "vpcIGWE57CBDCA": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc" - } - ] - } - }, - "vpcVPCGW7984C166": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "InternetGatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - } - }, - "zoneEB40FF1E": { - "Type": "AWS::Route53::HostedZone", - "Properties": { - "Name": "myexample.com." - } - }, - "laterRecordD393EDE6": { - "Type": "AWS::Route53::RecordSet", - "Properties": { - "Name": "u-record.myexample.com.", - "Type": "CNAME", - "HostedZoneId": { - "Ref": "zoneEB40FF1E" - }, - "ResourceRecords": [ - "console.aws.amazon.com" - ], - "TTL": "1800" - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "nametaskdefinitionTaskRole50FE844E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupE19F1043", - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "nameserviceTaskRecordManagerRuleStopped66D08B70" - ] - }, - "nametaskdefinition690762BB": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 256, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "namelogsF4B17D31" - }, - "awslogs-stream-prefix": "name", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 512, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "256", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "Family": "awsecsintegnametaskdefinition0EA6A1A0", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupE19F1043", - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "nameserviceTaskRecordManagerRuleStopped66D08B70" - ] - }, - "nametaskdefinitionExecutionRole45AC5C9A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupE19F1043", - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "nameserviceTaskRecordManagerRuleStopped66D08B70" - ] - }, - "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "namelogsF4B17D31", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "Roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupE19F1043", - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "nameserviceTaskRecordManagerRuleStopped66D08B70" - ] - }, - "namelogsF4B17D31": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceService8015C8D6": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "ENABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "vpcpublicSubnet1SubnetA635257E" - }, - { - "Ref": "vpcpublicSubnet2Subnet027D165B" - } - ] - } - }, - "TaskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "nameserviceSecurityGroup33F4662C": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "SecurityGroupIngress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Accept inbound traffic on traffic port from anywhere", - "FromPort": 80, - "IpProtocol": "tcp", - "ToPort": 80 - } - ], - "VpcId": { - "Ref": "vpcA2121C38" - } - } - }, - "nameserviceTaskRecordManagerEventsDLB8F13E1E": { - "Type": "AWS::SQS::Queue", - "Properties": { - "MessageRetentionPeriod": 1209600 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceTaskRecordManagerEventsQueueF805A6C1": { - "Type": "AWS::SQS::Queue", - "Properties": { - "RedrivePolicy": { - "deadLetterTargetArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsDLB8F13E1E", - "Arn" - ] - }, - "maxReceiveCount": 500 - }, - "VisibilityTimeout": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceTaskRecordManagerEventsQueuePolicy65CC6F9E": { - "Type": "AWS::SQS::QueuePolicy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:SendMessage" - ], - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - }, - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:SendMessage" - ], - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRuleStopped66D08B70", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "Queues": [ - { - "Ref": "nameserviceTaskRecordManagerEventsQueueF805A6C1" - } - ] - } - }, - "nameserviceTaskRecordManagerRecordsA4648C6E": { - "Type": "AWS::DynamoDB::Table", - "Properties": { - "KeySchema": [ - { - "AttributeName": "cluster_service", - "KeyType": "HASH" - } - ], - "AttributeDefinitions": [ - { - "AttributeName": "cluster_service", - "AttributeType": "S" - } - ], - "BillingMode": "PAY_PER_REQUEST" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceTaskRecordManagerRuleRunningCD85F46F": { - "Type": "AWS::Events::Rule", - "Properties": { - "EventPattern": { - "source": [ - "aws.ecs" - ], - "detail-type": [ - "ECS Task State Change" - ], - "detail": { - "clusterArn": [ - { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - ], - "lastStatus": [ - "RUNNING" - ], - "desiredStatus": [ - "RUNNING" - ] - } - }, - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - }, - "Id": "Target0" - } - ] - } - }, - "nameserviceTaskRecordManagerRuleStopped66D08B70": { - "Type": "AWS::Events::Rule", - "Properties": { - "EventPattern": { - "source": [ - "aws.ecs" - ], - "detail-type": [ - "ECS Task State Change" - ], - "detail": { - "clusterArn": [ - { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - ], - "lastStatus": [ - "STOPPED" - ], - "desiredStatus": [ - "STOPPED" - ] - } - }, - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - }, - "Id": "Target0" - } - ] - } - }, - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "ec2:DescribeNetworkInterfaces", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "route53:ChangeResourceRecordSets", - "route53:ListResourceRecordSets" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":route53:::hostedzone/", - { - "Ref": "zoneEB40FF1E" - } - ] - ] - } - }, - { - "Action": [ - "sqs:ChangeMessageVisibility", - "sqs:DeleteMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:ReceiveMessage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - }, - { - "Action": [ - "dynamodb:BatchGetItem", - "dynamodb:BatchWriteItem", - "dynamodb:ConditionCheckItem", - "dynamodb:DeleteItem", - "dynamodb:DescribeTable", - "dynamodb:GetItem", - "dynamodb:GetRecords", - "dynamodb:GetShardIterator", - "dynamodb:PutItem", - "dynamodb:Query", - "dynamodb:Scan", - "dynamodb:UpdateItem" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRecordsA4648C6E", - "Arn" - ] - }, - { - "Ref": "AWS::NoValue" - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "Roles": [ - { - "Ref": "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A" - } - ] - } - }, - "nameserviceTaskRecordManagerEventHandler4B8C6905": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A", - "Arn" - ] - }, - "Environment": { - "Variables": { - "HOSTED_ZONE_ID": { - "Ref": "zoneEB40FF1E" - }, - "RECORD_NAME": "test-record.myexample.com", - "RECORDS_TABLE": { - "Ref": "nameserviceTaskRecordManagerRecordsA4648C6E" - }, - "CLUSTER_ARN": { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - }, - "SERVICE_NAME": { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - } - }, - "Handler": "index.queue_handler", - "ReservedConcurrentExecutions": 1, - "Runtime": "python3.8", - "Timeout": 30 - }, - "DependsOn": [ - "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A" - ] - }, - "nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155": { - "Type": "AWS::Lambda::EventSourceMapping", - "Properties": { - "FunctionName": { - "Ref": "nameserviceTaskRecordManagerEventHandler4B8C6905" - }, - "EventSourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleDefaultPolicy7D095576": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "route53:ChangeResourceRecordSets", - "route53:ListResourceRecordSets" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":route53:::hostedzone/", - { - "Ref": "zoneEB40FF1E" - } - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleDefaultPolicy7D095576", - "Roles": [ - { - "Ref": "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0" - } - ] - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0", - "Arn" - ] - }, - "Handler": "index.cleanup_resource_handler", - "Runtime": "python3.8", - "Timeout": 300 - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleDefaultPolicy7D095576", - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0" - ] - }, - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleDefaultPolicy350D6FAC": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleDefaultPolicy350D6FAC", - "Roles": [ - { - "Ref": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0" - } - ] - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEvent9B27C899": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3Bucket40DFAF90" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3VersionKey36104212" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3VersionKey36104212" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0", - "Arn" - ] - }, - "Description": "AWS CDK resource provider framework - onEvent (aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider)", - "Environment": { - "Variables": { - "USER_ON_EVENT_FUNCTION_ARN": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - } - } - }, - "Handler": "framework.onEvent", - "Runtime": "nodejs14.x", - "Timeout": 900 - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleDefaultPolicy350D6FAC", - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0" - ] - }, - "nameserviceTaskRecordManagerCleanupE19F1043": { - "Type": "AWS::CloudFormation::CustomResource", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEvent9B27C899", - "Arn" - ] - }, - "HostedZoneId": { - "Ref": "zoneEB40FF1E" - }, - "RecordName": "test-record.myexample.com" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceTaskRecordManagerPrimingCallCustomResourcePolicy376F02F0": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameserviceTaskRecordManagerPrimingCallCustomResourcePolicy376F02F0", - "Roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - }, - "DependsOn": [ - "nameserviceTaskRecordManagerEventHandler4B8C6905", - "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A", - "nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155" - ] - }, - "nameserviceTaskRecordManagerPrimingCallE6113369": { - "Type": "Custom::AWS", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd22872D164C4C", - "Arn" - ] - }, - "Create": { - "Fn::Join": [ - "", - [ - "{\"service\":\"SQS\",\"action\":\"sendMessage\",\"parameters\":{\"QueueUrl\":\"", - { - "Ref": "nameserviceTaskRecordManagerEventsQueueF805A6C1" - }, - "\",\"DelaySeconds\":10,\"MessageBody\":\"{ \\\"prime\\\": true }\",\"MessageAttributes\":{\"HostedZoneId\":{\"DataType\":\"String\",\"StringValue\":\"", - { - "Ref": "zoneEB40FF1E" - }, - "\"},\"RecordName\":{\"DataType\":\"String\",\"StringValue\":\"test-record\"}}},\"physicalResourceId\":{\"responsePath\":\"MessageId\"}}" - ] - ] - }, - "Update": { - "Fn::Join": [ - "", - [ - "{\"service\":\"SQS\",\"action\":\"sendMessage\",\"parameters\":{\"QueueUrl\":\"", - { - "Ref": "nameserviceTaskRecordManagerEventsQueueF805A6C1" - }, - "\",\"DelaySeconds\":10,\"MessageBody\":\"{ \\\"prime\\\": true }\",\"MessageAttributes\":{\"HostedZoneId\":{\"DataType\":\"String\",\"StringValue\":\"", - { - "Ref": "zoneEB40FF1E" - }, - "\"},\"RecordName\":{\"DataType\":\"String\",\"StringValue\":\"test-record\"}}},\"physicalResourceId\":{\"responsePath\":\"MessageId\"}}" - ] - ] - }, - "InstallLatestAwsSdk": true - }, - "DependsOn": [ - "nameserviceTaskRecordManagerEventHandler4B8C6905", - "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A", - "nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155", - "nameserviceTaskRecordManagerPrimingCallCustomResourcePolicy376F02F0" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "AWS679f53fac002430cb0da5b7982bd22872D164C4C": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3BucketB21FB59F" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3VersionKey73D4F058" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3VersionKey73D4F058" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "nodejs14.x", - "Timeout": 120 - }, - "DependsOn": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - ] - } - }, - "Parameters": { - "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6": { - "Type": "String", - "Description": "S3 bucket for asset \"8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d\"" - }, - "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825": { - "Type": "String", - "Description": "S3 key for asset version \"8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d\"" - }, - "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dArtifactHash0F81F2AB": { - "Type": "String", - "Description": "Artifact hash for asset \"8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d\"" - }, - "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3Bucket40DFAF90": { - "Type": "String", - "Description": "S3 bucket for asset \"8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9\"" - }, - "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3VersionKey36104212": { - "Type": "String", - "Description": "S3 key for asset version \"8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9\"" - }, - "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9ArtifactHash26B5BCAA": { - "Type": "String", - "Description": "Artifact hash for asset \"8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9\"" - }, - "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3BucketB21FB59F": { - "Type": "String", - "Description": "S3 bucket for asset \"9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90\"" - }, - "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3VersionKey73D4F058": { - "Type": "String", - "Description": "S3 key for asset version \"9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90\"" - }, - "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90ArtifactHashC00C7285": { - "Type": "String", - "Description": "Artifact hash for asset \"9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90\"" - } - }, - "Outputs": { - "DnsName": { - "Value": "test-record.myexample.com" - }, - "DnsServer": { - "Value": { - "Fn::Select": [ - 0, - { - "Fn::GetAtt": [ - "zoneEB40FF1E", - "NameServers" - ] - } - ] - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/cdk.out b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/cdk.out deleted file mode 100644 index 588d7b269d34f..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/integ.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/integ.json deleted file mode 100644 index 53e04504bce72..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/integ.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "20.0.0", - "testCases": { - "integ.assign-public-ip": { - "stacks": [ - "aws-ecs-integ" - ], - "diffAssets": false, - "stackUpdateWorkflow": true - } - }, - "synthContext": {}, - "enableLookups": false -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/manifest.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/manifest.json deleted file mode 100644 index 7684dc02119c2..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/manifest.json +++ /dev/null @@ -1,378 +0,0 @@ -{ - "version": "20.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "aws-ecs-integ": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "aws-ecs-integ.template.json", - "validateOnSynth": false - }, - "metadata": { - "/aws-ecs-integ": [ - { - "type": "aws:cdk:asset", - "data": { - "path": "asset.8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d", - "id": "8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d", - "packaging": "zip", - "sourceHash": "8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d", - "s3BucketParameter": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6", - "s3KeyParameter": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825", - "artifactHashParameter": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dArtifactHash0F81F2AB" - } - }, - { - "type": "aws:cdk:asset", - "data": { - "path": "asset.8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9", - "id": "8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9", - "packaging": "zip", - "sourceHash": "8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9", - "s3BucketParameter": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3Bucket40DFAF90", - "s3KeyParameter": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3VersionKey36104212", - "artifactHashParameter": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9ArtifactHash26B5BCAA" - } - }, - { - "type": "aws:cdk:asset", - "data": { - "path": "asset.9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90", - "id": "9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90", - "packaging": "zip", - "sourceHash": "9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90", - "s3BucketParameter": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3BucketB21FB59F", - "s3KeyParameter": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3VersionKey73D4F058", - "artifactHashParameter": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90ArtifactHashC00C7285" - } - } - ], - "/aws-ecs-integ/vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcA2121C38" - } - ], - "/aws-ecs-integ/vpc/publicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcpublicSubnet1SubnetA635257E" - } - ], - "/aws-ecs-integ/vpc/publicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcpublicSubnet1RouteTableA38152FE" - } - ], - "/aws-ecs-integ/vpc/publicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcpublicSubnet1RouteTableAssociationB46101B8" - } - ], - "/aws-ecs-integ/vpc/publicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcpublicSubnet1DefaultRouteF0973989" - } - ], - "/aws-ecs-integ/vpc/publicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcpublicSubnet2Subnet027D165B" - } - ], - "/aws-ecs-integ/vpc/publicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcpublicSubnet2RouteTableA6135437" - } - ], - "/aws-ecs-integ/vpc/publicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcpublicSubnet2RouteTableAssociation73F6478A" - } - ], - "/aws-ecs-integ/vpc/publicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcpublicSubnet2DefaultRoute13685A07" - } - ], - "/aws-ecs-integ/vpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcIGWE57CBDCA" - } - ], - "/aws-ecs-integ/vpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "vpcVPCGW7984C166" - } - ], - "/aws-ecs-integ/zone/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "zoneEB40FF1E" - } - ], - "/aws-ecs-integ/laterRecord/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "laterRecordD393EDE6" - } - ], - "/aws-ecs-integ/production-environment-cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentclusterC6599D2D" - } - ], - "/aws-ecs-integ/name-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionTaskRole50FE844E" - } - ], - "/aws-ecs-integ/name-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinition690762BB" - } - ], - "/aws-ecs-integ/name-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionExecutionRole45AC5C9A" - } - ], - "/aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20" - } - ], - "/aws-ecs-integ/name-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namelogsF4B17D31" - } - ], - "/aws-ecs-integ/name-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceService8015C8D6" - } - ], - "/aws-ecs-integ/name-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceSecurityGroup33F4662C" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/EventsDL/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerEventsDLB8F13E1E" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/EventsQueue/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerEventsQueueF805A6C1" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/EventsQueue/Policy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerEventsQueuePolicy65CC6F9E" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/Records/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerRecordsA4648C6E" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/RuleRunning/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerRuleRunningCD85F46F" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/RuleStopped/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerRuleStopped66D08B70" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/EventHandler/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/EventHandler/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/EventHandler/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerEventHandler4B8C6905" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/EventHandler/SqsEventSource:awsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A86/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleDefaultPolicy7D095576" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleDefaultPolicy350D6FAC" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEvent9B27C899" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/Cleanup/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerCleanupE19F1043" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/PrimingCall/CustomResourcePolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerPrimingCallCustomResourcePolicy376F02F0" - } - ], - "/aws-ecs-integ/name-service/TaskRecordManager/PrimingCall/Resource/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskRecordManagerPrimingCallE6113369" - } - ], - "/aws-ecs-integ/AssetParameters/8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/S3Bucket": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6" - } - ], - "/aws-ecs-integ/AssetParameters/8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/S3VersionKey": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ], - "/aws-ecs-integ/AssetParameters/8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/ArtifactHash": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dArtifactHash0F81F2AB" - } - ], - "/aws-ecs-integ/AssetParameters/8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/S3Bucket": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3Bucket40DFAF90" - } - ], - "/aws-ecs-integ/AssetParameters/8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/S3VersionKey": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3VersionKey36104212" - } - ], - "/aws-ecs-integ/AssetParameters/8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/ArtifactHash": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9ArtifactHash26B5BCAA" - } - ], - "/aws-ecs-integ/AssetParameters/9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/S3Bucket": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3BucketB21FB59F" - } - ], - "/aws-ecs-integ/AssetParameters/9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/S3VersionKey": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3VersionKey73D4F058" - } - ], - "/aws-ecs-integ/AssetParameters/9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/ArtifactHash": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90ArtifactHashC00C7285" - } - ], - "/aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ], - "/aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "AWS679f53fac002430cb0da5b7982bd22872D164C4C" - } - ], - "/aws-ecs-integ/DnsName": [ - { - "type": "aws:cdk:logicalId", - "data": "DnsName" - } - ], - "/aws-ecs-integ/DnsServer": [ - { - "type": "aws:cdk:logicalId", - "data": "DnsServer" - } - ] - }, - "displayName": "aws-ecs-integ" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/tree.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/tree.json deleted file mode 100644 index 24e2854d72e08..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.integ.snapshot/tree.json +++ /dev/null @@ -1,2161 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "aws-ecs-integ": { - "id": "aws-ecs-integ", - "path": "aws-ecs-integ", - "children": { - "vpc": { - "id": "vpc", - "path": "aws-ecs-integ/vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "publicSubnet1": { - "id": "publicSubnet1", - "path": "aws-ecs-integ/vpc/publicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/vpc/publicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "vpcA2121C38" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/24", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/vpc/publicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/vpc/publicSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/vpc/publicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "vpcA2121C38" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/vpc/publicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/vpc/publicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "vpcpublicSubnet1RouteTableA38152FE" - }, - "subnetId": { - "Ref": "vpcpublicSubnet1SubnetA635257E" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/vpc/publicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "vpcpublicSubnet1RouteTableA38152FE" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "publicSubnet2": { - "id": "publicSubnet2", - "path": "aws-ecs-integ/vpc/publicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/vpc/publicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "vpcA2121C38" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.1.0/24", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/vpc/publicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/vpc/publicSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/vpc/publicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "vpcA2121C38" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/vpc/publicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/vpc/publicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "vpcpublicSubnet2RouteTableA6135437" - }, - "subnetId": { - "Ref": "vpcpublicSubnet2Subnet027D165B" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/vpc/publicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "vpcpublicSubnet2RouteTableA6135437" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "aws-ecs-integ/vpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "aws-ecs-integ/vpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "vpcA2121C38" - }, - "internetGatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "zone": { - "id": "zone", - "path": "aws-ecs-integ/zone", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/zone/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Route53::HostedZone", - "aws:cdk:cloudformation:props": { - "name": "myexample.com." - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CfnHostedZone", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-route53.PublicHostedZone", - "version": "0.0.0" - } - }, - "laterRecord": { - "id": "laterRecord", - "path": "aws-ecs-integ/laterRecord", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/laterRecord/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", - "aws:cdk:cloudformation:props": { - "name": "u-record.myexample.com.", - "type": "CNAME", - "hostedZoneId": { - "Ref": "zoneEB40FF1E" - }, - "resourceRecords": [ - "console.aws.amazon.com" - ], - "ttl": "1800" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CfnRecordSet", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CnameRecord", - "version": "0.0.0" - } - }, - "production": { - "id": "production", - "path": "aws-ecs-integ/production", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "production-environment-cluster": { - "id": "production-environment-cluster", - "path": "aws-ecs-integ/production-environment-cluster", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnCluster", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.Cluster", - "version": "0.0.0" - } - }, - "name": { - "id": "name", - "path": "aws-ecs-integ/name", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "name-task-definition": { - "id": "name-task-definition", - "path": "aws-ecs-integ/name-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/name-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 256, - "essential": true, - "image": "nathanpeck/name", - "memory": 512, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "namelogsF4B17D31" - }, - "awslogs-stream-prefix": "name", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - } - ] - } - ], - "cpu": "256", - "executionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "family": "awsecsintegnametaskdefinition0EA6A1A0", - "memory": "512", - "networkMode": "awsvpc", - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/name-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "namelogsF4B17D31", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "name-logs": { - "id": "name-logs", - "path": "aws-ecs-integ/name-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "name-logs", - "retentionInDays": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "name-service": { - "id": "name-service", - "path": "aws-ecs-integ/name-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/name-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "deploymentConfiguration": { - "maximumPercent": 200, - "minimumHealthyPercent": 100 - }, - "desiredCount": 1, - "enableEcsManagedTags": false, - "launchType": "FARGATE", - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "ENABLED", - "subnets": [ - { - "Ref": "vpcpublicSubnet1SubnetA635257E" - }, - { - "Ref": "vpcpublicSubnet2Subnet027D165B" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ] - } - }, - "taskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/name-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "securityGroupIngress": [ - { - "cidrIp": "0.0.0.0/0", - "ipProtocol": "tcp", - "fromPort": 80, - "toPort": 80, - "description": "Accept inbound traffic on traffic port from anywhere" - } - ], - "vpcId": { - "Ref": "vpcA2121C38" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "TaskRecordManager": { - "id": "TaskRecordManager", - "path": "aws-ecs-integ/name-service/TaskRecordManager", - "children": { - "EventsDL": { - "id": "EventsDL", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventsDL", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventsDL/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SQS::Queue", - "aws:cdk:cloudformation:props": { - "messageRetentionPeriod": 1209600 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.CfnQueue", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.Queue", - "version": "0.0.0" - } - }, - "EventsQueue": { - "id": "EventsQueue", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventsQueue", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventsQueue/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SQS::Queue", - "aws:cdk:cloudformation:props": { - "redrivePolicy": { - "deadLetterTargetArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsDLB8F13E1E", - "Arn" - ] - }, - "maxReceiveCount": 500 - }, - "visibilityTimeout": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.CfnQueue", - "version": "0.0.0" - } - }, - "Policy": { - "id": "Policy", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventsQueue/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventsQueue/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SQS::QueuePolicy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:SendMessage" - ], - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - }, - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:SendMessage" - ], - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRuleStopped66D08B70", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "queues": [ - { - "Ref": "nameserviceTaskRecordManagerEventsQueueF805A6C1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.CfnQueuePolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.QueuePolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.Queue", - "version": "0.0.0" - } - }, - "Records": { - "id": "Records", - "path": "aws-ecs-integ/name-service/TaskRecordManager/Records", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/Records/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", - "aws:cdk:cloudformation:props": { - "keySchema": [ - { - "attributeName": "cluster_service", - "keyType": "HASH" - } - ], - "attributeDefinitions": [ - { - "attributeName": "cluster_service", - "attributeType": "S" - } - ], - "billingMode": "PAY_PER_REQUEST" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-dynamodb.CfnTable", - "version": "0.0.0" - } - }, - "ScalingRole": { - "id": "ScalingRole", - "path": "aws-ecs-integ/name-service/TaskRecordManager/Records/ScalingRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-dynamodb.Table", - "version": "0.0.0" - } - }, - "RuleRunning": { - "id": "RuleRunning", - "path": "aws-ecs-integ/name-service/TaskRecordManager/RuleRunning", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/RuleRunning/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Events::Rule", - "aws:cdk:cloudformation:props": { - "eventPattern": { - "source": [ - "aws.ecs" - ], - "detail-type": [ - "ECS Task State Change" - ], - "detail": { - "clusterArn": [ - { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - ], - "lastStatus": [ - "RUNNING" - ], - "desiredStatus": [ - "RUNNING" - ] - } - }, - "state": "ENABLED", - "targets": [ - { - "id": "Target0", - "arn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-events.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-events.Rule", - "version": "0.0.0" - } - }, - "RuleStopped": { - "id": "RuleStopped", - "path": "aws-ecs-integ/name-service/TaskRecordManager/RuleStopped", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/RuleStopped/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Events::Rule", - "aws:cdk:cloudformation:props": { - "eventPattern": { - "source": [ - "aws.ecs" - ], - "detail-type": [ - "ECS Task State Change" - ], - "detail": { - "clusterArn": [ - { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - ], - "lastStatus": [ - "STOPPED" - ], - "desiredStatus": [ - "STOPPED" - ] - } - }, - "state": "ENABLED", - "targets": [ - { - "id": "Target0", - "arn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-events.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-events.Rule", - "version": "0.0.0" - } - }, - "EventHandler": { - "id": "EventHandler", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "ec2:DescribeNetworkInterfaces", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "route53:ChangeResourceRecordSets", - "route53:ListResourceRecordSets" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":route53:::hostedzone/", - { - "Ref": "zoneEB40FF1E" - } - ] - ] - } - }, - { - "Action": [ - "sqs:ChangeMessageVisibility", - "sqs:DeleteMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:ReceiveMessage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - }, - { - "Action": [ - "dynamodb:BatchGetItem", - "dynamodb:BatchWriteItem", - "dynamodb:ConditionCheckItem", - "dynamodb:DeleteItem", - "dynamodb:DescribeTable", - "dynamodb:GetItem", - "dynamodb:GetRecords", - "dynamodb:GetShardIterator", - "dynamodb:PutItem", - "dynamodb:Query", - "dynamodb:Scan", - "dynamodb:UpdateItem" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRecordsA4648C6E", - "Arn" - ] - }, - { - "Ref": "AWS::NoValue" - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "roles": [ - { - "Ref": "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6" - }, - "s3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - } - ] - ] - } - }, - "role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A", - "Arn" - ] - }, - "environment": { - "variables": { - "HOSTED_ZONE_ID": { - "Ref": "zoneEB40FF1E" - }, - "RECORD_NAME": "test-record.myexample.com", - "RECORDS_TABLE": { - "Ref": "nameserviceTaskRecordManagerRecordsA4648C6E" - }, - "CLUSTER_ARN": { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - }, - "SERVICE_NAME": { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - } - }, - "handler": "index.queue_handler", - "reservedConcurrentExecutions": 1, - "runtime": "python3.8", - "timeout": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - }, - "SqsEventSource:awsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A86": { - "id": "SqsEventSource:awsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A86", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/SqsEventSource:awsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A86", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/EventHandler/SqsEventSource:awsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A86/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::EventSourceMapping", - "aws:cdk:cloudformation:props": { - "functionName": { - "Ref": "nameserviceTaskRecordManagerEventHandler4B8C6905" - }, - "eventSourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnEventSourceMapping", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.EventSourceMapping", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - }, - "CleanupResourceProviderHandler": { - "id": "CleanupResourceProviderHandler", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "route53:ChangeResourceRecordSets", - "route53:ListResourceRecordSets" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":route53:::hostedzone/", - { - "Ref": "zoneEB40FF1E" - } - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleDefaultPolicy7D095576", - "roles": [ - { - "Ref": "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProviderHandler/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6" - }, - "s3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - } - ] - ] - } - }, - "role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0", - "Arn" - ] - }, - "handler": "index.cleanup_resource_handler", - "runtime": "python3.8", - "timeout": 300 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - }, - "CleanupResourceProvider": { - "id": "CleanupResourceProvider", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider", - "children": { - "framework-onEvent": { - "id": "framework-onEvent", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleDefaultPolicy350D6FAC", - "roles": [ - { - "Ref": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider/framework-onEvent/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Ref": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3Bucket40DFAF90" - }, - "s3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3VersionKey36104212" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9S3VersionKey36104212" - } - ] - } - ] - } - ] - ] - } - }, - "role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0", - "Arn" - ] - }, - "description": "AWS CDK resource provider framework - onEvent (aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider)", - "environment": { - "variables": { - "USER_ON_EVENT_FUNCTION_ARN": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - } - } - }, - "handler": "framework.onEvent", - "runtime": "nodejs14.x", - "timeout": 900 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/custom-resources.Provider", - "version": "0.0.0" - } - }, - "Cleanup": { - "id": "Cleanup", - "path": "aws-ecs-integ/name-service/TaskRecordManager/Cleanup", - "children": { - "Default": { - "id": "Default", - "path": "aws-ecs-integ/name-service/TaskRecordManager/Cleanup/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "PrimingCall": { - "id": "PrimingCall", - "path": "aws-ecs-integ/name-service/TaskRecordManager/PrimingCall", - "children": { - "Provider": { - "id": "Provider", - "path": "aws-ecs-integ/name-service/TaskRecordManager/PrimingCall/Provider", - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.SingletonFunction", - "version": "0.0.0" - } - }, - "CustomResourcePolicy": { - "id": "CustomResourcePolicy", - "path": "aws-ecs-integ/name-service/TaskRecordManager/PrimingCall/CustomResourcePolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/PrimingCall/CustomResourcePolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "nameserviceTaskRecordManagerPrimingCallCustomResourcePolicy376F02F0", - "roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskRecordManager/PrimingCall/Resource", - "children": { - "Default": { - "id": "Default", - "path": "aws-ecs-integ/name-service/TaskRecordManager/PrimingCall/Resource/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/custom-resources.AwsCustomResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - }, - "AssetParameters": { - "id": "AssetParameters", - "path": "aws-ecs-integ/AssetParameters", - "children": { - "8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d": { - "id": "8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d", - "path": "aws-ecs-integ/AssetParameters/8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d", - "children": { - "S3Bucket": { - "id": "S3Bucket", - "path": "aws-ecs-integ/AssetParameters/8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/S3Bucket", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "S3VersionKey": { - "id": "S3VersionKey", - "path": "aws-ecs-integ/AssetParameters/8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/S3VersionKey", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "ArtifactHash": { - "id": "ArtifactHash", - "path": "aws-ecs-integ/AssetParameters/8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d/ArtifactHash", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9": { - "id": "8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9", - "path": "aws-ecs-integ/AssetParameters/8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9", - "children": { - "S3Bucket": { - "id": "S3Bucket", - "path": "aws-ecs-integ/AssetParameters/8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/S3Bucket", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "S3VersionKey": { - "id": "S3VersionKey", - "path": "aws-ecs-integ/AssetParameters/8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/S3VersionKey", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "ArtifactHash": { - "id": "ArtifactHash", - "path": "aws-ecs-integ/AssetParameters/8dd02cc4ac473ca5b08800e92edaa31a1a7db4005928021d029c5363584f11b9/ArtifactHash", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90": { - "id": "9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90", - "path": "aws-ecs-integ/AssetParameters/9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90", - "children": { - "S3Bucket": { - "id": "S3Bucket", - "path": "aws-ecs-integ/AssetParameters/9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/S3Bucket", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "S3VersionKey": { - "id": "S3VersionKey", - "path": "aws-ecs-integ/AssetParameters/9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/S3VersionKey", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "ArtifactHash": { - "id": "ArtifactHash", - "path": "aws-ecs-integ/AssetParameters/9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90/ArtifactHash", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "AWS679f53fac002430cb0da5b7982bd2287": { - "id": "AWS679f53fac002430cb0da5b7982bd2287", - "path": "aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/AWS679f53fac002430cb0da5b7982bd2287/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Ref": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3BucketB21FB59F" - }, - "s3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3VersionKey73D4F058" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters9d784cf317cead201dfe56ed0404d6d23eba6d499ca7354138230c2267f2fe90S3VersionKey73D4F058" - } - ] - } - ] - } - ] - ] - } - }, - "role": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "nodejs14.x", - "timeout": 120 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - }, - "DnsName": { - "id": "DnsName", - "path": "aws-ecs-integ/DnsName", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "DnsServer": { - "id": "DnsServer", - "path": "aws-ecs-integ/DnsServer", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.test.ts deleted file mode 100644 index be8d6e6bcac51..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/assign-public-ip.test.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as autoscaling from '@aws-cdk/aws-autoscaling'; -import * as ec2 from '@aws-cdk/aws-ec2'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as route53 from '@aws-cdk/aws-route53'; -import * as cdk from '@aws-cdk/core'; -import { AssignPublicIpExtension, Container, Environment, EnvironmentCapacityType, Service, ServiceDescription } from '../lib'; -import { TaskRecordManager } from '../lib/extensions/assign-public-ip/task-record-manager'; - -describe('assign public ip', () => { - test('should assign a public ip to fargate tasks', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - serviceDescription.add(new AssignPublicIpExtension()); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - NetworkConfiguration: { - AwsvpcConfiguration: { - AssignPublicIp: 'ENABLED', - }, - }, - }); - }); - - test('errors when adding a public ip to ec2-backed service', () => { - // GIVEN - const stack = new cdk.Stack(); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new ecs.AsgCapacityProvider(stack, 'Provider', { - autoScalingGroup: new autoscaling.AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - machineImage: ec2.MachineImage.latestAmazonLinux(), - instanceType: new ec2.InstanceType('t2.micro'), - }), - })); - - const environment = new Environment(stack, 'production', { - vpc, - cluster, - capacityType: EnvironmentCapacityType.EC2, - }); - - const serviceDescription = new ServiceDescription(); - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - serviceDescription.add(new AssignPublicIpExtension()); - - // WHEN / THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - }).toThrow(/Fargate/i); - }); - - test('should not add a task record manager by default', () => { - // GIVEN - const stack = new cdk.Stack(); - - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - // WHEN - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - serviceDescription.add(new AssignPublicIpExtension()); - - const service = new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - expect(service.ecsService.node.tryFindChild('TaskRecordManager')).toBeUndefined(); - }); - - test('should add a task record manager when dns is requested', () => { - // GIVEN - const stack = new cdk.Stack(); - const dnsZone = new route53.PublicHostedZone(stack, 'zone', { - zoneName: 'myexample.com', - }); - - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - // WHEN - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - serviceDescription.add(new AssignPublicIpExtension({ - dns: { - zone: dnsZone, - recordName: 'test-record', - }, - })); - - const service = new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - expect(service.ecsService.node.tryFindChild('TaskRecordManager')).toBeDefined(); - }); - - test('task record manager listens for ecs events', () => { - // GIVEN - const stack = new cdk.Stack(); - const dnsZone = new route53.PublicHostedZone(stack, 'zone', { - zoneName: 'myexample.com', - }); - - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - serviceDescription.add(new AssignPublicIpExtension()); - - const service = new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // WHEN - new TaskRecordManager(stack, 'manager', { - dnsRecordName: 'test-record', - dnsZone: dnsZone, - service: service.ecsService, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::Events::Rule', { - EventPattern: { - 'source': ['aws.ecs'], - 'detail-type': [ - 'ECS Task State Change', - ], - 'detail': { - lastStatus: ['RUNNING'], - desiredStatus: ['RUNNING'], - }, - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::Events::Rule', { - EventPattern: { - 'source': ['aws.ecs'], - 'detail-type': [ - 'ECS Task State Change', - ], - 'detail': { - lastStatus: ['STOPPED'], - desiredStatus: ['STOPPED'], - }, - }, - }); - }); -}); diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/cloudwatch-agent.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/cloudwatch-agent.test.ts deleted file mode 100644 index 929f94180b3a2..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/cloudwatch-agent.test.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { CloudwatchAgentExtension, Container, Environment, Service, ServiceDescription } from '../lib'; - -describe('cloudwatch agent', () => { - test('should be able to add AWS X-Ray to a service', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new CloudwatchAgentExtension()); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - DependsOn: [ - { - Condition: 'START', - ContainerName: 'cloudwatch-agent', - }, - ], - Essential: true, - Image: 'nathanpeck/name', - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - { - Environment: [ - { - Name: 'CW_CONFIG_CONTENT', - Value: '{"logs":{"metrics_collected":{"emf":{}}},"metrics":{"metrics_collected":{"statsd":{}}}}', - }, - ], - Essential: true, - Image: 'amazon/cloudwatch-agent:latest', - LogConfiguration: { - LogDriver: 'awslogs', - Options: { - 'awslogs-group': { - Ref: 'myservicetaskdefinitioncloudwatchagentLogGroupDF0CD679', - }, - 'awslogs-stream-prefix': 'cloudwatch-agent', - 'awslogs-region': { - Ref: 'AWS::Region', - }, - }, - }, - MemoryReservation: 50, - Name: 'cloudwatch-agent', - User: '0:1338', - }, - ], - Cpu: '256', - ExecutionRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionExecutionRole0CE74AD0', - 'Arn', - ], - }, - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionTaskRole92ACD903', - 'Arn', - ], - }, - }); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/container.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/container.test.ts deleted file mode 100644 index 80fbe097b08d0..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/container.test.ts +++ /dev/null @@ -1,309 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as autoscaling from '@aws-cdk/aws-autoscaling'; -import * as ec2 from '@aws-cdk/aws-ec2'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as iam from '@aws-cdk/aws-iam'; -import * as awslogs from '@aws-cdk/aws-logs'; -import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; -import { Container, Environment, EnvironmentCapacityType, FireLensExtension, Service, ServiceDescription } from '../lib'; - -describe('container', () => { - test('should be able to add a container to the service', () => { - // GIVEN - const stack = new cdk.Stack(); - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new ecs.AsgCapacityProvider(stack, 'Provider', { - autoScalingGroup: new autoscaling.AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - machineImage: ec2.MachineImage.latestAmazonLinux(), - instanceType: new ec2.InstanceType('t2.micro'), - }), - })); - - const environment = new Environment(stack, 'production', { - vpc, - cluster, - capacityType: EnvironmentCapacityType.EC2, - }); - const serviceDescription = new ServiceDescription(); - const taskRole = new iam.Role(stack, 'CustomTaskRole', { - assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), - }); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - taskRole, - }); - - // THEN - Template.fromStack(stack).resourceCountIs('AWS::ECS::Service', 1); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Essential: true, - Image: 'nathanpeck/name', - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - Cpu: '256', - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'CustomTaskRole3C6B13FD', - 'Arn', - ], - }, - }); - }); - - test('should be able to enable default logging behavior - with enable default log driver feature flag', () => { - // GIVEN - const stack = new cdk.Stack(); - stack.node.setContext(cxapi.ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER, true); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new ecs.AsgCapacityProvider(stack, 'Provider', { - autoScalingGroup: new autoscaling.AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - machineImage: ec2.MachineImage.latestAmazonLinux(), - instanceType: new ec2.InstanceType('t2.micro'), - }), - })); - - const environment = new Environment(stack, 'production', { - vpc, - cluster, - capacityType: EnvironmentCapacityType.EC2, - }); - const serviceDescription = new ServiceDescription(); - const taskRole = new iam.Role(stack, 'CustomTaskRole', { - assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), - }); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - taskRole, - }); - - // THEN - Template.fromStack(stack).resourceCountIs('AWS::ECS::Service', 1); - - // Ensure that the log group was created - Template.fromStack(stack).resourceCountIs('AWS::Logs::LogGroup', 1); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Essential: true, - Image: 'nathanpeck/name', - LogConfiguration: { - LogDriver: 'awslogs', - Options: { - 'awslogs-group': { - Ref: 'myservicelogs176EE19F', - }, - 'awslogs-stream-prefix': 'my-service', - 'awslogs-region': { - Ref: 'AWS::Region', - }, - }, - }, - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - Cpu: '256', - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'CustomTaskRole3C6B13FD', - 'Arn', - ], - }, - }); - }); - - test('should be able to add user-provided log group in the log driver options', () => { - // GIVEN - const stack = new cdk.Stack(); - stack.node.setContext(cxapi.ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER, true); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new ecs.AsgCapacityProvider(stack, 'Provider', { - autoScalingGroup: new autoscaling.AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - machineImage: ec2.MachineImage.latestAmazonLinux(), - instanceType: new ec2.InstanceType('t2.micro'), - }), - })); - - const environment = new Environment(stack, 'production', { - vpc, - cluster, - capacityType: EnvironmentCapacityType.EC2, - }); - const serviceDescription = new ServiceDescription(); - const taskRole = new iam.Role(stack, 'CustomTaskRole', { - assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), - }); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - logGroup: new awslogs.LogGroup(stack, 'MyLogGroup'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - taskRole, - }); - - // THEN - Template.fromStack(stack).resourceCountIs('AWS::ECS::Service', 1); - - // Ensure that the log group was created - Template.fromStack(stack).resourceCountIs('AWS::Logs::LogGroup', 1); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Essential: true, - Image: 'nathanpeck/name', - LogConfiguration: { - LogDriver: 'awslogs', - Options: { - 'awslogs-group': { - Ref: 'MyLogGroup5C0DAD85', - }, - 'awslogs-stream-prefix': 'my-service', - 'awslogs-region': { - Ref: 'AWS::Region', - }, - }, - }, - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - Cpu: '256', - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'CustomTaskRole3C6B13FD', - 'Arn', - ], - }, - }); - }); - - test('should error when log group is provided in the container extension and another observability extension is added', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - logGroup: new awslogs.LogGroup(stack, 'MyLogGroup'), - })); - serviceDescription.add(new FireLensExtension()); - - // THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - }).toThrow(/Log configuration already specified. You cannot provide a log group for the application container of service 'my-service' while also adding log configuration separately using service extensions./); - }); -}); diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/aws-ecs-integ.assets.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/aws-ecs-integ.assets.json deleted file mode 100644 index 96f7fa4d6a6aa..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/aws-ecs-integ.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "20.0.0", - "files": { - "0c4bd04678299111d98eaa888bf6d98b39f6762a55b9ff2f659c9ef35371f748": { - "source": { - "path": "aws-ecs-integ.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0c4bd04678299111d98eaa888bf6d98b39f6762a55b9ff2f659c9ef35371f748.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/aws-ecs-integ.template.json deleted file mode 100644 index de9aec45a0fea..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/aws-ecs-integ.template.json +++ /dev/null @@ -1,651 +0,0 @@ -{ - "Resources": { - "productionenvironmentvpcAEB47DF7": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1Subnet8D92C089": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet1EIP54BA88DB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D", - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374" - ] - }, - "productionenvironmentvpcPublicSubnet2Subnet298E6C31": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.64.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTable842A68D7": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet2EIP14CA46AA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D", - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - ] - }, - "productionenvironmentvpcPrivateSubnet1Subnet53F632E6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "productionenvironmentvpcPrivateSubnet2Subnet756FB93C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.192.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "productionenvironmentvpcIGWE7C39890": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcVPCGW1B428D07": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "InternetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "nametaskdefinitionTaskRole50FE844E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nametaskdefinition690762BB": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "namelogsF4B17D31" - }, - "awslogs-stream-prefix": "name", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "Family": "awsecsintegnametaskdefinition0EA6A1A0", - "Memory": "2048", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - } - }, - "nametaskdefinitionExecutionRole45AC5C9A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "namelogsF4B17D31", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "Roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - } - }, - "namelogsF4B17D31": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceService8015C8D6": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 10, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ] - } - }, - "TaskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "nameserviceSecurityGroup33F4662C": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "nameserviceTaskCountTarget366C2B3A": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 20, - "MinCapacity": 5, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "nameserviceTaskCountTargetTargetCpuUtilization50E2840097": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsintegnameserviceTaskCountTargetTargetCpuUtilization508522EB56", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "nameserviceTaskCountTarget366C2B3A" - }, - "TargetTrackingScalingPolicyConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "ScaleInCooldown": 60, - "ScaleOutCooldown": 60, - "TargetValue": 50 - } - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/cdk.out b/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/cdk.out deleted file mode 100644 index 588d7b269d34f..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/integ.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/integ.json deleted file mode 100644 index b6de8c13acc3b..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/integ.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "20.0.0", - "testCases": { - "integ.custom-service-extension": { - "stacks": [ - "aws-ecs-integ" - ], - "diffAssets": false, - "stackUpdateWorkflow": true - } - }, - "synthContext": {}, - "enableLookups": false -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/manifest.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/manifest.json deleted file mode 100644 index b04bfd09f5e8a..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/manifest.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "version": "20.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "aws-ecs-integ": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "aws-ecs-integ.template.json", - "validateOnSynth": false - }, - "metadata": { - "/aws-ecs-integ/production-environment-vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcAEB47DF7" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1EIP54BA88DB" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2EIP14CA46AA" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1" - } - ], - "/aws-ecs-integ/production-environment-vpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcIGWE7C39890" - } - ], - "/aws-ecs-integ/production-environment-vpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcVPCGW1B428D07" - } - ], - "/aws-ecs-integ/production-environment-cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentclusterC6599D2D" - } - ], - "/aws-ecs-integ/name-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionTaskRole50FE844E" - } - ], - "/aws-ecs-integ/name-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinition690762BB" - } - ], - "/aws-ecs-integ/name-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionExecutionRole45AC5C9A" - } - ], - "/aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20" - } - ], - "/aws-ecs-integ/name-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namelogsF4B17D31" - } - ], - "/aws-ecs-integ/name-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceService8015C8D6" - } - ], - "/aws-ecs-integ/name-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceSecurityGroup33F4662C" - } - ], - "/aws-ecs-integ/name-service/TaskCount/Target/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskCountTarget366C2B3A" - } - ], - "/aws-ecs-integ/name-service/TaskCount/Target/TargetCpuUtilization50/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameserviceTaskCountTargetTargetCpuUtilization50E2840097" - } - ] - }, - "displayName": "aws-ecs-integ" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/tree.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/tree.json deleted file mode 100644 index 7576805c86192..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/custom-service-extension.integ.snapshot/tree.json +++ /dev/null @@ -1,1151 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "aws-ecs-integ": { - "id": "aws-ecs-integ", - "path": "aws-ecs-integ", - "children": { - "production": { - "id": "production", - "path": "aws-ecs-integ/production", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "production-environment-vpc": { - "id": "production-environment-vpc", - "path": "aws-ecs-integ/production-environment-vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "allocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.64.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "allocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.192.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "aws-ecs-integ/production-environment-vpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "aws-ecs-integ/production-environment-vpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "internetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "production-environment-cluster": { - "id": "production-environment-cluster", - "path": "aws-ecs-integ/production-environment-cluster", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnCluster", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.Cluster", - "version": "0.0.0" - } - }, - "name": { - "id": "name", - "path": "aws-ecs-integ/name", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "name-task-definition": { - "id": "name-task-definition", - "path": "aws-ecs-integ/name-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/name-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 1024, - "essential": true, - "image": "nathanpeck/name", - "memory": 2048, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "namelogsF4B17D31" - }, - "awslogs-stream-prefix": "name", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - } - ] - } - ], - "cpu": "1024", - "executionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "family": "awsecsintegnametaskdefinition0EA6A1A0", - "memory": "2048", - "networkMode": "awsvpc", - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/name-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "namelogsF4B17D31", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "name-logs": { - "id": "name-logs", - "path": "aws-ecs-integ/name-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "name-logs", - "retentionInDays": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "name-service": { - "id": "name-service", - "path": "aws-ecs-integ/name-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/name-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "deploymentConfiguration": { - "maximumPercent": 200, - "minimumHealthyPercent": 100 - }, - "desiredCount": 10, - "enableEcsManagedTags": false, - "launchType": "FARGATE", - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ] - } - }, - "taskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/name-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "ScalingRole": { - "id": "ScalingRole", - "path": "aws-ecs-integ/name-service/ScalingRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "TaskCount": { - "id": "TaskCount", - "path": "aws-ecs-integ/name-service/TaskCount", - "children": { - "Target": { - "id": "Target", - "path": "aws-ecs-integ/name-service/TaskCount/Target", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskCount/Target/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalableTarget", - "aws:cdk:cloudformation:props": { - "maxCapacity": 20, - "minCapacity": 5, - "resourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - ] - ] - }, - "roleArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "scalableDimension": "ecs:service:DesiredCount", - "serviceNamespace": "ecs" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalableTarget", - "version": "0.0.0" - } - }, - "TargetCpuUtilization50": { - "id": "TargetCpuUtilization50", - "path": "aws-ecs-integ/name-service/TaskCount/Target/TargetCpuUtilization50", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-service/TaskCount/Target/TargetCpuUtilization50/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "aws:cdk:cloudformation:props": { - "policyName": "awsecsintegnameserviceTaskCountTargetTargetCpuUtilization508522EB56", - "policyType": "TargetTrackingScaling", - "scalingTargetId": { - "Ref": "nameserviceTaskCountTarget366C2B3A" - }, - "targetTrackingScalingPolicyConfiguration": { - "predefinedMetricSpecification": { - "predefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "scaleInCooldown": 60, - "scaleOutCooldown": 60, - "targetValue": 50 - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.ScalableTarget", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ScalableTaskCount", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/environment.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/environment.test.ts deleted file mode 100644 index dc49c70a1b9d8..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/environment.test.ts +++ /dev/null @@ -1,244 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as autoscaling from '@aws-cdk/aws-autoscaling'; -import * as ec2 from '@aws-cdk/aws-ec2'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, EnvironmentCapacityType, Service, ServiceDescription } from '../lib'; - -describe('environment', () => { - test('should be able to add a service to an environment', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).resourceCountIs('AWS::ECS::Service', 1); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Essential: true, - Image: 'nathanpeck/name', - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - Cpu: '256', - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionTaskRole92ACD903', - 'Arn', - ], - }, - }); - }); - - test('should be able to create a Fargate environment with a given VPC and cluster', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - - const environment = new Environment(stack, 'production', { - vpc, - cluster, - }); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).resourceCountIs('AWS::ECS::Service', 1); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Essential: true, - Image: 'nathanpeck/name', - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - Cpu: '256', - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionTaskRole92ACD903', - 'Arn', - ], - }, - }); - }); - - test('should be able to create an environment for EC2', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new ecs.AsgCapacityProvider(stack, 'Provider', { - autoScalingGroup: new autoscaling.AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - machineImage: ec2.MachineImage.latestAmazonLinux(), - instanceType: new ec2.InstanceType('t2.micro'), - }), - })); - - const environment = new Environment(stack, 'production', { - vpc, - cluster, - capacityType: EnvironmentCapacityType.EC2, - }); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).resourceCountIs('AWS::ECS::Service', 1); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Essential: true, - Image: 'nathanpeck/name', - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - Cpu: '256', - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionTaskRole92ACD903', - 'Arn', - ], - }, - }); - }); - - test('should be able to create an environment from attributes', () => { - // GIVEN - const stack = new cdk.Stack(); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new ecs.AsgCapacityProvider(stack, 'Provider', { - autoScalingGroup: new autoscaling.AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - machineImage: ec2.MachineImage.latestAmazonLinux(), - instanceType: new ec2.InstanceType('t2.micro'), - }), - })); - - // WHEN - const environment = Environment.fromEnvironmentAttributes(stack, 'Environment', { - capacityType: EnvironmentCapacityType.EC2, - cluster: cluster, - }); - - // THEN - expect(environment.capacityType).toEqual(EnvironmentCapacityType.EC2); - expect(environment.cluster).toEqual(cluster); - expect(environment.vpc).toEqual(vpc); - expect(environment.id).toEqual('Environment'); - }); -}); diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/firelens.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/firelens.test.ts deleted file mode 100644 index 6cdd83d07610c..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/firelens.test.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { Match, Template } from '@aws-cdk/assertions'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, FireLensExtension, Service, ServiceDescription } from '../lib'; - -describe('firelens', () => { - test('should be able to add Firelens to a service', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new FireLensExtension()); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - - // Ensure that the log group was created - Template.fromStack(stack).hasResource('AWS::Logs::LogGroup', Match.anyValue()); - - // Ensure that task has a Firelens sidecar and a log configuration - // pointing at the sidecar - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - DependsOn: [ - { - Condition: 'START', - ContainerName: 'firelens', - }, - ], - Essential: true, - Image: 'nathanpeck/name', - LogConfiguration: { - LogDriver: 'awsfirelens', - Options: { - Name: 'cloudwatch', - region: { - Ref: 'AWS::Region', - }, - log_group_name: { - Ref: 'myservicelogs176EE19F', - }, - log_stream_prefix: 'my-service/', - }, - }, - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - { - Essential: true, - FirelensConfiguration: { - Type: 'fluentbit', - }, - Image: { - Ref: 'SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter', - }, - LogConfiguration: { - LogDriver: 'awslogs', - Options: { - 'awslogs-group': { - Ref: 'myservicetaskdefinitionfirelensLogGroup0D59B0EB', - }, - 'awslogs-stream-prefix': 'firelens', - 'awslogs-region': { - Ref: 'AWS::Region', - }, - }, - }, - MemoryReservation: 50, - Name: 'firelens', - User: '0:1338', - }, - ], - Cpu: '256', - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionTaskRole92ACD903', - 'Arn', - ], - }, - }); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/http-load-balancer.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/http-load-balancer.test.ts deleted file mode 100644 index 8af4ef5d44ab6..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/http-load-balancer.test.ts +++ /dev/null @@ -1,140 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, HttpLoadBalancerExtension, Service, ServiceDescription } from '../lib'; - -describe('http load balancer', () => { - test('should be able to add an HTTP load balancer to a service', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new HttpLoadBalancerExtension()); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Essential: true, - Image: 'nathanpeck/name', - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - Cpu: '256', - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionTaskRole92ACD903', - 'Arn', - ], - }, - }); - - Template.fromStack(stack).resourceCountIs('AWS::ElasticLoadBalancingV2::LoadBalancer', 1); - Template.fromStack(stack).resourceCountIs('AWS::ElasticLoadBalancingV2::Listener', 1); - }); - - test('allows scaling on request count for the HTTP load balancer', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new HttpLoadBalancerExtension({ requestsPerTarget: 100 })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - autoScaleTaskCount: { - maxTaskCount: 5, - }, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalableTarget', { - MaxCapacity: 5, - MinCapacity: 1, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - PolicyType: 'TargetTrackingScaling', - TargetTrackingScalingPolicyConfiguration: { - PredefinedMetricSpecification: { - PredefinedMetricType: 'ALBRequestCountPerTarget', - }, - TargetValue: 100, - }, - }); - }); - - test('should error when adding scaling policy if scaling target has not been configured', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new HttpLoadBalancerExtension({ requestsPerTarget: 100 })); - - // THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - }).toThrow(/Auto scaling target for the service 'my-service' hasn't been configured. Please use Service construct to configure 'minTaskCount' and 'maxTaskCount'./); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/cdk.out b/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/cdk.out deleted file mode 100644 index 90bef2e09ad39..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"17.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/imported-environment-integ.assets.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/imported-environment-integ.assets.json deleted file mode 100644 index 0ea5cec6feccc..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/imported-environment-integ.assets.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "17.0.0", - "files": { - "78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01": { - "source": { - "path": "importedenvironmentintegResourcesAB23EBEF.nested.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "7fe9c99c1005b092d9fa9efe78ab85333dfa158c59b57e1044f1ceba138ba46e": { - "source": { - "path": "imported-environment-integ.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7fe9c99c1005b092d9fa9efe78ab85333dfa158c59b57e1044f1ceba138ba46e.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/imported-environment-integ.template.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/imported-environment-integ.template.json deleted file mode 100644 index e717d68f82ecc..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/imported-environment-integ.template.json +++ /dev/null @@ -1,439 +0,0 @@ -{ - "Resources": { - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60": { - "Type": "AWS::CloudFormation::Stack", - "Properties": { - "TemplateURL": { - "Fn::Join": [ - "", - [ - "https://s3.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3Bucket64585C1B" - }, - "/", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3VersionKey41670582" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3VersionKey41670582" - } - ] - } - ] - } - ] - ] - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ServiceloadbalancerD5D60894": { - "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "Properties": { - "LoadBalancerAttributes": [ - { - "Key": "deletion_protection.enabled", - "Value": "false" - } - ], - "Scheme": "internet-facing", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref" - ] - }, - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef" - ] - } - ], - "Type": "application" - } - }, - "ServiceloadbalancerSecurityGroup2DA3E8D6": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Automatically created Security Group for ELB importedenvironmentintegServiceloadbalancerFAE8A5FA", - "SecurityGroupIngress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow from anyone on port 80", - "FromPort": 80, - "IpProtocol": "tcp", - "ToPort": 80 - } - ], - "VpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "ServiceloadbalancerSecurityGrouptoimportedenvironmentintegServiceserviceSecurityGroup2BE90F7480B17EB7CA": { - "Type": "AWS::EC2::SecurityGroupEgress", - "Properties": { - "GroupId": { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - }, - "IpProtocol": "tcp", - "Description": "Load balancer to target", - "DestinationSecurityGroupId": { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - }, - "FromPort": 80, - "ToPort": 80 - } - }, - "ServiceloadbalancerServicelistenerC862F722": { - "Type": "AWS::ElasticLoadBalancingV2::Listener", - "Properties": { - "DefaultActions": [ - { - "TargetGroupArn": { - "Ref": "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - }, - "Type": "forward" - } - ], - "LoadBalancerArn": { - "Ref": "ServiceloadbalancerD5D60894" - }, - "Port": 80, - "Protocol": "HTTP" - } - }, - "ServiceloadbalancerServicelistenerServiceGroup844B51E6": { - "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "Properties": { - "Port": 80, - "Protocol": "HTTP", - "TargetGroupAttributes": [ - { - "Key": "deregistration_delay.timeout_seconds", - "Value": "10" - }, - { - "Key": "stickiness.enabled", - "Value": "false" - } - ], - "TargetType": "ip", - "VpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "ServicetaskdefinitionTaskRole5B4B60A4": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "Servicetaskdefinition0CEAD834": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 256, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "Servicelogs9F4E1F70" - }, - "awslogs-stream-prefix": "Service", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 512, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "256", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "ServicetaskdefinitionExecutionRoleD09F4578", - "Arn" - ] - }, - "Family": "importedenvironmentintegServicetaskdefinition63936B87", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "ServicetaskdefinitionTaskRole5B4B60A4", - "Arn" - ] - } - } - }, - "ServicetaskdefinitionExecutionRoleD09F4578": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "ServicetaskdefinitionExecutionRoleDefaultPolicy25CEAFC5": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Servicelogs9F4E1F70", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ServicetaskdefinitionExecutionRoleDefaultPolicy25CEAFC5", - "Roles": [ - { - "Ref": "ServicetaskdefinitionExecutionRoleD09F4578" - } - ] - } - }, - "Servicelogs9F4E1F70": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "Service-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ServiceserviceService6A153CB8": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef" - ] - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "HealthCheckGracePeriodSeconds": 60, - "LaunchType": "FARGATE", - "LoadBalancers": [ - { - "ContainerName": "app", - "ContainerPort": 80, - "TargetGroupArn": { - "Ref": "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - } - } - ], - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref" - ] - }, - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref" - ] - } - ] - } - }, - "TaskDefinition": { - "Ref": "Servicetaskdefinition0CEAD834" - } - }, - "DependsOn": [ - "ServiceloadbalancerServicelistenerC862F722", - "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - ] - }, - "ServiceserviceSecurityGroup1915660F": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "imported-environment-integ/Service-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "ServiceserviceSecurityGroupfromimportedenvironmentintegServiceloadbalancerSecurityGroup68EE533C8070FCF629": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "IpProtocol": "tcp", - "Description": "Load balancer to target", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - }, - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - }, - "ToPort": 80 - } - } - }, - "Outputs": { - "Serviceloadbalancerdnsoutput": { - "Value": { - "Fn::GetAtt": [ - "ServiceloadbalancerD5D60894", - "DNSName" - ] - } - } - }, - "Parameters": { - "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3Bucket64585C1B": { - "Type": "String", - "Description": "S3 bucket for asset \"78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01\"" - }, - "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3VersionKey41670582": { - "Type": "String", - "Description": "S3 key for asset version \"78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01\"" - }, - "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01ArtifactHashF1155D65": { - "Type": "String", - "Description": "Artifact hash for asset \"78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01\"" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/importedenvironmentintegResourcesAB23EBEF.nested.template.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/importedenvironmentintegResourcesAB23EBEF.nested.template.json deleted file mode 100644 index 31aa8b1dd95d4..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/importedenvironmentintegResourcesAB23EBEF.nested.template.json +++ /dev/null @@ -1,422 +0,0 @@ -{ - "Resources": { - "Environmentenvironmentvpc02635CAD": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc" - } - ] - } - }, - "EnvironmentenvironmentvpcPublicSubnet1Subnet90FA3050": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1" - } - ] - } - }, - "EnvironmentenvironmentvpcPublicSubnet1RouteTableF562A242": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1" - } - ] - } - }, - "EnvironmentenvironmentvpcPublicSubnet1RouteTableAssociationFDE85030": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1RouteTableF562A242" - }, - "SubnetId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1Subnet90FA3050" - } - } - }, - "EnvironmentenvironmentvpcPublicSubnet1DefaultRoute4171CB3F": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1RouteTableF562A242" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "EnvironmentenvironmentvpcIGWD3352EF8" - } - }, - "DependsOn": [ - "EnvironmentenvironmentvpcVPCGWD59F3C86" - ] - }, - "EnvironmentenvironmentvpcPublicSubnet1EIP0B5752AE": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1" - } - ] - } - }, - "EnvironmentenvironmentvpcPublicSubnet1NATGateway65E8E64D": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1Subnet90FA3050" - }, - "AllocationId": { - "Fn::GetAtt": [ - "EnvironmentenvironmentvpcPublicSubnet1EIP0B5752AE", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1" - } - ] - } - }, - "EnvironmentenvironmentvpcPublicSubnet2Subnet80565813": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.64.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2" - } - ] - } - }, - "EnvironmentenvironmentvpcPublicSubnet2RouteTableCC311A3A": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2" - } - ] - } - }, - "EnvironmentenvironmentvpcPublicSubnet2RouteTableAssociation54B3A48A": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2RouteTableCC311A3A" - }, - "SubnetId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2Subnet80565813" - } - } - }, - "EnvironmentenvironmentvpcPublicSubnet2DefaultRouteCA3995A5": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2RouteTableCC311A3A" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "EnvironmentenvironmentvpcIGWD3352EF8" - } - }, - "DependsOn": [ - "EnvironmentenvironmentvpcVPCGWD59F3C86" - ] - }, - "EnvironmentenvironmentvpcPublicSubnet2EIP54A162E2": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2" - } - ] - } - }, - "EnvironmentenvironmentvpcPublicSubnet2NATGatewayEDDF81A3": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2Subnet80565813" - }, - "AllocationId": { - "Fn::GetAtt": [ - "EnvironmentenvironmentvpcPublicSubnet2EIP54A162E2", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2" - } - ] - } - }, - "EnvironmentenvironmentvpcPrivateSubnet1SubnetE66B59C1": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "EnvironmentenvironmentvpcPrivateSubnet1RouteTable2FAF7412": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "EnvironmentenvironmentvpcPrivateSubnet1RouteTableAssociation46A426C7": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet1RouteTable2FAF7412" - }, - "SubnetId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet1SubnetE66B59C1" - } - } - }, - "EnvironmentenvironmentvpcPrivateSubnet1DefaultRoute1AFA55BA": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet1RouteTable2FAF7412" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1NATGateway65E8E64D" - } - } - }, - "EnvironmentenvironmentvpcPrivateSubnet2SubnetD38DAD67": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.192.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "EnvironmentenvironmentvpcPrivateSubnet2RouteTable244FED3F": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "EnvironmentenvironmentvpcPrivateSubnet2RouteTableAssociation9FE6BFCD": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet2RouteTable244FED3F" - }, - "SubnetId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet2SubnetD38DAD67" - } - } - }, - "EnvironmentenvironmentvpcPrivateSubnet2DefaultRouteF5A23DA3": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet2RouteTable244FED3F" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2NATGatewayEDDF81A3" - } - } - }, - "EnvironmentenvironmentvpcIGWD3352EF8": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "imported-environment-integ/Resources/Environment-environment-vpc" - } - ] - } - }, - "EnvironmentenvironmentvpcVPCGWD59F3C86": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "InternetGatewayId": { - "Ref": "EnvironmentenvironmentvpcIGWD3352EF8" - } - } - }, - "EnvironmentenvironmentclusterA67A8E69": { - "Type": "AWS::ECS::Cluster" - } - }, - "Outputs": { - "importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref": { - "Value": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1Subnet90FA3050" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef": { - "Value": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2Subnet80565813" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref": { - "Value": { - "Ref": "Environmentenvironmentvpc02635CAD" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef": { - "Value": { - "Ref": "EnvironmentenvironmentclusterA67A8E69" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref": { - "Value": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet1SubnetE66B59C1" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref": { - "Value": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet2SubnetD38DAD67" - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/manifest.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/manifest.json deleted file mode 100644 index a7b371a74e01b..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/manifest.json +++ /dev/null @@ -1,351 +0,0 @@ -{ - "version": "17.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "imported-environment-integ": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "imported-environment-integ.template.json", - "validateOnSynth": false - }, - "metadata": { - "/imported-environment-integ": [ - { - "type": "aws:cdk:asset", - "data": { - "path": "importedenvironmentintegResourcesAB23EBEF.nested.template.json", - "id": "78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01", - "packaging": "file", - "sourceHash": "78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01", - "s3BucketParameter": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3Bucket64585C1B", - "s3KeyParameter": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3VersionKey41670582", - "artifactHashParameter": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01ArtifactHashF1155D65" - } - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Environmentenvironmentvpc02635CAD" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet1Subnet90FA3050" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet1RouteTableF562A242" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet1RouteTableAssociationFDE85030" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet1DefaultRoute4171CB3F" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet1EIP0B5752AE" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet1NATGateway65E8E64D" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet2Subnet80565813" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet2RouteTableCC311A3A" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet2RouteTableAssociation54B3A48A" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet2DefaultRouteCA3995A5" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet2EIP54A162E2" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPublicSubnet2NATGatewayEDDF81A3" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPrivateSubnet1SubnetE66B59C1" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPrivateSubnet1RouteTable2FAF7412" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPrivateSubnet1RouteTableAssociation46A426C7" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPrivateSubnet1DefaultRoute1AFA55BA" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPrivateSubnet2SubnetD38DAD67" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPrivateSubnet2RouteTable244FED3F" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPrivateSubnet2RouteTableAssociation9FE6BFCD" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcPrivateSubnet2DefaultRouteF5A23DA3" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcIGWD3352EF8" - } - ], - "/imported-environment-integ/Resources/Environment-environment-vpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentvpcVPCGWD59F3C86" - } - ], - "/imported-environment-integ/Resources/Environment-environment-cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "EnvironmentenvironmentclusterA67A8E69" - } - ], - "/imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref": [ - { - "type": "aws:cdk:logicalId", - "data": "importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref" - } - ], - "/imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef": [ - { - "type": "aws:cdk:logicalId", - "data": "importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef" - } - ], - "/imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref": [ - { - "type": "aws:cdk:logicalId", - "data": "importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - } - ], - "/imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef": [ - { - "type": "aws:cdk:logicalId", - "data": "importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef" - } - ], - "/imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref": [ - { - "type": "aws:cdk:logicalId", - "data": "importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref" - } - ], - "/imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref": [ - { - "type": "aws:cdk:logicalId", - "data": "importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref" - } - ], - "/imported-environment-integ/Resources.NestedStack/Resources.NestedStackResource": [ - { - "type": "aws:cdk:logicalId", - "data": "ResourcesNestedStackResourcesNestedStackResourceCDA26E60" - } - ], - "/imported-environment-integ/Vpc/PublicSubnet1": [ - { - "type": "aws:cdk:warning", - "data": "No routeTableId was provided to the subnet at 'imported-environment-integ/Vpc/PublicSubnet1'. Attempting to read its .routeTable.routeTableId will return null/undefined. (More info: https://github.com/aws/aws-cdk/pull/3171)" - } - ], - "/imported-environment-integ/Vpc/PublicSubnet2": [ - { - "type": "aws:cdk:warning", - "data": "No routeTableId was provided to the subnet at 'imported-environment-integ/Vpc/PublicSubnet2'. Attempting to read its .routeTable.routeTableId will return null/undefined. (More info: https://github.com/aws/aws-cdk/pull/3171)" - } - ], - "/imported-environment-integ/Vpc/PrivateSubnet1": [ - { - "type": "aws:cdk:warning", - "data": "No routeTableId was provided to the subnet at 'imported-environment-integ/Vpc/PrivateSubnet1'. Attempting to read its .routeTable.routeTableId will return null/undefined. (More info: https://github.com/aws/aws-cdk/pull/3171)" - } - ], - "/imported-environment-integ/Vpc/PrivateSubnet2": [ - { - "type": "aws:cdk:warning", - "data": "No routeTableId was provided to the subnet at 'imported-environment-integ/Vpc/PrivateSubnet2'. Attempting to read its .routeTable.routeTableId will return null/undefined. (More info: https://github.com/aws/aws-cdk/pull/3171)" - } - ], - "/imported-environment-integ/Service-load-balancer/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceloadbalancerD5D60894" - } - ], - "/imported-environment-integ/Service-load-balancer/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceloadbalancerSecurityGroup2DA3E8D6" - } - ], - "/imported-environment-integ/Service-load-balancer/SecurityGroup/to importedenvironmentintegServiceserviceSecurityGroup2BE90F74:80": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceloadbalancerSecurityGrouptoimportedenvironmentintegServiceserviceSecurityGroup2BE90F7480B17EB7CA" - } - ], - "/imported-environment-integ/Service-load-balancer/Service-listener/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceloadbalancerServicelistenerC862F722" - } - ], - "/imported-environment-integ/Service-load-balancer/Service-listener/ServiceGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - } - ], - "/imported-environment-integ/Service-load-balancer-dns-output": [ - { - "type": "aws:cdk:logicalId", - "data": "Serviceloadbalancerdnsoutput" - } - ], - "/imported-environment-integ/Service-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ServicetaskdefinitionTaskRole5B4B60A4" - } - ], - "/imported-environment-integ/Service-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Servicetaskdefinition0CEAD834", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] - } - ], - "/imported-environment-integ/Service-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ServicetaskdefinitionExecutionRoleD09F4578" - } - ], - "/imported-environment-integ/Service-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ServicetaskdefinitionExecutionRoleDefaultPolicy25CEAFC5" - } - ], - "/imported-environment-integ/Service-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Servicelogs9F4E1F70" - } - ], - "/imported-environment-integ/Service-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceserviceService6A153CB8" - } - ], - "/imported-environment-integ/Service-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceserviceSecurityGroup1915660F" - } - ], - "/imported-environment-integ/Service-service/SecurityGroup/from importedenvironmentintegServiceloadbalancerSecurityGroup68EE533C:80": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceserviceSecurityGroupfromimportedenvironmentintegServiceloadbalancerSecurityGroup68EE533C8070FCF629" - } - ], - "/imported-environment-integ/AssetParameters/78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01/S3Bucket": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3Bucket64585C1B" - } - ], - "/imported-environment-integ/AssetParameters/78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01/S3VersionKey": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3VersionKey41670582" - } - ], - "/imported-environment-integ/AssetParameters/78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01/ArtifactHash": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01ArtifactHashF1155D65" - } - ] - }, - "displayName": "imported-environment-integ" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/tree.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/tree.json deleted file mode 100644 index 4e7b1a30254dc..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/imported-environment.integ.snapshot/tree.json +++ /dev/null @@ -1,1630 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "imported-environment-integ": { - "id": "imported-environment-integ", - "path": "imported-environment-integ", - "children": { - "Resources": { - "id": "Resources", - "path": "imported-environment-integ/Resources", - "children": { - "Environment": { - "id": "Environment", - "path": "imported-environment-integ/Resources/Environment", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "Environment-environment-vpc": { - "id": "Environment-environment-vpc", - "path": "imported-environment-integ/Resources/Environment-environment-vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1RouteTableF562A242" - }, - "subnetId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1Subnet90FA3050" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1RouteTableF562A242" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "EnvironmentenvironmentvpcIGWD3352EF8" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1Subnet90FA3050" - }, - "allocationId": { - "Fn::GetAtt": [ - "EnvironmentenvironmentvpcPublicSubnet1EIP0B5752AE", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.64.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2RouteTableCC311A3A" - }, - "subnetId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2Subnet80565813" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2RouteTableCC311A3A" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "EnvironmentenvironmentvpcIGWD3352EF8" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2Subnet80565813" - }, - "allocationId": { - "Fn::GetAtt": [ - "EnvironmentenvironmentvpcPublicSubnet2EIP54A162E2", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet1RouteTable2FAF7412" - }, - "subnetId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet1SubnetE66B59C1" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet1RouteTable2FAF7412" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet1NATGateway65E8E64D" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.192.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet2RouteTable244FED3F" - }, - "subnetId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet2SubnetD38DAD67" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "EnvironmentenvironmentvpcPrivateSubnet2RouteTable244FED3F" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "EnvironmentenvironmentvpcPublicSubnet2NATGatewayEDDF81A3" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "imported-environment-integ/Resources/Environment-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "imported-environment-integ/Resources/Environment-environment-vpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Environmentenvironmentvpc02635CAD" - }, - "internetGatewayId": { - "Ref": "EnvironmentenvironmentvpcIGWD3352EF8" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Environment-environment-cluster": { - "id": "Environment-environment-cluster", - "path": "imported-environment-integ/Resources/Environment-environment-cluster", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Resources/Environment-environment-cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref": { - "id": "importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref", - "path": "imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef": { - "id": "importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef", - "path": "imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref": { - "id": "importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref", - "path": "imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef": { - "id": "importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef", - "path": "imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref": { - "id": "importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref", - "path": "imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref": { - "id": "importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref", - "path": "imported-environment-integ/Resources/importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.NestedStack", - "version": "0.0.0" - } - }, - "Resources.NestedStack": { - "id": "Resources.NestedStack", - "path": "imported-environment-integ/Resources.NestedStack", - "children": { - "Resources.NestedStackResource": { - "id": "Resources.NestedStackResource", - "path": "imported-environment-integ/Resources.NestedStack/Resources.NestedStackResource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::CloudFormation::Stack", - "aws:cdk:cloudformation:props": { - "templateUrl": { - "Fn::Join": [ - "", - [ - "https://s3.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3Bucket64585C1B" - }, - "/", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3VersionKey41670582" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01S3VersionKey41670582" - } - ] - } - ] - } - ] - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnStack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "Vpc": { - "id": "Vpc", - "path": "imported-environment-integ/Vpc", - "children": { - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "imported-environment-integ/Vpc/PublicSubnet1", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "imported-environment-integ/Vpc/PublicSubnet2", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "imported-environment-integ/Vpc/PrivateSubnet1", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "imported-environment-integ/Vpc/PrivateSubnet2", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Cluster": { - "id": "Cluster", - "path": "imported-environment-integ/Cluster", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Environment": { - "id": "Environment", - "path": "imported-environment-integ/Environment", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "Service": { - "id": "Service", - "path": "imported-environment-integ/Service", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "Service-load-balancer": { - "id": "Service-load-balancer", - "path": "imported-environment-integ/Service-load-balancer", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-load-balancer/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "aws:cdk:cloudformation:props": { - "loadBalancerAttributes": [ - { - "key": "deletion_protection.enabled", - "value": "false" - } - ], - "scheme": "internet-facing", - "securityGroups": [ - { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - } - ], - "subnets": [ - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref" - ] - }, - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef" - ] - } - ], - "type": "application" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "imported-environment-integ/Service-load-balancer/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-load-balancer/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "Automatically created Security Group for ELB importedenvironmentintegServiceloadbalancerFAE8A5FA", - "securityGroupIngress": [ - { - "cidrIp": "0.0.0.0/0", - "ipProtocol": "tcp", - "fromPort": 80, - "toPort": 80, - "description": "Allow from anyone on port 80" - } - ], - "vpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "to importedenvironmentintegServiceserviceSecurityGroup2BE90F74:80": { - "id": "to importedenvironmentintegServiceserviceSecurityGroup2BE90F74:80", - "path": "imported-environment-integ/Service-load-balancer/SecurityGroup/to importedenvironmentintegServiceserviceSecurityGroup2BE90F74:80", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupEgress", - "aws:cdk:cloudformation:props": { - "groupId": { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - }, - "ipProtocol": "tcp", - "description": "Load balancer to target", - "destinationSecurityGroupId": { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - }, - "fromPort": 80, - "toPort": 80 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Service-listener": { - "id": "Service-listener", - "path": "imported-environment-integ/Service-load-balancer/Service-listener", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-load-balancer/Service-listener/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::Listener", - "aws:cdk:cloudformation:props": { - "defaultActions": [ - { - "type": "forward", - "targetGroupArn": { - "Ref": "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - } - } - ], - "loadBalancerArn": { - "Ref": "ServiceloadbalancerD5D60894" - }, - "port": 80, - "protocol": "HTTP" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "ServiceGroup": { - "id": "ServiceGroup", - "path": "imported-environment-integ/Service-load-balancer/Service-listener/ServiceGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-load-balancer/Service-listener/ServiceGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "aws:cdk:cloudformation:props": { - "port": 80, - "protocol": "HTTP", - "targetGroupAttributes": [ - { - "key": "deregistration_delay.timeout_seconds", - "value": "10" - }, - { - "key": "stickiness.enabled", - "value": "false" - } - ], - "targetType": "ip", - "vpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Service-load-balancer-dns-output": { - "id": "Service-load-balancer-dns-output", - "path": "imported-environment-integ/Service-load-balancer-dns-output", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "Service-task-definition": { - "id": "Service-task-definition", - "path": "imported-environment-integ/Service-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "imported-environment-integ/Service-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 256, - "essential": true, - "image": "nathanpeck/name", - "memory": 512, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "Servicelogs9F4E1F70" - }, - "awslogs-stream-prefix": "Service", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - } - ] - } - ], - "cpu": "256", - "executionRoleArn": { - "Fn::GetAtt": [ - "ServicetaskdefinitionExecutionRoleD09F4578", - "Arn" - ] - }, - "family": "importedenvironmentintegServicetaskdefinition63936B87", - "memory": "512", - "networkMode": "awsvpc", - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "ServicetaskdefinitionTaskRole5B4B60A4", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "imported-environment-integ/Service-task-definition/app", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "imported-environment-integ/Service-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "imported-environment-integ/Service-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Servicelogs9F4E1F70", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "ServicetaskdefinitionExecutionRoleDefaultPolicy25CEAFC5", - "roles": [ - { - "Ref": "ServicetaskdefinitionExecutionRoleD09F4578" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Service-logs": { - "id": "Service-logs", - "path": "imported-environment-integ/Service-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "Service-logs", - "retentionInDays": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "imported-environment-integ/Service-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "imported-environment-integ/Service-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Servicelogs9F4E1F70", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "ServicetaskdefinitionExecutionRoleDefaultPolicy25CEAFC5", - "roles": [ - { - "Ref": "ServicetaskdefinitionExecutionRoleD09F4578" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Service-logs": { - "id": "Service-logs", - "path": "imported-environment-integ/Service-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "Service-logs", - "retentionInDays": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Service-service": { - "id": "Service-service", - "path": "imported-environment-integ/Service-service", - "children": { - "Service": { - "id": "Service", - "path": "imported-environment-integ/Service-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef" - ] - }, - "deploymentConfiguration": { - "maximumPercent": 200, - "minimumHealthyPercent": 100 - }, - "desiredCount": 1, - "enableEcsManagedTags": false, - "healthCheckGracePeriodSeconds": 60, - "launchType": "FARGATE", - "loadBalancers": [ - { - "targetGroupArn": { - "Ref": "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - }, - "containerName": "app", - "containerPort": 80 - } - ], - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref" - ] - }, - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref" - ] - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - } - ] - } - }, - "taskDefinition": { - "Ref": "Servicetaskdefinition0CEAD834" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "imported-environment-integ/Service-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "imported-environment-integ/Service-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "imported-environment-integ/Service-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "from importedenvironmentintegServiceloadbalancerSecurityGroup68EE533C:80": { - "id": "from importedenvironmentintegServiceloadbalancerSecurityGroup68EE533C:80", - "path": "imported-environment-integ/Service-service/SecurityGroup/from importedenvironmentintegServiceloadbalancerSecurityGroup68EE533C:80", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", - "aws:cdk:cloudformation:props": { - "ipProtocol": "tcp", - "description": "Load balancer to target", - "fromPort": 80, - "groupId": { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - }, - "sourceSecurityGroupId": { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - }, - "toPort": 80 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "AssetParameters": { - "id": "AssetParameters", - "path": "imported-environment-integ/AssetParameters", - "children": { - "78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01": { - "id": "78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01", - "path": "imported-environment-integ/AssetParameters/78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01", - "children": { - "S3Bucket": { - "id": "S3Bucket", - "path": "imported-environment-integ/AssetParameters/78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01/S3Bucket", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "S3VersionKey": { - "id": "S3VersionKey", - "path": "imported-environment-integ/AssetParameters/78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01/S3VersionKey", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "ArtifactHash": { - "id": "ArtifactHash", - "path": "imported-environment-integ/AssetParameters/78cd13b88474241c9844c0c939b6fca0f485ffbba32f35718002319e7ab73a01/ArtifactHash", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/injecter.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/injecter.test.ts deleted file mode 100644 index e52c498f17455..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/injecter.test.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as sns from '@aws-cdk/aws-sns'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, InjecterExtension, InjectableTopic, Service, ServiceDescription } from '../lib'; - -describe('injecter', () => { - test('correctly sets publish permissions for given topics', () => { - // GIVEN - const stack = new cdk.Stack(); - - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, - })); - - // WHEN - const topic1 = new InjectableTopic({ - topic: new sns.Topic(stack, 'topic1'), - }); - - const topic2 = new InjectableTopic({ - topic: new sns.Topic(stack, 'topic2'), - }); - - serviceDescription.add(new InjecterExtension({ - injectables: [topic1, topic2], - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - // Ensure creation of provided topics - Template.fromStack(stack).resourceCountIs('AWS::SNS::Topic', 2); - - // Ensure the task role is given permissions to publish events to topics - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - Statement: [ - { - Action: 'sns:Publish', - Effect: 'Allow', - Resource: { - Ref: 'topic152D84A37', - }, - }, - { - Action: 'sns:Publish', - Effect: 'Allow', - Resource: { - Ref: 'topic2A4FB547F', - }, - }, - ], - Version: '2012-10-17', - }, - }); - - // Ensure that the topic ARNs have been correctly appended to the environment variables - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Environment: [ - { - Name: 'PORT', - Value: '80', - }, - { - Name: 'TOPIC1_TOPIC_ARN', - Value: { - Ref: 'topic152D84A37', - }, - }, - { - Name: 'TOPIC2_TOPIC_ARN', - Value: { - Ref: 'topic2A4FB547F', - }, - }, - ], - Image: 'nathanpeck/name', - Essential: true, - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - }); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.all-service-addons.expected.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.all-service-addons.expected.json deleted file mode 100644 index 4f51a31f422dd..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.all-service-addons.expected.json +++ /dev/null @@ -1,3455 +0,0 @@ -{ - "Resources": { - "mymeshEA67EDEF": { - "Type": "AWS::AppMesh::Mesh", - "Properties": { - "MeshName": "awsecsintegmymeshFCC0D554", - "Spec": {} - } - }, - "productionenvironmentvpcAEB47DF7": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1Subnet8D92C089": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet1EIP54BA88DB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2Subnet298E6C31": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.32.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTable842A68D7": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet2EIP14CA46AA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3SubnetC7B5665D": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.64.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3RouteTableAssociationFA34D6E7": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - } - } - }, - "productionenvironmentvpcPublicSubnet3DefaultRouteE1ADEA6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet3EIP53405AED": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3NATGateway94604057": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet3EIP53405AED", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1Subnet53F632E6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.96.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "productionenvironmentvpcPrivateSubnet2Subnet756FB93C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.128.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.160.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet3RouteTableAssociation65F18B9C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - } - }, - "productionenvironmentvpcPrivateSubnet3DefaultRoute2438918B": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet3NATGateway94604057" - } - } - }, - "productionenvironmentvpcIGWE7C39890": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcVPCGW1B428D07": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "InternetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D": { - "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "Properties": { - "Name": "production", - "Vpc": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "namelogsF4B17D31": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-logs", - "RetentionInDays": 7 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nametaskdefinitionTaskRole50FE844E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "nametaskdefinitionTaskRoleDefaultPolicyE66EDC68": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nametaskdefinitionTaskRoleDefaultPolicyE66EDC68", - "Roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "nametaskdefinition690762BB": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "START", - "ContainerName": "firelens" - }, - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - }, - { - "Condition": "START", - "ContainerName": "cloudwatch-agent" - }, - { - "Condition": "HEALTHY", - "ContainerName": "xray" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awsfirelens", - "Options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "namelogsF4B17D31" - }, - "log_stream_prefix": "name/" - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/name" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "nameenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nametaskdefinitionenvoyLogGroup258B673B" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Essential": true, - "FirelensConfiguration": { - "Type": "fluentbit" - }, - "Image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nametaskdefinitionfirelensLogGroup80DDA60F" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "firelens", - "User": "0:1338" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": "amazon/aws-xray-daemon:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nametaskdefinitionxrayLogGroup4AF4CA37" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 256, - "Name": "xray", - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "CW_CONFIG_CONTENT", - "Value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ], - "Essential": true, - "Image": "amazon/cloudwatch-agent:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nametaskdefinitioncloudwatchagentLogGroup78DDC685" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "cloudwatch-agent", - "User": "0:1338" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "Family": "awsecsintegnametaskdefinition0EA6A1A0", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - } - }, - "nametaskdefinitionenvoyLogGroup258B673B": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nametaskdefinitionExecutionRole45AC5C9A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "nameenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nametaskdefinitioncloudwatchagentLogGroup78DDC685", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionenvoyLogGroup258B673B", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionfirelensLogGroup80DDA60F", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nametaskdefinitionxrayLogGroup4AF4CA37", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "Roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - } - }, - "nametaskdefinitionfirelensLogGroup80DDA60F": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nametaskdefinitionxrayLogGroup4AF4CA37": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nametaskdefinitioncloudwatchagentLogGroup78DDC685": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nameenvoytoappmesh2767D3E6": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameenvoytoappmesh2767D3E6", - "Roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "namepublishmetricsF329C7AE": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "namepublishmetricsF329C7AE", - "Roles": [ - { - "Ref": "nametaskdefinitionTaskRole50FE844E" - } - ] - } - }, - "nameserviceService8015C8D6": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 150, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 2, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "nameserviceCloudmapService3D5B0548", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "nameserviceCloudmapService3D5B0548": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "name", - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "nameserviceSecurityGroup33F4662C": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "nameserviceSecurityGroupfromawsecsinteggreeterserviceSecurityGroup055DC23B8048057EFF": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "IpProtocol": "tcp", - "Description": "Accept inbound traffic from greeter", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - }, - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "ToPort": 80 - } - }, - "nameserviceTaskCountTarget366C2B3A": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 8, - "MinCapacity": 2, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "nameserviceTaskCountTargetnametargetcpuutilization5018B16243": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsintegnameserviceTaskCountTargetnametargetcpuutilization50CAB59E05", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "nameserviceTaskCountTarget366C2B3A" - }, - "TargetTrackingScalingPolicyConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "ScaleInCooldown": 60, - "ScaleOutCooldown": 60, - "TargetValue": 50 - } - } - }, - "namevirtualnode6C99CB14": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "production", - "ServiceName": { - "Fn::GetAtt": [ - "nameserviceCloudmapService3D5B0548", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "name" - } - }, - "namevirtualrouterC00E1ACE": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "name" - } - }, - "namevirtualrouternamerouteDCDF3715": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "namevirtualnode6C99CB14", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "namevirtualrouterC00E1ACE", - "VirtualRouterName" - ] - }, - "RouteName": "name-route" - } - }, - "namevirtualservice3DDDDF1E": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "namevirtualrouterC00E1ACE", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "name.production" - } - }, - "greetinglogsCC360934": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "greeting-logs", - "RetentionInDays": 7 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "greetingtaskdefinitionTaskRole9179DA4A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "greetingtaskdefinitionTaskRoleDefaultPolicy5DB4510A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetingtaskdefinitionTaskRoleDefaultPolicy5DB4510A", - "Roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "greetingtaskdefinition31690093": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "START", - "ContainerName": "firelens" - }, - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - }, - { - "Condition": "START", - "ContainerName": "cloudwatch-agent" - }, - { - "Condition": "HEALTHY", - "ContainerName": "xray" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/greeting", - "LogConfiguration": { - "LogDriver": "awsfirelens", - "Options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "greetinglogsCC360934" - }, - "log_stream_prefix": "greeting/" - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/greeting" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "greetingenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionenvoyLogGroup6556AC35" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Essential": true, - "FirelensConfiguration": { - "Type": "fluentbit" - }, - "Image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionfirelensLogGroupD7A398A7" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "firelens", - "User": "0:1338" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": "amazon/aws-xray-daemon:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitionxrayLogGroupD25C072D" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 256, - "Name": "xray", - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "CW_CONFIG_CONTENT", - "Value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ], - "Essential": true, - "Image": "amazon/cloudwatch-agent:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "cloudwatch-agent", - "User": "0:1338" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "greetingtaskdefinitionExecutionRole9E3A7CF3", - "Arn" - ] - }, - "Family": "awsecsinteggreetingtaskdefinitionA6E8A57B", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "greetingtaskdefinitionTaskRole9179DA4A", - "Arn" - ] - } - } - }, - "greetingtaskdefinitionenvoyLogGroup6556AC35": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetingtaskdefinitionExecutionRole9E3A7CF3": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "greetingtaskdefinitionExecutionRoleDefaultPolicy31B93022": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "greetingenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionenvoyLogGroup6556AC35", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionfirelensLogGroupD7A398A7", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetingtaskdefinitionxrayLogGroupD25C072D", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetingtaskdefinitionExecutionRoleDefaultPolicy31B93022", - "Roles": [ - { - "Ref": "greetingtaskdefinitionExecutionRole9E3A7CF3" - } - ] - } - }, - "greetingtaskdefinitionfirelensLogGroupD7A398A7": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetingtaskdefinitionxrayLogGroupD25C072D": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetingtaskdefinitioncloudwatchagentLogGroupCEF72742": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetingenvoytoappmesh97051B23": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetingenvoytoappmesh97051B23", - "Roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "greetingpublishmetricsF17124EF": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetingpublishmetricsF17124EF", - "Roles": [ - { - "Ref": "greetingtaskdefinitionTaskRole9179DA4A" - } - ] - } - }, - "greetingserviceService8DA58640": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 150, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 2, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "greetingserviceSecurityGroupE9BE665B", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "greetingserviceCloudmapService0A2D7385", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "greetingtaskdefinition31690093" - } - } - }, - "greetingserviceCloudmapService0A2D7385": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "greeting", - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "greetingserviceSecurityGroupE9BE665B": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/greeting-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "greetingserviceSecurityGroupfromawsecsinteggreeterserviceSecurityGroup055DC23B807B9C4357": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "IpProtocol": "tcp", - "Description": "Accept inbound traffic from greeter", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "greetingserviceSecurityGroupE9BE665B", - "GroupId" - ] - }, - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "ToPort": 80 - } - }, - "greetingserviceTaskCountTargetA036048C": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 8, - "MinCapacity": 2, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "greetingserviceService8DA58640", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "greetingserviceTaskCountTargetgreetingtargetcpuutilization50FEAF6434": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsinteggreetingserviceTaskCountTargetgreetingtargetcpuutilization504C76B1F4", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "greetingserviceTaskCountTargetA036048C" - }, - "TargetTrackingScalingPolicyConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "ScaleInCooldown": 60, - "ScaleOutCooldown": 60, - "TargetValue": 50 - } - } - }, - "greetingvirtualnodeC4A2C517": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "production", - "ServiceName": { - "Fn::GetAtt": [ - "greetingserviceCloudmapService0A2D7385", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "greeting" - } - }, - "greetingvirtualrouter0F898D1A": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "greeting" - } - }, - "greetingvirtualroutergreetingroute46305F50": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "greetingvirtualnodeC4A2C517", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "greetingvirtualrouter0F898D1A", - "VirtualRouterName" - ] - }, - "RouteName": "greeting-route" - } - }, - "greetingvirtualservice60AD3AD9": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "greetingvirtualrouter0F898D1A", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "greeting.production" - } - }, - "greeterlogsCCD2F8B2": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "greeter-logs", - "RetentionInDays": 7 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "greeterloadbalancer85256741": { - "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "Properties": { - "LoadBalancerAttributes": [ - { - "Key": "deletion_protection.enabled", - "Value": "false" - } - ], - "Scheme": "internet-facing", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - } - ], - "Type": "application" - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D", - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D", - "productionenvironmentvpcPublicSubnet3DefaultRouteE1ADEA6C" - ] - }, - "greeterloadbalancerSecurityGroupEE1B20F3": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Automatically created Security Group for ELB awsecsinteggreeterloadbalancer147D1D5C", - "SecurityGroupIngress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow from anyone on port 80", - "FromPort": 80, - "IpProtocol": "tcp", - "ToPort": 80 - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "greeterloadbalancerSecurityGrouptoawsecsinteggreeterserviceSecurityGroup055DC23B803EEF3320": { - "Type": "AWS::EC2::SecurityGroupEgress", - "Properties": { - "GroupId": { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - }, - "IpProtocol": "tcp", - "Description": "Load balancer to target", - "DestinationSecurityGroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "FromPort": 80, - "ToPort": 80 - } - }, - "greeterloadbalancergreeterlistener952E028B": { - "Type": "AWS::ElasticLoadBalancingV2::Listener", - "Properties": { - "DefaultActions": [ - { - "TargetGroupArn": { - "Ref": "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2" - }, - "Type": "forward" - } - ], - "LoadBalancerArn": { - "Ref": "greeterloadbalancer85256741" - }, - "Port": 80, - "Protocol": "HTTP" - } - }, - "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2": { - "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "Properties": { - "Port": 80, - "Protocol": "HTTP", - "TargetGroupAttributes": [ - { - "Key": "deregistration_delay.timeout_seconds", - "Value": "10" - }, - { - "Key": "stickiness.enabled", - "Value": "false" - } - ], - "TargetType": "ip", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "greetertaskdefinitionTaskRole2A098ACC": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AWSXRayDaemonWriteAccess" - ] - ] - } - ] - } - }, - "greetertaskdefinitionTaskRoleDefaultPolicyD0F53B1C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetertaskdefinitionTaskRoleDefaultPolicyD0F53B1C", - "Roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "greetertaskdefinitionE956EEA2": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "START", - "ContainerName": "firelens" - }, - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - }, - { - "Condition": "START", - "ContainerName": "cloudwatch-agent" - }, - { - "Condition": "HEALTHY", - "ContainerName": "xray" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - }, - { - "Name": "GREETING_URL", - "Value": "http://greeting.production" - }, - { - "Name": "NAME_URL", - "Value": "http://name.production" - } - ], - "Essential": true, - "Image": "nathanpeck/greeter", - "LogConfiguration": { - "LogDriver": "awsfirelens", - "Options": { - "Name": "cloudwatch", - "region": { - "Ref": "AWS::Region" - }, - "log_group_name": { - "Ref": "greeterlogsCCD2F8B2" - }, - "log_stream_prefix": "greeter/" - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "/virtualNode/greeter" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "greeterenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionenvoyLogGroup6E10B93E" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Essential": true, - "FirelensConfiguration": { - "Type": "fluentbit" - }, - "Image": { - "Ref": "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionfirelensLogGroupD5BAAC35" - }, - "awslogs-stream-prefix": "firelens", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "firelens", - "User": "0:1338" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:2000" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": "amazon/aws-xray-daemon:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetertaskdefinitionxrayLogGroupBC1558B6" - }, - "awslogs-stream-prefix": "xray", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 256, - "Name": "xray", - "User": "1337" - }, - { - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "CW_CONFIG_CONTENT", - "Value": "{\"logs\":{\"metrics_collected\":{\"emf\":{}}},\"metrics\":{\"metrics_collected\":{\"statsd\":{}}}}" - } - ], - "Essential": true, - "Image": "amazon/cloudwatch-agent:latest", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327" - }, - "awslogs-stream-prefix": "cloudwatch-agent", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 50, - "Name": "cloudwatch-agent", - "User": "0:1338" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "greetertaskdefinitionExecutionRoleAED0EC79", - "Arn" - ] - }, - "Family": "awsecsinteggreetertaskdefinitionB95239FB", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "greetertaskdefinitionTaskRole2A098ACC", - "Arn" - ] - } - } - }, - "greetertaskdefinitionenvoyLogGroup6E10B93E": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetertaskdefinitionExecutionRoleAED0EC79": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "greetertaskdefinitionExecutionRoleDefaultPolicy0D8E9106": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "greeterenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetAuthorizationToken", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionenvoyLogGroup6E10B93E", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionfirelensLogGroupD5BAAC35", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "greetertaskdefinitionxrayLogGroupBC1558B6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greetertaskdefinitionExecutionRoleDefaultPolicy0D8E9106", - "Roles": [ - { - "Ref": "greetertaskdefinitionExecutionRoleAED0EC79" - } - ] - } - }, - "greetertaskdefinitionfirelensLogGroupD5BAAC35": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetertaskdefinitionxrayLogGroupBC1558B6": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greetertaskdefinitioncloudwatchagentLogGroupE7EAF327": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "greeterenvoytoappmesh1A94938B": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "mymeshEA67EDEF" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greeterenvoytoappmesh1A94938B", - "Roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "greeterpublishmetrics0CCA359A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "cloudwatch:PutMetricData", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "greeterpublishmetrics0CCA359A", - "Roles": [ - { - "Ref": "greetertaskdefinitionTaskRole2A098ACC" - } - ] - } - }, - "greeterserviceService8EDD3244": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 150, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 2, - "EnableECSManagedTags": false, - "HealthCheckGracePeriodSeconds": 60, - "LaunchType": "FARGATE", - "LoadBalancers": [ - { - "ContainerName": "app", - "ContainerPort": 80, - "TargetGroupArn": { - "Ref": "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2" - } - } - ], - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "greeterserviceCloudmapServiceEE292978", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "greetertaskdefinitionE956EEA2" - } - }, - "DependsOn": [ - "greeterloadbalancergreeterlistenergreeterGroupFFBFF0C2", - "greeterloadbalancergreeterlistener952E028B" - ] - }, - "greeterserviceCloudmapServiceEE292978": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "greeter", - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "greeterserviceSecurityGroupDB4AC3A9": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/greeter-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "greeterserviceSecurityGroupfromawsecsinteggreeterloadbalancerSecurityGroupF791FA838037FDF8F5": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "IpProtocol": "tcp", - "Description": "Load balancer to target", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "greeterserviceSecurityGroupDB4AC3A9", - "GroupId" - ] - }, - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "greeterloadbalancerSecurityGroupEE1B20F3", - "GroupId" - ] - }, - "ToPort": 80 - } - }, - "greeterserviceTaskCountTargetAB95B3D0": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 8, - "MinCapacity": 2, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "greeterserviceService8EDD3244", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "greeterserviceTaskCountTargetgreetertargetcpuutilization50299508D1": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsinteggreeterserviceTaskCountTargetgreetertargetcpuutilization50A75D0C0D", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "greeterserviceTaskCountTargetAB95B3D0" - }, - "TargetTrackingScalingPolicyConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "ScaleInCooldown": 60, - "ScaleOutCooldown": 60, - "TargetValue": 50 - } - } - }, - "greetervirtualnode21EA7CC9": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Backends": [ - { - "VirtualService": { - "VirtualServiceName": "name.production" - } - }, - { - "VirtualService": { - "VirtualServiceName": "greeting.production" - } - } - ], - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "production", - "ServiceName": { - "Fn::GetAtt": [ - "greeterserviceCloudmapServiceEE292978", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "greeter" - } - }, - "greetervirtualrouter193840BB": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "greeter" - } - }, - "greetervirtualroutergreeterroute3EC6ACB0": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "greetervirtualnode21EA7CC9", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "greetervirtualrouter193840BB", - "VirtualRouterName" - ] - }, - "RouteName": "greeter-route" - } - }, - "greetervirtualservice6559950C": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "mymeshEA67EDEF", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "greetervirtualrouter193840BB", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "greeter.production" - } - } - }, - "Mappings": { - "nameenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - }, - "greetingenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - }, - "greeterenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - } - }, - "Parameters": { - "SsmParameterValueawsserviceawsforfluentbitlatestC96584B6F00A464EAD1953AFF4B05118Parameter": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/aws/service/aws-for-fluent-bit/latest" - } - }, - "Outputs": { - "greeterloadbalancerdnsoutput": { - "Value": { - "Fn::GetAtt": [ - "greeterloadbalancer85256741", - "DNSName" - ] - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.all-service-addons.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.all-service-addons.ts deleted file mode 100644 index 7241ff0dd8ef1..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.all-service-addons.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { Mesh } from '@aws-cdk/aws-appmesh'; -import { ContainerImage } from '@aws-cdk/aws-ecs'; -import { App, Stack } from '@aws-cdk/core'; -import { AppMeshExtension, CloudwatchAgentExtension, Container, Environment, FireLensExtension, HttpLoadBalancerExtension, ScaleOnCpuUtilization, Service, ServiceDescription, XRayExtension } from '../lib'; - -const app = new App(); -const stack = new Stack(app, 'aws-ecs-integ'); - -const mesh = new Mesh(stack, 'my-mesh'); -const environment = new Environment(stack, 'production'); - -/** Name service */ -const nameDescription = new ServiceDescription(); -nameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); -nameDescription.add(new AppMeshExtension({ mesh })); -nameDescription.add(new FireLensExtension()); -nameDescription.add(new XRayExtension()); -nameDescription.add(new CloudwatchAgentExtension()); -nameDescription.add(new ScaleOnCpuUtilization({ - initialTaskCount: 2, - minTaskCount: 2, -})); - -const nameService = new Service(stack, 'name', { - environment: environment, - serviceDescription: nameDescription, -}); - -/** Greeting service */ -const greetingDescription = new ServiceDescription(); -greetingDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ContainerImage.fromRegistry('nathanpeck/greeting'), - environment: { - PORT: '80', - }, -})); -greetingDescription.add(new AppMeshExtension({ mesh })); -greetingDescription.add(new FireLensExtension()); -greetingDescription.add(new XRayExtension()); -greetingDescription.add(new CloudwatchAgentExtension()); -greetingDescription.add(new ScaleOnCpuUtilization({ - initialTaskCount: 2, - minTaskCount: 2, -})); - -const greetingService = new Service(stack, 'greeting', { - environment: environment, - serviceDescription: greetingDescription, -}); - -/** Greeter service */ -const greeterDescription = new ServiceDescription(); -greeterDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ContainerImage.fromRegistry('nathanpeck/greeter'), - environment: { - PORT: '80', - GREETING_URL: 'http://greeting.production', - NAME_URL: 'http://name.production', - }, -})); -greeterDescription.add(new AppMeshExtension({ mesh })); -greeterDescription.add(new FireLensExtension()); -greeterDescription.add(new XRayExtension()); -greeterDescription.add(new CloudwatchAgentExtension()); -greeterDescription.add(new HttpLoadBalancerExtension()); -greeterDescription.add(new ScaleOnCpuUtilization({ - initialTaskCount: 2, - minTaskCount: 2, -})); - -const greeterService = new Service(stack, 'greeter', { - environment: environment, - serviceDescription: greeterDescription, -}); - -greeterService.connectTo(nameService); -greeterService.connectTo(greetingService); - -/** - * Expectations are that you should see an output - * of the load balancer URL for the greeter service, make - * a request to it and see a greeting phrase constructed out - * of a random greeting and a random name from the two underlying - * services. The other addons enable tracing and logging which must - * be verified separately. - */ \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.expected.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.expected.json deleted file mode 100644 index 3b3093ff42fdb..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.expected.json +++ /dev/null @@ -1,1400 +0,0 @@ -{ - "Resources": { - "vpcA2121C38": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc" - } - ] - } - }, - "vpcpublicSubnet1SubnetA635257E": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/24", - "VpcId": { - "Ref": "vpcA2121C38" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet1" - } - ] - } - }, - "vpcpublicSubnet1RouteTableA38152FE": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet1" - } - ] - } - }, - "vpcpublicSubnet1RouteTableAssociationB46101B8": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet1RouteTableA38152FE" - }, - "SubnetId": { - "Ref": "vpcpublicSubnet1SubnetA635257E" - } - } - }, - "vpcpublicSubnet1DefaultRouteF0973989": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet1RouteTableA38152FE" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - }, - "DependsOn": [ - "vpcVPCGW7984C166" - ] - }, - "vpcpublicSubnet2Subnet027D165B": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.1.0/24", - "VpcId": { - "Ref": "vpcA2121C38" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet2" - } - ] - } - }, - "vpcpublicSubnet2RouteTableA6135437": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet2" - } - ] - } - }, - "vpcpublicSubnet2RouteTableAssociation73F6478A": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet2RouteTableA6135437" - }, - "SubnetId": { - "Ref": "vpcpublicSubnet2Subnet027D165B" - } - } - }, - "vpcpublicSubnet2DefaultRoute13685A07": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet2RouteTableA6135437" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - }, - "DependsOn": [ - "vpcVPCGW7984C166" - ] - }, - "vpcpublicSubnet3Subnet3B90E684": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.2.0/24", - "VpcId": { - "Ref": "vpcA2121C38" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet3" - } - ] - } - }, - "vpcpublicSubnet3RouteTable901FAA39": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc/publicSubnet3" - } - ] - } - }, - "vpcpublicSubnet3RouteTableAssociationF6210B68": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet3RouteTable901FAA39" - }, - "SubnetId": { - "Ref": "vpcpublicSubnet3Subnet3B90E684" - } - } - }, - "vpcpublicSubnet3DefaultRoute02D8E508": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "vpcpublicSubnet3RouteTable901FAA39" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - }, - "DependsOn": [ - "vpcVPCGW7984C166" - ] - }, - "vpcIGWE57CBDCA": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/vpc" - } - ] - } - }, - "vpcVPCGW7984C166": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "vpcA2121C38" - }, - "InternetGatewayId": { - "Ref": "vpcIGWE57CBDCA" - } - } - }, - "zoneEB40FF1E": { - "Type": "AWS::Route53::HostedZone", - "Properties": { - "Name": "myexample.com." - } - }, - "laterRecordD393EDE6": { - "Type": "AWS::Route53::RecordSet", - "Properties": { - "Name": "u-record.myexample.com.", - "Type": "CNAME", - "HostedZoneId": { - "Ref": "zoneEB40FF1E" - }, - "ResourceRecords": [ - "console.aws.amazon.com" - ], - "TTL": "1800" - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "nametaskdefinitionTaskRole50FE844E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupE19F1043", - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "nameserviceTaskRecordManagerRuleStopped66D08B70" - ] - }, - "nametaskdefinition690762BB": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 256, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "namelogsF4B17D31" - }, - "awslogs-stream-prefix": "name", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 512, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "256", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "Family": "awsecsintegnametaskdefinition0EA6A1A0", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupE19F1043", - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "nameserviceTaskRecordManagerRuleStopped66D08B70" - ] - }, - "nametaskdefinitionExecutionRole45AC5C9A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupE19F1043", - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "nameserviceTaskRecordManagerRuleStopped66D08B70" - ] - }, - "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "namelogsF4B17D31", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "Roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupE19F1043", - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "nameserviceTaskRecordManagerRuleStopped66D08B70" - ] - }, - "namelogsF4B17D31": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceService8015C8D6": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "ENABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "vpcpublicSubnet1SubnetA635257E" - }, - { - "Ref": "vpcpublicSubnet2Subnet027D165B" - }, - { - "Ref": "vpcpublicSubnet3Subnet3B90E684" - } - ] - } - }, - "TaskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "nameserviceSecurityGroup33F4662C": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "SecurityGroupIngress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Accept inbound traffic on traffic port from anywhere", - "FromPort": 80, - "IpProtocol": "tcp", - "ToPort": 80 - } - ], - "VpcId": { - "Ref": "vpcA2121C38" - } - } - }, - "nameserviceTaskRecordManagerEventsDLB8F13E1E": { - "Type": "AWS::SQS::Queue", - "Properties": { - "MessageRetentionPeriod": 1209600 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceTaskRecordManagerEventsQueueF805A6C1": { - "Type": "AWS::SQS::Queue", - "Properties": { - "RedrivePolicy": { - "deadLetterTargetArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsDLB8F13E1E", - "Arn" - ] - }, - "maxReceiveCount": 500 - }, - "VisibilityTimeout": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceTaskRecordManagerEventsQueuePolicy65CC6F9E": { - "Type": "AWS::SQS::QueuePolicy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:SendMessage" - ], - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRuleRunningCD85F46F", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - }, - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:SendMessage" - ], - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRuleStopped66D08B70", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "Queues": [ - { - "Ref": "nameserviceTaskRecordManagerEventsQueueF805A6C1" - } - ] - } - }, - "nameserviceTaskRecordManagerRecordsA4648C6E": { - "Type": "AWS::DynamoDB::Table", - "Properties": { - "KeySchema": [ - { - "AttributeName": "cluster_service", - "KeyType": "HASH" - } - ], - "AttributeDefinitions": [ - { - "AttributeName": "cluster_service", - "AttributeType": "S" - } - ], - "BillingMode": "PAY_PER_REQUEST" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceTaskRecordManagerRuleRunningCD85F46F": { - "Type": "AWS::Events::Rule", - "Properties": { - "EventPattern": { - "source": [ - "aws.ecs" - ], - "detail-type": [ - "ECS Task State Change" - ], - "detail": { - "clusterArn": [ - { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - ], - "lastStatus": [ - "RUNNING" - ], - "desiredStatus": [ - "RUNNING" - ] - } - }, - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - }, - "Id": "Target0" - } - ] - } - }, - "nameserviceTaskRecordManagerRuleStopped66D08B70": { - "Type": "AWS::Events::Rule", - "Properties": { - "EventPattern": { - "source": [ - "aws.ecs" - ], - "detail-type": [ - "ECS Task State Change" - ], - "detail": { - "clusterArn": [ - { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - ], - "lastStatus": [ - "STOPPED" - ], - "desiredStatus": [ - "STOPPED" - ] - } - }, - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - }, - "Id": "Target0" - } - ] - } - }, - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "ec2:DescribeNetworkInterfaces", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "route53:ChangeResourceRecordSets", - "route53:ListResourceRecordSets" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":route53:::hostedzone/", - { - "Ref": "zoneEB40FF1E" - } - ] - ] - } - }, - { - "Action": [ - "sqs:ChangeMessageVisibility", - "sqs:DeleteMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:ReceiveMessage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - }, - { - "Action": [ - "dynamodb:BatchGetItem", - "dynamodb:BatchWriteItem", - "dynamodb:ConditionCheckItem", - "dynamodb:DeleteItem", - "dynamodb:DescribeTable", - "dynamodb:GetItem", - "dynamodb:GetRecords", - "dynamodb:GetShardIterator", - "dynamodb:PutItem", - "dynamodb:Query", - "dynamodb:Scan", - "dynamodb:UpdateItem" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerRecordsA4648C6E", - "Arn" - ] - }, - { - "Ref": "AWS::NoValue" - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "Roles": [ - { - "Ref": "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A" - } - ] - } - }, - "nameserviceTaskRecordManagerEventHandler4B8C6905": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A", - "Arn" - ] - }, - "Environment": { - "Variables": { - "HOSTED_ZONE_ID": { - "Ref": "zoneEB40FF1E" - }, - "RECORD_NAME": "test-record.myexample.com", - "RECORDS_TABLE": { - "Ref": "nameserviceTaskRecordManagerRecordsA4648C6E" - }, - "CLUSTER_ARN": { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - }, - "SERVICE_NAME": { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - } - }, - "Handler": "index.queue_handler", - "ReservedConcurrentExecutions": 1, - "Runtime": "python3.8", - "Timeout": 30 - }, - "DependsOn": [ - "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A" - ] - }, - "nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155": { - "Type": "AWS::Lambda::EventSourceMapping", - "Properties": { - "FunctionName": { - "Ref": "nameserviceTaskRecordManagerEventHandler4B8C6905" - }, - "EventSourceArn": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleDefaultPolicy7D095576": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "route53:ChangeResourceRecordSets", - "route53:ListResourceRecordSets" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":route53:::hostedzone/", - { - "Ref": "zoneEB40FF1E" - } - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleDefaultPolicy7D095576", - "Roles": [ - { - "Ref": "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0" - } - ] - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0", - "Arn" - ] - }, - "Handler": "index.cleanup_resource_handler", - "Runtime": "python3.8", - "Timeout": 300 - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleDefaultPolicy7D095576", - "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0" - ] - }, - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleDefaultPolicy350D6FAC": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleDefaultPolicy350D6FAC", - "Roles": [ - { - "Ref": "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0" - } - ] - } - }, - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEvent9B27C899": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParameters5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391S3BucketB4102E9A" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391S3VersionKeyC1EC3ED6" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391S3VersionKeyC1EC3ED6" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0", - "Arn" - ] - }, - "Description": "AWS CDK resource provider framework - onEvent (aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider)", - "Environment": { - "Variables": { - "USER_ON_EVENT_FUNCTION_ARN": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderHandler08068F99", - "Arn" - ] - } - } - }, - "Handler": "framework.onEvent", - "Runtime": "nodejs14.x", - "Timeout": 900 - }, - "DependsOn": [ - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleDefaultPolicy350D6FAC", - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0" - ] - }, - "nameserviceTaskRecordManagerCleanupE19F1043": { - "Type": "AWS::CloudFormation::CustomResource", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEvent9B27C899", - "Arn" - ] - }, - "HostedZoneId": { - "Ref": "zoneEB40FF1E" - }, - "RecordName": "test-record.myexample.com" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceTaskRecordManagerPrimingCallCustomResourcePolicy376F02F0": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "nameserviceTaskRecordManagerEventsQueueF805A6C1", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameserviceTaskRecordManagerPrimingCallCustomResourcePolicy376F02F0", - "Roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - }, - "DependsOn": [ - "nameserviceTaskRecordManagerEventHandler4B8C6905", - "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A", - "nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155" - ] - }, - "nameserviceTaskRecordManagerPrimingCallE6113369": { - "Type": "Custom::AWS", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd22872D164C4C", - "Arn" - ] - }, - "Create": { - "Fn::Join": [ - "", - [ - "{\"service\":\"SQS\",\"action\":\"sendMessage\",\"parameters\":{\"QueueUrl\":\"", - { - "Ref": "nameserviceTaskRecordManagerEventsQueueF805A6C1" - }, - "\",\"DelaySeconds\":10,\"MessageBody\":\"{ \\\"prime\\\": true }\",\"MessageAttributes\":{\"HostedZoneId\":{\"DataType\":\"String\",\"StringValue\":\"", - { - "Ref": "zoneEB40FF1E" - }, - "\"},\"RecordName\":{\"DataType\":\"String\",\"StringValue\":\"test-record\"}}},\"physicalResourceId\":{\"responsePath\":\"MessageId\"}}" - ] - ] - }, - "Update": { - "Fn::Join": [ - "", - [ - "{\"service\":\"SQS\",\"action\":\"sendMessage\",\"parameters\":{\"QueueUrl\":\"", - { - "Ref": "nameserviceTaskRecordManagerEventsQueueF805A6C1" - }, - "\",\"DelaySeconds\":10,\"MessageBody\":\"{ \\\"prime\\\": true }\",\"MessageAttributes\":{\"HostedZoneId\":{\"DataType\":\"String\",\"StringValue\":\"", - { - "Ref": "zoneEB40FF1E" - }, - "\"},\"RecordName\":{\"DataType\":\"String\",\"StringValue\":\"test-record\"}}},\"physicalResourceId\":{\"responsePath\":\"MessageId\"}}" - ] - ] - }, - "InstallLatestAwsSdk": true - }, - "DependsOn": [ - "nameserviceTaskRecordManagerEventHandler4B8C6905", - "nameserviceTaskRecordManagerEventHandlerServiceRoleDefaultPolicy96DD8140", - "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A", - "nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155", - "nameserviceTaskRecordManagerPrimingCallCustomResourcePolicy376F02F0" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "AWS679f53fac002430cb0da5b7982bd22872D164C4C": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParameters3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87S3Bucket36F31A16" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87S3VersionKeyF80D542B" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameters3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87S3VersionKeyF80D542B" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "nodejs14.x", - "Timeout": 120 - }, - "DependsOn": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - ] - } - }, - "Parameters": { - "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3Bucket1E7F92B6": { - "Type": "String", - "Description": "S3 bucket for asset \"8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d\"" - }, - "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dS3VersionKey86FCA825": { - "Type": "String", - "Description": "S3 key for asset version \"8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d\"" - }, - "AssetParameters8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725dArtifactHash0F81F2AB": { - "Type": "String", - "Description": "Artifact hash for asset \"8f06a3db22794ebc7ff89b4745fd706afd46e17816fe46da72e5125cabae725d\"" - }, - "AssetParameters5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391S3BucketB4102E9A": { - "Type": "String", - "Description": "S3 bucket for asset \"5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391\"" - }, - "AssetParameters5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391S3VersionKeyC1EC3ED6": { - "Type": "String", - "Description": "S3 key for asset version \"5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391\"" - }, - "AssetParameters5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391ArtifactHashA391D940": { - "Type": "String", - "Description": "Artifact hash for asset \"5b47c8e4cbbce7e4a8085f1aa83ed9c4691b7f65927ba092d6620bbba925f391\"" - }, - "AssetParameters3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87S3Bucket36F31A16": { - "Type": "String", - "Description": "S3 bucket for asset \"3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87\"" - }, - "AssetParameters3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87S3VersionKeyF80D542B": { - "Type": "String", - "Description": "S3 key for asset version \"3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87\"" - }, - "AssetParameters3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87ArtifactHash40DDF5EE": { - "Type": "String", - "Description": "Artifact hash for asset \"3744fa896361f81b76b1efde632ac07b1920ce09a4ca1ff15ab486f262a19b87\"" - } - }, - "Outputs": { - "DnsName": { - "Value": "test-record.myexample.com" - }, - "DnsServer": { - "Value": { - "Fn::Select": [ - 0, - { - "Fn::GetAtt": [ - "zoneEB40FF1E", - "NameServers" - ] - } - ] - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.ts deleted file mode 100644 index ffd17d2e6bacf..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.ts +++ /dev/null @@ -1,95 +0,0 @@ -/// !cdk-integ pragma:ignore-assets -import { SubnetType, Vpc } from '@aws-cdk/aws-ec2'; -import { ContainerImage } from '@aws-cdk/aws-ecs'; -import { CnameRecord, PublicHostedZone } from '@aws-cdk/aws-route53'; -import { App, CfnOutput, Fn, Stack } from '@aws-cdk/core'; -import { AssignPublicIpExtension, Container, Environment, Service, ServiceDescription } from '../lib'; - -// Record name. You can change this and redeploy this integration test to see -// what happens when the record name changes. -const RECORD_NAME = 'test-record'; - -const app = new App(); -const stack = new Stack(app, 'aws-ecs-integ'); - -const vpc = new Vpc(stack, 'vpc', { - subnetConfiguration: [ - { - cidrMask: 24, - name: 'public', - subnetType: SubnetType.PUBLIC, - }, - ], -}); - -const dnsZone = new PublicHostedZone(stack, 'zone', { - zoneName: 'myexample.com', -}); - -// A record in the zone that is lexicographically later than 'test-record' -// to try to trip up the record set locator. -new CnameRecord(stack, 'laterRecord', { - recordName: 'u-record', - zone: dnsZone, - domainName: 'console.aws.amazon.com', -}); - -const environment = new Environment(stack, 'production', { vpc }); - -const nameDescription = new ServiceDescription(); - -nameDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); - -nameDescription.add(new AssignPublicIpExtension({ - dns: { - zone: dnsZone, - recordName: RECORD_NAME, - }, -})); - -new Service(stack, 'name', { - environment: environment, - serviceDescription: nameDescription, -}); - -new CfnOutput(stack, 'DnsName', { - value: Fn.join('.', [RECORD_NAME, dnsZone.zoneName]), -}); - -new CfnOutput(stack, 'DnsServer', { - value: Fn.select(0, dnsZone.hostedZoneNameServers!), -}); - -/** - * Expect this stack to deploy. The stack outputs include a DNS name and a - * nameserver. A short time after the services have settled, you may query the - * nameserver for the record. If an IP address is shown, then this test has - * succeeded. - * - * Example: - * - * ``` - * $ cdk --app 'node ./integ.assign-public-ip.js' deploy - * ... - * Outputs: - * aws-ecs-integ.DnsName = test-record.myexample.com - * aws-ecs-integ.DnsServer = ns-1836.awsdns-37.co.uk - * ... - * - * $ host test-record.myexample.com ns-1836.awsdns-37.co.uk - * Using domain server: - * Name: ns-1836.awsdns-37.co.uk - * Address: 2600:9000:5307:2c00::1#53 - * Aliases: - * - * test-record.myexample.com has address 52.60.53.62 - * ``` - */ diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.custom-service-extension.expected.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.custom-service-extension.expected.json deleted file mode 100644 index af4f8829a1501..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.custom-service-extension.expected.json +++ /dev/null @@ -1,777 +0,0 @@ -{ - "Resources": { - "productionenvironmentvpcAEB47DF7": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1Subnet8D92C089": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet1EIP54BA88DB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2Subnet298E6C31": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.32.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTable842A68D7": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet2EIP14CA46AA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3SubnetC7B5665D": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.64.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3RouteTableAssociationFA34D6E7": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - } - } - }, - "productionenvironmentvpcPublicSubnet3DefaultRouteE1ADEA6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet3EIP53405AED": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3NATGateway94604057": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet3EIP53405AED", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1Subnet53F632E6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.96.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "productionenvironmentvpcPrivateSubnet2Subnet756FB93C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.128.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.160.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet3RouteTableAssociation65F18B9C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - } - }, - "productionenvironmentvpcPrivateSubnet3DefaultRoute2438918B": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet3NATGateway94604057" - } - } - }, - "productionenvironmentvpcIGWE7C39890": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcVPCGW1B428D07": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "InternetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "nametaskdefinitionTaskRole50FE844E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nametaskdefinition690762BB": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "namelogsF4B17D31" - }, - "awslogs-stream-prefix": "name", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionExecutionRole45AC5C9A", - "Arn" - ] - }, - "Family": "awsecsintegnametaskdefinition0EA6A1A0", - "Memory": "2048", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "nametaskdefinitionTaskRole50FE844E", - "Arn" - ] - } - } - }, - "nametaskdefinitionExecutionRole45AC5C9A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "namelogsF4B17D31", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nametaskdefinitionExecutionRoleDefaultPolicyF7942D20", - "Roles": [ - { - "Ref": "nametaskdefinitionExecutionRole45AC5C9A" - } - ] - } - }, - "namelogsF4B17D31": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameserviceService8015C8D6": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 10, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "nameserviceSecurityGroup33F4662C", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - ] - } - }, - "TaskDefinition": { - "Ref": "nametaskdefinition690762BB" - } - } - }, - "nameserviceSecurityGroup33F4662C": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "nameserviceTaskCountTarget366C2B3A": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 20, - "MinCapacity": 5, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "nameserviceService8015C8D6", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "nameserviceTaskCountTargetTargetCpuUtilization50E2840097": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsintegnameserviceTaskCountTargetTargetCpuUtilization508522EB56", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "nameserviceTaskCountTarget366C2B3A" - }, - "TargetTrackingScalingPolicyConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ECSServiceAverageCPUUtilization" - }, - "ScaleInCooldown": 60, - "ScaleOutCooldown": 60, - "TargetValue": 50 - } - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.custom-service-extension.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.custom-service-extension.ts deleted file mode 100644 index a33e066841034..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.custom-service-extension.ts +++ /dev/null @@ -1,65 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, Service, ServiceBuild, ServiceDescription, ServiceExtension } from '../lib'; - -class MyCustomAutoscaling extends ServiceExtension { - constructor() { - super('my-custom-autoscaling'); - } - - // This service modifies properties of the service prior - // to construct creation. - public modifyServiceProps(props: ServiceBuild) { - return { - ...props, - - // Initially launch 10 copies of the service - desiredCount: 10, - } as ServiceBuild; - } - - // This hook utilizes the resulting service construct - // once it is created - public useService(service: ecs.Ec2Service | ecs.FargateService) { - const scalingTarget = service.autoScaleTaskCount({ - minCapacity: 5, // Min 5 tasks - maxCapacity: 20, // Max 20 tasks - }); - - scalingTarget.scaleOnCpuUtilization('TargetCpuUtilization50', { - targetUtilizationPercent: 50, - scaleInCooldown: cdk.Duration.seconds(60), - scaleOutCooldown: cdk.Duration.seconds(60), - }); - } -} - -const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-ecs-integ'); - -const environment = new Environment(stack, 'production'); - -/** Name service */ -const nameDescription = new ServiceDescription(); -nameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); -nameDescription.add(new MyCustomAutoscaling()); - -new Service(stack, 'name', { - environment: environment, - serviceDescription: nameDescription, -}); - -/** - * Expectation is that the user is able to implement their own extension - * using the abstract class, and that it will function. This will help - * catch breaking changes to extensions. (Might need to make this example - * custom extension more complex eventually) - */ \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.expected.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.expected.json deleted file mode 100644 index 48775db8f3c84..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.expected.json +++ /dev/null @@ -1,451 +0,0 @@ -{ - "Resources": { - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60": { - "Type": "AWS::CloudFormation::Stack", - "Properties": { - "TemplateURL": { - "Fn::Join": [ - "", - [ - "https://s3.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3Bucket85F9E22A" - }, - "/", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3VersionKey8103F967" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3VersionKey8103F967" - } - ] - } - ] - } - ] - ] - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ServiceloadbalancerD5D60894": { - "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "Properties": { - "LoadBalancerAttributes": [ - { - "Key": "deletion_protection.enabled", - "Value": "false" - } - ], - "Scheme": "internet-facing", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet1Subnet0D15D382Ref" - ] - }, - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet2Subnet68645ACARef" - ] - }, - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPublicSubnet3Subnet408F449FRef" - ] - } - ], - "Type": "application" - } - }, - "ServiceloadbalancerSecurityGroup2DA3E8D6": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Automatically created Security Group for ELB importedenvironmentintegServiceloadbalancerFAE8A5FA", - "SecurityGroupIngress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow from anyone on port 80", - "FromPort": 80, - "IpProtocol": "tcp", - "ToPort": 80 - } - ], - "VpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "ServiceloadbalancerSecurityGrouptoimportedenvironmentintegServiceserviceSecurityGroup2BE90F7480B17EB7CA": { - "Type": "AWS::EC2::SecurityGroupEgress", - "Properties": { - "GroupId": { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - }, - "IpProtocol": "tcp", - "Description": "Load balancer to target", - "DestinationSecurityGroupId": { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - }, - "FromPort": 80, - "ToPort": 80 - } - }, - "ServiceloadbalancerServicelistenerC862F722": { - "Type": "AWS::ElasticLoadBalancingV2::Listener", - "Properties": { - "DefaultActions": [ - { - "TargetGroupArn": { - "Ref": "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - }, - "Type": "forward" - } - ], - "LoadBalancerArn": { - "Ref": "ServiceloadbalancerD5D60894" - }, - "Port": 80, - "Protocol": "HTTP" - } - }, - "ServiceloadbalancerServicelistenerServiceGroup844B51E6": { - "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "Properties": { - "Port": 80, - "Protocol": "HTTP", - "TargetGroupAttributes": [ - { - "Key": "deregistration_delay.timeout_seconds", - "Value": "10" - }, - { - "Key": "stickiness.enabled", - "Value": "false" - } - ], - "TargetType": "ip", - "VpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "ServicetaskdefinitionTaskRole5B4B60A4": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "Servicetaskdefinition0CEAD834": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 256, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "Servicelogs9F4E1F70" - }, - "awslogs-stream-prefix": "Service", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 512, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "256", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "ServicetaskdefinitionExecutionRoleD09F4578", - "Arn" - ] - }, - "Family": "importedenvironmentintegServicetaskdefinition63936B87", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "ServicetaskdefinitionTaskRole5B4B60A4", - "Arn" - ] - } - } - }, - "ServicetaskdefinitionExecutionRoleD09F4578": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "ServicetaskdefinitionExecutionRoleDefaultPolicy25CEAFC5": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Servicelogs9F4E1F70", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ServicetaskdefinitionExecutionRoleDefaultPolicy25CEAFC5", - "Roles": [ - { - "Ref": "ServicetaskdefinitionExecutionRoleD09F4578" - } - ] - } - }, - "Servicelogs9F4E1F70": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "Service-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ServiceserviceService6A153CB8": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentcluster594A3DCARef" - ] - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "HealthCheckGracePeriodSeconds": 60, - "LaunchType": "FARGATE", - "LoadBalancers": [ - { - "ContainerName": "app", - "ContainerPort": 80, - "TargetGroupArn": { - "Ref": "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - } - } - ], - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet1Subnet7309E967Ref" - ] - }, - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet2Subnet55014443Ref" - ] - }, - { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcPrivateSubnet3Subnet6CF08327Ref" - ] - } - ] - } - }, - "TaskDefinition": { - "Ref": "Servicetaskdefinition0CEAD834" - } - }, - "DependsOn": [ - "ServiceloadbalancerServicelistenerC862F722", - "ServiceloadbalancerServicelistenerServiceGroup844B51E6" - ] - }, - "ServiceserviceSecurityGroup1915660F": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "imported-environment-integ/Service-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Fn::GetAtt": [ - "ResourcesNestedStackResourcesNestedStackResourceCDA26E60", - "Outputs.importedenvironmentintegResourcesEnvironmentenvironmentvpcDC34D4D3Ref" - ] - } - } - }, - "ServiceserviceSecurityGroupfromimportedenvironmentintegServiceloadbalancerSecurityGroup68EE533C8070FCF629": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "IpProtocol": "tcp", - "Description": "Load balancer to target", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "ServiceserviceSecurityGroup1915660F", - "GroupId" - ] - }, - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "ServiceloadbalancerSecurityGroup2DA3E8D6", - "GroupId" - ] - }, - "ToPort": 80 - } - } - }, - "Outputs": { - "Serviceloadbalancerdnsoutput": { - "Value": { - "Fn::GetAtt": [ - "ServiceloadbalancerD5D60894", - "DNSName" - ] - } - } - }, - "Parameters": { - "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3Bucket85F9E22A": { - "Type": "String", - "Description": "S3 bucket for asset \"e2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886\"" - }, - "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3VersionKey8103F967": { - "Type": "String", - "Description": "S3 key for asset version \"e2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886\"" - }, - "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886ArtifactHash6FA4ABA8": { - "Type": "String", - "Description": "Artifact hash for asset \"e2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886\"" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.ts deleted file mode 100644 index 8f6da80a87732..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.ts +++ /dev/null @@ -1,100 +0,0 @@ -/// !cdk-integ pragma:ignore-assets -import { Vpc } from '@aws-cdk/aws-ec2'; -import { Cluster, ContainerImage } from '@aws-cdk/aws-ecs'; -import { App, NestedStack, Stack } from '@aws-cdk/core'; -import { Construct } from 'constructs'; -import { - Container, - Environment, - EnvironmentCapacityType, - HttpLoadBalancerExtension, - Service, - ServiceDescription, -} from '../lib'; - -class ResourceStack extends NestedStack { - public readonly clusterName: string; - public readonly vpcId: string; - public readonly publicSubnetIds: string[]; - public readonly privateSubnetIds: string[]; - - constructor(scope: Construct, id: string) { - super(scope, id); - - const environment = new Environment(this, 'Environment'); - - this.clusterName = environment.cluster.clusterName; - this.vpcId = environment.vpc.vpcId; - this.privateSubnetIds = environment.vpc.privateSubnets.map(m => m.subnetId); - this.publicSubnetIds = environment.vpc.publicSubnets.map(m => m.subnetId); - } -} - -class TestStack extends Stack { - constructor(scope: Construct, id: string) { - super(scope, id); - // Create a nested stack with the shared resources - const resourceStack = new ResourceStack(this, 'Resources'); - - // Import the vpc from the nested stack - const vpc = Vpc.fromVpcAttributes(this, 'Vpc', { - availabilityZones: resourceStack.availabilityZones, - vpcId: resourceStack.vpcId, - privateSubnetIds: resourceStack.privateSubnetIds, - publicSubnetIds: resourceStack.publicSubnetIds, - }); - - // Import the cluster from the nested stack - const cluster = Cluster.fromClusterAttributes(this, 'Cluster', { - clusterName: resourceStack.clusterName, - securityGroups: [], - vpc: vpc, - }); - - // Create the environment from attributes. - const environment = Environment.fromEnvironmentAttributes(this, 'Environment', { - cluster, - capacityType: EnvironmentCapacityType.FARGATE, - }); - - // Add a workload. - const serviceDescription = new ServiceDescription(); - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, - })); - serviceDescription.add(new HttpLoadBalancerExtension()); - - new Service(this, 'Service', { - environment, - serviceDescription, - }); - } -} - -const app = new App(); -new TestStack(app, 'imported-environment-integ'); - -/** - * Expect this stack to deploy and show a load balancer DNS address. When you - * request the address with curl, you should see the name container's output. - * The load balancer may response 503 Service Temporarily Unavailable for a - * short while, before you can see the container output. - * - * Example: - * ``` - * $ cdk --app 'node integ.imported-environment.js' deploy - * ... - * Outputs: - * shared-cluster-integ.Serviceloadbalancerdnsoutput = share-Servi-6JALU1FDE36L-2093347098.us-east-1.elb.amazonaws.com - * ... - * - * $ curl share-Servi-6JALU1FDE36L-2093347098.us-east-1.elb.amazonaws.com - * Keira (ip-10-0-153-44.ec2.internal) - * ``` - */ diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.multiple-environments.expected.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.multiple-environments.expected.json deleted file mode 100644 index ecee47c85b2a4..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.multiple-environments.expected.json +++ /dev/null @@ -1,2322 +0,0 @@ -{ - "Resources": { - "productionenvironmentvpcAEB47DF7": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1Subnet8D92C089": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet1EIP54BA88DB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2Subnet298E6C31": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.32.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTable842A68D7": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet2EIP14CA46AA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3SubnetC7B5665D": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.64.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3RouteTableAssociationFA34D6E7": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - } - } - }, - "productionenvironmentvpcPublicSubnet3DefaultRouteE1ADEA6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet3EIP53405AED": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3NATGateway94604057": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet3EIP53405AED", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1Subnet53F632E6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.96.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "productionenvironmentvpcPrivateSubnet2Subnet756FB93C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.128.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.160.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet3RouteTableAssociation65F18B9C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - } - }, - "productionenvironmentvpcPrivateSubnet3DefaultRoute2438918B": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet3NATGateway94604057" - } - } - }, - "productionenvironmentvpcIGWE7C39890": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcVPCGW1B428D07": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "InternetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D": { - "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "Properties": { - "Name": "production", - "Vpc": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "developmentenvironmentvpcCB4216A4": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet1Subnet0D18046B": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/19", - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet1RouteTableAssociation8F257A0C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet1Subnet0D18046B" - } - } - }, - "developmentenvironmentvpcPublicSubnet1DefaultRoute2BAA794D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - }, - "DependsOn": [ - "developmentenvironmentvpcVPCGW702C2C38" - ] - }, - "developmentenvironmentvpcPublicSubnet1EIPE8B9F4D4": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet1NATGateway6B01CC4E": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet1Subnet0D18046B" - }, - "AllocationId": { - "Fn::GetAtt": [ - "developmentenvironmentvpcPublicSubnet1EIPE8B9F4D4", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.32.0/19", - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet2RouteTableAssociation6630985C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3" - } - } - }, - "developmentenvironmentvpcPublicSubnet2DefaultRoute2C5118B5": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - }, - "DependsOn": [ - "developmentenvironmentvpcVPCGW702C2C38" - ] - }, - "developmentenvironmentvpcPublicSubnet2EIP560C2BBA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet2NATGateway15A9C252": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3" - }, - "AllocationId": { - "Fn::GetAtt": [ - "developmentenvironmentvpcPublicSubnet2EIP560C2BBA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet3Subnet00B8A77C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.64.0/19", - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet3" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet3RouteTableAEB3B528": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet3" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet3RouteTableAssociationF90257AE": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet3RouteTableAEB3B528" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet3Subnet00B8A77C" - } - } - }, - "developmentenvironmentvpcPublicSubnet3DefaultRoute11687292": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet3RouteTableAEB3B528" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - }, - "DependsOn": [ - "developmentenvironmentvpcVPCGW702C2C38" - ] - }, - "developmentenvironmentvpcPublicSubnet3EIPE2E366D3": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet3" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet3NATGatewayAD65DE0B": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet3Subnet00B8A77C" - }, - "AllocationId": { - "Fn::GetAtt": [ - "developmentenvironmentvpcPublicSubnet3EIPE2E366D3", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet3" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.96.0/19", - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet1RouteTableAssociation95EE92E6": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171" - } - } - }, - "developmentenvironmentvpcPrivateSubnet1DefaultRoute1813B5F3": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "developmentenvironmentvpcPublicSubnet1NATGateway6B01CC4E" - } - } - }, - "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.128.0/19", - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet2RouteTableAssociation1C336DAE": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D" - } - } - }, - "developmentenvironmentvpcPrivateSubnet2DefaultRoute1B4A6D0D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "developmentenvironmentvpcPublicSubnet2NATGateway15A9C252" - } - } - }, - "developmentenvironmentvpcPrivateSubnet3SubnetAE84C610": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.160.0/19", - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet3RouteTableBD7C810A": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet3RouteTableAssociation08099995": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet3RouteTableBD7C810A" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPrivateSubnet3SubnetAE84C610" - } - } - }, - "developmentenvironmentvpcPrivateSubnet3DefaultRoute93B77208": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet3RouteTableBD7C810A" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "developmentenvironmentvpcPublicSubnet3NATGatewayAD65DE0B" - } - } - }, - "developmentenvironmentvpcIGW2B4E91B1": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc" - } - ] - } - }, - "developmentenvironmentvpcVPCGW702C2C38": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "InternetGatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - } - }, - "developmentenvironmentcluster1B64BE8B": { - "Type": "AWS::ECS::Cluster" - }, - "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767": { - "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "Properties": { - "Name": "development", - "Vpc": { - "Ref": "developmentenvironmentvpcCB4216A4" - } - } - }, - "productionmeshB6E81744": { - "Type": "AWS::AppMesh::Mesh", - "Properties": { - "MeshName": "awsecsintegproductionmesh1A4ED585", - "Spec": {} - } - }, - "developmentmeshCEC28AFE": { - "Type": "AWS::AppMesh::Mesh", - "Properties": { - "MeshName": "awsecsintegdevelopmentmeshEFC35179", - "Spec": {} - } - }, - "nameproductiontaskdefinitionTaskRole93E922EB": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nameproductiontaskdefinition33A5D5E0": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nameproductionlogsD0BFFE8C" - }, - "awslogs-stream-prefix": "name-production", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "/virtualNode/name-production" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "nameproductionenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nameproductiontaskdefinitionenvoyLogGroupF79A2732" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionExecutionRoleB72DD86B", - "Arn" - ] - }, - "Family": "awsecsintegnameproductiontaskdefinition9E1C363B", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionTaskRole93E922EB", - "Arn" - ] - } - } - }, - "nameproductiontaskdefinitionExecutionRoleB72DD86B": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nameproductiontaskdefinitionExecutionRoleDefaultPolicyB66C67BE": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameproductionlogsD0BFFE8C", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionenvoyLogGroupF79A2732", - "Arn" - ] - } - ] - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "nameproductionenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameproductiontaskdefinitionExecutionRoleDefaultPolicyB66C67BE", - "Roles": [ - { - "Ref": "nameproductiontaskdefinitionExecutionRoleB72DD86B" - } - ] - } - }, - "nameproductiontaskdefinitionenvoyLogGroupF79A2732": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nameproductionlogsD0BFFE8C": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-production-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameproductionenvoytoappmesh1B44B04A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "productionmeshB6E81744" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameproductionenvoytoappmesh1B44B04A", - "Roles": [ - { - "Ref": "nameproductiontaskdefinitionTaskRole93E922EB" - } - ] - } - }, - "nameproductionserviceServiceB2D31516": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "nameproductionserviceSecurityGroupF496E439", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "nameproductionserviceCloudmapService60E3273A", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "nameproductiontaskdefinition33A5D5E0" - } - } - }, - "nameproductionserviceCloudmapService60E3273A": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "name-production", - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "nameproductionserviceSecurityGroupF496E439": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-production-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "nameproductionvirtualnodeC78443D9": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "production", - "ServiceName": { - "Fn::GetAtt": [ - "nameproductionserviceCloudmapService60E3273A", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "name-production" - } - }, - "nameproductionvirtualrouter00E3366D": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "name-production" - } - }, - "nameproductionvirtualrouternameproductionrouteE886BEFD": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "nameproductionvirtualnodeC78443D9", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "nameproductionvirtualrouter00E3366D", - "VirtualRouterName" - ] - }, - "RouteName": "name-production-route" - } - }, - "nameproductionvirtualservice4D49D5F6": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "nameproductionvirtualrouter00E3366D", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "name-production.production" - } - }, - "namedevelopmenttaskdefinitionTaskRole66A85BBB": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "namedevelopmenttaskdefinition0468FBFF": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "namedevelopmentlogs108670CC" - }, - "awslogs-stream-prefix": "name-development", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "/virtualNode/name-development" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "namedevelopmentenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionExecutionRole48B53E4E", - "Arn" - ] - }, - "Family": "awsecsintegnamedevelopmenttaskdefinitionC3797E10", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionTaskRole66A85BBB", - "Arn" - ] - } - } - }, - "namedevelopmenttaskdefinitionExecutionRole48B53E4E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "namedevelopmenttaskdefinitionExecutionRoleDefaultPolicy34EAA008": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "namedevelopmentlogs108670CC", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6", - "Arn" - ] - } - ] - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "namedevelopmentenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "namedevelopmenttaskdefinitionExecutionRoleDefaultPolicy34EAA008", - "Roles": [ - { - "Ref": "namedevelopmenttaskdefinitionExecutionRole48B53E4E" - } - ] - } - }, - "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "namedevelopmentlogs108670CC": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-development-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "namedevelopmentenvoytoappmesh45FF08AA": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "developmentmeshCEC28AFE" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "namedevelopmentenvoytoappmesh45FF08AA", - "Roles": [ - { - "Ref": "namedevelopmenttaskdefinitionTaskRole66A85BBB" - } - ] - } - }, - "namedevelopmentserviceService8A24F793": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "developmentenvironmentcluster1B64BE8B" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "namedevelopmentserviceSecurityGroupE2ECED97", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171" - }, - { - "Ref": "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D" - }, - { - "Ref": "developmentenvironmentvpcPrivateSubnet3SubnetAE84C610" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "namedevelopmentserviceCloudmapService63674467", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "namedevelopmenttaskdefinition0468FBFF" - } - } - }, - "namedevelopmentserviceCloudmapService63674467": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "name-development", - "NamespaceId": { - "Fn::GetAtt": [ - "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767", - "Id" - ] - } - } - }, - "namedevelopmentserviceSecurityGroupE2ECED97": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-development-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - } - } - }, - "namedevelopmentvirtualnode55118E80": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "development", - "ServiceName": { - "Fn::GetAtt": [ - "namedevelopmentserviceCloudmapService63674467", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "name-development" - } - }, - "namedevelopmentvirtualrouter0AE5105D": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "name-development" - } - }, - "namedevelopmentvirtualrouternamedevelopmentroute611E499A": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "namedevelopmentvirtualnode55118E80", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "namedevelopmentvirtualrouter0AE5105D", - "VirtualRouterName" - ] - }, - "RouteName": "name-development-route" - } - }, - "namedevelopmentvirtualserviceD936E3FD": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "namedevelopmentvirtualrouter0AE5105D", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "name-development.development" - } - } - }, - "Mappings": { - "nameproductionenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - }, - "namedevelopmentenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.multiple-environments.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.multiple-environments.ts deleted file mode 100644 index bc5bd3f32e742..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.multiple-environments.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Mesh } from '@aws-cdk/aws-appmesh'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, Service, ServiceDescription, AppMeshExtension } from '../lib'; - -const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-ecs-integ'); - -const production = new Environment(stack, 'production'); -const development = new Environment(stack, 'development'); - -const productionMesh = new Mesh(stack, 'production-mesh'); -const developmentMesh = new Mesh(stack, 'development-mesh'); - -/** Production name service */ -const productionNameDescription = new ServiceDescription(); -productionNameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); -productionNameDescription.add(new AppMeshExtension({ mesh: productionMesh })); - -new Service(stack, 'name-production', { - environment: production, - serviceDescription: productionNameDescription, -}); - -/** Development name service */ -const developmentNameDescription = new ServiceDescription(); -developmentNameDescription.add(new Container({ - cpu: 1024, - memoryMiB: 2048, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); -developmentNameDescription.add(new AppMeshExtension({ mesh: developmentMesh })); - -new Service(stack, 'name-development', { - environment: development, - serviceDescription: developmentNameDescription, -}); - -/** - * This test verifies the edge case of creating multiple environments - * on the same account to ensure that there are no conflicts. - */ \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.publish-subscribe.expected.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.publish-subscribe.expected.json deleted file mode 100644 index 34ffb8672f890..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.publish-subscribe.expected.json +++ /dev/null @@ -1,1478 +0,0 @@ -{ - "Resources": { - "productionenvironmentvpcAEB47DF7": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1Subnet8D92C089": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet1EIP54BA88DB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2Subnet298E6C31": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.32.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTable842A68D7": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet2EIP14CA46AA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3SubnetC7B5665D": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.64.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3RouteTableAssociationFA34D6E7": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - } - } - }, - "productionenvironmentvpcPublicSubnet3DefaultRouteE1ADEA6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet3RouteTable00E3BF60" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet3EIP53405AED": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet3NATGateway94604057": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet3EIP53405AED", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1Subnet53F632E6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.96.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1a", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "productionenvironmentvpcPrivateSubnet2Subnet756FB93C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.128.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1b", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.160.0/19", - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": "test-region-1c", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet3" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet3RouteTableAssociation65F18B9C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - } - }, - "productionenvironmentvpcPrivateSubnet3DefaultRoute2438918B": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet3RouteTable1A244D34" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet3NATGateway94604057" - } - } - }, - "productionenvironmentvpcIGWE7C39890": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcVPCGW1B428D07": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "InternetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "signupD2AAA171": { - "Type": "AWS::SNS::Topic" - }, - "delete1CCE71FF": { - "Type": "AWS::SNS::Topic" - }, - "PublishertaskdefinitionTaskRoleE8655AA5": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "PublishertaskdefinitionTaskRoleDefaultPolicyD6E49F15": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sns:Publish", - "Effect": "Allow", - "Resource": [ - { - "Ref": "delete1CCE71FF" - }, - { - "Ref": "signupD2AAA171" - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "PublishertaskdefinitionTaskRoleDefaultPolicyD6E49F15", - "Roles": [ - { - "Ref": "PublishertaskdefinitionTaskRoleE8655AA5" - } - ] - } - }, - "PublishertaskdefinitionA4324C64": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 256, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - }, - { - "Name": "SIGN-UP_TOPIC_ARN", - "Value": { - "Ref": "signupD2AAA171" - } - }, - { - "Name": "DELETE_TOPIC_ARN", - "Value": { - "Ref": "delete1CCE71FF" - } - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "PublisherlogsDF0C1067" - }, - "awslogs-stream-prefix": "Publisher", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 512, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "256", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "PublishertaskdefinitionExecutionRole5C00C542", - "Arn" - ] - }, - "Family": "awsecsintegPublishertaskdefinitionD50610D0", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "PublishertaskdefinitionTaskRoleE8655AA5", - "Arn" - ] - } - } - }, - "PublishertaskdefinitionExecutionRole5C00C542": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "PublishertaskdefinitionExecutionRoleDefaultPolicy681FD8E6": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "PublisherlogsDF0C1067", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "PublishertaskdefinitionExecutionRoleDefaultPolicy681FD8E6", - "Roles": [ - { - "Ref": "PublishertaskdefinitionExecutionRole5C00C542" - } - ] - } - }, - "PublisherlogsDF0C1067": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "Publisher-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "PublisherserviceService9EB00F60": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "PublisherserviceSecurityGroupC7B0C0D0", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - ] - } - }, - "TaskDefinition": { - "Ref": "PublishertaskdefinitionA4324C64" - } - } - }, - "PublisherserviceSecurityGroupC7B0C0D0": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/Publisher-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "signupqueue33AFF2E6": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "signupqueuePolicy185ADC00": { - "Type": "AWS::SQS::QueuePolicy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Ref": "signupD2AAA171" - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "sns.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "Queues": [ - { - "Ref": "signupqueue33AFF2E6" - } - ] - } - }, - "signupqueueawsecsintegsignup8DE00B29CE828029": { - "Type": "AWS::SNS::Subscription", - "Properties": { - "Protocol": "sqs", - "TopicArn": { - "Ref": "signupD2AAA171" - }, - "Endpoint": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - } - }, - "EventsDeadLetterQueue404572C7": { - "Type": "AWS::SQS::Queue", - "Properties": { - "MessageRetentionPeriod": 1209600 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EventsQueueB96EB0D2": { - "Type": "AWS::SQS::Queue", - "Properties": { - "RedrivePolicy": { - "deadLetterTargetArn": { - "Fn::GetAtt": [ - "EventsDeadLetterQueue404572C7", - "Arn" - ] - }, - "maxReceiveCount": 3 - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EventsQueuePolicyF3E925EC": { - "Type": "AWS::SQS::QueuePolicy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Ref": "delete1CCE71FF" - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "sns.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "Queues": [ - { - "Ref": "EventsQueueB96EB0D2" - } - ] - } - }, - "EventsQueueawsecsintegdeleteF56807768162F4C0": { - "Type": "AWS::SNS::Subscription", - "Properties": { - "Protocol": "sqs", - "TopicArn": { - "Ref": "delete1CCE71FF" - }, - "Endpoint": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - } - } - }, - "WorkertaskdefinitionTaskRole1EBF20D6": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "WorkertaskdefinitionTaskRoleDefaultPolicy45EAFD8C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "sqs:ChangeMessageVisibility", - "sqs:DeleteMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:ReceiveMessage" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "WorkertaskdefinitionTaskRoleDefaultPolicy45EAFD8C", - "Roles": [ - { - "Ref": "WorkertaskdefinitionTaskRole1EBF20D6" - } - ] - } - }, - "WorkertaskdefinitionBF93A675": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 256, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - }, - { - "Name": "WORKER_QUEUE_URI", - "Value": { - "Ref": "EventsQueueB96EB0D2" - } - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "Workerlogs2994AC4D" - }, - "awslogs-stream-prefix": "Worker", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 512, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "256", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "WorkertaskdefinitionExecutionRole3C1A1848", - "Arn" - ] - }, - "Family": "awsecsintegWorkertaskdefinition32B60762", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "WorkertaskdefinitionTaskRole1EBF20D6", - "Arn" - ] - } - } - }, - "WorkertaskdefinitionExecutionRole3C1A1848": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "WorkertaskdefinitionExecutionRoleDefaultPolicy6E199B19": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Workerlogs2994AC4D", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "WorkertaskdefinitionExecutionRoleDefaultPolicy6E199B19", - "Roles": [ - { - "Ref": "WorkertaskdefinitionExecutionRole3C1A1848" - } - ] - } - }, - "Workerlogs2994AC4D": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "Worker-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "WorkerserviceService68C5A5C3": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "WorkerserviceSecurityGroup1CDDB904", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet3Subnet3BD4064E" - } - ] - } - }, - "TaskDefinition": { - "Ref": "WorkertaskdefinitionBF93A675" - } - } - }, - "WorkerserviceSecurityGroup1CDDB904": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/Worker-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "WorkerserviceTaskCountTarget6636D808": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 10, - "MinCapacity": 1, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "WorkerserviceService68C5A5C3", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "WorkerserviceTaskCountTargetEventsQueueautoscalingpolicyD12B62ED": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsintegWorkerserviceTaskCountTargetEventsQueueautoscalingpolicyDBD40B57", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "WorkerserviceTaskCountTarget6636D808" - }, - "TargetTrackingScalingPolicyConfiguration": { - "CustomizedMetricSpecification": { - "Dimensions": [ - { - "Name": "QueueName", - "Value": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "QueueName" - ] - } - } - ], - "MetricName": "BacklogPerTask", - "Namespace": "production-Worker", - "Statistic": "Average", - "Unit": "Count" - }, - "TargetValue": 15 - } - } - }, - "WorkerserviceTaskCountTargetsignupqueueautoscalingpolicyB7321DB7": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsintegWorkerserviceTaskCountTargetsignupqueueautoscalingpolicyDF93FC37", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "WorkerserviceTaskCountTarget6636D808" - }, - "TargetTrackingScalingPolicyConfiguration": { - "CustomizedMetricSpecification": { - "Dimensions": [ - { - "Name": "QueueName", - "Value": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "QueueName" - ] - } - } - ], - "MetricName": "BacklogPerTask", - "Namespace": "production-Worker", - "Statistic": "Average", - "Unit": "Count" - }, - "TargetValue": 30 - } - } - }, - "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "BackLogPerTaskCalculatorFunctionServiceRoleDefaultPolicyB6B10266": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "ecs:DescribeServices", - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": { - "Ref": "WorkerserviceService68C5A5C3" - } - }, - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "BackLogPerTaskCalculatorFunctionServiceRoleDefaultPolicyB6B10266", - "Roles": [ - { - "Ref": "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4" - } - ] - } - }, - "BackLogPerTaskCalculatorFunction95AA21D5": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3Bucket1FFDEA8D" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4", - "Arn" - ] - }, - "Environment": { - "Variables": { - "CLUSTER_NAME": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "SERVICE_NAME": { - "Fn::GetAtt": [ - "WorkerserviceService68C5A5C3", - "Name" - ] - }, - "NAMESPACE": "production-Worker", - "QUEUE_NAMES": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "QueueName" - ] - }, - ",", - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "QueueName" - ] - } - ] - ] - } - } - }, - "Handler": "index.queue_handler", - "Runtime": "python3.9" - }, - "DependsOn": [ - "BackLogPerTaskCalculatorFunctionServiceRoleDefaultPolicyB6B10266", - "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4" - ] - }, - "BacklogPerTaskScheduledRuleB871DD15": { - "Type": "AWS::Events::Rule", - "Properties": { - "ScheduleExpression": "rate(1 minute)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunction95AA21D5", - "Arn" - ] - }, - "Id": "Target0" - } - ] - } - }, - "BacklogPerTaskScheduledRuleAllowEventRuleawsecsintegBackLogPerTaskCalculatorFunctionEB2B91C7CCD725BB": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunction95AA21D5", - "Arn" - ] - }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": [ - "BacklogPerTaskScheduledRuleB871DD15", - "Arn" - ] - } - } - }, - "WorkerBackLogPerTaskCalculatorLogsA4B5AF42": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": { - "Fn::Join": [ - "", - [ - "/aws/lambda/", - { - "Ref": "BackLogPerTaskCalculatorFunction95AA21D5" - } - ] - ] - }, - "RetentionInDays": 3 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - } - }, - "Parameters": { - "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3Bucket1FFDEA8D": { - "Type": "String", - "Description": "S3 bucket for asset \"a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91\"" - }, - "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B": { - "Type": "String", - "Description": "S3 key for asset version \"a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91\"" - }, - "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91ArtifactHashC1953821": { - "Type": "String", - "Description": "Artifact hash for asset \"a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91\"" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.publish-subscribe.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.publish-subscribe.ts deleted file mode 100644 index 9cef50adce4c0..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.publish-subscribe.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as ecs from '@aws-cdk/aws-ecs'; -import * as sns from '@aws-cdk/aws-sns'; -import * as sqs from '@aws-cdk/aws-sqs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, InjecterExtension, InjectableTopic, QueueExtension, Service, ServiceDescription, TopicSubscription } from '../lib'; - - -const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-ecs-integ'); - -const environment = new Environment(stack, 'production'); - -const pubServiceDescription = new ServiceDescription(); - -pubServiceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); - -const topic1 = new InjectableTopic({ - topic: new sns.Topic(stack, 'sign-up'), -}); - -const topic2 = new InjectableTopic({ - topic: new sns.Topic(stack, 'delete'), -}); - -pubServiceDescription.add(new InjecterExtension({ - injectables: [topic1, topic2], -})); - -new Service(stack, 'Publisher', { - environment: environment, - serviceDescription: pubServiceDescription, -}); - -const subServiceDescription = new ServiceDescription(); - -subServiceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, -})); - -const topicSubscription1 = new TopicSubscription({ - topic: topic1.topic, - topicSubscriptionQueue: { - queue: new sqs.Queue(stack, 'sign-up-queue'), - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(10), - messageProcessingTime: cdk.Duration.seconds(20), - }, - }, -}); -const topicSubscription2 = new TopicSubscription({ - topic: topic2.topic, -}); - -subServiceDescription.add(new QueueExtension({ - subscriptions: [topicSubscription1, topicSubscription2], - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(5), - messageProcessingTime: cdk.Duration.seconds(20), - }, -})); - -new Service(stack, 'Worker', { - environment: environment, - serviceDescription: subServiceDescription, - autoScaleTaskCount: { - maxTaskCount: 10, - }, -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/aws-ecs-integ.assets.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/aws-ecs-integ.assets.json deleted file mode 100644 index a861676b9d655..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/aws-ecs-integ.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "20.0.0", - "files": { - "1c4ad1ddd84ec62cd00e1c01c2971172dcc3acca3cf10509e3f7dca20433d2e3": { - "source": { - "path": "aws-ecs-integ.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1c4ad1ddd84ec62cd00e1c01c2971172dcc3acca3cf10509e3f7dca20433d2e3.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/aws-ecs-integ.template.json deleted file mode 100644 index c8a1d5bae0905..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/aws-ecs-integ.template.json +++ /dev/null @@ -1,2070 +0,0 @@ -{ - "Resources": { - "productionenvironmentvpcAEB47DF7": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1Subnet8D92C089": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet1EIP54BA88DB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D", - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374" - ] - }, - "productionenvironmentvpcPublicSubnet2Subnet298E6C31": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.64.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTable842A68D7": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet2EIP14CA46AA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D", - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - ] - }, - "productionenvironmentvpcPrivateSubnet1Subnet53F632E6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "productionenvironmentvpcPrivateSubnet2Subnet756FB93C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.192.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "productionenvironmentvpcIGWE7C39890": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcVPCGW1B428D07": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "InternetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D": { - "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "Properties": { - "Name": "production", - "Vpc": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "developmentenvironmentvpcCB4216A4": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet1Subnet0D18046B": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet1RouteTableAssociation8F257A0C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet1Subnet0D18046B" - } - } - }, - "developmentenvironmentvpcPublicSubnet1DefaultRoute2BAA794D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - }, - "DependsOn": [ - "developmentenvironmentvpcVPCGW702C2C38" - ] - }, - "developmentenvironmentvpcPublicSubnet1EIPE8B9F4D4": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet1NATGateway6B01CC4E": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet1Subnet0D18046B" - }, - "AllocationId": { - "Fn::GetAtt": [ - "developmentenvironmentvpcPublicSubnet1EIPE8B9F4D4", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "developmentenvironmentvpcPublicSubnet1DefaultRoute2BAA794D", - "developmentenvironmentvpcPublicSubnet1RouteTableAssociation8F257A0C" - ] - }, - "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.64.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet2RouteTableAssociation6630985C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3" - } - } - }, - "developmentenvironmentvpcPublicSubnet2DefaultRoute2C5118B5": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - }, - "DependsOn": [ - "developmentenvironmentvpcVPCGW702C2C38" - ] - }, - "developmentenvironmentvpcPublicSubnet2EIP560C2BBA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPublicSubnet2NATGateway15A9C252": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3" - }, - "AllocationId": { - "Fn::GetAtt": [ - "developmentenvironmentvpcPublicSubnet2EIP560C2BBA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "developmentenvironmentvpcPublicSubnet2DefaultRoute2C5118B5", - "developmentenvironmentvpcPublicSubnet2RouteTableAssociation6630985C" - ] - }, - "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet1RouteTableAssociation95EE92E6": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171" - } - } - }, - "developmentenvironmentvpcPrivateSubnet1DefaultRoute1813B5F3": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "developmentenvironmentvpcPublicSubnet1NATGateway6B01CC4E" - } - } - }, - "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.192.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "developmentenvironmentvpcPrivateSubnet2RouteTableAssociation1C336DAE": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B" - }, - "SubnetId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D" - } - } - }, - "developmentenvironmentvpcPrivateSubnet2DefaultRoute1B4A6D0D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "developmentenvironmentvpcPublicSubnet2NATGateway15A9C252" - } - } - }, - "developmentenvironmentvpcIGW2B4E91B1": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/development-environment-vpc" - } - ] - } - }, - "developmentenvironmentvpcVPCGW702C2C38": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "InternetGatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - } - }, - "developmentenvironmentcluster1B64BE8B": { - "Type": "AWS::ECS::Cluster" - }, - "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767": { - "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "Properties": { - "Name": "development", - "Vpc": { - "Ref": "developmentenvironmentvpcCB4216A4" - } - } - }, - "productionmeshB6E81744": { - "Type": "AWS::AppMesh::Mesh", - "Properties": { - "MeshName": "awsecsintegproductionmesh1A4ED585", - "Spec": {} - } - }, - "developmentmeshCEC28AFE": { - "Type": "AWS::AppMesh::Mesh", - "Properties": { - "MeshName": "awsecsintegdevelopmentmeshEFC35179", - "Spec": {} - } - }, - "nameproductiontaskdefinitionTaskRole93E922EB": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nameproductiontaskdefinition33A5D5E0": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nameproductionlogsD0BFFE8C" - }, - "awslogs-stream-prefix": "name-production", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "/virtualNode/name-production" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "nameproductionenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "nameproductiontaskdefinitionenvoyLogGroupF79A2732" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionExecutionRoleB72DD86B", - "Arn" - ] - }, - "Family": "awsecsintegnameproductiontaskdefinition9E1C363B", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionTaskRole93E922EB", - "Arn" - ] - } - } - }, - "nameproductiontaskdefinitionExecutionRoleB72DD86B": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "nameproductiontaskdefinitionExecutionRoleDefaultPolicyB66C67BE": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameproductionlogsD0BFFE8C", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionenvoyLogGroupF79A2732", - "Arn" - ] - } - ] - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "nameproductionenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameproductiontaskdefinitionExecutionRoleDefaultPolicyB66C67BE", - "Roles": [ - { - "Ref": "nameproductiontaskdefinitionExecutionRoleB72DD86B" - } - ] - } - }, - "nameproductiontaskdefinitionenvoyLogGroupF79A2732": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "nameproductionlogsD0BFFE8C": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-production-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "nameproductionenvoytoappmesh1B44B04A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "productionmeshB6E81744" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "nameproductionenvoytoappmesh1B44B04A", - "Roles": [ - { - "Ref": "nameproductiontaskdefinitionTaskRole93E922EB" - } - ] - } - }, - "nameproductionserviceServiceB2D31516": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "nameproductionserviceSecurityGroupF496E439", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "nameproductionserviceCloudmapService60E3273A", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "nameproductiontaskdefinition33A5D5E0" - } - } - }, - "nameproductionserviceCloudmapService60E3273A": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "name-production", - "NamespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "nameproductionserviceSecurityGroupF496E439": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-production-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "nameproductionvirtualnodeC78443D9": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "production", - "ServiceName": { - "Fn::GetAtt": [ - "nameproductionserviceCloudmapService60E3273A", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "name-production" - } - }, - "nameproductionvirtualrouter00E3366D": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "name-production" - } - }, - "nameproductionvirtualrouternameproductionrouteE886BEFD": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "nameproductionvirtualnodeC78443D9", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "nameproductionvirtualrouter00E3366D", - "VirtualRouterName" - ] - }, - "RouteName": "name-production-route" - } - }, - "nameproductionvirtualservice4D49D5F6": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "nameproductionvirtualrouter00E3366D", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "name-production.production" - } - }, - "namedevelopmenttaskdefinitionTaskRole66A85BBB": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "namedevelopmenttaskdefinition0468FBFF": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 1024, - "DependsOn": [ - { - "Condition": "HEALTHY", - "ContainerName": "envoy" - } - ], - "Environment": [ - { - "Name": "PORT", - "Value": "80" - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "namedevelopmentlogs108670CC" - }, - "awslogs-stream-prefix": "name-development", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 2048, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - }, - { - "Environment": [ - { - "Name": "APPMESH_VIRTUAL_NODE_NAME", - "Value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "/virtualNode/name-development" - ] - ] - } - }, - { - "Name": "AWS_REGION", - "Value": { - "Ref": "AWS::Region" - } - }, - { - "Name": "ENABLE_ENVOY_STATS_TAGS", - "Value": "1" - }, - { - "Name": "ENABLE_ENVOY_DOG_STATSD", - "Value": "1" - } - ], - "Essential": true, - "HealthCheck": { - "Command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "Interval": 5, - "Retries": 3, - "StartPeriod": 10, - "Timeout": 2 - }, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "namedevelopmentenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "MemoryReservation": 128, - "Name": "envoy", - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ], - "User": "1337" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionExecutionRole48B53E4E", - "Arn" - ] - }, - "Family": "awsecsintegnamedevelopmenttaskdefinitionC3797E10", - "Memory": "2048", - "NetworkMode": "awsvpc", - "ProxyConfiguration": { - "ContainerName": "envoy", - "ProxyConfigurationProperties": [ - { - "Name": "AppPorts", - "Value": "80" - }, - { - "Name": "ProxyEgressPort", - "Value": "15001" - }, - { - "Name": "ProxyIngressPort", - "Value": "15000" - }, - { - "Name": "IgnoredUID", - "Value": "1337" - }, - { - "Name": "IgnoredGID", - "Value": "1338" - }, - { - "Name": "EgressIgnoredIPs", - "Value": "169.254.170.2,169.254.169.254" - } - ], - "Type": "APPMESH" - }, - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionTaskRole66A85BBB", - "Arn" - ] - } - } - }, - "namedevelopmenttaskdefinitionExecutionRole48B53E4E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "namedevelopmenttaskdefinitionExecutionRoleDefaultPolicy34EAA008": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "namedevelopmentlogs108670CC", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6", - "Arn" - ] - } - ] - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "namedevelopmentenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "namedevelopmenttaskdefinitionExecutionRoleDefaultPolicy34EAA008", - "Roles": [ - { - "Ref": "namedevelopmenttaskdefinitionExecutionRole48B53E4E" - } - ] - } - }, - "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "namedevelopmentlogs108670CC": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "name-development-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "namedevelopmentenvoytoappmesh45FF08AA": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "developmentmeshCEC28AFE" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "namedevelopmentenvoytoappmesh45FF08AA", - "Roles": [ - { - "Ref": "namedevelopmenttaskdefinitionTaskRole66A85BBB" - } - ] - } - }, - "namedevelopmentserviceService8A24F793": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "developmentenvironmentcluster1B64BE8B" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "namedevelopmentserviceSecurityGroupE2ECED97", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171" - }, - { - "Ref": "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D" - } - ] - } - }, - "ServiceRegistries": [ - { - "RegistryArn": { - "Fn::GetAtt": [ - "namedevelopmentserviceCloudmapService63674467", - "Arn" - ] - } - } - ], - "TaskDefinition": { - "Ref": "namedevelopmenttaskdefinition0468FBFF" - } - } - }, - "namedevelopmentserviceCloudmapService63674467": { - "Type": "AWS::ServiceDiscovery::Service", - "Properties": { - "DnsConfig": { - "DnsRecords": [ - { - "TTL": 10, - "Type": "A" - } - ], - "NamespaceId": { - "Fn::GetAtt": [ - "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767", - "Id" - ] - }, - "RoutingPolicy": "MULTIVALUE" - }, - "HealthCheckCustomConfig": { - "FailureThreshold": 2 - }, - "Name": "name-development", - "NamespaceId": { - "Fn::GetAtt": [ - "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767", - "Id" - ] - } - } - }, - "namedevelopmentserviceSecurityGroupE2ECED97": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/name-development-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - } - } - }, - "namedevelopmentvirtualnode55118E80": { - "Type": "AWS::AppMesh::VirtualNode", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ], - "ServiceDiscovery": { - "AWSCloudMap": { - "NamespaceName": "development", - "ServiceName": { - "Fn::GetAtt": [ - "namedevelopmentserviceCloudmapService63674467", - "Name" - ] - } - } - } - }, - "VirtualNodeName": "name-development" - } - }, - "namedevelopmentvirtualrouter0AE5105D": { - "Type": "AWS::AppMesh::VirtualRouter", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "Spec": { - "Listeners": [ - { - "PortMapping": { - "Port": 80, - "Protocol": "http" - } - } - ] - }, - "VirtualRouterName": "name-development" - } - }, - "namedevelopmentvirtualrouternamedevelopmentroute611E499A": { - "Type": "AWS::AppMesh::Route", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "Spec": { - "HttpRoute": { - "Action": { - "WeightedTargets": [ - { - "VirtualNode": { - "Fn::GetAtt": [ - "namedevelopmentvirtualnode55118E80", - "VirtualNodeName" - ] - }, - "Weight": 1 - } - ] - }, - "Match": { - "Prefix": "/" - } - } - }, - "VirtualRouterName": { - "Fn::GetAtt": [ - "namedevelopmentvirtualrouter0AE5105D", - "VirtualRouterName" - ] - }, - "RouteName": "name-development-route" - } - }, - "namedevelopmentvirtualserviceD936E3FD": { - "Type": "AWS::AppMesh::VirtualService", - "Properties": { - "MeshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "Spec": { - "Provider": { - "VirtualRouter": { - "VirtualRouterName": { - "Fn::GetAtt": [ - "namedevelopmentvirtualrouter0AE5105D", - "VirtualRouterName" - ] - } - } - } - }, - "VirtualServiceName": "name-development.development" - } - } - }, - "Mappings": { - "nameproductionenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - }, - "namedevelopmentenvoyimageaccountmapping": { - "ap-northeast-1": { - "ecrRepo": "840364872350" - }, - "ap-northeast-2": { - "ecrRepo": "840364872350" - }, - "ap-south-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-1": { - "ecrRepo": "840364872350" - }, - "ap-southeast-2": { - "ecrRepo": "840364872350" - }, - "ca-central-1": { - "ecrRepo": "840364872350" - }, - "cn-north-1": { - "ecrRepo": "919366029133" - }, - "cn-northwest-1": { - "ecrRepo": "919830735681" - }, - "eu-central-1": { - "ecrRepo": "840364872350" - }, - "eu-north-1": { - "ecrRepo": "840364872350" - }, - "eu-south-1": { - "ecrRepo": "422531588944" - }, - "eu-west-1": { - "ecrRepo": "840364872350" - }, - "eu-west-2": { - "ecrRepo": "840364872350" - }, - "eu-west-3": { - "ecrRepo": "840364872350" - }, - "sa-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-1": { - "ecrRepo": "840364872350" - }, - "us-east-2": { - "ecrRepo": "840364872350" - }, - "us-west-1": { - "ecrRepo": "840364872350" - }, - "us-west-2": { - "ecrRepo": "840364872350" - }, - "me-south-1": { - "ecrRepo": "772975370895" - }, - "ap-east-1": { - "ecrRepo": "856666278305" - }, - "af-south-1": { - "ecrRepo": "924023996002" - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/cdk.out b/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/cdk.out deleted file mode 100644 index 588d7b269d34f..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/integ.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/integ.json deleted file mode 100644 index f395e0c5aec85..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/integ.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "20.0.0", - "testCases": { - "integ.multiple-environments": { - "stacks": [ - "aws-ecs-integ" - ], - "diffAssets": false, - "stackUpdateWorkflow": true - } - }, - "synthContext": {}, - "enableLookups": false -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/manifest.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/manifest.json deleted file mode 100644 index e031c17b58fe9..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/manifest.json +++ /dev/null @@ -1,514 +0,0 @@ -{ - "version": "20.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "aws-ecs-integ": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "aws-ecs-integ.template.json", - "validateOnSynth": false - }, - "metadata": { - "/aws-ecs-integ/production-environment-vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcAEB47DF7" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1EIP54BA88DB" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2EIP14CA46AA" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1" - } - ], - "/aws-ecs-integ/production-environment-vpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcIGWE7C39890" - } - ], - "/aws-ecs-integ/production-environment-vpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcVPCGW1B428D07" - } - ], - "/aws-ecs-integ/production-environment-cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentclusterC6599D2D" - } - ], - "/aws-ecs-integ/production-environment-cluster/DefaultServiceDiscoveryNamespace/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D" - } - ], - "/aws-ecs-integ/development-environment-vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcCB4216A4" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet1Subnet0D18046B" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet1RouteTableAssociation8F257A0C" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet1DefaultRoute2BAA794D" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet1EIPE8B9F4D4" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet1NATGateway6B01CC4E" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet2RouteTableAssociation6630985C" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet2DefaultRoute2C5118B5" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet2EIP560C2BBA" - } - ], - "/aws-ecs-integ/development-environment-vpc/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPublicSubnet2NATGateway15A9C252" - } - ], - "/aws-ecs-integ/development-environment-vpc/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171" - } - ], - "/aws-ecs-integ/development-environment-vpc/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB" - } - ], - "/aws-ecs-integ/development-environment-vpc/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPrivateSubnet1RouteTableAssociation95EE92E6" - } - ], - "/aws-ecs-integ/development-environment-vpc/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPrivateSubnet1DefaultRoute1813B5F3" - } - ], - "/aws-ecs-integ/development-environment-vpc/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D" - } - ], - "/aws-ecs-integ/development-environment-vpc/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B" - } - ], - "/aws-ecs-integ/development-environment-vpc/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPrivateSubnet2RouteTableAssociation1C336DAE" - } - ], - "/aws-ecs-integ/development-environment-vpc/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcPrivateSubnet2DefaultRoute1B4A6D0D" - } - ], - "/aws-ecs-integ/development-environment-vpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcIGW2B4E91B1" - } - ], - "/aws-ecs-integ/development-environment-vpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentvpcVPCGW702C2C38" - } - ], - "/aws-ecs-integ/development-environment-cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentcluster1B64BE8B" - } - ], - "/aws-ecs-integ/development-environment-cluster/DefaultServiceDiscoveryNamespace/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767" - } - ], - "/aws-ecs-integ/production-mesh/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionmeshB6E81744" - } - ], - "/aws-ecs-integ/development-mesh/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "developmentmeshCEC28AFE" - } - ], - "/aws-ecs-integ/name-production-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductiontaskdefinitionTaskRole93E922EB" - } - ], - "/aws-ecs-integ/name-production-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductiontaskdefinition33A5D5E0" - } - ], - "/aws-ecs-integ/name-production-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductiontaskdefinitionExecutionRoleB72DD86B" - } - ], - "/aws-ecs-integ/name-production-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductiontaskdefinitionExecutionRoleDefaultPolicyB66C67BE" - } - ], - "/aws-ecs-integ/name-production-task-definition/envoy/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductiontaskdefinitionenvoyLogGroupF79A2732" - } - ], - "/aws-ecs-integ/name-production-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionlogsD0BFFE8C" - } - ], - "/aws-ecs-integ/name-production-envoy-image-account-mapping": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionenvoyimageaccountmapping" - } - ], - "/aws-ecs-integ/name-production-envoy-to-appmesh/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionenvoytoappmesh1B44B04A" - } - ], - "/aws-ecs-integ/name-production-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionserviceServiceB2D31516" - } - ], - "/aws-ecs-integ/name-production-service/CloudmapService/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionserviceCloudmapService60E3273A" - } - ], - "/aws-ecs-integ/name-production-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionserviceSecurityGroupF496E439" - } - ], - "/aws-ecs-integ/name-production-virtual-node/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionvirtualnodeC78443D9" - } - ], - "/aws-ecs-integ/name-production-virtual-router/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionvirtualrouter00E3366D" - } - ], - "/aws-ecs-integ/name-production-virtual-router/name-production-route/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionvirtualrouternameproductionrouteE886BEFD" - } - ], - "/aws-ecs-integ/name-production-virtual-service/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "nameproductionvirtualservice4D49D5F6" - } - ], - "/aws-ecs-integ/name-development-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmenttaskdefinitionTaskRole66A85BBB" - } - ], - "/aws-ecs-integ/name-development-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmenttaskdefinition0468FBFF" - } - ], - "/aws-ecs-integ/name-development-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmenttaskdefinitionExecutionRole48B53E4E" - } - ], - "/aws-ecs-integ/name-development-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmenttaskdefinitionExecutionRoleDefaultPolicy34EAA008" - } - ], - "/aws-ecs-integ/name-development-task-definition/envoy/LogGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6" - } - ], - "/aws-ecs-integ/name-development-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentlogs108670CC" - } - ], - "/aws-ecs-integ/name-development-envoy-image-account-mapping": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentenvoyimageaccountmapping" - } - ], - "/aws-ecs-integ/name-development-envoy-to-appmesh/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentenvoytoappmesh45FF08AA" - } - ], - "/aws-ecs-integ/name-development-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentserviceService8A24F793" - } - ], - "/aws-ecs-integ/name-development-service/CloudmapService/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentserviceCloudmapService63674467" - } - ], - "/aws-ecs-integ/name-development-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentserviceSecurityGroupE2ECED97" - } - ], - "/aws-ecs-integ/name-development-virtual-node/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentvirtualnode55118E80" - } - ], - "/aws-ecs-integ/name-development-virtual-router/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentvirtualrouter0AE5105D" - } - ], - "/aws-ecs-integ/name-development-virtual-router/name-development-route/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentvirtualrouternamedevelopmentroute611E499A" - } - ], - "/aws-ecs-integ/name-development-virtual-service/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "namedevelopmentvirtualserviceD936E3FD" - } - ] - }, - "displayName": "aws-ecs-integ" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/tree.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/tree.json deleted file mode 100644 index 743acfc5c6d86..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/multiple-environments.integ.snapshot/tree.json +++ /dev/null @@ -1,3171 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "aws-ecs-integ": { - "id": "aws-ecs-integ", - "path": "aws-ecs-integ", - "children": { - "production": { - "id": "production", - "path": "aws-ecs-integ/production", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "production-environment-vpc": { - "id": "production-environment-vpc", - "path": "aws-ecs-integ/production-environment-vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "allocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.64.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "allocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.192.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "aws-ecs-integ/production-environment-vpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "aws-ecs-integ/production-environment-vpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "internetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "production-environment-cluster": { - "id": "production-environment-cluster", - "path": "aws-ecs-integ/production-environment-cluster", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnCluster", - "version": "0.0.0" - } - }, - "DefaultServiceDiscoveryNamespace": { - "id": "DefaultServiceDiscoveryNamespace", - "path": "aws-ecs-integ/production-environment-cluster/DefaultServiceDiscoveryNamespace", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-cluster/DefaultServiceDiscoveryNamespace/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "aws:cdk:cloudformation:props": { - "name": "production", - "vpc": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnPrivateDnsNamespace", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.PrivateDnsNamespace", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.Cluster", - "version": "0.0.0" - } - }, - "development": { - "id": "development", - "path": "aws-ecs-integ/development", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "development-environment-vpc": { - "id": "development-environment-vpc", - "path": "aws-ecs-integ/development-environment-vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/development-environment-vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983" - }, - "subnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet1Subnet0D18046B" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet1RouteTable8FC58983" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet1Subnet0D18046B" - }, - "allocationId": { - "Fn::GetAtt": [ - "developmentenvironmentvpcPublicSubnet1EIPE8B9F4D4", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.64.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2" - }, - "subnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "developmentenvironmentvpcPublicSubnet2RouteTable803A92C2" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/development-environment-vpc/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "developmentenvironmentvpcPublicSubnet2SubnetC2026CD3" - }, - "allocationId": { - "Fn::GetAtt": [ - "developmentenvironmentvpcPublicSubnet2EIP560C2BBA", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB" - }, - "subnetId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet1RouteTable29CEB1DB" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "developmentenvironmentvpcPublicSubnet1NATGateway6B01CC4E" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.192.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B" - }, - "subnetId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/development-environment-vpc/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "developmentenvironmentvpcPrivateSubnet2RouteTable687AB03B" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "developmentenvironmentvpcPublicSubnet2NATGateway15A9C252" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "aws-ecs-integ/development-environment-vpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/development-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "aws-ecs-integ/development-environment-vpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - }, - "internetGatewayId": { - "Ref": "developmentenvironmentvpcIGW2B4E91B1" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "development-environment-cluster": { - "id": "development-environment-cluster", - "path": "aws-ecs-integ/development-environment-cluster", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/development-environment-cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnCluster", - "version": "0.0.0" - } - }, - "DefaultServiceDiscoveryNamespace": { - "id": "DefaultServiceDiscoveryNamespace", - "path": "aws-ecs-integ/development-environment-cluster/DefaultServiceDiscoveryNamespace", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/development-environment-cluster/DefaultServiceDiscoveryNamespace/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::PrivateDnsNamespace", - "aws:cdk:cloudformation:props": { - "name": "development", - "vpc": { - "Ref": "developmentenvironmentvpcCB4216A4" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnPrivateDnsNamespace", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.PrivateDnsNamespace", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.Cluster", - "version": "0.0.0" - } - }, - "production-mesh": { - "id": "production-mesh", - "path": "aws-ecs-integ/production-mesh", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-mesh/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::Mesh", - "aws:cdk:cloudformation:props": { - "meshName": "awsecsintegproductionmesh1A4ED585", - "spec": {} - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnMesh", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.Mesh", - "version": "0.0.0" - } - }, - "development-mesh": { - "id": "development-mesh", - "path": "aws-ecs-integ/development-mesh", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/development-mesh/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::Mesh", - "aws:cdk:cloudformation:props": { - "meshName": "awsecsintegdevelopmentmeshEFC35179", - "spec": {} - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnMesh", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.Mesh", - "version": "0.0.0" - } - }, - "name-production": { - "id": "name-production", - "path": "aws-ecs-integ/name-production", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "name-production-task-definition": { - "id": "name-production-task-definition", - "path": "aws-ecs-integ/name-production-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/name-production-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 1024, - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "nathanpeck/name", - "memory": 2048, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "nameproductionlogsD0BFFE8C" - }, - "awslogs-stream-prefix": "name-production", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - } - ] - }, - { - "essential": true, - "image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "nameproductionenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "memoryReservation": 128, - "name": "envoy", - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "user": "1337", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "nameproductiontaskdefinitionenvoyLogGroupF79A2732" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "APPMESH_VIRTUAL_NODE_NAME", - "value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "/virtualNode/name-production" - ] - ] - } - }, - { - "name": "AWS_REGION", - "value": { - "Ref": "AWS::Region" - } - }, - { - "name": "ENABLE_ENVOY_STATS_TAGS", - "value": "1" - }, - { - "name": "ENABLE_ENVOY_DOG_STATSD", - "value": "1" - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "interval": 5, - "retries": 3, - "startPeriod": 10, - "timeout": 2 - } - } - ], - "cpu": "1024", - "executionRoleArn": { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionExecutionRoleB72DD86B", - "Arn" - ] - }, - "family": "awsecsintegnameproductiontaskdefinition9E1C363B", - "memory": "2048", - "networkMode": "awsvpc", - "proxyConfiguration": { - "containerName": "envoy", - "proxyConfigurationProperties": [ - { - "name": "AppPorts", - "value": "80" - }, - { - "name": "ProxyEgressPort", - "value": "15001" - }, - { - "name": "ProxyIngressPort", - "value": "15000" - }, - { - "name": "IgnoredUID", - "value": "1337" - }, - { - "name": "IgnoredGID", - "value": "1338" - }, - { - "name": "EgressIgnoredIPs", - "value": "169.254.170.2,169.254.169.254" - } - ], - "type": "APPMESH" - }, - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionTaskRole93E922EB", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/name-production-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/name-production-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-production-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "nameproductionlogsD0BFFE8C", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "nameproductiontaskdefinitionenvoyLogGroupF79A2732", - "Arn" - ] - } - ] - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "nameproductionenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "nameproductiontaskdefinitionExecutionRoleDefaultPolicyB66C67BE", - "roles": [ - { - "Ref": "nameproductiontaskdefinitionExecutionRoleB72DD86B" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "envoy": { - "id": "envoy", - "path": "aws-ecs-integ/name-production-task-definition/envoy", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/name-production-task-definition/envoy/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-task-definition/envoy/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "name-production-logs": { - "id": "name-production-logs", - "path": "aws-ecs-integ/name-production-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "name-production-logs", - "retentionInDays": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "name-production-envoy-image-account-mapping": { - "id": "name-production-envoy-image-account-mapping", - "path": "aws-ecs-integ/name-production-envoy-image-account-mapping", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnMapping", - "version": "0.0.0" - } - }, - "name-production-envoy-repo": { - "id": "name-production-envoy-repo", - "path": "aws-ecs-integ/name-production-envoy-repo", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecr.RepositoryBase", - "version": "0.0.0" - } - }, - "name-production-envoy-to-appmesh": { - "id": "name-production-envoy-to-appmesh", - "path": "aws-ecs-integ/name-production-envoy-to-appmesh", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-envoy-to-appmesh/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "productionmeshB6E81744" - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "nameproductionenvoytoappmesh1B44B04A", - "roles": [ - { - "Ref": "nameproductiontaskdefinitionTaskRole93E922EB" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "name-production-service": { - "id": "name-production-service", - "path": "aws-ecs-integ/name-production-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/name-production-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "deploymentConfiguration": { - "maximumPercent": 200, - "minimumHealthyPercent": 100 - }, - "desiredCount": 1, - "enableEcsManagedTags": false, - "launchType": "FARGATE", - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "nameproductionserviceSecurityGroupF496E439", - "GroupId" - ] - } - ] - } - }, - "serviceRegistries": [ - { - "registryArn": { - "Fn::GetAtt": [ - "nameproductionserviceCloudmapService60E3273A", - "Arn" - ] - } - } - ], - "taskDefinition": { - "Ref": "nameproductiontaskdefinition33A5D5E0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "CloudmapService": { - "id": "CloudmapService", - "path": "aws-ecs-integ/name-production-service/CloudmapService", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-service/CloudmapService/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::Service", - "aws:cdk:cloudformation:props": { - "dnsConfig": { - "dnsRecords": [ - { - "type": "A", - "ttl": 10 - } - ], - "namespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - }, - "routingPolicy": "MULTIVALUE" - }, - "healthCheckCustomConfig": { - "failureThreshold": 2 - }, - "name": "name-production", - "namespaceId": { - "Fn::GetAtt": [ - "productionenvironmentclusterDefaultServiceDiscoveryNamespaceBE74D64D", - "Id" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.Service", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/name-production-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/name-production-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - }, - "name-production-virtual-node": { - "id": "name-production-virtual-node", - "path": "aws-ecs-integ/name-production-virtual-node", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-virtual-node/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualNode", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ], - "serviceDiscovery": { - "awsCloudMap": { - "namespaceName": "production", - "serviceName": { - "Fn::GetAtt": [ - "nameproductionserviceCloudmapService60E3273A", - "Name" - ] - } - } - } - }, - "virtualNodeName": "name-production" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualNode", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualNode", - "version": "0.0.0" - } - }, - "name-production-virtual-router": { - "id": "name-production-virtual-router", - "path": "aws-ecs-integ/name-production-virtual-router", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-virtual-router/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualRouter", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ] - }, - "virtualRouterName": "name-production" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualRouter", - "version": "0.0.0" - } - }, - "name-production-route": { - "id": "name-production-route", - "path": "aws-ecs-integ/name-production-virtual-router/name-production-route", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-virtual-router/name-production-route/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::Route", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "spec": { - "httpRoute": { - "action": { - "weightedTargets": [ - { - "virtualNode": { - "Fn::GetAtt": [ - "nameproductionvirtualnodeC78443D9", - "VirtualNodeName" - ] - }, - "weight": 1 - } - ] - }, - "match": { - "prefix": "/" - } - } - }, - "virtualRouterName": { - "Fn::GetAtt": [ - "nameproductionvirtualrouter00E3366D", - "VirtualRouterName" - ] - }, - "routeName": "name-production-route" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.Route", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualRouter", - "version": "0.0.0" - } - }, - "name-production-virtual-service": { - "id": "name-production-virtual-service", - "path": "aws-ecs-integ/name-production-virtual-service", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-production-virtual-service/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualService", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "productionmeshB6E81744", - "MeshName" - ] - }, - "spec": { - "provider": { - "virtualRouter": { - "virtualRouterName": { - "Fn::GetAtt": [ - "nameproductionvirtualrouter00E3366D", - "VirtualRouterName" - ] - } - } - } - }, - "virtualServiceName": "name-production.production" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualService", - "version": "0.0.0" - } - }, - "name-development": { - "id": "name-development", - "path": "aws-ecs-integ/name-development", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "name-development-task-definition": { - "id": "name-development-task-definition", - "path": "aws-ecs-integ/name-development-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/name-development-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 1024, - "dependsOn": [ - { - "containerName": "envoy", - "condition": "HEALTHY" - } - ], - "essential": true, - "image": "nathanpeck/name", - "memory": 2048, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "namedevelopmentlogs108670CC" - }, - "awslogs-stream-prefix": "name-development", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - } - ] - }, - { - "essential": true, - "image": { - "Fn::Join": [ - "", - [ - { - "Fn::FindInMap": [ - "namedevelopmentenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/aws-appmesh-envoy:v1.15.1.0-prod" - ] - ] - }, - "memoryReservation": 128, - "name": "envoy", - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "user": "1337", - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6" - }, - "awslogs-stream-prefix": "envoy", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "APPMESH_VIRTUAL_NODE_NAME", - "value": { - "Fn::Join": [ - "", - [ - "mesh/", - { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "/virtualNode/name-development" - ] - ] - } - }, - { - "name": "AWS_REGION", - "value": { - "Ref": "AWS::Region" - } - }, - { - "name": "ENABLE_ENVOY_STATS_TAGS", - "value": "1" - }, - { - "name": "ENABLE_ENVOY_DOG_STATSD", - "value": "1" - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -s http://localhost:9901/server_info | grep state | grep -q LIVE" - ], - "interval": 5, - "retries": 3, - "startPeriod": 10, - "timeout": 2 - } - } - ], - "cpu": "1024", - "executionRoleArn": { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionExecutionRole48B53E4E", - "Arn" - ] - }, - "family": "awsecsintegnamedevelopmenttaskdefinitionC3797E10", - "memory": "2048", - "networkMode": "awsvpc", - "proxyConfiguration": { - "containerName": "envoy", - "proxyConfigurationProperties": [ - { - "name": "AppPorts", - "value": "80" - }, - { - "name": "ProxyEgressPort", - "value": "15001" - }, - { - "name": "ProxyIngressPort", - "value": "15000" - }, - { - "name": "IgnoredUID", - "value": "1337" - }, - { - "name": "IgnoredGID", - "value": "1338" - }, - { - "name": "EgressIgnoredIPs", - "value": "169.254.170.2,169.254.169.254" - } - ], - "type": "APPMESH" - }, - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionTaskRole66A85BBB", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/name-development-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/name-development-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/name-development-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "namedevelopmentlogs108670CC", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "namedevelopmenttaskdefinitionenvoyLogGroupF8FCAFD6", - "Arn" - ] - } - ] - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ecr:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Fn::FindInMap": [ - "namedevelopmentenvoyimageaccountmapping", - { - "Ref": "AWS::Region" - }, - "ecrRepo" - ] - }, - ":repository/aws-appmesh-envoy" - ] - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "namedevelopmenttaskdefinitionExecutionRoleDefaultPolicy34EAA008", - "roles": [ - { - "Ref": "namedevelopmenttaskdefinitionExecutionRole48B53E4E" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "envoy": { - "id": "envoy", - "path": "aws-ecs-integ/name-development-task-definition/envoy", - "children": { - "LogGroup": { - "id": "LogGroup", - "path": "aws-ecs-integ/name-development-task-definition/envoy/LogGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-task-definition/envoy/LogGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "name-development-logs": { - "id": "name-development-logs", - "path": "aws-ecs-integ/name-development-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "name-development-logs", - "retentionInDays": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "name-development-envoy-image-account-mapping": { - "id": "name-development-envoy-image-account-mapping", - "path": "aws-ecs-integ/name-development-envoy-image-account-mapping", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnMapping", - "version": "0.0.0" - } - }, - "name-development-envoy-repo": { - "id": "name-development-envoy-repo", - "path": "aws-ecs-integ/name-development-envoy-repo", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecr.RepositoryBase", - "version": "0.0.0" - } - }, - "name-development-envoy-to-appmesh": { - "id": "name-development-envoy-to-appmesh", - "path": "aws-ecs-integ/name-development-envoy-to-appmesh", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-envoy-to-appmesh/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "appmesh:StreamAggregatedResources", - "Effect": "Allow", - "Resource": { - "Ref": "developmentmeshCEC28AFE" - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "namedevelopmentenvoytoappmesh45FF08AA", - "roles": [ - { - "Ref": "namedevelopmenttaskdefinitionTaskRole66A85BBB" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - }, - "name-development-service": { - "id": "name-development-service", - "path": "aws-ecs-integ/name-development-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/name-development-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "developmentenvironmentcluster1B64BE8B" - }, - "deploymentConfiguration": { - "maximumPercent": 200, - "minimumHealthyPercent": 100 - }, - "desiredCount": 1, - "enableEcsManagedTags": false, - "launchType": "FARGATE", - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Ref": "developmentenvironmentvpcPrivateSubnet1SubnetAAECD171" - }, - { - "Ref": "developmentenvironmentvpcPrivateSubnet2Subnet20C1C37D" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "namedevelopmentserviceSecurityGroupE2ECED97", - "GroupId" - ] - } - ] - } - }, - "serviceRegistries": [ - { - "registryArn": { - "Fn::GetAtt": [ - "namedevelopmentserviceCloudmapService63674467", - "Arn" - ] - } - } - ], - "taskDefinition": { - "Ref": "namedevelopmenttaskdefinition0468FBFF" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "CloudmapService": { - "id": "CloudmapService", - "path": "aws-ecs-integ/name-development-service/CloudmapService", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-service/CloudmapService/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ServiceDiscovery::Service", - "aws:cdk:cloudformation:props": { - "dnsConfig": { - "dnsRecords": [ - { - "type": "A", - "ttl": 10 - } - ], - "namespaceId": { - "Fn::GetAtt": [ - "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767", - "Id" - ] - }, - "routingPolicy": "MULTIVALUE" - }, - "healthCheckCustomConfig": { - "failureThreshold": 2 - }, - "name": "name-development", - "namespaceId": { - "Fn::GetAtt": [ - "developmentenvironmentclusterDefaultServiceDiscoveryNamespace0F234767", - "Id" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.CfnService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-servicediscovery.Service", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/name-development-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/name-development-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "developmentenvironmentvpcCB4216A4" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - }, - "name-development-virtual-node": { - "id": "name-development-virtual-node", - "path": "aws-ecs-integ/name-development-virtual-node", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-virtual-node/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualNode", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ], - "serviceDiscovery": { - "awsCloudMap": { - "namespaceName": "development", - "serviceName": { - "Fn::GetAtt": [ - "namedevelopmentserviceCloudmapService63674467", - "Name" - ] - } - } - } - }, - "virtualNodeName": "name-development" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualNode", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualNode", - "version": "0.0.0" - } - }, - "name-development-virtual-router": { - "id": "name-development-virtual-router", - "path": "aws-ecs-integ/name-development-virtual-router", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-virtual-router/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualRouter", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "spec": { - "listeners": [ - { - "portMapping": { - "port": 80, - "protocol": "http" - } - } - ] - }, - "virtualRouterName": "name-development" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualRouter", - "version": "0.0.0" - } - }, - "name-development-route": { - "id": "name-development-route", - "path": "aws-ecs-integ/name-development-virtual-router/name-development-route", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-virtual-router/name-development-route/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::Route", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "spec": { - "httpRoute": { - "action": { - "weightedTargets": [ - { - "virtualNode": { - "Fn::GetAtt": [ - "namedevelopmentvirtualnode55118E80", - "VirtualNodeName" - ] - }, - "weight": 1 - } - ] - }, - "match": { - "prefix": "/" - } - } - }, - "virtualRouterName": { - "Fn::GetAtt": [ - "namedevelopmentvirtualrouter0AE5105D", - "VirtualRouterName" - ] - }, - "routeName": "name-development-route" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.Route", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualRouter", - "version": "0.0.0" - } - }, - "name-development-virtual-service": { - "id": "name-development-virtual-service", - "path": "aws-ecs-integ/name-development-virtual-service", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/name-development-virtual-service/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AppMesh::VirtualService", - "aws:cdk:cloudformation:props": { - "meshName": { - "Fn::GetAtt": [ - "developmentmeshCEC28AFE", - "MeshName" - ] - }, - "spec": { - "provider": { - "virtualRouter": { - "virtualRouterName": { - "Fn::GetAtt": [ - "namedevelopmentvirtualrouter0AE5105D", - "VirtualRouterName" - ] - } - } - } - }, - "virtualServiceName": "name-development.development" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.CfnVirtualService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-appmesh.VirtualService", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/asset.a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/index.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/asset.a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/index.py deleted file mode 100644 index d24454171e478..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/asset.a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/index.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -import boto3 -from queue_backlog_calculator import QueueHandler - -def queue_handler(event, context): - """ - Handler for the lambda trigger - """ - - ecs = boto3.client('ecs') - sqs = boto3.client('sqs') - - queue_handler = QueueHandler(ecs_client=ecs, sqs_client=sqs, environ=os.environ) - - return queue_handler.emit() diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/asset.a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/queue_backlog_calculator.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/asset.a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/queue_backlog_calculator.py deleted file mode 100644 index 5f14d74a76bd2..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/asset.a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/queue_backlog_calculator.py +++ /dev/null @@ -1,71 +0,0 @@ -from math import ceil -import time -import json - -class QueueHandler: - def __init__(self, ecs_client, sqs_client, environ): - self.ecs = ecs_client - self.sqs = sqs_client - self.cluster_name = environ['CLUSTER_NAME'] - self.service_name = environ['SERVICE_NAME'] - self.namespace = environ['NAMESPACE'] - self.queue_names = environ['QUEUE_NAMES'].split(',') - - def emit(self): - try: - running_count = self.get_running_task_count() - backlogs = [self.get_queue_backlog(queue_name, running_count) for queue_name in self.queue_names] - self.timestamp = int(time.time() * 1000) - for backlog in backlogs: - self.emit_backlog_per_task_metric(backlog['queueName'], backlog['backlogPerTask']) - except Exception as e: - Exception('Exception: {}'.format(e)) - - """ - Write the backlogPerTask metric to the stdout according to the Cloudwatch embedded metric format. - """ - def emit_backlog_per_task_metric(self, queue_name, backlog_per_task): - print(json.dumps({ - "_aws": { - "Timestamp": self.timestamp, - "CloudWatchMetrics": [{ - "Namespace": self.namespace, - "Dimensions": [["QueueName"]], - "Metrics": [{"Name":"BacklogPerTask", "Unit": "Count"}] - }], - }, - "QueueName": queue_name, - "BacklogPerTask": backlog_per_task, - })) - - """ - Get the number of tasks in the 'RUNNING' state for the service 'service_name'. - """ - def get_running_task_count(self): - service_desc = self.ecs.describe_services( - cluster=self.cluster_name, - services=[self.service_name], - ) - if len(service_desc['services']) == 0: - raise Exception('There are no services with name {} in cluster: {}'.format(self.service_name, self.cluster_name)) - return service_desc['services'][0].get('runningCount', 0) - - """ - This method calculates and returns the backlogPerTask metric for the given queue. - """ - def get_queue_backlog(self, queue_name, count): - queue_url = self.sqs.get_queue_url(QueueName=queue_name) - running_count = 1 if count == 0 else count - - def get_backlog_per_task(): - queue_attributes = self.sqs.get_queue_attributes( - QueueUrl=queue_url['QueueUrl'], - AttributeNames=['ApproximateNumberOfMessages'] - ) - num_of_msgs = int(queue_attributes['Attributes'].get('ApproximateNumberOfMessages', 0)) - return ceil(num_of_msgs/running_count) - - return { - 'queueName': queue_name, - 'backlogPerTask': get_backlog_per_task() - } \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/aws-ecs-integ.assets.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/aws-ecs-integ.assets.json deleted file mode 100644 index 17514323e1e87..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/aws-ecs-integ.assets.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "20.0.0", - "files": { - "a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91": { - "source": { - "path": "asset.a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "7bed77928bc4f184a8e1345e4025a6fc29d609cf88bd752874e21f4e42d98071": { - "source": { - "path": "aws-ecs-integ.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7bed77928bc4f184a8e1345e4025a6fc29d609cf88bd752874e21f4e42d98071.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/aws-ecs-integ.template.json deleted file mode 100644 index f46f9b625f469..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/aws-ecs-integ.template.json +++ /dev/null @@ -1,1349 +0,0 @@ -{ - "Resources": { - "productionenvironmentvpcAEB47DF7": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1Subnet8D92C089": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet1EIP54BA88DB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D", - "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374" - ] - }, - "productionenvironmentvpcPublicSubnet2Subnet298E6C31": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.64.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTable842A68D7": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - }, - "DependsOn": [ - "productionenvironmentvpcVPCGW1B428D07" - ] - }, - "productionenvironmentvpcPublicSubnet2EIP14CA46AA": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "AllocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D", - "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - ] - }, - "productionenvironmentvpcPrivateSubnet1Subnet53F632E6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "productionenvironmentvpcPrivateSubnet2Subnet756FB93C": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.192.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "SubnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "productionenvironmentvpcIGWE7C39890": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "productionenvironmentvpcVPCGW1B428D07": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "InternetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "productionenvironmentclusterC6599D2D": { - "Type": "AWS::ECS::Cluster" - }, - "signupD2AAA171": { - "Type": "AWS::SNS::Topic" - }, - "delete1CCE71FF": { - "Type": "AWS::SNS::Topic" - }, - "PublishertaskdefinitionTaskRoleE8655AA5": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "PublishertaskdefinitionTaskRoleDefaultPolicyD6E49F15": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sns:Publish", - "Effect": "Allow", - "Resource": [ - { - "Ref": "delete1CCE71FF" - }, - { - "Ref": "signupD2AAA171" - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "PublishertaskdefinitionTaskRoleDefaultPolicyD6E49F15", - "Roles": [ - { - "Ref": "PublishertaskdefinitionTaskRoleE8655AA5" - } - ] - } - }, - "PublishertaskdefinitionA4324C64": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 256, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - }, - { - "Name": "SIGN-UP_TOPIC_ARN", - "Value": { - "Ref": "signupD2AAA171" - } - }, - { - "Name": "DELETE_TOPIC_ARN", - "Value": { - "Ref": "delete1CCE71FF" - } - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "PublisherlogsDF0C1067" - }, - "awslogs-stream-prefix": "Publisher", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 512, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "256", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "PublishertaskdefinitionExecutionRole5C00C542", - "Arn" - ] - }, - "Family": "awsecsintegPublishertaskdefinitionD50610D0", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "PublishertaskdefinitionTaskRoleE8655AA5", - "Arn" - ] - } - } - }, - "PublishertaskdefinitionExecutionRole5C00C542": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "PublishertaskdefinitionExecutionRoleDefaultPolicy681FD8E6": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "PublisherlogsDF0C1067", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "PublishertaskdefinitionExecutionRoleDefaultPolicy681FD8E6", - "Roles": [ - { - "Ref": "PublishertaskdefinitionExecutionRole5C00C542" - } - ] - } - }, - "PublisherlogsDF0C1067": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "Publisher-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "PublisherserviceService9EB00F60": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "DesiredCount": 1, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "PublisherserviceSecurityGroupC7B0C0D0", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ] - } - }, - "TaskDefinition": { - "Ref": "PublishertaskdefinitionA4324C64" - } - } - }, - "PublisherserviceSecurityGroupC7B0C0D0": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/Publisher-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "signupqueue33AFF2E6": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "signupqueuePolicy185ADC00": { - "Type": "AWS::SQS::QueuePolicy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Ref": "signupD2AAA171" - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "sns.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "Queues": [ - { - "Ref": "signupqueue33AFF2E6" - } - ] - } - }, - "signupqueueawsecsintegsignup8DE00B29CE828029": { - "Type": "AWS::SNS::Subscription", - "Properties": { - "Protocol": "sqs", - "TopicArn": { - "Ref": "signupD2AAA171" - }, - "Endpoint": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - } - }, - "EventsDeadLetterQueue404572C7": { - "Type": "AWS::SQS::Queue", - "Properties": { - "MessageRetentionPeriod": 1209600 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EventsQueueB96EB0D2": { - "Type": "AWS::SQS::Queue", - "Properties": { - "RedrivePolicy": { - "deadLetterTargetArn": { - "Fn::GetAtt": [ - "EventsDeadLetterQueue404572C7", - "Arn" - ] - }, - "maxReceiveCount": 3 - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EventsQueuePolicyF3E925EC": { - "Type": "AWS::SQS::QueuePolicy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Ref": "delete1CCE71FF" - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "sns.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "Queues": [ - { - "Ref": "EventsQueueB96EB0D2" - } - ] - } - }, - "EventsQueueawsecsintegdeleteF56807768162F4C0": { - "Type": "AWS::SNS::Subscription", - "Properties": { - "Protocol": "sqs", - "TopicArn": { - "Ref": "delete1CCE71FF" - }, - "Endpoint": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - } - } - }, - "WorkertaskdefinitionTaskRole1EBF20D6": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "WorkertaskdefinitionTaskRoleDefaultPolicy45EAFD8C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "sqs:ChangeMessageVisibility", - "sqs:DeleteMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:ReceiveMessage" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "WorkertaskdefinitionTaskRoleDefaultPolicy45EAFD8C", - "Roles": [ - { - "Ref": "WorkertaskdefinitionTaskRole1EBF20D6" - } - ] - } - }, - "WorkertaskdefinitionBF93A675": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Cpu": 256, - "Environment": [ - { - "Name": "PORT", - "Value": "80" - }, - { - "Name": "WORKER_QUEUE_URI", - "Value": { - "Ref": "EventsQueueB96EB0D2" - } - } - ], - "Essential": true, - "Image": "nathanpeck/name", - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "Workerlogs2994AC4D" - }, - "awslogs-stream-prefix": "Worker", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 512, - "Name": "app", - "PortMappings": [ - { - "ContainerPort": 80, - "Protocol": "tcp" - } - ], - "Ulimits": [ - { - "HardLimit": 1024000, - "Name": "nofile", - "SoftLimit": 1024000 - } - ] - } - ], - "Cpu": "256", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "WorkertaskdefinitionExecutionRole3C1A1848", - "Arn" - ] - }, - "Family": "awsecsintegWorkertaskdefinition32B60762", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "WorkertaskdefinitionTaskRole1EBF20D6", - "Arn" - ] - } - } - }, - "WorkertaskdefinitionExecutionRole3C1A1848": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "WorkertaskdefinitionExecutionRoleDefaultPolicy6E199B19": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Workerlogs2994AC4D", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "WorkertaskdefinitionExecutionRoleDefaultPolicy6E199B19", - "Roles": [ - { - "Ref": "WorkertaskdefinitionExecutionRole3C1A1848" - } - ] - } - }, - "Workerlogs2994AC4D": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "Worker-logs", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "WorkerserviceService68C5A5C3": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "DeploymentConfiguration": { - "MaximumPercent": 200, - "MinimumHealthyPercent": 100 - }, - "EnableECSManagedTags": false, - "LaunchType": "FARGATE", - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "DISABLED", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "WorkerserviceSecurityGroup1CDDB904", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ] - } - }, - "TaskDefinition": { - "Ref": "WorkertaskdefinitionBF93A675" - } - } - }, - "WorkerserviceSecurityGroup1CDDB904": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ/Worker-service/SecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "WorkerserviceTaskCountTarget6636D808": { - "Type": "AWS::ApplicationAutoScaling::ScalableTarget", - "Properties": { - "MaxCapacity": 10, - "MinCapacity": 1, - "ResourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "WorkerserviceService68C5A5C3", - "Name" - ] - } - ] - ] - }, - "RoleARN": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "ScalableDimension": "ecs:service:DesiredCount", - "ServiceNamespace": "ecs" - } - }, - "WorkerserviceTaskCountTargetEventsQueueautoscalingpolicyD12B62ED": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsintegWorkerserviceTaskCountTargetEventsQueueautoscalingpolicyDBD40B57", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "WorkerserviceTaskCountTarget6636D808" - }, - "TargetTrackingScalingPolicyConfiguration": { - "CustomizedMetricSpecification": { - "Dimensions": [ - { - "Name": "QueueName", - "Value": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "QueueName" - ] - } - } - ], - "MetricName": "BacklogPerTask", - "Namespace": "production-Worker", - "Statistic": "Average", - "Unit": "Count" - }, - "TargetValue": 15 - } - } - }, - "WorkerserviceTaskCountTargetsignupqueueautoscalingpolicyB7321DB7": { - "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "Properties": { - "PolicyName": "awsecsintegWorkerserviceTaskCountTargetsignupqueueautoscalingpolicyDF93FC37", - "PolicyType": "TargetTrackingScaling", - "ScalingTargetId": { - "Ref": "WorkerserviceTaskCountTarget6636D808" - }, - "TargetTrackingScalingPolicyConfiguration": { - "CustomizedMetricSpecification": { - "Dimensions": [ - { - "Name": "QueueName", - "Value": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "QueueName" - ] - } - } - ], - "MetricName": "BacklogPerTask", - "Namespace": "production-Worker", - "Statistic": "Average", - "Unit": "Count" - }, - "TargetValue": 30 - } - } - }, - "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "BackLogPerTaskCalculatorFunctionServiceRoleDefaultPolicyB6B10266": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "ecs:DescribeServices", - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": { - "Ref": "WorkerserviceService68C5A5C3" - } - }, - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "BackLogPerTaskCalculatorFunctionServiceRoleDefaultPolicyB6B10266", - "Roles": [ - { - "Ref": "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4" - } - ] - } - }, - "BackLogPerTaskCalculatorFunction95AA21D5": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3Bucket1FFDEA8D" - }, - "S3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B" - } - ] - } - ] - } - ] - ] - } - }, - "Role": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4", - "Arn" - ] - }, - "Environment": { - "Variables": { - "CLUSTER_NAME": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "SERVICE_NAME": { - "Fn::GetAtt": [ - "WorkerserviceService68C5A5C3", - "Name" - ] - }, - "NAMESPACE": "production-Worker", - "QUEUE_NAMES": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "QueueName" - ] - }, - ",", - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "QueueName" - ] - } - ] - ] - } - } - }, - "Handler": "index.queue_handler", - "Runtime": "python3.9" - }, - "DependsOn": [ - "BackLogPerTaskCalculatorFunctionServiceRoleDefaultPolicyB6B10266", - "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4" - ] - }, - "BacklogPerTaskScheduledRuleB871DD15": { - "Type": "AWS::Events::Rule", - "Properties": { - "ScheduleExpression": "rate(1 minute)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunction95AA21D5", - "Arn" - ] - }, - "Id": "Target0" - } - ] - } - }, - "BacklogPerTaskScheduledRuleAllowEventRuleawsecsintegBackLogPerTaskCalculatorFunctionEB2B91C7CCD725BB": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunction95AA21D5", - "Arn" - ] - }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": [ - "BacklogPerTaskScheduledRuleB871DD15", - "Arn" - ] - } - } - }, - "WorkerBackLogPerTaskCalculatorLogsA4B5AF42": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": { - "Fn::Join": [ - "", - [ - "/aws/lambda/", - { - "Ref": "BackLogPerTaskCalculatorFunction95AA21D5" - } - ] - ] - }, - "RetentionInDays": 3 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - } - }, - "Parameters": { - "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3Bucket1FFDEA8D": { - "Type": "String", - "Description": "S3 bucket for asset \"a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91\"" - }, - "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B": { - "Type": "String", - "Description": "S3 key for asset version \"a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91\"" - }, - "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91ArtifactHashC1953821": { - "Type": "String", - "Description": "Artifact hash for asset \"a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91\"" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/cdk.out b/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/cdk.out deleted file mode 100644 index 588d7b269d34f..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/integ.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/integ.json deleted file mode 100644 index bff18dd3c507a..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/integ.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "20.0.0", - "testCases": { - "integ.publish-subscribe": { - "stacks": [ - "aws-ecs-integ" - ], - "diffAssets": false, - "stackUpdateWorkflow": true - } - }, - "synthContext": {}, - "enableLookups": false -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/manifest.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/manifest.json deleted file mode 100644 index ea9a28cc5a1ec..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/manifest.json +++ /dev/null @@ -1,402 +0,0 @@ -{ - "version": "20.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "aws-ecs-integ": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "aws-ecs-integ.template.json", - "validateOnSynth": false - }, - "metadata": { - "/aws-ecs-integ": [ - { - "type": "aws:cdk:asset", - "data": { - "path": "asset.a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91", - "id": "a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91", - "packaging": "zip", - "sourceHash": "a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91", - "s3BucketParameter": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3Bucket1FFDEA8D", - "s3KeyParameter": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B", - "artifactHashParameter": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91ArtifactHashC1953821" - } - } - ], - "/aws-ecs-integ/production-environment-vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcAEB47DF7" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1RouteTableAssociationA8117374" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1DefaultRoute524C894D" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1EIP54BA88DB" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2RouteTableAssociation0A7549F3" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2DefaultRoute92CD697D" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2EIP14CA46AA" - } - ], - "/aws-ecs-integ/production-environment-vpc/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1RouteTableAssociation8BA32463" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet1DefaultRouteFBB3DE6C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2RouteTableAssociation09188261" - } - ], - "/aws-ecs-integ/production-environment-vpc/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcPrivateSubnet2DefaultRoute5F9AB6C1" - } - ], - "/aws-ecs-integ/production-environment-vpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcIGWE7C39890" - } - ], - "/aws-ecs-integ/production-environment-vpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentvpcVPCGW1B428D07" - } - ], - "/aws-ecs-integ/production-environment-cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "productionenvironmentclusterC6599D2D" - } - ], - "/aws-ecs-integ/sign-up/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "signupD2AAA171" - } - ], - "/aws-ecs-integ/delete/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "delete1CCE71FF" - } - ], - "/aws-ecs-integ/Publisher-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PublishertaskdefinitionTaskRoleE8655AA5" - } - ], - "/aws-ecs-integ/Publisher-task-definition/TaskRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PublishertaskdefinitionTaskRoleDefaultPolicyD6E49F15" - } - ], - "/aws-ecs-integ/Publisher-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PublishertaskdefinitionA4324C64" - } - ], - "/aws-ecs-integ/Publisher-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PublishertaskdefinitionExecutionRole5C00C542" - } - ], - "/aws-ecs-integ/Publisher-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PublishertaskdefinitionExecutionRoleDefaultPolicy681FD8E6" - } - ], - "/aws-ecs-integ/Publisher-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PublisherlogsDF0C1067" - } - ], - "/aws-ecs-integ/Publisher-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "PublisherserviceService9EB00F60" - } - ], - "/aws-ecs-integ/Publisher-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PublisherserviceSecurityGroupC7B0C0D0" - } - ], - "/aws-ecs-integ/sign-up-queue/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "signupqueue33AFF2E6" - } - ], - "/aws-ecs-integ/sign-up-queue/Policy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "signupqueuePolicy185ADC00" - } - ], - "/aws-ecs-integ/sign-up-queue/awsecsintegsignup8DE00B29/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "signupqueueawsecsintegsignup8DE00B29CE828029" - } - ], - "/aws-ecs-integ/EventsDeadLetterQueue/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "EventsDeadLetterQueue404572C7" - } - ], - "/aws-ecs-integ/EventsQueue/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "EventsQueueB96EB0D2" - } - ], - "/aws-ecs-integ/EventsQueue/Policy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "EventsQueuePolicyF3E925EC" - } - ], - "/aws-ecs-integ/EventsQueue/awsecsintegdeleteF5680776/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "EventsQueueawsecsintegdeleteF56807768162F4C0" - } - ], - "/aws-ecs-integ/Worker-task-definition/TaskRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkertaskdefinitionTaskRole1EBF20D6" - } - ], - "/aws-ecs-integ/Worker-task-definition/TaskRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkertaskdefinitionTaskRoleDefaultPolicy45EAFD8C" - } - ], - "/aws-ecs-integ/Worker-task-definition/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkertaskdefinitionBF93A675" - } - ], - "/aws-ecs-integ/Worker-task-definition/ExecutionRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkertaskdefinitionExecutionRole3C1A1848" - } - ], - "/aws-ecs-integ/Worker-task-definition/ExecutionRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkertaskdefinitionExecutionRoleDefaultPolicy6E199B19" - } - ], - "/aws-ecs-integ/Worker-logs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Workerlogs2994AC4D" - } - ], - "/aws-ecs-integ/Worker-service/Service": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkerserviceService68C5A5C3" - } - ], - "/aws-ecs-integ/Worker-service/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkerserviceSecurityGroup1CDDB904" - } - ], - "/aws-ecs-integ/Worker-service/TaskCount/Target/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkerserviceTaskCountTarget6636D808" - } - ], - "/aws-ecs-integ/Worker-service/TaskCount/Target/EventsQueue-autoscaling-policy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkerserviceTaskCountTargetEventsQueueautoscalingpolicyD12B62ED" - } - ], - "/aws-ecs-integ/Worker-service/TaskCount/Target/sign-up-queue-autoscaling-policy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkerserviceTaskCountTargetsignupqueueautoscalingpolicyB7321DB7" - } - ], - "/aws-ecs-integ/BackLogPerTaskCalculatorFunction/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4" - } - ], - "/aws-ecs-integ/BackLogPerTaskCalculatorFunction/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "BackLogPerTaskCalculatorFunctionServiceRoleDefaultPolicyB6B10266" - } - ], - "/aws-ecs-integ/BackLogPerTaskCalculatorFunction/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "BackLogPerTaskCalculatorFunction95AA21D5" - } - ], - "/aws-ecs-integ/AssetParameters/a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/S3Bucket": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3Bucket1FFDEA8D" - } - ], - "/aws-ecs-integ/AssetParameters/a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/S3VersionKey": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B" - } - ], - "/aws-ecs-integ/AssetParameters/a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/ArtifactHash": [ - { - "type": "aws:cdk:logicalId", - "data": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91ArtifactHashC1953821" - } - ], - "/aws-ecs-integ/BacklogPerTaskScheduledRule/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "BacklogPerTaskScheduledRuleB871DD15" - } - ], - "/aws-ecs-integ/BacklogPerTaskScheduledRule/AllowEventRuleawsecsintegBackLogPerTaskCalculatorFunctionEB2B91C7": [ - { - "type": "aws:cdk:logicalId", - "data": "BacklogPerTaskScheduledRuleAllowEventRuleawsecsintegBackLogPerTaskCalculatorFunctionEB2B91C7CCD725BB" - } - ], - "/aws-ecs-integ/Worker-BackLogPerTaskCalculatorLogs/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "WorkerBackLogPerTaskCalculatorLogsA4B5AF42" - } - ] - }, - "displayName": "aws-ecs-integ" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/tree.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/tree.json deleted file mode 100644 index 444bf4b24fee4..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/publish-subscribe.integ.snapshot/tree.json +++ /dev/null @@ -1,2350 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "aws-ecs-integ": { - "id": "aws-ecs-integ", - "path": "aws-ecs-integ", - "children": { - "production": { - "id": "production", - "path": "aws-ecs-integ/production", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "production-environment-vpc": { - "id": "production-environment-vpc", - "path": "aws-ecs-integ/production-environment-vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet1RouteTable6E9ABC21" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089" - }, - "allocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet1EIP54BA88DB", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.64.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPublicSubnet2RouteTable842A68D7" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ/production-environment-vpc/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31" - }, - "allocationId": { - "Fn::GetAtt": [ - "productionenvironmentvpcPublicSubnet2EIP14CA46AA", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet1RouteTable2C6DFF0C" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet1NATGateway6075E4CA" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.192.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "subnetId": { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ/production-environment-vpc/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "productionenvironmentvpcPrivateSubnet2RouteTable2F77D0D2" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "aws-ecs-integ/production-environment-vpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ/production-environment-vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "aws-ecs-integ/production-environment-vpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - }, - "internetGatewayId": { - "Ref": "productionenvironmentvpcIGWE7C39890" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "production-environment-cluster": { - "id": "production-environment-cluster", - "path": "aws-ecs-integ/production-environment-cluster", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/production-environment-cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnCluster", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.Cluster", - "version": "0.0.0" - } - }, - "sign-up": { - "id": "sign-up", - "path": "aws-ecs-integ/sign-up", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/sign-up/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SNS::Topic", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sns.CfnTopic", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sns.Topic", - "version": "0.0.0" - } - }, - "delete": { - "id": "delete", - "path": "aws-ecs-integ/delete", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/delete/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SNS::Topic", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sns.CfnTopic", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sns.Topic", - "version": "0.0.0" - } - }, - "Publisher": { - "id": "Publisher", - "path": "aws-ecs-integ/Publisher", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "Publisher-task-definition": { - "id": "Publisher-task-definition", - "path": "aws-ecs-integ/Publisher-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/Publisher-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Publisher-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/Publisher-task-definition/TaskRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Publisher-task-definition/TaskRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "sns:Publish", - "Effect": "Allow", - "Resource": [ - { - "Ref": "delete1CCE71FF" - }, - { - "Ref": "signupD2AAA171" - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "PublishertaskdefinitionTaskRoleDefaultPolicyD6E49F15", - "roles": [ - { - "Ref": "PublishertaskdefinitionTaskRoleE8655AA5" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Publisher-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 256, - "essential": true, - "image": "nathanpeck/name", - "memory": 512, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "PublisherlogsDF0C1067" - }, - "awslogs-stream-prefix": "Publisher", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - }, - { - "name": "SIGN-UP_TOPIC_ARN", - "value": { - "Ref": "signupD2AAA171" - } - }, - { - "name": "DELETE_TOPIC_ARN", - "value": { - "Ref": "delete1CCE71FF" - } - } - ] - } - ], - "cpu": "256", - "executionRoleArn": { - "Fn::GetAtt": [ - "PublishertaskdefinitionExecutionRole5C00C542", - "Arn" - ] - }, - "family": "awsecsintegPublishertaskdefinitionD50610D0", - "memory": "512", - "networkMode": "awsvpc", - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "PublishertaskdefinitionTaskRoleE8655AA5", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/Publisher-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/Publisher-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Publisher-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/Publisher-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Publisher-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "PublisherlogsDF0C1067", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "PublishertaskdefinitionExecutionRoleDefaultPolicy681FD8E6", - "roles": [ - { - "Ref": "PublishertaskdefinitionExecutionRole5C00C542" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "Publisher-logs": { - "id": "Publisher-logs", - "path": "aws-ecs-integ/Publisher-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Publisher-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "Publisher-logs", - "retentionInDays": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "Publisher-service": { - "id": "Publisher-service", - "path": "aws-ecs-integ/Publisher-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/Publisher-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "deploymentConfiguration": { - "maximumPercent": 200, - "minimumHealthyPercent": 100 - }, - "desiredCount": 1, - "enableEcsManagedTags": false, - "launchType": "FARGATE", - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "PublisherserviceSecurityGroupC7B0C0D0", - "GroupId" - ] - } - ] - } - }, - "taskDefinition": { - "Ref": "PublishertaskdefinitionA4324C64" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/Publisher-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Publisher-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/Publisher-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - }, - "sign-up-queue": { - "id": "sign-up-queue", - "path": "aws-ecs-integ/sign-up-queue", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/sign-up-queue/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SQS::Queue", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.CfnQueue", - "version": "0.0.0" - } - }, - "Policy": { - "id": "Policy", - "path": "aws-ecs-integ/sign-up-queue/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/sign-up-queue/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SQS::QueuePolicy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Ref": "signupD2AAA171" - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "sns.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "queues": [ - { - "Ref": "signupqueue33AFF2E6" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.CfnQueuePolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.QueuePolicy", - "version": "0.0.0" - } - }, - "awsecsintegsignup8DE00B29": { - "id": "awsecsintegsignup8DE00B29", - "path": "aws-ecs-integ/sign-up-queue/awsecsintegsignup8DE00B29", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/sign-up-queue/awsecsintegsignup8DE00B29/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", - "aws:cdk:cloudformation:props": { - "protocol": "sqs", - "topicArn": { - "Ref": "signupD2AAA171" - }, - "endpoint": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sns.CfnSubscription", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sns.Subscription", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.Queue", - "version": "0.0.0" - } - }, - "Worker": { - "id": "Worker", - "path": "aws-ecs-integ/Worker", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "EventsDeadLetterQueue": { - "id": "EventsDeadLetterQueue", - "path": "aws-ecs-integ/EventsDeadLetterQueue", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/EventsDeadLetterQueue/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SQS::Queue", - "aws:cdk:cloudformation:props": { - "messageRetentionPeriod": 1209600 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.CfnQueue", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.Queue", - "version": "0.0.0" - } - }, - "EventsQueue": { - "id": "EventsQueue", - "path": "aws-ecs-integ/EventsQueue", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/EventsQueue/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SQS::Queue", - "aws:cdk:cloudformation:props": { - "redrivePolicy": { - "deadLetterTargetArn": { - "Fn::GetAtt": [ - "EventsDeadLetterQueue404572C7", - "Arn" - ] - }, - "maxReceiveCount": 3 - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.CfnQueue", - "version": "0.0.0" - } - }, - "Policy": { - "id": "Policy", - "path": "aws-ecs-integ/EventsQueue/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/EventsQueue/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SQS::QueuePolicy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Condition": { - "ArnEquals": { - "aws:SourceArn": { - "Ref": "delete1CCE71FF" - } - } - }, - "Effect": "Allow", - "Principal": { - "Service": "sns.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "queues": [ - { - "Ref": "EventsQueueB96EB0D2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.CfnQueuePolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.QueuePolicy", - "version": "0.0.0" - } - }, - "awsecsintegdeleteF5680776": { - "id": "awsecsintegdeleteF5680776", - "path": "aws-ecs-integ/EventsQueue/awsecsintegdeleteF5680776", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/EventsQueue/awsecsintegdeleteF5680776/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", - "aws:cdk:cloudformation:props": { - "protocol": "sqs", - "topicArn": { - "Ref": "delete1CCE71FF" - }, - "endpoint": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sns.CfnSubscription", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sns.Subscription", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-sqs.Queue", - "version": "0.0.0" - } - }, - "Worker-task-definition": { - "id": "Worker-task-definition", - "path": "aws-ecs-integ/Worker-task-definition", - "children": { - "TaskRole": { - "id": "TaskRole", - "path": "aws-ecs-integ/Worker-task-definition/TaskRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-task-definition/TaskRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/Worker-task-definition/TaskRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-task-definition/TaskRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "sqs:ChangeMessageVisibility", - "sqs:DeleteMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", - "sqs:ReceiveMessage" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "WorkertaskdefinitionTaskRoleDefaultPolicy45EAFD8C", - "roles": [ - { - "Ref": "WorkertaskdefinitionTaskRole1EBF20D6" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-task-definition/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", - "aws:cdk:cloudformation:props": { - "containerDefinitions": [ - { - "cpu": 256, - "essential": true, - "image": "nathanpeck/name", - "memory": 512, - "name": "app", - "portMappings": [ - { - "containerPort": 80, - "protocol": "tcp" - } - ], - "ulimits": [ - { - "name": "nofile", - "softLimit": 1024000, - "hardLimit": 1024000 - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": { - "Ref": "Workerlogs2994AC4D" - }, - "awslogs-stream-prefix": "Worker", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "environment": [ - { - "name": "PORT", - "value": "80" - }, - { - "name": "WORKER_QUEUE_URI", - "value": { - "Ref": "EventsQueueB96EB0D2" - } - } - ] - } - ], - "cpu": "256", - "executionRoleArn": { - "Fn::GetAtt": [ - "WorkertaskdefinitionExecutionRole3C1A1848", - "Arn" - ] - }, - "family": "awsecsintegWorkertaskdefinition32B60762", - "memory": "512", - "networkMode": "awsvpc", - "requiresCompatibilities": [ - "EC2", - "FARGATE" - ], - "taskRoleArn": { - "Fn::GetAtt": [ - "WorkertaskdefinitionTaskRole1EBF20D6", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" - } - }, - "app": { - "id": "app", - "path": "aws-ecs-integ/Worker-task-definition/app", - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" - } - }, - "ExecutionRole": { - "id": "ExecutionRole", - "path": "aws-ecs-integ/Worker-task-definition/ExecutionRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-task-definition/ExecutionRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/Worker-task-definition/ExecutionRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-task-definition/ExecutionRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Workerlogs2994AC4D", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "WorkertaskdefinitionExecutionRoleDefaultPolicy6E199B19", - "roles": [ - { - "Ref": "WorkertaskdefinitionExecutionRole3C1A1848" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.TaskDefinition", - "version": "0.0.0" - } - }, - "Worker-logs": { - "id": "Worker-logs", - "path": "aws-ecs-integ/Worker-logs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-logs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": "Worker-logs", - "retentionInDays": 30 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - }, - "Worker-service": { - "id": "Worker-service", - "path": "aws-ecs-integ/Worker-service", - "children": { - "Service": { - "id": "Service", - "path": "aws-ecs-integ/Worker-service/Service", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Service", - "aws:cdk:cloudformation:props": { - "cluster": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "deploymentConfiguration": { - "maximumPercent": 200, - "minimumHealthyPercent": 100 - }, - "enableEcsManagedTags": false, - "launchType": "FARGATE", - "networkConfiguration": { - "awsvpcConfiguration": { - "assignPublicIp": "DISABLED", - "subnets": [ - { - "Ref": "productionenvironmentvpcPrivateSubnet1Subnet53F632E6" - }, - { - "Ref": "productionenvironmentvpcPrivateSubnet2Subnet756FB93C" - } - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "WorkerserviceSecurityGroup1CDDB904", - "GroupId" - ] - } - ] - } - }, - "taskDefinition": { - "Ref": "WorkertaskdefinitionBF93A675" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnService", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-ecs-integ/Worker-service/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-service/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ/Worker-service/SecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "productionenvironmentvpcAEB47DF7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "ScalingRole": { - "id": "ScalingRole", - "path": "aws-ecs-integ/Worker-service/ScalingRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "TaskCount": { - "id": "TaskCount", - "path": "aws-ecs-integ/Worker-service/TaskCount", - "children": { - "Target": { - "id": "Target", - "path": "aws-ecs-integ/Worker-service/TaskCount/Target", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-service/TaskCount/Target/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalableTarget", - "aws:cdk:cloudformation:props": { - "maxCapacity": 10, - "minCapacity": 1, - "resourceId": { - "Fn::Join": [ - "", - [ - "service/", - { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "/", - { - "Fn::GetAtt": [ - "WorkerserviceService68C5A5C3", - "Name" - ] - } - ] - ] - }, - "roleArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" - ] - ] - }, - "scalableDimension": "ecs:service:DesiredCount", - "serviceNamespace": "ecs" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalableTarget", - "version": "0.0.0" - } - }, - "EventsQueue-autoscaling-policy": { - "id": "EventsQueue-autoscaling-policy", - "path": "aws-ecs-integ/Worker-service/TaskCount/Target/EventsQueue-autoscaling-policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-service/TaskCount/Target/EventsQueue-autoscaling-policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "aws:cdk:cloudformation:props": { - "policyName": "awsecsintegWorkerserviceTaskCountTargetEventsQueueautoscalingpolicyDBD40B57", - "policyType": "TargetTrackingScaling", - "scalingTargetId": { - "Ref": "WorkerserviceTaskCountTarget6636D808" - }, - "targetTrackingScalingPolicyConfiguration": { - "customizedMetricSpecification": { - "dimensions": [ - { - "name": "QueueName", - "value": { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "QueueName" - ] - } - } - ], - "metricName": "BacklogPerTask", - "namespace": "production-Worker", - "statistic": "Average", - "unit": "Count" - }, - "targetValue": 15 - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy", - "version": "0.0.0" - } - }, - "sign-up-queue-autoscaling-policy": { - "id": "sign-up-queue-autoscaling-policy", - "path": "aws-ecs-integ/Worker-service/TaskCount/Target/sign-up-queue-autoscaling-policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-service/TaskCount/Target/sign-up-queue-autoscaling-policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", - "aws:cdk:cloudformation:props": { - "policyName": "awsecsintegWorkerserviceTaskCountTargetsignupqueueautoscalingpolicyDF93FC37", - "policyType": "TargetTrackingScaling", - "scalingTargetId": { - "Ref": "WorkerserviceTaskCountTarget6636D808" - }, - "targetTrackingScalingPolicyConfiguration": { - "customizedMetricSpecification": { - "dimensions": [ - { - "name": "QueueName", - "value": { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "QueueName" - ] - } - } - ], - "metricName": "BacklogPerTask", - "namespace": "production-Worker", - "statistic": "Average", - "unit": "Count" - }, - "targetValue": 30 - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.CfnScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.TargetTrackingScalingPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-applicationautoscaling.ScalableTarget", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ScalableTaskCount", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateService", - "version": "0.0.0" - } - }, - "BackLogPerTaskCalculatorFunction": { - "id": "BackLogPerTaskCalculatorFunction", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "ecs:DescribeServices", - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "productionenvironmentclusterC6599D2D", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": { - "Ref": "WorkerserviceService68C5A5C3" - } - }, - { - "Action": [ - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "Arn" - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "BackLogPerTaskCalculatorFunctionServiceRoleDefaultPolicyB6B10266", - "roles": [ - { - "Ref": "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/BackLogPerTaskCalculatorFunction/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3Bucket1FFDEA8D" - }, - "s3Key": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B" - } - ] - } - ] - }, - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "||", - { - "Ref": "AssetParametersa820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91S3VersionKeyA60C027B" - } - ] - } - ] - } - ] - ] - } - }, - "role": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunctionServiceRoleEFA723A4", - "Arn" - ] - }, - "environment": { - "variables": { - "CLUSTER_NAME": { - "Ref": "productionenvironmentclusterC6599D2D" - }, - "SERVICE_NAME": { - "Fn::GetAtt": [ - "WorkerserviceService68C5A5C3", - "Name" - ] - }, - "NAMESPACE": "production-Worker", - "QUEUE_NAMES": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "EventsQueueB96EB0D2", - "QueueName" - ] - }, - ",", - { - "Fn::GetAtt": [ - "signupqueue33AFF2E6", - "QueueName" - ] - } - ] - ] - } - } - }, - "handler": "index.queue_handler", - "runtime": "python3.9" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - }, - "AssetParameters": { - "id": "AssetParameters", - "path": "aws-ecs-integ/AssetParameters", - "children": { - "a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91": { - "id": "a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91", - "path": "aws-ecs-integ/AssetParameters/a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91", - "children": { - "S3Bucket": { - "id": "S3Bucket", - "path": "aws-ecs-integ/AssetParameters/a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/S3Bucket", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "S3VersionKey": { - "id": "S3VersionKey", - "path": "aws-ecs-integ/AssetParameters/a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/S3VersionKey", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "ArtifactHash": { - "id": "ArtifactHash", - "path": "aws-ecs-integ/AssetParameters/a820140ad8525b8ed56ad2a7bcd9da99d6afc2490e8c91e34620886c011bdc91/ArtifactHash", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.78" - } - }, - "BacklogPerTaskScheduledRule": { - "id": "BacklogPerTaskScheduledRule", - "path": "aws-ecs-integ/BacklogPerTaskScheduledRule", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/BacklogPerTaskScheduledRule/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Events::Rule", - "aws:cdk:cloudformation:props": { - "scheduleExpression": "rate(1 minute)", - "state": "ENABLED", - "targets": [ - { - "id": "Target0", - "arn": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunction95AA21D5", - "Arn" - ] - } - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-events.CfnRule", - "version": "0.0.0" - } - }, - "AllowEventRuleawsecsintegBackLogPerTaskCalculatorFunctionEB2B91C7": { - "id": "AllowEventRuleawsecsintegBackLogPerTaskCalculatorFunctionEB2B91C7", - "path": "aws-ecs-integ/BacklogPerTaskScheduledRule/AllowEventRuleawsecsintegBackLogPerTaskCalculatorFunctionEB2B91C7", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "BackLogPerTaskCalculatorFunction95AA21D5", - "Arn" - ] - }, - "principal": "events.amazonaws.com", - "sourceArn": { - "Fn::GetAtt": [ - "BacklogPerTaskScheduledRuleB871DD15", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-events.Rule", - "version": "0.0.0" - } - }, - "Worker-BackLogPerTaskCalculatorLogs": { - "id": "Worker-BackLogPerTaskCalculatorLogs", - "path": "aws-ecs-integ/Worker-BackLogPerTaskCalculatorLogs", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ/Worker-BackLogPerTaskCalculatorLogs/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", - "aws:cdk:cloudformation:props": { - "logGroupName": { - "Fn::Join": [ - "", - [ - "/aws/lambda/", - { - "Ref": "BackLogPerTaskCalculatorFunction95AA21D5" - } - ] - ] - }, - "retentionInDays": 3 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/Dockerfile b/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/Dockerfile deleted file mode 100644 index 8c87ab2f7179d..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM public.ecr.aws/lambda/python:latest - -ADD . /opt/lambda -WORKDIR /opt/lambda - -RUN pip3 install boto3 -RUN python3 test_index.py - -ENTRYPOINT [ "/bin/bash" ] \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/test.sh b/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/test.sh deleted file mode 100755 index 17ff0d950b21d..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -#--------------------------------------------------------------------------------------------------- -# executes unit tests -# -# prepares a staging directory with the requirements -set -e -script_dir=$(cd $(dirname $0) && pwd) - -# prepare staging directory -staging=$(mktemp -d) -mkdir -p ${staging} -cd ${staging} - -# copy src and overlay with test -cp ${script_dir}/../../lib/extensions/queue/lambda/queue_backlog_calculator.py $PWD -cp ${script_dir}/test_index.py $PWD -cp ${script_dir}/Dockerfile $PWD - -docker build . \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/test_index.py b/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/test_index.py deleted file mode 100644 index 1ff692292eaa1..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue-handler/test_index.py +++ /dev/null @@ -1,149 +0,0 @@ -import json -import io -import unittest -import unittest.mock as mock -import time -from botocore.exceptions import ClientError -from queue_backlog_calculator import QueueHandler - -mock_time = time.time() - -class TestQueueAutoscaling(unittest.TestCase): - maxDiff = None - ''' - Test for unexpected error. - ''' - def test_unexpected_error(self): - ecs_client = mock.Mock() - ecs_client.describe_services.side_effect = ClientError({'Error': {'Code': 'UnexpectedError'}}, 'DescribeServices') - - sqs_client = mock.Mock() - environ = { - 'CLUSTER_NAME': 'TEST_CLUSTER', - 'SERVICE_NAME': 'TEST_SERVICE', - 'NAMESPACE': 'TEST', - 'QUEUE_NAMES': 'queue1' - } - - queue_handler = QueueHandler(ecs_client, sqs_client, environ) - queue_handler.emit() - - self.assertRaisesRegex(Exception, r'UnexpectedError') - - ''' - Test for Exception when the service doesn't exist in cluster. - ''' - @mock.patch('sys.stdout', new_callable=io.StringIO) - def test_no_services_in_cluster(self, _): - ecs_client = mock.Mock() - ecs_client.describe_services.return_value = {'services': []} - - sqs_client = mock.Mock() - environ = { - 'CLUSTER_NAME': 'TEST_CLUSTER', - 'SERVICE_NAME': 'TEST_SERVICE', - 'NAMESPACE': 'TEST', - 'QUEUE_NAMES': 'queue1' - } - - queue_handler = QueueHandler(ecs_client, sqs_client, environ) - queue_handler.emit() - - self.assertRaisesRegex(Exception, r'There are no services with name {} in cluster: {}'.format(environ['SERVICE_NAME'], environ['CLUSTER_NAME'])) - - ''' - Test 'backPerTask' value is equal to 'ApproximateNumberOfMessages' in the queue when no tasks are running. - ''' - @mock.patch('time.time', mock.MagicMock(return_value=mock_time)) - @mock.patch('sys.stdout', new_callable=io.StringIO) - def test_backlog_with_no_running_tasks(self, mock_stdout): - ecs_client = mock.Mock() - ecs_client.describe_services.return_value = {'services': [{'runningCount': 0}]} - - sqs_client = mock.Mock() - sqs_client.get_queue_url.return_value = {'QueueUrl': 'queue1_url'} - sqs_client.get_queue_attributes.return_value = {'Attributes': {'ApproximateNumberOfMessages':100}} - environ = { - 'CLUSTER_NAME': 'TEST_CLUSTER', - 'SERVICE_NAME': 'TEST_SERVICE', - 'NAMESPACE': 'TEST', - 'QUEUE_NAMES': 'queue1' - } - - queue_handler = QueueHandler(ecs_client, sqs_client, environ) - queue_handler.emit() - - metric = json.dumps({ - "_aws": { - "Timestamp": int(mock_time*1000), - "CloudWatchMetrics": [{ - "Namespace": "TEST", - "Dimensions": [["QueueName"]], - "Metrics": [{"Name":"BacklogPerTask", "Unit": "Count"}] - }], - }, - "QueueName": "queue1", - "BacklogPerTask": 100, - }) - self.assertEqual(mock_stdout.getvalue(), metric+'\n') - - ''' - Test 'backPerTask' metric is generated correctly for each queue. - ''' - @mock.patch('time.time', mock.MagicMock(return_value=mock_time)) - @mock.patch('sys.stdout', new_callable=io.StringIO) - def test_metric_generation_per_queue(self, mock_stdout): - ecs_client = mock.Mock() - ecs_client.describe_services.return_value = {'services': [{'runningCount': 2}]} - - val1 = { - 'queue1': {'QueueUrl': 'queue1_url'}, - 'queue2': {'QueueUrl': 'queue2_url'} - } - val2 = { - 'queue1_url': {'Attributes': {'ApproximateNumberOfMessages':101}}, - 'queue2_url': {'Attributes': {'ApproximateNumberOfMessages':200}} - } - - sqs_client = mock.Mock() - sqs_client.get_queue_url.side_effect = [val1['queue1'], val1['queue2']] - sqs_client.get_queue_attributes.side_effect = [val2['queue1_url'], val2['queue2_url']] - environ = { - 'CLUSTER_NAME': 'TEST_CLUSTER', - 'SERVICE_NAME': 'TEST_SERVICE', - 'NAMESPACE': 'TEST', - 'QUEUE_NAMES': 'queue1,queue2' - } - - queue_handler = QueueHandler(ecs_client, sqs_client, environ) - queue_handler.emit() - - metric1 = json.dumps({ - "_aws": { - "Timestamp": int(mock_time*1000), - "CloudWatchMetrics": [{ - "Namespace": "TEST", - "Dimensions": [["QueueName"]], - "Metrics": [{"Name":"BacklogPerTask", "Unit": "Count"}] - }], - }, - "QueueName": "queue1", - "BacklogPerTask": 51, - }) - metric2 = json.dumps({ - "_aws": { - "Timestamp": int(mock_time*1000), - "CloudWatchMetrics": [{ - "Namespace": "TEST", - "Dimensions": [["QueueName"]], - "Metrics": [{"Name":"BacklogPerTask", "Unit": "Count"}] - }], - }, - "QueueName": "queue2", - "BacklogPerTask": 100, - }) - - self.assertEqual(mock_stdout.getvalue(), metric1+'\n'+metric2+'\n') - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue.lambda.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/queue.lambda.test.ts deleted file mode 100644 index c367e0cbb7715..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue.lambda.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { spawnSync } from 'child_process'; -import * as path from 'path'; - -test('queue handler', () => { - const testScript = path.join(__dirname, 'queue-handler', 'test.sh'); - const result = spawnSync(testScript, { stdio: 'inherit' }); - expect(result.status).toBe(0); -}); diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/queue.test.ts deleted file mode 100644 index dfc6bd8a9bcdd..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/queue.test.ts +++ /dev/null @@ -1,835 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as sns from '@aws-cdk/aws-sns'; -import * as sqs from '@aws-cdk/aws-sqs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, QueueExtension, Service, ServiceDescription, TopicSubscription } from '../lib'; - -describe('queue', () => { - test('should only create a default queue when no input props are provided', () => { - // GIVEN - const stack = new cdk.Stack(); - - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, - })); - - // WHEN - serviceDescription.add(new QueueExtension()); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - // Ensure creation of default queue and queue policy allowing SNS Topics to send message to the queue - Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { - MessageRetentionPeriod: 1209600, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { - RedrivePolicy: { - deadLetterTargetArn: { - 'Fn::GetAtt': [ - 'EventsDeadLetterQueue404572C7', - 'Arn', - ], - }, - maxReceiveCount: 3, - }, - }); - - // Ensure the task role is given permissions to consume messages from the queue - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - Statement: [ - { - Action: [ - 'sqs:ReceiveMessage', - 'sqs:ChangeMessageVisibility', - 'sqs:GetQueueUrl', - 'sqs:DeleteMessage', - 'sqs:GetQueueAttributes', - ], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': [ - 'EventsQueueB96EB0D2', - 'Arn', - ], - }, - }, - ], - Version: '2012-10-17', - }, - }); - - // Ensure there are no SNS Subscriptions created - Template.fromStack(stack).resourceCountIs('AWS::SNS::Subscription', 0); - - // Ensure that the queue URL has been correctly appended to the environment variables - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Environment: [ - { - Name: 'PORT', - Value: '80', - }, - { - Name: 'MY-SERVICE_QUEUE_URI', - Value: { - Ref: 'EventsQueueB96EB0D2', - }, - }, - ], - Image: 'nathanpeck/name', - Essential: true, - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - }); - }); - - test('should be able to subscribe default events queue created by the extension to given topics', () => { - // GIVEN - const stack = new cdk.Stack(); - - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - environment: { - PORT: '80', - }, - })); - - // WHEN - const topicSubscription1 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic1'), - }); - const topicSubscription2 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic2'), - }); - serviceDescription.add(new QueueExtension({ - subscriptions: [topicSubscription1, topicSubscription2], - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - // Ensure creation of default queue and queue policy allowing SNS Topics to send message to the queue - Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { - MessageRetentionPeriod: 1209600, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { - RedrivePolicy: { - deadLetterTargetArn: { - 'Fn::GetAtt': [ - 'EventsDeadLetterQueue404572C7', - 'Arn', - ], - }, - maxReceiveCount: 3, - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::SQS::QueuePolicy', { - PolicyDocument: { - Statement: [ - { - Action: 'sqs:SendMessage', - Condition: { - ArnEquals: { - 'aws:SourceArn': { - Ref: 'topic152D84A37', - }, - }, - }, - Effect: 'Allow', - Principal: { - Service: 'sns.amazonaws.com', - }, - Resource: { - 'Fn::GetAtt': [ - 'EventsQueueB96EB0D2', - 'Arn', - ], - }, - }, - { - Action: 'sqs:SendMessage', - Condition: { - ArnEquals: { - 'aws:SourceArn': { - Ref: 'topic2A4FB547F', - }, - }, - }, - Effect: 'Allow', - Principal: { - Service: 'sns.amazonaws.com', - }, - Resource: { - 'Fn::GetAtt': [ - 'EventsQueueB96EB0D2', - 'Arn', - ], - }, - }, - ], - Version: '2012-10-17', - }, - }); - - // Ensure the task role is given permissions to consume messages from the queue - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - Statement: [ - { - Action: [ - 'sqs:ReceiveMessage', - 'sqs:ChangeMessageVisibility', - 'sqs:GetQueueUrl', - 'sqs:DeleteMessage', - 'sqs:GetQueueAttributes', - ], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': [ - 'EventsQueueB96EB0D2', - 'Arn', - ], - }, - }, - ], - Version: '2012-10-17', - }, - }); - - // Ensure SNS Subscriptions for given topics - Template.fromStack(stack).hasResourceProperties('AWS::SNS::Subscription', { - Protocol: 'sqs', - TopicArn: { - Ref: 'topic152D84A37', - }, - Endpoint: { - 'Fn::GetAtt': [ - 'EventsQueueB96EB0D2', - 'Arn', - ], - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::SNS::Subscription', { - Protocol: 'sqs', - TopicArn: { - Ref: 'topic2A4FB547F', - }, - Endpoint: { - 'Fn::GetAtt': [ - 'EventsQueueB96EB0D2', - 'Arn', - ], - }, - }); - - // Ensure that the queue URL has been correctly appended to the environment variables - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Environment: [ - { - Name: 'PORT', - Value: '80', - }, - { - Name: 'MY-SERVICE_QUEUE_URI', - Value: { - Ref: 'EventsQueueB96EB0D2', - }, - }, - ], - Image: 'nathanpeck/name', - Essential: true, - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - }); - }); - - test('should be able to subscribe user-provided queue to given topics', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const topicSubscription1 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic1'), - topicSubscriptionQueue: { - queue: new sqs.Queue(stack, 'myQueue'), - }, - }); - const topicSubscription2 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic2'), - }); - serviceDescription.add(new QueueExtension({ - subscriptions: [topicSubscription1, topicSubscription2], - eventsQueue: new sqs.Queue(stack, 'defQueue'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - // Ensure queue policy allows SNS Topics to send message to the queue - Template.fromStack(stack).hasResourceProperties('AWS::SQS::QueuePolicy', { - PolicyDocument: { - Statement: [ - { - Action: 'sqs:SendMessage', - Condition: { - ArnEquals: { - 'aws:SourceArn': { - Ref: 'topic152D84A37', - }, - }, - }, - Effect: 'Allow', - Principal: { - Service: 'sns.amazonaws.com', - }, - Resource: { - 'Fn::GetAtt': [ - 'myQueue4FDFF71C', - 'Arn', - ], - }, - }, - ], - Version: '2012-10-17', - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::SQS::QueuePolicy', { - PolicyDocument: { - Statement: [ - { - Action: 'sqs:SendMessage', - Condition: { - ArnEquals: { - 'aws:SourceArn': { - Ref: 'topic2A4FB547F', - }, - }, - }, - Effect: 'Allow', - Principal: { - Service: 'sns.amazonaws.com', - }, - Resource: { - 'Fn::GetAtt': [ - 'defQueue1F91A65B', - 'Arn', - ], - }, - }, - ], - Version: '2012-10-17', - }, - }); - - // Ensure the task role is given permissions to consume messages from the queue - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - Statement: [ - { - Action: [ - 'sqs:ReceiveMessage', - 'sqs:ChangeMessageVisibility', - 'sqs:GetQueueUrl', - 'sqs:DeleteMessage', - 'sqs:GetQueueAttributes', - ], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': [ - 'defQueue1F91A65B', - 'Arn', - ], - }, - }, - { - Action: [ - 'sqs:ReceiveMessage', - 'sqs:ChangeMessageVisibility', - 'sqs:GetQueueUrl', - 'sqs:DeleteMessage', - 'sqs:GetQueueAttributes', - ], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': [ - 'myQueue4FDFF71C', - 'Arn', - ], - }, - }, - ], - Version: '2012-10-17', - }, - }); - - // Ensure SNS Subscriptions for given topics - Template.fromStack(stack).hasResourceProperties('AWS::SNS::Subscription', { - Protocol: 'sqs', - TopicArn: { - Ref: 'topic152D84A37', - }, - Endpoint: { - 'Fn::GetAtt': [ - 'myQueue4FDFF71C', - 'Arn', - ], - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::SNS::Subscription', { - Protocol: 'sqs', - TopicArn: { - Ref: 'topic2A4FB547F', - }, - Endpoint: { - 'Fn::GetAtt': [ - 'defQueue1F91A65B', - 'Arn', - ], - }, - }); - - // Ensure that the queue URL has been correctly added to the environment variables - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - Environment: [ - { - Name: 'MY-SERVICE_QUEUE_URI', - Value: { - Ref: 'defQueue1F91A65B', - }, - }, - ], - Image: 'nathanpeck/name', - Essential: true, - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - ], - }); - }); - - test('should error when providing both the subscriptionQueue and queue (deprecated) props for a topic subscription', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - // THEN - expect(() => { - new TopicSubscription({ - topic: new sns.Topic(stack, 'topic1'), - queue: new sqs.Queue(stack, 'delete-queue'), - topicSubscriptionQueue: { - queue: new sqs.Queue(stack, 'sign-up-queue'), - }, - }); - }).toThrow('Either provide the `subscriptionQueue` or the `queue` (deprecated) for the topic subscription, but not both.'); - }); - - test('should be able to add target tracking scaling policy for the Events Queue with no subscriptions', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new QueueExtension({ - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(5), - messageProcessingTime: cdk.Duration.seconds(20), - }, - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - autoScaleTaskCount: { - maxTaskCount: 10, - }, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalableTarget', { - MaxCapacity: 10, - MinCapacity: 1, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - PolicyType: 'TargetTrackingScaling', - TargetTrackingScalingPolicyConfiguration: { - CustomizedMetricSpecification: { - Dimensions: [ - { - Name: 'QueueName', - Value: { - 'Fn::GetAtt': [ - 'EventsQueueB96EB0D2', - 'QueueName', - ], - }, - }, - ], - MetricName: 'BacklogPerTask', - Namespace: 'production-my-service', - Statistic: 'Average', - Unit: 'Count', - }, - TargetValue: 15, - }, - }); - }); - - test('should be able to add target tracking scaling policy for the SQS Queues', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const topicSubscription1 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic1'), - topicSubscriptionQueue: { - queue: new sqs.Queue(stack, 'myQueue'), - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(10), - messageProcessingTime: cdk.Duration.seconds(20), - }, - }, - }); - const topicSubscription2 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic2'), - queue: new sqs.Queue(stack, 'tempQueue'), - }); - serviceDescription.add(new QueueExtension({ - subscriptions: [topicSubscription1, topicSubscription2], - eventsQueue: new sqs.Queue(stack, 'defQueue'), - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(5), - messageProcessingTime: cdk.Duration.seconds(20), - }, - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - autoScaleTaskCount: { - maxTaskCount: 10, - }, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalableTarget', { - MaxCapacity: 10, - MinCapacity: 1, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - PolicyType: 'TargetTrackingScaling', - TargetTrackingScalingPolicyConfiguration: { - CustomizedMetricSpecification: { - Dimensions: [ - { - Name: 'QueueName', - Value: { - 'Fn::GetAtt': [ - 'defQueue1F91A65B', - 'QueueName', - ], - }, - }, - ], - MetricName: 'BacklogPerTask', - Namespace: 'production-my-service', - Statistic: 'Average', - Unit: 'Count', - }, - TargetValue: 15, - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - PolicyType: 'TargetTrackingScaling', - TargetTrackingScalingPolicyConfiguration: { - CustomizedMetricSpecification: { - Dimensions: [ - { - Name: 'QueueName', - Value: { - 'Fn::GetAtt': [ - 'myQueue4FDFF71C', - 'QueueName', - ], - }, - }, - ], - MetricName: 'BacklogPerTask', - Namespace: 'production-my-service', - Statistic: 'Average', - Unit: 'Count', - }, - TargetValue: 30, - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - PolicyType: 'TargetTrackingScaling', - TargetTrackingScalingPolicyConfiguration: { - CustomizedMetricSpecification: { - Dimensions: [ - { - Name: 'QueueName', - Value: { - 'Fn::GetAtt': [ - 'tempQueueEF946882', - 'QueueName', - ], - }, - }, - ], - MetricName: 'BacklogPerTask', - Namespace: 'production-my-service', - Statistic: 'Average', - Unit: 'Count', - }, - TargetValue: 15, - }, - }); - }); - - test('should error when adding scaling policy if scaling target has not been configured', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const topicSubscription1 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic1'), - }); - - serviceDescription.add(new QueueExtension({ - subscriptions: [topicSubscription1], - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(10), - messageProcessingTime: cdk.Duration.seconds(20), - }, - })); - - // THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - }).toThrow(/Auto scaling target for the service 'my-service' hasn't been configured. Please use Service construct to configure 'minTaskCount' and 'maxTaskCount'./); - }); - - test('should error when message processing time for the queue is greater than acceptable latency', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const topicSubscription1 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic1'), - topicSubscriptionQueue: { - queue: new sqs.Queue(stack, 'sign-up-queue'), - }, - }); - - serviceDescription.add(new QueueExtension({ - subscriptions: [topicSubscription1], - scaleOnLatency: { - acceptableLatency: cdk.Duration.seconds(10), - messageProcessingTime: cdk.Duration.seconds(20), - }, - })); - - // THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - autoScaleTaskCount: { - maxTaskCount: 10, - }, - }); - }).toThrow('Message processing time (20s) for the queue cannot be greater acceptable queue latency (10s).'); - }); - - test('should error when configuring auto scaling only for topic-specific queue', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - const topicSubscription1 = new TopicSubscription({ - topic: new sns.Topic(stack, 'topic1'), - topicSubscriptionQueue: { - queue: new sqs.Queue(stack, 'sign-up-queue'), - scaleOnLatency: { - acceptableLatency: cdk.Duration.minutes(10), - messageProcessingTime: cdk.Duration.seconds(20), - }, - }, - }); - - serviceDescription.add(new QueueExtension({ - subscriptions: [topicSubscription1], - })); - - // THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - autoScaleTaskCount: { - maxTaskCount: 10, - }, - }); - }).toThrow(/Autoscaling for a topic-specific queue cannot be configured as autoscaling based on SQS Queues hasn’t been set up for the service 'my-service'. If you want to enable autoscaling for this service, please also specify 'scaleOnLatency' in the 'QueueExtension'/); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/scale-on-cpu-utilization.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/scale-on-cpu-utilization.test.ts deleted file mode 100644 index bfcf67e394609..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/scale-on-cpu-utilization.test.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, ScaleOnCpuUtilization, Service, ServiceDescription } from '../lib'; - -describe('scale on cpu utilization', () => { - test('scale on cpu utilization extension with no parameters should create a default autoscaling setup', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new ScaleOnCpuUtilization()); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DeploymentConfiguration: { - MaximumPercent: 200, - MinimumHealthyPercent: 100, - }, - DesiredCount: 2, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalableTarget', { - MaxCapacity: 8, - MinCapacity: 2, - ResourceId: { - 'Fn::Join': [ - '', - [ - 'service/', - { - Ref: 'productionenvironmentclusterC6599D2D', - }, - '/', - { - 'Fn::GetAtt': [ - 'myserviceserviceServiceE9A5732D', - 'Name', - ], - }, - ], - ], - }, - RoleARN: { - 'Fn::Join': [ - '', - [ - 'arn:', - { - Ref: 'AWS::Partition', - }, - ':iam::', - { - Ref: 'AWS::AccountId', - }, - ':role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService', - ], - ], - }, - ScalableDimension: 'ecs:service:DesiredCount', - ServiceNamespace: 'ecs', - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - PolicyName: 'myserviceserviceTaskCountTargetmyservicetargetcpuutilization50E6628660', - PolicyType: 'TargetTrackingScaling', - ScalingTargetId: { - Ref: 'myserviceserviceTaskCountTarget4268918D', - }, - TargetTrackingScalingPolicyConfiguration: { - PredefinedMetricSpecification: { - PredefinedMetricType: 'ECSServiceAverageCPUUtilization', - }, - ScaleInCooldown: 60, - ScaleOutCooldown: 60, - TargetValue: 50, - }, - }); - }); - - test('should be able to set a custom scaling policy as well', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new ScaleOnCpuUtilization({ - initialTaskCount: 25, - minTaskCount: 15, - maxTaskCount: 30, - targetCpuUtilization: 75, - scaleInCooldown: cdk.Duration.minutes(3), - scaleOutCooldown: cdk.Duration.minutes(3), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DeploymentConfiguration: { - MaximumPercent: 200, - MinimumHealthyPercent: 100, - }, - DesiredCount: 25, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalableTarget', { - MaxCapacity: 30, - MinCapacity: 15, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - TargetTrackingScalingPolicyConfiguration: { - ScaleInCooldown: 180, - ScaleOutCooldown: 180, - TargetValue: 75, - }, - }); - }); - - test('should error if configuring autoscaling target both in the extension and the Service', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new ScaleOnCpuUtilization()); - // THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - autoScaleTaskCount: { - maxTaskCount: 5, - }, - }); - }).toThrow('Cannot specify \'autoScaleTaskCount\' in the Service construct and also provide a \'ScaleOnCpuUtilization\' extension. \'ScaleOnCpuUtilization\' is deprecated. Please only provide \'autoScaleTaskCount\'.'); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/service.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/service.test.ts deleted file mode 100644 index 9879282f7e254..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/service.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { Match, Template } from '@aws-cdk/assertions'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, Service, ServiceDescription } from '../lib'; - -describe('service', () => { - test('should error if a service is prepared with no addons', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - // THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - }).toThrow(/Service 'my-service' must have a Container extension/); - }); - - test('allows scaling on a target CPU utilization', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - desiredCount: 3, - autoScaleTaskCount: { - maxTaskCount: 5, - targetCpuUtilization: 70, - }, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DesiredCount: Match.absent(), - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalableTarget', { - MaxCapacity: 5, - MinCapacity: 1, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - PolicyType: 'TargetTrackingScaling', - TargetTrackingScalingPolicyConfiguration: { - PredefinedMetricSpecification: { PredefinedMetricType: 'ECSServiceAverageCPUUtilization' }, - TargetValue: 70, - }, - }); - }); - - test('allows scaling on a target memory utilization', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - desiredCount: 3, - autoScaleTaskCount: { - maxTaskCount: 5, - targetMemoryUtilization: 70, - }, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DesiredCount: Match.absent(), - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalableTarget', { - MaxCapacity: 5, - MinCapacity: 1, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApplicationAutoScaling::ScalingPolicy', { - PolicyType: 'TargetTrackingScaling', - TargetTrackingScalingPolicyConfiguration: { - PredefinedMetricSpecification: { PredefinedMetricType: 'ECSServiceAverageMemoryUtilization' }, - TargetValue: 70, - }, - }); - }); - - test('should error when no auto scaling policies have been configured after creating the auto scaling target', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - // THEN - expect(() => { - new Service(stack, 'my-service', { - environment, - serviceDescription, - autoScaleTaskCount: { - maxTaskCount: 5, - }, - }); - }).toThrow(/The auto scaling target for the service 'my-service' has been created but no auto scaling policies have been configured./); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/xray.test.ts b/packages/@aws-cdk-containers/ecs-service-extensions/test/xray.test.ts deleted file mode 100644 index f8f096369d50b..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/xray.test.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { Template } from '@aws-cdk/assertions'; -import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; -import { Container, Environment, XRayExtension, Service, ServiceDescription } from '../lib'; - -describe('xray', () => { - test('should be able to add AWS X-Ray to a service', () => { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - const environment = new Environment(stack, 'production'); - const serviceDescription = new ServiceDescription(); - - serviceDescription.add(new Container({ - cpu: 256, - memoryMiB: 512, - trafficPort: 80, - image: ecs.ContainerImage.fromRegistry('nathanpeck/name'), - })); - - serviceDescription.add(new XRayExtension()); - - new Service(stack, 'my-service', { - environment, - serviceDescription, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Cpu: 256, - DependsOn: [ - { - Condition: 'HEALTHY', - ContainerName: 'xray', - }, - ], - Essential: true, - Image: 'nathanpeck/name', - Memory: 512, - Name: 'app', - PortMappings: [ - { - ContainerPort: 80, - Protocol: 'tcp', - }, - ], - Ulimits: [ - { - HardLimit: 1024000, - Name: 'nofile', - SoftLimit: 1024000, - }, - ], - }, - { - Environment: [ - { - Name: 'AWS_REGION', - Value: { - Ref: 'AWS::Region', - }, - }, - ], - Essential: true, - HealthCheck: { - Command: [ - 'CMD-SHELL', - 'curl -s http://localhost:2000', - ], - Interval: 5, - Retries: 3, - StartPeriod: 10, - Timeout: 2, - }, - Image: 'amazon/aws-xray-daemon:latest', - LogConfiguration: { - LogDriver: 'awslogs', - Options: { - 'awslogs-group': { - Ref: 'myservicetaskdefinitionxrayLogGroupC0252525', - }, - 'awslogs-stream-prefix': 'xray', - 'awslogs-region': { - Ref: 'AWS::Region', - }, - }, - }, - MemoryReservation: 256, - Name: 'xray', - User: '1337', - }, - ], - Cpu: '256', - ExecutionRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionExecutionRole0CE74AD0', - 'Arn', - ], - }, - Family: 'myservicetaskdefinition', - Memory: '512', - NetworkMode: 'awsvpc', - RequiresCompatibilities: [ - 'EC2', - 'FARGATE', - ], - TaskRoleArn: { - 'Fn::GetAtt': [ - 'myservicetaskdefinitionTaskRole92ACD903', - 'Arn', - ], - }, - }); - }); -}); \ No newline at end of file diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/tsconfig.json b/packages/@aws-cdk-containers/ecs-service-extensions/tsconfig.json deleted file mode 100644 index 124a3ce0d3346..0000000000000 --- a/packages/@aws-cdk-containers/ecs-service-extensions/tsconfig.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "compilerOptions": { - "alwaysStrict": true, - "charset": "utf8", - "declaration": true, - "experimentalDecorators": true, - "inlineSourceMap": true, - "inlineSources": true, - "lib": [ - "es2018" - ], - "module": "CommonJS", - "noEmitOnError": true, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "resolveJsonModule": true, - "strict": true, - "strictNullChecks": true, - "strictPropertyInitialization": true, - "stripInternal": true, - "target": "ES2018", - "composite": true, - "incremental": true, - "tsBuildInfoFile": "./tsconfig.tsbuildinfo" - }, - "include": [ - "**/*.ts" - ], - "exclude": [ - "node_modules" - ], - "references": [ - { - "path": "../../@aws-cdk/aws-applicationautoscaling" - }, - { - "path": "../../@aws-cdk/aws-appmesh" - }, - { - "path": "../../@aws-cdk/aws-certificatemanager" - }, - { - "path": "../../@aws-cdk/aws-dynamodb" - }, - { - "path": "../../@aws-cdk/aws-ec2" - }, - { - "path": "../../@aws-cdk/aws-ecr" - }, - { - "path": "../../@aws-cdk/aws-ecs" - }, - { - "path": "../../@aws-cdk/aws-elasticloadbalancingv2" - }, - { - "path": "../../@aws-cdk/aws-events" - }, - { - "path": "../../@aws-cdk/aws-events-targets" - }, - { - "path": "../../@aws-cdk/aws-iam" - }, - { - "path": "../../@aws-cdk/aws-logs" - }, - { - "path": "../../@aws-cdk/aws-route53" - }, - { - "path": "../../@aws-cdk/aws-route53-targets" - }, - { - "path": "../../@aws-cdk/aws-servicediscovery" - }, - { - "path": "../../@aws-cdk/aws-sqs" - }, - { - "path": "../../@aws-cdk/core" - }, - { - "path": "../../@aws-cdk/region-info" - }, - { - "path": "../../@aws-cdk/assert" - }, - { - "path": "../../../tools/@aws-cdk/cdk-build-tools" - }, - { - "path": "../../../tools/@aws-cdk/cdk-integ-tools" - }, - { - "path": "../../../tools/@aws-cdk/cfn2ts" - }, - { - "path": "../../../tools/@aws-cdk/pkglint" - } - ], - "_generated_by_jsii_": "Generated by jsii - safe to delete, and ideally should be in .gitignore" -} diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.ts b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.ts index 976b6c441af47..9eb8a32e1f774 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.ts +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import { Asset } from '@aws-cdk/aws-s3-assets'; import { App, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts index 4f79409da4013..60ec86b2430a3 100644 --- a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts +++ b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; import { App, Stack } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.ts b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.ts index a7f0a367fbd46..5ec9733a7ada5 100644 --- a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.ts +++ b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; diff --git a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.lit.ts b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.lit.ts index 2b5fc3a62ddc8..5932b7a5a8a13 100644 --- a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.lit.ts +++ b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.lit.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; import { App, Stack } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.cors.ts b/packages/@aws-cdk/aws-apigateway/test/integ.cors.ts index 5c7ac6eb8d4cf..4c6eb67f693b7 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.cors.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.cors.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; import { App, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/integ.user-pool.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/integ.user-pool.ts index ee544d4da7313..3de728d75412b 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/integ.user-pool.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/integ.user-pool.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import { HttpApi, HttpMethod } from '@aws-cdk/aws-apigatewayv2'; import { HttpLambdaIntegration } from '@aws-cdk/aws-apigatewayv2-integrations'; diff --git a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json index 300fde6728b66..88a6c196cc7ed 100644 --- a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json +++ b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json @@ -25,7 +25,7 @@ } }, "flattenResponse": "false", - "salt": "1660753153241" + "salt": "1661796816388" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -57,7 +57,7 @@ ] ] }, - "salt": "1660753153242" + "salt": "1661796816388" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -109,7 +109,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" }, "S3Key": { "Fn::Join": [ @@ -122,7 +122,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -135,7 +135,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -167,17 +167,17 @@ } }, "Parameters": { - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80": { "Type": "String", - "Description": "S3 bucket for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 bucket for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE": { "Type": "String", - "Description": "S3 key for asset version \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 key for asset version \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036": { "Type": "String", - "Description": "Artifact hash for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "Artifact hash for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js similarity index 99% rename from packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js rename to packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js index b3ec1b8c53d30..ba956d47f51fe 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js +++ b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js @@ -493,7 +493,7 @@ var AssertionHandler = class extends CustomResourceHandler { } else { result = { data: JSON.stringify({ - status: "pass" + status: "success" }) }; } diff --git a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/integ.json b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/integ.json index f7061163099a8..a51861bb20b53 100644 --- a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/integ.json @@ -1,11 +1,12 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "Integ/DefaultTest": { "stacks": [ "AppSyncIntegLogRetention" ], - "assertionStack": "Integ/DefaultTest/DeployAssert" + "assertionStack": "Integ/DefaultTest/DeployAssert", + "assertionStackName": "IntegDefaultTestDeployAssert4E6713E1" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/manifest.json index 41a0338187688..19ae39c8935cd 100644 --- a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -119,13 +119,13 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle", - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "packaging": "zip", - "sourceHash": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "s3BucketParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7", - "s3KeyParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E", - "artifactHashParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "sourceHash": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "s3BucketParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80", + "s3KeyParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE", + "artifactHashParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } } ], @@ -159,22 +159,22 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/Integ/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket": [ + "/Integ/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" } ], - "/Integ/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey": [ + "/Integ/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ], - "/Integ/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash": [ + "/Integ/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } ] }, diff --git a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/tree.json b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/tree.json index cd81435afe9f6..3a40b439248f4 100644 --- a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "AppSyncIntegLogRetention": { @@ -136,8 +136,8 @@ "id": "LogGroup", "path": "AppSyncIntegLogRetention/GraphqlApi/LogGroup", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "LogRetention": { @@ -148,8 +148,8 @@ "id": "Resource", "path": "AppSyncIntegLogRetention/GraphqlApi/LogRetention/Resource", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -176,8 +176,8 @@ "id": "Stage", "path": "AppSyncIntegLogRetention/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/Code/Stage", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssetBucket": { @@ -289,14 +289,14 @@ "id": "Resource", "path": "AppSyncIntegLogRetention/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/Resource", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "AssetParameters": { @@ -311,36 +311,36 @@ "id": "S3Bucket", "path": "AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", "path": "AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", "path": "AppSyncIntegLogRetention/AssetParameters/d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "Exports": { @@ -351,20 +351,20 @@ "id": "Output{\"Fn::GetAtt\":[\"GraphqlApi1B6CF24C\",\"ApiId\"]}", "path": "AppSyncIntegLogRetention/Exports/Output{\"Fn::GetAtt\":[\"GraphqlApi1B6CF24C\",\"ApiId\"]}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Integ": { @@ -380,7 +380,7 @@ "path": "Integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "DeployAssert": { @@ -400,7 +400,7 @@ "path": "Integ/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsdescribeLogGroups/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, @@ -417,14 +417,14 @@ "id": "Default", "path": "Integ/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsdescribeLogGroups/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertEqualsCloudWatchLogsdescribeLogGroups": { @@ -440,7 +440,7 @@ "path": "Integ/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsdescribeLogGroups/AssertEqualsCloudWatchLogsdescribeLogGroups/AssertionProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, @@ -457,22 +457,22 @@ "id": "Default", "path": "Integ/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsdescribeLogGroups/AssertEqualsCloudWatchLogsdescribeLogGroups/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertionResults": { "id": "AssertionResults", "path": "Integ/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsdescribeLogGroups/AssertEqualsCloudWatchLogsdescribeLogGroups/AssertionResults", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -495,80 +495,80 @@ "id": "Staging", "path": "Integ/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", "path": "Integ/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", "path": "Integ/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", "path": "Integ/DefaultTest/DeployAssert/AssetParameters", "children": { - "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd": { - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "path": "Integ/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "path": "Integ/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "Integ/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket", + "path": "Integ/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "Integ/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey", + "path": "Integ/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "Integ/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash", + "path": "Integ/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -585,8 +585,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.template.json b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.template.json index f343518a8bc86..4d4755066daa6 100644 --- a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.template.json +++ b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.template.json @@ -15,7 +15,7 @@ "status": "ACTIVE" }, "flattenResponse": "true", - "salt": "1660823602154" + "salt": "1661796816631" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -36,7 +36,7 @@ ] }, "expected": "{\"$StringLike\":\"AWS_REGION\"}", - "salt": "1660823602155" + "salt": "1661796816632" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -88,7 +88,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" }, "S3Key": { "Fn::Join": [ @@ -101,7 +101,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -114,7 +114,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -146,17 +146,17 @@ } }, "Parameters": { - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80": { "Type": "String", - "Description": "S3 bucket for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 bucket for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE": { "Type": "String", - "Description": "S3 key for asset version \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 key for asset version \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036": { "Type": "String", - "Description": "Artifact hash for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "Artifact hash for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js old mode 100755 new mode 100644 similarity index 99% rename from packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js rename to packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js index b3ec1b8c53d30..ba956d47f51fe --- a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js +++ b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js @@ -493,7 +493,7 @@ var AssertionHandler = class extends CustomResourceHandler { } else { result = { data: JSON.stringify({ - status: "pass" + status: "success" }) }; } diff --git a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/integ.json b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/integ.json index 736943309c556..4fff561c7815d 100644 --- a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "IntegTest-BatchDefaultEnvVarsStack/DefaultTest": { "stacks": [ @@ -8,7 +8,8 @@ "regions": [ "us-east-1" ], - "assertionStack": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert" + "assertionStack": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert", + "assertionStackName": "IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/manifest.json index 485b343d781b7..1405bf2c4acaa 100644 --- a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -36,13 +36,13 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle", - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "packaging": "zip", - "sourceHash": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "s3BucketParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7", - "s3KeyParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E", - "artifactHashParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "sourceHash": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "s3BucketParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80", + "s3KeyParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE", + "artifactHashParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } } ], @@ -76,22 +76,22 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket": [ + "/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" } ], - "/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey": [ + "/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ], - "/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash": [ + "/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } ] }, diff --git a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/tree.json b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/tree.json index dd66108f81c0e..324060f75a5a6 100644 --- a/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-batch/test/job-definition.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "BatchDefaultEnvVarsStack": { @@ -94,8 +94,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "IntegTest-BatchDefaultEnvVarsStack": { @@ -111,7 +111,7 @@ "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "DeployAssert": { @@ -131,7 +131,7 @@ "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, @@ -148,14 +148,14 @@ "id": "Default", "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertEqualsBatchdescribeJobDefinitions": { @@ -171,7 +171,7 @@ "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/AssertEqualsBatchdescribeJobDefinitions/AssertionProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, @@ -188,22 +188,22 @@ "id": "Default", "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/AssertEqualsBatchdescribeJobDefinitions/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertionResults": { "id": "AssertionResults", "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/AssertEqualsBatchdescribeJobDefinitions/AssertionResults", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -226,80 +226,80 @@ "id": "Staging", "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters", "children": { - "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd": { - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket", + "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey", + "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash", + "path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -316,8 +316,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts b/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts index c44c1997efaee..aed957b6376ee 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts @@ -227,6 +227,11 @@ export class Certificate extends CertificateBase implements ICertificate { } } + // check if domain name is 64 characters or less + if (props.domainName.length > 64) { + throw new Error('Domain name must be 64 characters or less'); + } + const allDomainNames = [props.domainName].concat(props.subjectAlternativeNames || []); let certificateTransparencyLoggingPreference: string | undefined; diff --git a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts index 25b800c7f4c35..eb4044cb7833f 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts @@ -84,14 +84,16 @@ export class DnsValidatedCertificate extends CertificateBase implements ICertifi super(scope, id); this.region = props.region; - this.domainName = props.domainName; + // check if domain name is 64 characters or less + if (this.domainName.length > 64) { + throw new Error('Domain name must be 64 characters or less'); + } this.normalizedZoneName = props.hostedZone.zoneName; // Remove trailing `.` from zone name if (this.normalizedZoneName.endsWith('.')) { this.normalizedZoneName = this.normalizedZoneName.substring(0, this.normalizedZoneName.length - 1); } - // Remove any `/hostedzone/` prefix from the Hosted Zone ID this.hostedZoneId = props.hostedZone.hostedZoneId.replace(/^\/hostedzone\//, ''); this.tags = new cdk.TagManager(cdk.TagType.MAP, 'AWS::CertificateManager::Certificate'); diff --git a/packages/@aws-cdk/aws-certificatemanager/test/certificate.test.ts b/packages/@aws-cdk/aws-certificatemanager/test/certificate.test.ts index 4c538bd7e62c6..846ef3d79c393 100644 --- a/packages/@aws-cdk/aws-certificatemanager/test/certificate.test.ts +++ b/packages/@aws-cdk/aws-certificatemanager/test/certificate.test.ts @@ -81,6 +81,17 @@ test('can configure validation method', () => { }); }); +test('throws when domain name is longer than 64 characters', () => { + const stack = new Stack(); + + expect(() => { + new Certificate(stack, 'Certificate', { + domainName: 'example.com'.repeat(7), + }); + }).toThrow(/Domain name must be 64 characters or less/); +}); + + test('needs validation domain supplied if domain contains a token', () => { const stack = new Stack(); @@ -363,4 +374,5 @@ describe('Transparency logging settings', () => { CertificateTransparencyLoggingPreference: 'DISABLED', }); }); -}); \ No newline at end of file +}); + diff --git a/packages/@aws-cdk/aws-certificatemanager/test/dns-validated-certificate.test.ts b/packages/@aws-cdk/aws-certificatemanager/test/dns-validated-certificate.test.ts index b3e8210004191..5ed77764de122 100644 --- a/packages/@aws-cdk/aws-certificatemanager/test/dns-validated-certificate.test.ts +++ b/packages/@aws-cdk/aws-certificatemanager/test/dns-validated-certificate.test.ts @@ -225,6 +225,21 @@ test('works with imported role', () => { }); }); + +test('throws when domain name is longer than 64 characters', () => { + const stack = new Stack(); + + const exampleDotComZone = new PublicHostedZone(stack, 'ExampleDotCom', { + zoneName: 'example.com', + }); + expect(() => { + new DnsValidatedCertificate(stack, 'Cert', { + domainName: 'example.com'.repeat(7), + hostedZone: exampleDotComZone, + }); + }).toThrow(/Domain name must be 64 characters or less/); +}), + test('test transparency logging settings is passed to the custom resource', () => { const stack = new Stack(); diff --git a/packages/@aws-cdk/aws-chatbot/test/integ.chatbot-logretention.ts b/packages/@aws-cdk/aws-chatbot/test/integ.chatbot-logretention.ts index c443319bd336f..b23280b6c45d7 100644 --- a/packages/@aws-cdk/aws-chatbot/test/integ.chatbot-logretention.ts +++ b/packages/@aws-cdk/aws-chatbot/test/integ.chatbot-logretention.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as iam from '@aws-cdk/aws-iam'; import * as logs from '@aws-cdk/aws-logs'; import * as cdk from '@aws-cdk/core'; @@ -31,4 +30,3 @@ const app = new cdk.App(); new ChatbotLogRetentionInteg(app, 'ChatbotLogRetentionInteg'); app.synth(); - diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts index e55c6c800eafb..f98c131af7218 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets /* * Stack verification steps: * - Deploy with `--no-clean` diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.ts index 79b78eb2d6132..b3c49a7e7d493 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; import { App, NestedStack, Stack } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi-refs.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi-refs.ts index e810da5b1f1e5..f0d3cae275f5f 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi-refs.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi-refs.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as sns from '@aws-cdk/aws-sns'; import { App, Fn, NestedStack, Stack } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.ts index ac60c82dd3885..ebd9f51ee93ed 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as sns from '@aws-cdk/aws-sns'; import { App, NestedStack, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; diff --git a/packages/@aws-cdk/aws-cloudtrail/README.md b/packages/@aws-cdk/aws-cloudtrail/README.md index 2a5f3a06c300d..4a750517d60bd 100644 --- a/packages/@aws-cdk/aws-cloudtrail/README.md +++ b/packages/@aws-cdk/aws-cloudtrail/README.md @@ -190,7 +190,7 @@ trail.addLambdaEventSelector([ amazingFunction ]); ## Organization Trail It is possible to create a trail that will be applied to all accounts in an organization if the current account manages an organization. -To enable this, the property `isOrganizationTrail` must be set. If this property is set and the current account does not manage an organization, the created trail will be created only for the account. +To enable this, the property `isOrganizationTrail` must be set. If this property is set and the current account does not manage an organization, the stack will fail to deploy. ```ts new cloudtrail.Trail(this, 'OrganizationTrail', { diff --git a/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts b/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts index 1394baeab8965..73cb247821560 100644 --- a/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts +++ b/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts @@ -119,6 +119,8 @@ export interface TrailProps { /** * Specifies whether the trail is applied to all accounts in an organization in AWS Organizations, or only for the current AWS account. * + * If this is set to true then the current account _must_ be the management account. If it is not, then CloudFormation will throw an error. + * * If this is set to true and the current account is a management account for an organization in AWS Organizations, the trail will be created in all AWS accounts that belong to the organization. * If this is set to false, the trail will remain in the current AWS account but be deleted from all member accounts in the organization. * diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/CloudtrailIntegTestStack.template.json b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/CloudtrailIntegTestStack.template.json deleted file mode 100644 index d07a2d5591de4..0000000000000 --- a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/CloudtrailIntegTestStack.template.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "Resources": { - "TrailS30071F172": { - "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "TrailS3PolicyE42170FE": { - "Type": "AWS::S3::BucketPolicy", - "Properties": { - "Bucket": { - "Ref": "TrailS30071F172" - }, - "PolicyDocument": { - "Statement": [ - { - "Action": "s3:*", - "Condition": { - "Bool": { - "aws:SecureTransport": "false" - } - }, - "Effect": "Deny", - "Principal": { - "AWS": "*" - }, - "Resource": [ - { - "Fn::GetAtt": [ - "TrailS30071F172", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "TrailS30071F172", - "Arn" - ] - }, - "/*" - ] - ] - } - ] - }, - { - "Action": "s3:GetBucketAcl", - "Effect": "Allow", - "Principal": { - "Service": "cloudtrail.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "TrailS30071F172", - "Arn" - ] - } - }, - { - "Action": "s3:PutObject", - "Condition": { - "StringEquals": { - "s3:x-amz-acl": "bucket-owner-full-control" - } - }, - "Effect": "Allow", - "Principal": { - "Service": "cloudtrail.amazonaws.com" - }, - "Resource": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "TrailS30071F172", - "Arn" - ] - }, - "/AWSLogs/", - { - "Ref": "AWS::AccountId" - }, - "/*" - ] - ] - } - } - ], - "Version": "2012-10-17" - } - } - }, - "Trail022F0CF2": { - "Type": "AWS::CloudTrail::Trail", - "Properties": { - "IsLogging": true, - "S3BucketName": { - "Ref": "TrailS30071F172" - }, - "EnableLogFileValidation": true, - "EventSelectors": [], - "IncludeGlobalServiceEvents": true, - "IsMultiRegionTrail": true, - "IsOrganizationTrail": true - }, - "DependsOn": [ - "TrailS3PolicyE42170FE" - ] - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/cdk.out deleted file mode 100644 index 588d7b269d34f..0000000000000 --- a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/integ.json b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/integ.json deleted file mode 100644 index 61291759f654d..0000000000000 --- a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/integ.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "20.0.0", - "testCases": { - "TrailIntegTest/DefaultTest": { - "stacks": [ - "CloudtrailIntegTestStack" - ], - "assertionStack": "TrailIntegTestDefaultTestDeployAssertA42C24D1" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/manifest.json deleted file mode 100644 index 66d0aeebc2852..0000000000000 --- a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/manifest.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "version": "20.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "CloudtrailIntegTestStack": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "CloudtrailIntegTestStack.template.json", - "validateOnSynth": false - }, - "metadata": { - "/CloudtrailIntegTestStack/Trail/S3/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "TrailS30071F172" - } - ], - "/CloudtrailIntegTestStack/Trail/S3/Policy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "TrailS3PolicyE42170FE" - } - ], - "/CloudtrailIntegTestStack/Trail/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Trail022F0CF2" - } - ] - }, - "displayName": "CloudtrailIntegTestStack" - }, - "TrailIntegTestDefaultTestDeployAssertA42C24D1": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "TrailIntegTestDefaultTestDeployAssertA42C24D1.template.json", - "validateOnSynth": false - }, - "displayName": "TrailIntegTest/DefaultTest/DeployAssert" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/tree.json b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/tree.json deleted file mode 100644 index 1a80da9d3bd60..0000000000000 --- a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/tree.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.71" - } - }, - "CloudtrailIntegTestStack": { - "id": "CloudtrailIntegTestStack", - "path": "CloudtrailIntegTestStack", - "children": { - "Trail": { - "id": "Trail", - "path": "CloudtrailIntegTestStack/Trail", - "children": { - "S3": { - "id": "S3", - "path": "CloudtrailIntegTestStack/Trail/S3", - "children": { - "Resource": { - "id": "Resource", - "path": "CloudtrailIntegTestStack/Trail/S3/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::S3::Bucket", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.CfnBucket", - "version": "0.0.0" - } - }, - "Policy": { - "id": "Policy", - "path": "CloudtrailIntegTestStack/Trail/S3/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "CloudtrailIntegTestStack/Trail/S3/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::S3::BucketPolicy", - "aws:cdk:cloudformation:props": { - "bucket": { - "Ref": "TrailS30071F172" - }, - "policyDocument": { - "Statement": [ - { - "Action": "s3:*", - "Condition": { - "Bool": { - "aws:SecureTransport": "false" - } - }, - "Effect": "Deny", - "Principal": { - "AWS": "*" - }, - "Resource": [ - { - "Fn::GetAtt": [ - "TrailS30071F172", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "TrailS30071F172", - "Arn" - ] - }, - "/*" - ] - ] - } - ] - }, - { - "Action": "s3:GetBucketAcl", - "Effect": "Allow", - "Principal": { - "Service": "cloudtrail.amazonaws.com" - }, - "Resource": { - "Fn::GetAtt": [ - "TrailS30071F172", - "Arn" - ] - } - }, - { - "Action": "s3:PutObject", - "Condition": { - "StringEquals": { - "s3:x-amz-acl": "bucket-owner-full-control" - } - }, - "Effect": "Allow", - "Principal": { - "Service": "cloudtrail.amazonaws.com" - }, - "Resource": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "TrailS30071F172", - "Arn" - ] - }, - "/AWSLogs/", - { - "Ref": "AWS::AccountId" - }, - "/*" - ] - ] - } - } - ], - "Version": "2012-10-17" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.CfnBucketPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.Bucket", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "CloudtrailIntegTestStack/Trail/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::CloudTrail::Trail", - "aws:cdk:cloudformation:props": { - "isLogging": true, - "s3BucketName": { - "Ref": "TrailS30071F172" - }, - "enableLogFileValidation": true, - "eventSelectors": [], - "includeGlobalServiceEvents": true, - "isMultiRegionTrail": true, - "isOrganizationTrail": true - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-cloudtrail.CfnTrail", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-cloudtrail.Trail", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - }, - "TrailIntegTest": { - "id": "TrailIntegTest", - "path": "TrailIntegTest", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "TrailIntegTest/DefaultTest", - "children": { - "Default": { - "id": "Default", - "path": "TrailIntegTest/DefaultTest/Default", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.71" - } - }, - "DeployAssert": { - "id": "DeployAssert", - "path": "TrailIntegTest/DefaultTest/DeployAssert", - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTestCase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTest", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail.ts b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail.ts deleted file mode 100644 index 23d5ba58e4776..0000000000000 --- a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as cdk from '@aws-cdk/core'; -import * as integ from '@aws-cdk/integ-tests'; -import * as cloudtrail from '../lib'; - -const app = new cdk.App(); -const stack = new cdk.Stack(app, 'CloudtrailIntegTestStack'); - -new cloudtrail.Trail(stack, 'Trail', { - isOrganizationTrail: true, -}); - -new integ.IntegTest(app, 'TrailIntegTest', { - testCases: [stack], -}); - -app.synth(); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.ts index 2c646a52721ae..e2e096037fd3c 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { UserPool } from '../lib'; @@ -26,4 +25,4 @@ new CfnOutput(stack, 'Domain', { new CfnOutput(stack, 'CloudFrontDomainName', { value: domain.cloudFrontDomainName, -}); \ No newline at end of file +}); diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.global-replicas-provisioned.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.global-replicas-provisioned.ts index 7135e5c5f10ef..8403538c2bd50 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.global-replicas-provisioned.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.global-replicas-provisioned.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as cdk from '@aws-cdk/core'; import * as dynamodb from '../lib'; diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.global.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.global.ts index 27150cf3b5b6d..e697731091ec7 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.global.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.global.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as dynamodb from '../lib'; diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/FlowLogsDefaultTestDeployAssert6AFD1854.template.json b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/FlowLogsDefaultTestDeployAssert6AFD1854.template.json index ac44adc18c7c3..edd0e54f89c68 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/FlowLogsDefaultTestDeployAssert6AFD1854.template.json +++ b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/FlowLogsDefaultTestDeployAssert6AFD1854.template.json @@ -30,7 +30,7 @@ } }, "flattenResponse": "false", - "salt": "1660924391599" + "salt": "1661796480503" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -51,7 +51,7 @@ ] }, "expected": "{\"$ObjectLike\":{\"KeyCount\":1}}", - "salt": "1660924391599" + "salt": "1661796480503" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -133,7 +133,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" }, "S3Key": { "Fn::Join": [ @@ -146,7 +146,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -159,7 +159,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -191,17 +191,17 @@ } }, "Parameters": { - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80": { "Type": "String", - "Description": "S3 bucket for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 bucket for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE": { "Type": "String", - "Description": "S3 key for asset version \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 key for asset version \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036": { "Type": "String", - "Description": "Artifact hash for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "Artifact hash for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js old mode 100755 new mode 100644 similarity index 99% rename from packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js rename to packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js index b3ec1b8c53d30..ba956d47f51fe --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js +++ b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js @@ -493,7 +493,7 @@ var AssertionHandler = class extends CustomResourceHandler { } else { result = { data: JSON.stringify({ - status: "pass" + status: "success" }) }; } diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/integ.json b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/integ.json index 465cf66252994..9bd00780726f5 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/integ.json @@ -1,12 +1,13 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "FlowLogs/DefaultTest": { "stacks": [ "FlowLogsTestStack", "FlowLogsFeatureFlag" ], - "assertionStack": "FlowLogs/DefaultTest/DeployAssert" + "assertionStack": "FlowLogs/DefaultTest/DeployAssert", + "assertionStackName": "FlowLogsDefaultTestDeployAssert6AFD1854" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/manifest.json index cbe7726f31c2c..625ddb5bc8751 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -508,13 +508,13 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle", - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "packaging": "zip", - "sourceHash": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "s3BucketParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7", - "s3KeyParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E", - "artifactHashParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "sourceHash": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "s3BucketParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80", + "s3KeyParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE", + "artifactHashParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } } ], @@ -548,22 +548,22 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/FlowLogs/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket": [ + "/FlowLogs/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" } ], - "/FlowLogs/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey": [ + "/FlowLogs/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ], - "/FlowLogs/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash": [ + "/FlowLogs/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } ] }, diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/tree.json b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/tree.json index 801b62da2f16a..079e2f28b821d 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-ec2/test/vpc-flow-logs.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "FlowLogsFeatureFlag": { @@ -91,8 +91,8 @@ "id": "Acl", "path": "FlowLogsFeatureFlag/VPC/PublicSubnet1/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "RouteTable": { @@ -258,8 +258,8 @@ "id": "Acl", "path": "FlowLogsFeatureFlag/VPC/PublicSubnet2/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "RouteTable": { @@ -425,8 +425,8 @@ "id": "Acl", "path": "FlowLogsFeatureFlag/VPC/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "RouteTable": { @@ -544,8 +544,8 @@ "id": "Acl", "path": "FlowLogsFeatureFlag/VPC/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "RouteTable": { @@ -1074,22 +1074,22 @@ "id": "Output{\"Fn::GetAtt\":[\"VPCFlowLogsS3BucketFB7DC2BE\",\"Arn\"]}", "path": "FlowLogsFeatureFlag/Exports/Output{\"Fn::GetAtt\":[\"VPCFlowLogsS3BucketFB7DC2BE\",\"Arn\"]}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Output{\"Ref\":\"VPCFlowLogsS3BucketFB7DC2BE\"}": { "id": "Output{\"Ref\":\"VPCFlowLogsS3BucketFB7DC2BE\"}", "path": "FlowLogsFeatureFlag/Exports/Output{\"Ref\":\"VPCFlowLogsS3BucketFB7DC2BE\"}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "FlowLogsInstance": { @@ -1263,22 +1263,22 @@ "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "path": "FlowLogsFeatureFlag/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118": { "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", "path": "FlowLogsFeatureFlag/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "FlowLogsTestStack": { @@ -1360,8 +1360,8 @@ "id": "Acl", "path": "FlowLogsTestStack/VPC/PublicSubnet1/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "RouteTable": { @@ -1527,8 +1527,8 @@ "id": "Acl", "path": "FlowLogsTestStack/VPC/PublicSubnet2/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "RouteTable": { @@ -1694,8 +1694,8 @@ "id": "Acl", "path": "FlowLogsTestStack/VPC/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "RouteTable": { @@ -1813,8 +1813,8 @@ "id": "Acl", "path": "FlowLogsTestStack/VPC/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "RouteTable": { @@ -2553,14 +2553,14 @@ "id": "Default", "path": "FlowLogsTestStack/Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -2577,30 +2577,30 @@ "id": "Staging", "path": "FlowLogsTestStack/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", "path": "FlowLogsTestStack/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", "path": "FlowLogsTestStack/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResourceProvider", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssetParameters": { @@ -2615,42 +2615,42 @@ "id": "S3Bucket", "path": "FlowLogsTestStack/AssetParameters/60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", "path": "FlowLogsTestStack/AssetParameters/60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", "path": "FlowLogsTestStack/AssetParameters/60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "FlowLogs": { @@ -2666,7 +2666,7 @@ "path": "FlowLogs/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "DeployAssert": { @@ -2686,7 +2686,7 @@ "path": "FlowLogs/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV2/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, @@ -2703,14 +2703,14 @@ "id": "Default", "path": "FlowLogs/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV2/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertEqualsS3listObjectsV2": { @@ -2726,7 +2726,7 @@ "path": "FlowLogs/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV2/AssertEqualsS3listObjectsV2/AssertionProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, @@ -2743,22 +2743,22 @@ "id": "Default", "path": "FlowLogs/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV2/AssertEqualsS3listObjectsV2/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertionResults": { "id": "AssertionResults", "path": "FlowLogs/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV2/AssertEqualsS3listObjectsV2/AssertionResults", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -2781,80 +2781,80 @@ "id": "Staging", "path": "FlowLogs/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", "path": "FlowLogs/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", "path": "FlowLogs/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters", "children": { - "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd": { - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket", + "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey", + "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash", + "path": "FlowLogs/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -2871,8 +2871,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr/test/integ.imagescan.ts b/packages/@aws-cdk/aws-ecr/test/integ.imagescan.ts index a7b1766081354..9feece9392f8e 100644 --- a/packages/@aws-cdk/aws-ecr/test/integ.imagescan.ts +++ b/packages/@aws-cdk/aws-ecr/test/integ.imagescan.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as cdk from '@aws-cdk/core'; import * as ecr from '../lib'; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts index 9b73999ee866f..9347a7649d87b 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts @@ -98,6 +98,7 @@ export interface QueueProcessingServiceBaseProps { * The maximum number of times that a message can be received by consumers. * When this value is exceeded for a message the message will be automatically sent to the Dead Letter Queue. * + * If the queue construct is specified, maxReceiveCount should be omitted. * @default 3 */ readonly maxReceiveCount?: number; @@ -106,6 +107,7 @@ export interface QueueProcessingServiceBaseProps { * Timeout of processing a single message. After dequeuing, the processor has this much time to handle the message and delete it from the queue * before it becomes visible again for dequeueing by another processor. Values must be between 0 and (12 hours). * + * If the queue construct is specified, visibilityTimeout should be omitted. * @default Duration.seconds(30) */ readonly visibilityTimeout?: Duration; @@ -113,6 +115,7 @@ export interface QueueProcessingServiceBaseProps { /** * The number of seconds that Dead Letter Queue retains a message. * + * If the queue construct is specified, retentionPeriod should be omitted. * @default Duration.days(14) */ readonly retentionPeriod?: Duration; @@ -288,6 +291,10 @@ export abstract class QueueProcessingServiceBase extends Construct { } this.cluster = props.cluster || this.getDefaultCluster(this, props.vpc); + if (props.queue && (props.retentionPeriod || props.visibilityTimeout || props.maxReceiveCount)) { + const errorProps = ['retentionPeriod', 'visibilityTimeout', 'maxReceiveCount'].filter(prop => props.hasOwnProperty(prop)); + throw new Error(`${errorProps.join(', ')} can be set only when queue is not set. Specify them in the QueueProps of the queue`); + } // Create the SQS queue and it's corresponding DLQ if one is not provided if (props.queue) { this.sqsQueue = props.queue; diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/queue-processing-ecs-service.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/queue-processing-ecs-service.test.ts index df70409b293d2..4a9089ccb8c6c 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/queue-processing-ecs-service.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/queue-processing-ecs-service.test.ts @@ -6,6 +6,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import { AsgCapacityProvider } from '@aws-cdk/aws-ecs'; import * as ecs from '@aws-cdk/aws-ecs'; import * as sqs from '@aws-cdk/aws-sqs'; +import { Queue } from '@aws-cdk/aws-sqs'; import { testDeprecated, testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; @@ -505,3 +506,125 @@ test('can set capacity provider strategies', () => { ], }); }); + +it('can set queue props by queue construct', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + cluster.addAsgCapacityProvider(new AsgCapacityProvider(stack, 'DefaultAutoScalingGroupProvider', { + autoScalingGroup: new AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { + vpc, + instanceType: new ec2.InstanceType('t2.micro'), + machineImage: MachineImage.latestAmazonLinux(), + }), + })); + const queue = new Queue(stack, 'Queue', { + queueName: 'custom-queue', + visibilityTimeout: cdk.Duration.seconds(200), + deadLetterQueue: { + queue: new Queue(stack, 'DeadLetterQueue', { + queueName: 'custom-dead-letter-queue', + retentionPeriod: cdk.Duration.seconds(100), + }), + maxReceiveCount: 10, + }, + }); + + // WHEN + new ecsPatterns.QueueProcessingEc2Service(stack, 'Service', { + cluster: cluster, + memoryLimitMiB: 512, + image: ecs.ContainerImage.fromRegistry('test'), + queue: queue, + }); + + // Queue + Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { + QueueName: 'custom-queue', + VisibilityTimeout: 200, + RedrivePolicy: { + maxReceiveCount: 10, + }, + }); + // DLQ + Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { + QueueName: 'custom-dead-letter-queue', + MessageRetentionPeriod: 100, + }); +}); + +it('can set queue props by QueueProcessingServiceBaseProps', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + cluster.addAsgCapacityProvider(new AsgCapacityProvider(stack, 'DefaultAutoScalingGroupProvider', { + autoScalingGroup: new AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { + vpc, + instanceType: new ec2.InstanceType('t2.micro'), + machineImage: MachineImage.latestAmazonLinux(), + }), + })); + + // WHEN + new ecsPatterns.QueueProcessingEc2Service(stack, 'Service', { + cluster: cluster, + memoryLimitMiB: 512, + image: ecs.ContainerImage.fromRegistry('test'), + retentionPeriod: cdk.Duration.seconds(100), + visibilityTimeout: cdk.Duration.seconds(200), + maxReceiveCount: 10, + }); + + // Queue + Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { + QueueName: Match.absent(), + VisibilityTimeout: 200, + RedrivePolicy: { + maxReceiveCount: 10, + }, + }); + // DLQ + Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { + QueueName: Match.absent(), + MessageRetentionPeriod: 100, + }); +}); + +it('throws validation errors of the specific queue prop, when setting queue and queue related props at same time', () => { + // GIVEN + const stack = new cdk.Stack(); + const queue = new Queue(stack, 'Queue'); + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + cluster.addAsgCapacityProvider(new AsgCapacityProvider(stack, 'DefaultAutoScalingGroupProvider', { + autoScalingGroup: new AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { + vpc, + instanceType: new ec2.InstanceType('t2.micro'), + machineImage: MachineImage.latestAmazonLinux(), + }), + })); + + // Setting all retentionPeriod, visibilityTimeout and maxReceiveCount + expect(() => { + new ecsPatterns.QueueProcessingEc2Service(stack, 'Service1', { + cluster: cluster, + memoryLimitMiB: 512, + image: ecs.ContainerImage.fromRegistry('test'), + queue: queue, + retentionPeriod: cdk.Duration.seconds(100), + visibilityTimeout: cdk.Duration.seconds(200), + maxReceiveCount: 10, + }); + }).toThrow(new Error('retentionPeriod, visibilityTimeout, maxReceiveCount can be set only when queue is not set. Specify them in the QueueProps of the queue')); + + // Setting only visibilityTimeout + expect(() => { + new ecsPatterns.QueueProcessingFargateService(stack, 'Service2', { + image: ecs.ContainerImage.fromRegistry('test'), + queue: queue, + visibilityTimeout: cdk.Duration.seconds(200), + }); + }).toThrow(new Error('visibilityTimeout can be set only when queue is not set. Specify them in the QueueProps of the queue')); +}); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts index 0164356061d61..baabcb914289e 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts @@ -5,6 +5,7 @@ import { MachineImage } from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import { AsgCapacityProvider } from '@aws-cdk/aws-ecs'; import * as sqs from '@aws-cdk/aws-sqs'; +import { Queue } from '@aws-cdk/aws-sqs'; import { testDeprecated, testFutureBehavior } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; @@ -653,3 +654,92 @@ test('can set capacity provider strategies', () => { ], }); }); + +it('can set queue props by queue construct', () => { + // GIVEN + const stack = new cdk.Stack(); + const queue = new Queue(stack, 'Queue', { + queueName: 'custom-queue', + visibilityTimeout: cdk.Duration.seconds(200), + deadLetterQueue: { + queue: new Queue(stack, 'DeadLetterQueue', { + queueName: 'custom-dead-letter-queue', + retentionPeriod: cdk.Duration.seconds(100), + }), + maxReceiveCount: 10, + }, + }); + + // WHEN + new ecsPatterns.QueueProcessingFargateService(stack, 'Service', { + image: ecs.ContainerImage.fromRegistry('test'), + queue: queue, + }); + + // Queue + Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { + QueueName: 'custom-queue', + VisibilityTimeout: 200, + RedrivePolicy: { + maxReceiveCount: 10, + }, + }); + // DLQ + Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { + QueueName: 'custom-dead-letter-queue', + MessageRetentionPeriod: 100, + }); +}); + +it('can set queue props by QueueProcessingServiceBaseProps', () => { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + new ecsPatterns.QueueProcessingFargateService(stack, 'Service', { + image: ecs.ContainerImage.fromRegistry('test'), + retentionPeriod: cdk.Duration.seconds(100), + visibilityTimeout: cdk.Duration.seconds(200), + maxReceiveCount: 10, + }); + + // Queue + Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { + QueueName: Match.absent(), + VisibilityTimeout: 200, + RedrivePolicy: { + maxReceiveCount: 10, + }, + }); + // DLQ + Template.fromStack(stack).hasResourceProperties('AWS::SQS::Queue', { + QueueName: Match.absent(), + MessageRetentionPeriod: 100, + }); +}); + +it('throws validation errors of the specific queue prop, when setting queue and queue related props at same time', () => { + // GIVEN + const stack = new cdk.Stack(); + const queue = new Queue(stack, 'Queue'); + + // Setting all retentionPeriod, visibilityTimeout and maxReceiveCount + expect(() => { + new ecsPatterns.QueueProcessingFargateService(stack, 'Service1', { + image: ecs.ContainerImage.fromRegistry('test'), + queue: queue, + retentionPeriod: cdk.Duration.seconds(100), + visibilityTimeout: cdk.Duration.seconds(200), + maxReceiveCount: 10, + }); + }).toThrow(new Error('retentionPeriod, visibilityTimeout, maxReceiveCount can be set only when queue is not set. Specify them in the QueueProps of the queue')); + + // Setting only visibilityTimeout + expect(() => { + new ecsPatterns.QueueProcessingFargateService(stack, 'Service2', { + image: ecs.ContainerImage.fromRegistry('test'), + queue: queue, + visibilityTimeout: cdk.Duration.seconds(200), + }); + }).toThrow(new Error('visibilityTimeout can be set only when queue is not set. Specify them in the QueueProps of the queue')); +}); diff --git a/packages/@aws-cdk/aws-ecs/README.md b/packages/@aws-cdk/aws-ecs/README.md index bf67ee5437d26..aa83bf6c8f91b 100644 --- a/packages/@aws-cdk/aws-ecs/README.md +++ b/packages/@aws-cdk/aws-ecs/README.md @@ -868,13 +868,15 @@ taskDefinition.addContainer('TheContainer', { ### splunk Log Driver ```ts +declare const secret: secretsmanager.Secret; + // Create a Task Definition for the container to start const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef'); taskDefinition.addContainer('TheContainer', { image: ecs.ContainerImage.fromRegistry('example-image'), memoryLimitMiB: 256, logging: ecs.LogDrivers.splunk({ - token: SecretValue.secretsManager('my-splunk-token'), + secretToken: secret, url: 'my-splunk-url', }), }); diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts index 0069db85635df..87582fbd18be8 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts @@ -37,11 +37,8 @@ export interface SplunkLogDriverProps extends BaseLogDriverProps { * * The splunk-token is added to the SecretOptions property of the Log Driver Configuration. So the secret value will not be * resolved or viewable as plain text. - * - * Please provide at least one of `token` or `secretToken`. - * @default - If secret token is not provided, then the value provided in `token` will be used. */ - readonly secretToken?: Secret; + readonly secretToken: Secret; /** * Path to your Splunk Enterprise, self-service Splunk Cloud instance, or Splunk diff --git a/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts b/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts index b33b4155615a4..02786fa5d61cc 100644 --- a/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts @@ -209,16 +209,4 @@ describe('splunk log driver', () => { ], }); }); - - test('throws when neither token nor secret token are provided', () => { - expect(() => { - td.addContainer('Container', { - image, - logging: ecs.LogDrivers.splunk({ - url: 'my-splunk-url', - }), - memoryLimitMiB: 128, - }); - }).toThrow('Please provide either token or secretToken.'); - }); }); diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index 71e3dffd22071..d47e07847071b 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -90,7 +90,7 @@ "@types/sinon": "^9.0.11", "@types/yaml": "1.9.6", "aws-sdk": "^2.848.0", - "cdk8s": "^2.4.14", + "cdk8s": "^2.4.17", "cdk8s-plus-21": "^2.0.0-beta.12", "jest": "^27.5.1", "sinon": "^9.2.4" diff --git a/packages/@aws-cdk/aws-eks/test/integ.alb-controller.ts b/packages/@aws-cdk/aws-eks/test/integ.alb-controller.ts index 70c307c90ff90..841cf0fc5aeb7 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.alb-controller.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.alb-controller.ts @@ -1,4 +1,4 @@ -/// !cdk-integ pragma:ignore-assets pragma:disable-update-workflow +/// !cdk-integ pragma:disable-update-workflow import * as ec2 from '@aws-cdk/aws-ec2'; import { App, CfnOutput, Duration, Stack } from '@aws-cdk/core'; import * as cdk8s from 'cdk8s'; diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-bottlerocket-ng.ts b/packages/@aws-cdk/aws-eks/test/integ.eks-bottlerocket-ng.ts index e3a5a58ab86ab..60333ed564d1e 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-bottlerocket-ng.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-bottlerocket-ng.ts @@ -1,4 +1,4 @@ -/// !cdk-integ pragma:ignore-assets pragma:disable-update-workflow +/// !cdk-integ pragma:disable-update-workflow import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import { App, Stack } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-handlers-vpc.ts b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-handlers-vpc.ts index 711ebc5c72656..327e18bb2c936 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-handlers-vpc.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-handlers-vpc.ts @@ -1,4 +1,4 @@ -/// !cdk-integ pragma:ignore-assets pragma:disable-update-workflow +/// !cdk-integ pragma:disable-update-workflow import { App, Stack } from '@aws-cdk/core'; import * as eks from '../lib'; diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-private-endpoint.ts b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-private-endpoint.ts index cdb6c1ff90e89..0014b79130ec8 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-private-endpoint.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-private-endpoint.ts @@ -1,4 +1,4 @@ -/// !cdk-integ pragma:ignore-assets pragma:disable-update-workflow +/// !cdk-integ pragma:disable-update-workflow import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import { App, Stack } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.ts b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.ts index 248f6c2f714e0..de19a5a829e96 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.ts @@ -1,4 +1,4 @@ -/// !cdk-integ pragma:ignore-assets pragma:disable-update-workflow +/// !cdk-integ pragma:disable-update-workflow import * as path from 'path'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-inference.ts b/packages/@aws-cdk/aws-eks/test/integ.eks-inference.ts index 775eabc66097d..a97f4e83e42ed 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-inference.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-inference.ts @@ -1,4 +1,4 @@ -/// !cdk-integ pragma:ignore-assets pragma:disable-update-workflow +/// !cdk-integ pragma:disable-update-workflow import * as ec2 from '@aws-cdk/aws-ec2'; import { App, Stack } from '@aws-cdk/core'; import * as eks from '../lib'; diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-oidc-provider.ts b/packages/@aws-cdk/aws-eks/test/integ.eks-oidc-provider.ts index 79a7ad4493b28..ad04871ffed1d 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-oidc-provider.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-oidc-provider.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { App, Stack } from '@aws-cdk/core'; import * as eks from '../lib'; diff --git a/packages/@aws-cdk/aws-eks/test/integ.fargate-cluster.ts b/packages/@aws-cdk/aws-eks/test/integ.fargate-cluster.ts index a0b990deff1a5..9e506e303b943 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.fargate-cluster.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.fargate-cluster.ts @@ -1,4 +1,4 @@ -/// !cdk-integ pragma:ignore-assets pragma:disable-update-workflow +/// !cdk-integ pragma:disable-update-workflow import { App, Stack } from '@aws-cdk/core'; import * as eks from '../lib'; diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.ts b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.ts index 73475672f1716..1c1d3493d5057 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ts b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ts index fb112d26390ee..dfef1fe48b1b9 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.ts b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.ts index a294d793f0862..5e7fb2787972d 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as es from '../lib'; diff --git a/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.ts b/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.ts index cc1b49612b04e..9dc135dfef993 100644 --- a/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.ts +++ b/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as events from '@aws-cdk/aws-events'; import * as cdk from '@aws-cdk/core'; import * as targets from '../../lib'; diff --git a/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.ts b/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.ts index 5a102ea3cba6c..7874121359afc 100644 --- a/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.ts +++ b/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as events from '@aws-cdk/aws-events'; import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/integ.log-group.ts b/packages/@aws-cdk/aws-events-targets/test/logs/integ.log-group.ts index 7b9cf2ebe2e57..88004a8f44c5f 100644 --- a/packages/@aws-cdk/aws-events-targets/test/logs/integ.log-group.ts +++ b/packages/@aws-cdk/aws-events-targets/test/logs/integ.log-group.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as events from '@aws-cdk/aws-events'; import * as logs from '@aws-cdk/aws-logs'; import * as sqs from '@aws-cdk/aws-sqs'; @@ -86,4 +85,3 @@ logEvents.node.addDependency(putEvent); logEvents.assertAtPath('events.0.message', ExpectedResult.stringLikeRegexp(expectedValue)); app.synth(); - diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/LogGroupDefaultTestDeployAssert353EE07A.template.json b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/LogGroupDefaultTestDeployAssert353EE07A.template.json index 4f7be1d2b933a..8e7ef7600601a 100644 --- a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/LogGroupDefaultTestDeployAssert353EE07A.template.json +++ b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/LogGroupDefaultTestDeployAssert353EE07A.template.json @@ -14,14 +14,14 @@ "parameters": { "Entries": [ { - "Detail": "{\"date\":\"abc1655234384146\"}", + "Detail": "{\"date\":\"abc1661796816664\"}", "DetailType": "cdk-integ-custom-rule", "Source": "cdk-integ" } ] }, "flattenResponse": "false", - "salt": "1655234384148" + "salt": "1661796816666" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -91,7 +91,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3BucketA9F12763" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" }, "S3Key": { "Fn::Join": [ @@ -104,7 +104,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3VersionKey589F30A2" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -117,7 +117,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3VersionKey589F30A2" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -152,11 +152,11 @@ "logGroupName": { "Fn::ImportValue": "log-group-events:ExportsOutputRefloggroup2F19C5C9B4F4C6918" }, - "startTime": "1655234384146", + "startTime": "1661796816664", "limit": 1 }, "flattenResponse": "true", - "salt": "1655234384149" + "salt": "1661796816667" }, "DependsOn": [ "AwsApiCallEventBridgeputEvents" @@ -179,8 +179,8 @@ "apiCallResponse.events.0.message" ] }, - "expected": "{\"$StringLike\":\"abc1655234384146\"}", - "salt": "1655234384149" + "expected": "{\"$StringLike\":\"abc1661796816664\"}", + "salt": "1661796816667" }, "DependsOn": [ "AwsApiCallEventBridgeputEvents" @@ -190,17 +190,17 @@ } }, "Parameters": { - "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3BucketA9F12763": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80": { "Type": "String", - "Description": "S3 bucket for asset \"41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736\"" + "Description": "S3 bucket for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3VersionKey589F30A2": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE": { "Type": "String", - "Description": "S3 key for asset version \"41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736\"" + "Description": "S3 key for asset version \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736ArtifactHash2CC614EA": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036": { "Type": "String", - "Description": "Artifact hash for asset \"41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736\"" + "Description": "Artifact hash for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/index.js b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/index.js new file mode 100644 index 0000000000000..7bae87b06d44d --- /dev/null +++ b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/index.js @@ -0,0 +1,252 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handler = exports.forceSdkInstallation = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/* eslint-disable no-console */ +const child_process_1 = require("child_process"); +const fs = require("fs"); +const path_1 = require("path"); +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + return Object.assign({}, ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + }(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +let latestSdkInstalled = false; +function forceSdkInstallation() { + latestSdkInstalled = false; +} +exports.forceSdkInstallation = forceSdkInstallation; +/** + * Installs latest AWS SDK v2 + */ +function installLatestSdk() { + console.log('Installing latest AWS SDK v2'); + // Both HOME and --prefix are needed here because /tmp is the only writable location + child_process_1.execSync('HOME=/tmp npm install aws-sdk@2 --production --no-package-lock --no-save --prefix /tmp'); + latestSdkInstalled = true; +} +// no currently patched services +const patchedServices = []; +/** + * Patches the AWS SDK by loading service models in the same manner as the actual SDK + */ +function patchSdk(awsSdk) { + const apiLoader = awsSdk.apiLoader; + patchedServices.forEach(({ serviceName, apiVersions }) => { + const lowerServiceName = serviceName.toLowerCase(); + if (!awsSdk.Service.hasService(lowerServiceName)) { + apiLoader.services[lowerServiceName] = {}; + awsSdk[serviceName] = awsSdk.Service.defineService(lowerServiceName, apiVersions); + } + else { + awsSdk.Service.addVersions(awsSdk[serviceName], apiVersions); + } + apiVersions.forEach(apiVersion => { + Object.defineProperty(apiLoader.services[lowerServiceName], apiVersion, { + get: function get() { + const modelFilePrefix = `aws-sdk-patch/${lowerServiceName}-${apiVersion}`; + const model = JSON.parse(fs.readFileSync(path_1.join(__dirname, `${modelFilePrefix}.service.json`), 'utf-8')); + model.paginators = JSON.parse(fs.readFileSync(path_1.join(__dirname, `${modelFilePrefix}.paginators.json`), 'utf-8')).pagination; + return model; + }, + enumerable: true, + configurable: true, + }); + }); + }); + return awsSdk; +} +/* eslint-disable @typescript-eslint/no-require-imports, import/no-extraneous-dependencies */ +async function handler(event, context) { + try { + let AWS; + if (!latestSdkInstalled && event.ResourceProperties.InstallLatestAwsSdk === 'true') { + try { + installLatestSdk(); + AWS = require('/tmp/node_modules/aws-sdk'); + } + catch (e) { + console.log(`Failed to install latest AWS SDK v2: ${e}`); + AWS = require('aws-sdk'); // Fallback to pre-installed version + } + } + else if (latestSdkInstalled) { + AWS = require('/tmp/node_modules/aws-sdk'); + } + else { + AWS = require('aws-sdk'); + } + try { + AWS = patchSdk(AWS); + } + catch (e) { + console.log(`Failed to patch AWS SDK: ${e}. Proceeding with the installed copy.`); + } + console.log(JSON.stringify({ ...event, ResponseURL: '...' })); + console.log('AWS SDK VERSION: ' + AWS.VERSION); + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + // Default physical resource id + let physicalResourceId; + switch (event.RequestType) { + case 'Create': + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? + event.ResourceProperties.Update?.physicalResourceId?.id ?? + event.ResourceProperties.Delete?.physicalResourceId?.id ?? + event.LogicalResourceId; + break; + case 'Update': + case 'Delete': + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + let flatData = {}; + let data = {}; + const call = event.ResourceProperties[event.RequestType]; + if (call) { + let credentials; + if (call.assumedRoleArn) { + const timestamp = (new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64), + }; + credentials = new AWS.ChainableTemporaryCredentials({ + params: params, + }); + } + if (!Object.prototype.hasOwnProperty.call(AWS, call.service)) { + throw Error(`Service ${call.service} does not exist in AWS SDK version ${AWS.VERSION}.`); + } + const awsService = new AWS[call.service]({ + apiVersion: call.apiVersion, + credentials: credentials, + region: call.region, + }); + try { + const response = await awsService[call.action](call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)).promise(); + flatData = { + apiVersion: awsService.config.apiVersion, + region: awsService.config.region, + ...flatten(response), + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } + else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } + else { + data = flatData; + } + } + catch (e) { + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(e.code)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond('SUCCESS', 'OK', physicalResourceId, data); + } + catch (e) { + console.log(e); + await respond('FAILED', e.message || 'Internal Error', context.logStreamName, {}); + } + function respond(responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { 'content-type': '', 'content-length': responseBody.length }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); + } +} +exports.handler = handler; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsaURBQXlDO0FBQ3pDLHlCQUF5QjtBQUN6QiwrQkFBNEI7QUFTNUI7O0dBRUc7QUFDVSxRQUFBLDhCQUE4QixHQUFHLHNCQUFzQixDQUFDO0FBRXJFOzs7OztHQUtHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLE1BQWM7SUFDcEMsT0FBTyxNQUFNLENBQUMsTUFBTSxDQUNsQixFQUFFLEVBQ0YsR0FBRyxTQUFTLFFBQVEsQ0FBQyxLQUFVLEVBQUUsT0FBaUIsRUFBRTtRQUNsRCxPQUFPLEVBQUUsQ0FBQyxNQUFNLENBQUMsR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQzthQUNuQyxHQUFHLENBQUMsR0FBRyxDQUFDLEVBQUU7WUFDVCxNQUFNLFFBQVEsR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7WUFDeEYsT0FBTyxPQUFPLFFBQVEsS0FBSyxRQUFRLElBQUksUUFBUSxLQUFLLElBQUk7Z0JBQ3RELENBQUMsQ0FBQyxRQUFRLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO2dCQUN4QyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsUUFBUSxFQUFFLENBQUMsQ0FBQztRQUNyRCxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ1IsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUNWLENBQUM7QUFDSixDQUFDO0FBYkQsMEJBYUM7QUFFRDs7R0FFRztBQUNILFNBQVMsbUJBQW1CLENBQUMsTUFBYyxFQUFFLGtCQUEwQjtJQUNyRSxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUNsRCxRQUFRLENBQUMsRUFBRTtZQUNULEtBQUssc0NBQThCO2dCQUNqQyxPQUFPLGtCQUFrQixDQUFDO1lBQzVCO2dCQUNFLE9BQU8sQ0FBQyxDQUFDO1NBQ1o7SUFDSCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUM7QUFFRDs7R0FFRztBQUNILFNBQVMsVUFBVSxDQUFDLE1BQWMsRUFBRSxJQUE4QjtJQUNoRSxPQUFPLE1BQU0sQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDO1NBQzFCLE1BQU0sQ0FDTCxDQUFDLEdBQUcsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztRQUN0QixDQUFDLENBQUMsRUFBRSxHQUFHLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRTtRQUNwQixDQUFDLENBQUMsR0FBRyxFQUNQLEVBQUUsQ0FDSCxDQUFDO0FBQ04sQ0FBQztBQUVELElBQUksa0JBQWtCLEdBQUcsS0FBSyxDQUFDO0FBRS9CLFNBQWdCLG9CQUFvQjtJQUNsQyxrQkFBa0IsR0FBRyxLQUFLLENBQUM7QUFDN0IsQ0FBQztBQUZELG9EQUVDO0FBRUQ7O0dBRUc7QUFDSCxTQUFTLGdCQUFnQjtJQUN2QixPQUFPLENBQUMsR0FBRyxDQUFDLDhCQUE4QixDQUFDLENBQUM7SUFDNUMsb0ZBQW9GO0lBQ3BGLHdCQUFRLENBQUMsd0ZBQXdGLENBQUMsQ0FBQztJQUNuRyxrQkFBa0IsR0FBRyxJQUFJLENBQUM7QUFDNUIsQ0FBQztBQUVELGdDQUFnQztBQUNoQyxNQUFNLGVBQWUsR0FBcUQsRUFBRSxDQUFDO0FBQzdFOztHQUVHO0FBQ0gsU0FBUyxRQUFRLENBQUMsTUFBVztJQUMzQixNQUFNLFNBQVMsR0FBRyxNQUFNLENBQUMsU0FBUyxDQUFDO0lBQ25DLGVBQWUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxFQUFFLFdBQVcsRUFBRSxXQUFXLEVBQUUsRUFBRSxFQUFFO1FBQ3ZELE1BQU0sZ0JBQWdCLEdBQUcsV0FBVyxDQUFDLFdBQVcsRUFBRSxDQUFDO1FBQ25ELElBQUksQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxnQkFBZ0IsQ0FBQyxFQUFFO1lBQ2hELFNBQVMsQ0FBQyxRQUFRLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxFQUFFLENBQUM7WUFDMUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLGdCQUFnQixFQUFFLFdBQVcsQ0FBQyxDQUFDO1NBQ25GO2FBQU07WUFDTCxNQUFNLENBQUMsT0FBTyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLEVBQUUsV0FBVyxDQUFDLENBQUM7U0FDOUQ7UUFDRCxXQUFXLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxFQUFFO1lBQy9CLE1BQU0sQ0FBQyxjQUFjLENBQUMsU0FBUyxDQUFDLFFBQVEsQ0FBQyxnQkFBZ0IsQ0FBQyxFQUFFLFVBQVUsRUFBRTtnQkFDdEUsR0FBRyxFQUFFLFNBQVMsR0FBRztvQkFDZixNQUFNLGVBQWUsR0FBRyxpQkFBaUIsZ0JBQWdCLElBQUksVUFBVSxFQUFFLENBQUM7b0JBQzFFLE1BQU0sS0FBSyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxXQUFJLENBQUMsU0FBUyxFQUFFLEdBQUcsZUFBZSxlQUFlLENBQUMsRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFDO29CQUN2RyxLQUFLLENBQUMsVUFBVSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxXQUFJLENBQUMsU0FBUyxFQUFFLEdBQUcsZUFBZSxrQkFBa0IsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDO29CQUMxSCxPQUFPLEtBQUssQ0FBQztnQkFDZixDQUFDO2dCQUNELFVBQVUsRUFBRSxJQUFJO2dCQUNoQixZQUFZLEVBQUUsSUFBSTthQUNuQixDQUFDLENBQUM7UUFDTCxDQUFDLENBQUMsQ0FBQztJQUNMLENBQUMsQ0FBQyxDQUFDO0lBQ0gsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQztBQUVELDZGQUE2RjtBQUN0RixLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQWtELEVBQUUsT0FBMEI7SUFDMUcsSUFBSTtRQUNGLElBQUksR0FBUSxDQUFDO1FBQ2IsSUFBSSxDQUFDLGtCQUFrQixJQUFJLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxtQkFBbUIsS0FBSyxNQUFNLEVBQUU7WUFDbEYsSUFBSTtnQkFDRixnQkFBZ0IsRUFBRSxDQUFDO2dCQUNuQixHQUFHLEdBQUcsT0FBTyxDQUFDLDJCQUEyQixDQUFDLENBQUM7YUFDNUM7WUFBQyxPQUFPLENBQUMsRUFBRTtnQkFDVixPQUFPLENBQUMsR0FBRyxDQUFDLHdDQUF3QyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2dCQUN6RCxHQUFHLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsb0NBQW9DO2FBQy9EO1NBQ0Y7YUFBTSxJQUFJLGtCQUFrQixFQUFFO1lBQzdCLEdBQUcsR0FBRyxPQUFPLENBQUMsMkJBQTJCLENBQUMsQ0FBQztTQUM1QzthQUFNO1lBQ0wsR0FBRyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztTQUMxQjtRQUNELElBQUk7WUFDRixHQUFHLEdBQUcsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1NBQ3JCO1FBQUMsT0FBTyxDQUFDLEVBQUU7WUFDVixPQUFPLENBQUMsR0FBRyxDQUFDLDRCQUE0QixDQUFDLHVDQUF1QyxDQUFDLENBQUM7U0FDbkY7UUFFRCxPQUFPLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsRUFBRSxHQUFHLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFDO1FBQzlELE9BQU8sQ0FBQyxHQUFHLENBQUMsbUJBQW1CLEdBQUcsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBRS9DLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLEdBQUcsVUFBVSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUM5RSxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxHQUFHLFVBQVUsQ0FBQyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDOUUsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sR0FBRyxVQUFVLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQzlFLCtCQUErQjtRQUMvQixJQUFJLGtCQUEwQixDQUFDO1FBQy9CLFFBQVEsS0FBSyxDQUFDLFdBQVcsRUFBRTtZQUN6QixLQUFLLFFBQVE7Z0JBQ1gsa0JBQWtCLEdBQUcsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sRUFBRSxrQkFBa0IsRUFBRSxFQUFFO29CQUN2RCxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxFQUFFLGtCQUFrQixFQUFFLEVBQUU7b0JBQ3ZELEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLEVBQUUsa0JBQWtCLEVBQUUsRUFBRTtvQkFDdkQsS0FBSyxDQUFDLGlCQUFpQixDQUFDO2dCQUM3QyxNQUFNO1lBQ1IsS0FBSyxRQUFRLENBQUM7WUFDZCxLQUFLLFFBQVE7Z0JBQ1gsa0JBQWtCLEdBQUcsS0FBSyxDQUFDLGtCQUFrQixDQUFDLEtBQUssQ0FBQyxXQUFXLENBQUMsRUFBRSxrQkFBa0IsRUFBRSxFQUFFLElBQUksS0FBSyxDQUFDLGtCQUFrQixDQUFDO2dCQUNySCxNQUFNO1NBQ1Q7UUFFRCxJQUFJLFFBQVEsR0FBOEIsRUFBRSxDQUFDO1FBQzdDLElBQUksSUFBSSxHQUE4QixFQUFFLENBQUM7UUFDekMsTUFBTSxJQUFJLEdBQTJCLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUM7UUFFakYsSUFBSSxJQUFJLEVBQUU7WUFFUixJQUFJLFdBQVcsQ0FBQztZQUNoQixJQUFJLElBQUksQ0FBQyxjQUFjLEVBQUU7Z0JBQ3ZCLE1BQU0sU0FBUyxHQUFHLENBQUMsSUFBSSxJQUFJLEVBQUUsQ0FBQyxDQUFDLE9BQU8sRUFBRSxDQUFDO2dCQUV6QyxNQUFNLE1BQU0sR0FBRztvQkFDYixPQUFPLEVBQUUsSUFBSSxDQUFDLGNBQWM7b0JBQzVCLGVBQWUsRUFBRSxHQUFHLFNBQVMsSUFBSSxrQkFBa0IsRUFBRSxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDO2lCQUN2RSxDQUFDO2dCQUVGLFdBQVcsR0FBRyxJQUFJLEdBQUcsQ0FBQyw2QkFBNkIsQ0FBQztvQkFDbEQsTUFBTSxFQUFFLE1BQU07aUJBQ2YsQ0FBQyxDQUFDO2FBQ0o7WUFFRCxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLEVBQUU7Z0JBQzVELE1BQU0sS0FBSyxDQUFDLFdBQVcsSUFBSSxDQUFDLE9BQU8sc0NBQXNDLEdBQUcsQ0FBQyxPQUFPLEdBQUcsQ0FBQyxDQUFDO2FBQzFGO1lBQ0QsTUFBTSxVQUFVLEdBQUcsSUFBSyxHQUFXLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO2dCQUNoRCxVQUFVLEVBQUUsSUFBSSxDQUFDLFVBQVU7Z0JBQzNCLFdBQVcsRUFBRSxXQUFXO2dCQUN4QixNQUFNLEVBQUUsSUFBSSxDQUFDLE1BQU07YUFDcEIsQ0FBQyxDQUFDO1lBRUgsSUFBSTtnQkFDRixNQUFNLFFBQVEsR0FBRyxNQUFNLFVBQVUsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQzVDLElBQUksQ0FBQyxVQUFVLElBQUksbUJBQW1CLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxrQkFBa0IsQ0FBQyxDQUFDLENBQUMsT0FBTyxFQUFFLENBQUM7Z0JBQ3pGLFFBQVEsR0FBRztvQkFDVCxVQUFVLEVBQUUsVUFBVSxDQUFDLE1BQU0sQ0FBQyxVQUFVO29CQUN4QyxNQUFNLEVBQUUsVUFBVSxDQUFDLE1BQU0sQ0FBQyxNQUFNO29CQUNoQyxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUM7aUJBQ3JCLENBQUM7Z0JBRUYsSUFBSSxXQUFpQyxDQUFDO2dCQUN0QyxJQUFJLElBQUksQ0FBQyxVQUFVLEVBQUU7b0JBQ25CLFdBQVcsR0FBRyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQztpQkFDakM7cUJBQU0sSUFBSSxJQUFJLENBQUMsV0FBVyxFQUFFO29CQUMzQixXQUFXLEdBQUcsSUFBSSxDQUFDLFdBQVcsQ0FBQztpQkFDaEM7Z0JBRUQsSUFBSSxXQUFXLEVBQUU7b0JBQ2YsSUFBSSxHQUFHLFVBQVUsQ0FBQyxRQUFRLEVBQUUsZUFBZSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7aUJBQzNEO3FCQUFNO29CQUNMLElBQUksR0FBRyxRQUFRLENBQUM7aUJBQ2pCO2FBQ0Y7WUFBQyxPQUFPLENBQUMsRUFBRTtnQkFDVixJQUFJLENBQUMsSUFBSSxDQUFDLHdCQUF3QixJQUFJLENBQUMsSUFBSSxNQUFNLENBQUMsSUFBSSxDQUFDLHdCQUF3QixDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsRUFBRTtvQkFDN0YsTUFBTSxDQUFDLENBQUM7aUJBQ1Q7YUFDRjtZQUVELElBQUksSUFBSSxDQUFDLGtCQUFrQixFQUFFLFlBQVksRUFBRTtnQkFDekMsa0JBQWtCLEdBQUcsUUFBUSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxZQUFZLENBQUMsQ0FBQzthQUNyRTtTQUNGO1FBRUQsTUFBTSxPQUFPLENBQUMsU0FBUyxFQUFFLElBQUksRUFBRSxrQkFBa0IsRUFBRSxJQUFJLENBQUMsQ0FBQztLQUMxRDtJQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQ1YsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUNmLE1BQU0sT0FBTyxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUMsT0FBTyxJQUFJLGdCQUFnQixFQUFFLE9BQU8sQ0FBQyxhQUFhLEVBQUUsRUFBRSxDQUFDLENBQUM7S0FDbkY7SUFFRCxTQUFTLE9BQU8sQ0FBQyxjQUFzQixFQUFFLE1BQWMsRUFBRSxrQkFBMEIsRUFBRSxJQUFTO1FBQzVGLE1BQU0sWUFBWSxHQUFHLElBQUksQ0FBQyxTQUFTLENBQUM7WUFDbEMsTUFBTSxFQUFFLGNBQWM7WUFDdEIsTUFBTSxFQUFFLE1BQU07WUFDZCxrQkFBa0IsRUFBRSxrQkFBa0I7WUFDdEMsT0FBTyxFQUFFLEtBQUssQ0FBQyxPQUFPO1lBQ3RCLFNBQVMsRUFBRSxLQUFLLENBQUMsU0FBUztZQUMxQixpQkFBaUIsRUFBRSxLQUFLLENBQUMsaUJBQWlCO1lBQzFDLE1BQU0sRUFBRSxLQUFLO1lBQ2IsSUFBSSxFQUFFLElBQUk7U0FDWCxDQUFDLENBQUM7UUFFSCxPQUFPLENBQUMsR0FBRyxDQUFDLFlBQVksRUFBRSxZQUFZLENBQUMsQ0FBQztRQUV4QyxpRUFBaUU7UUFDakUsTUFBTSxTQUFTLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUM7UUFDMUQsTUFBTSxjQUFjLEdBQUc7WUFDckIsUUFBUSxFQUFFLFNBQVMsQ0FBQyxRQUFRO1lBQzVCLElBQUksRUFBRSxTQUFTLENBQUMsSUFBSTtZQUNwQixNQUFNLEVBQUUsS0FBSztZQUNiLE9BQU8sRUFBRSxFQUFFLGNBQWMsRUFBRSxFQUFFLEVBQUUsZ0JBQWdCLEVBQUUsWUFBWSxDQUFDLE1BQU0sRUFBRTtTQUN2RSxDQUFDO1FBRUYsT0FBTyxJQUFJLE9BQU8sQ0FBQyxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsRUFBRTtZQUNyQyxJQUFJO2dCQUNGLGlFQUFpRTtnQkFDakUsTUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLEVBQUUsT0FBTyxDQUFDLENBQUM7Z0JBQ2xFLE9BQU8sQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFFLE1BQU0sQ0FBQyxDQUFDO2dCQUM1QixPQUFPLENBQUMsS0FBSyxDQUFDLFlBQVksQ0FBQyxDQUFDO2dCQUM1QixPQUFPLENBQUMsR0FBRyxFQUFFLENBQUM7YUFDZjtZQUFDLE9BQU8sQ0FBQyxFQUFFO2dCQUNWLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQzthQUNYO1FBQ0gsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDO0FBQ0gsQ0FBQztBQWpKRCwwQkFpSkM7QUFFRCxTQUFTLFVBQVUsQ0FBQyxJQUF3QjtJQUMxQyxJQUFJLENBQUMsSUFBSSxFQUFFO1FBQUUsT0FBTyxTQUFTLENBQUM7S0FBRTtJQUNoQyxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDMUIsQ0FBQztBQUVELFNBQVMsZUFBZSxDQUFDLGFBQXVCO0lBQzlDLE9BQU8sVUFBUyxNQUFjO1FBQzVCLEtBQUssTUFBTSxZQUFZLElBQUksYUFBYSxFQUFFO1lBQ3hDLElBQUksTUFBTSxDQUFDLFVBQVUsQ0FBQyxZQUFZLENBQUMsRUFBRTtnQkFDbkMsT0FBTyxJQUFJLENBQUM7YUFDYjtTQUNGO1FBQ0QsT0FBTyxLQUFLLENBQUM7SUFDZixDQUFDLENBQUM7QUFDSixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuaW1wb3J0IHsgZXhlY1N5bmMgfSBmcm9tICdjaGlsZF9wcm9jZXNzJztcbmltcG9ydCAqIGFzIGZzIGZyb20gJ2ZzJztcbmltcG9ydCB7IGpvaW4gfSBmcm9tICdwYXRoJztcbi8vIGltcG9ydCB0aGUgQVdTTGFtYmRhIHBhY2thZ2UgZXhwbGljaXRseSxcbi8vIHdoaWNoIGlzIGdsb2JhbGx5IGF2YWlsYWJsZSBpbiB0aGUgTGFtYmRhIHJ1bnRpbWUsXG4vLyBhcyBvdGhlcndpc2UgbGlua2luZyB0aGlzIHJlcG9zaXRvcnkgd2l0aCBsaW5rLWFsbC5zaFxuLy8gZmFpbHMgaW4gdGhlIENESyBhcHAgZXhlY3V0ZWQgd2l0aCB0cy1ub2RlXG4vKiBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgaW1wb3J0L25vLWV4dHJhbmVvdXMtZGVwZW5kZW5jaWVzLGltcG9ydC9uby11bnJlc29sdmVkICovXG5pbXBvcnQgKiBhcyBBV1NMYW1iZGEgZnJvbSAnYXdzLWxhbWJkYSc7XG5pbXBvcnQgeyBBd3NTZGtDYWxsIH0gZnJvbSAnLi4vYXdzLWN1c3RvbS1yZXNvdXJjZSc7XG5cbi8qKlxuICogU2VyaWFsaXplZCBmb3JtIG9mIHRoZSBwaHlzaWNhbCByZXNvdXJjZSBpZCBmb3IgdXNlIGluIHRoZSBvcGVyYXRpb24gcGFyYW1ldGVyc1xuICovXG5leHBvcnQgY29uc3QgUEhZU0lDQUxfUkVTT1VSQ0VfSURfUkVGRVJFTkNFID0gJ1BIWVNJQ0FMOlJFU09VUkNFSUQ6JztcblxuLyoqXG4gKiBGbGF0dGVucyBhIG5lc3RlZCBvYmplY3RcbiAqXG4gKiBAcGFyYW0gb2JqZWN0IHRoZSBvYmplY3QgdG8gYmUgZmxhdHRlbmVkXG4gKiBAcmV0dXJucyBhIGZsYXQgb2JqZWN0IHdpdGggcGF0aCBhcyBrZXlzXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBmbGF0dGVuKG9iamVjdDogb2JqZWN0KTogeyBba2V5OiBzdHJpbmddOiBhbnkgfSB7XG4gIHJldHVybiBPYmplY3QuYXNzaWduKFxuICAgIHt9LFxuICAgIC4uLmZ1bmN0aW9uIF9mbGF0dGVuKGNoaWxkOiBhbnksIHBhdGg6IHN0cmluZ1tdID0gW10pOiBhbnkge1xuICAgICAgcmV0dXJuIFtdLmNvbmNhdCguLi5PYmplY3Qua2V5cyhjaGlsZClcbiAgICAgICAgLm1hcChrZXkgPT4ge1xuICAgICAgICAgIGNvbnN0IGNoaWxkS2V5ID0gQnVmZmVyLmlzQnVmZmVyKGNoaWxkW2tleV0pID8gY2hpbGRba2V5XS50b1N0cmluZygndXRmOCcpIDogY2hpbGRba2V5XTtcbiAgICAgICAgICByZXR1cm4gdHlwZW9mIGNoaWxkS2V5ID09PSAnb2JqZWN0JyAmJiBjaGlsZEtleSAhPT0gbnVsbFxuICAgICAgICAgICAgPyBfZmxhdHRlbihjaGlsZEtleSwgcGF0aC5jb25jYXQoW2tleV0pKVxuICAgICAgICAgICAgOiAoeyBbcGF0aC5jb25jYXQoW2tleV0pLmpvaW4oJy4nKV06IGNoaWxkS2V5IH0pO1xuICAgICAgICB9KSk7XG4gICAgfShvYmplY3QpLFxuICApO1xufVxuXG4vKipcbiAqIERlY29kZXMgZW5jb2RlZCBzcGVjaWFsIHZhbHVlcyAocGh5c2ljYWxSZXNvdXJjZUlkKVxuICovXG5mdW5jdGlvbiBkZWNvZGVTcGVjaWFsVmFsdWVzKG9iamVjdDogb2JqZWN0LCBwaHlzaWNhbFJlc291cmNlSWQ6IHN0cmluZykge1xuICByZXR1cm4gSlNPTi5wYXJzZShKU09OLnN0cmluZ2lmeShvYmplY3QpLCAoX2ssIHYpID0+IHtcbiAgICBzd2l0Y2ggKHYpIHtcbiAgICAgIGNhc2UgUEhZU0lDQUxfUkVTT1VSQ0VfSURfUkVGRVJFTkNFOlxuICAgICAgICByZXR1cm4gcGh5c2ljYWxSZXNvdXJjZUlkO1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgcmV0dXJuIHY7XG4gICAgfVxuICB9KTtcbn1cblxuLyoqXG4gKiBGaWx0ZXJzIHRoZSBrZXlzIG9mIGFuIG9iamVjdC5cbiAqL1xuZnVuY3Rpb24gZmlsdGVyS2V5cyhvYmplY3Q6IG9iamVjdCwgcHJlZDogKGtleTogc3RyaW5nKSA9PiBib29sZWFuKSB7XG4gIHJldHVybiBPYmplY3QuZW50cmllcyhvYmplY3QpXG4gICAgLnJlZHVjZShcbiAgICAgIChhY2MsIFtrLCB2XSkgPT4gcHJlZChrKVxuICAgICAgICA/IHsgLi4uYWNjLCBba106IHYgfVxuICAgICAgICA6IGFjYyxcbiAgICAgIHt9LFxuICAgICk7XG59XG5cbmxldCBsYXRlc3RTZGtJbnN0YWxsZWQgPSBmYWxzZTtcblxuZXhwb3J0IGZ1bmN0aW9uIGZvcmNlU2RrSW5zdGFsbGF0aW9uKCkge1xuICBsYXRlc3RTZGtJbnN0YWxsZWQgPSBmYWxzZTtcbn1cblxuLyoqXG4gKiBJbnN0YWxscyBsYXRlc3QgQVdTIFNESyB2MlxuICovXG5mdW5jdGlvbiBpbnN0YWxsTGF0ZXN0U2RrKCk6IHZvaWQge1xuICBjb25zb2xlLmxvZygnSW5zdGFsbGluZyBsYXRlc3QgQVdTIFNESyB2MicpO1xuICAvLyBCb3RoIEhPTUUgYW5kIC0tcHJlZml4IGFyZSBuZWVkZWQgaGVyZSBiZWNhdXNlIC90bXAgaXMgdGhlIG9ubHkgd3JpdGFibGUgbG9jYXRpb25cbiAgZXhlY1N5bmMoJ0hPTUU9L3RtcCBucG0gaW5zdGFsbCBhd3Mtc2RrQDIgLS1wcm9kdWN0aW9uIC0tbm8tcGFja2FnZS1sb2NrIC0tbm8tc2F2ZSAtLXByZWZpeCAvdG1wJyk7XG4gIGxhdGVzdFNka0luc3RhbGxlZCA9IHRydWU7XG59XG5cbi8vIG5vIGN1cnJlbnRseSBwYXRjaGVkIHNlcnZpY2VzXG5jb25zdCBwYXRjaGVkU2VydmljZXM6IHsgc2VydmljZU5hbWU6IHN0cmluZzsgYXBpVmVyc2lvbnM6IHN0cmluZ1tdIH1bXSA9IFtdO1xuLyoqXG4gKiBQYXRjaGVzIHRoZSBBV1MgU0RLIGJ5IGxvYWRpbmcgc2VydmljZSBtb2RlbHMgaW4gdGhlIHNhbWUgbWFubmVyIGFzIHRoZSBhY3R1YWwgU0RLXG4gKi9cbmZ1bmN0aW9uIHBhdGNoU2RrKGF3c1NkazogYW55KTogYW55IHtcbiAgY29uc3QgYXBpTG9hZGVyID0gYXdzU2RrLmFwaUxvYWRlcjtcbiAgcGF0Y2hlZFNlcnZpY2VzLmZvckVhY2goKHsgc2VydmljZU5hbWUsIGFwaVZlcnNpb25zIH0pID0+IHtcbiAgICBjb25zdCBsb3dlclNlcnZpY2VOYW1lID0gc2VydmljZU5hbWUudG9Mb3dlckNhc2UoKTtcbiAgICBpZiAoIWF3c1Nkay5TZXJ2aWNlLmhhc1NlcnZpY2UobG93ZXJTZXJ2aWNlTmFtZSkpIHtcbiAgICAgIGFwaUxvYWRlci5zZXJ2aWNlc1tsb3dlclNlcnZpY2VOYW1lXSA9IHt9O1xuICAgICAgYXdzU2RrW3NlcnZpY2VOYW1lXSA9IGF3c1Nkay5TZXJ2aWNlLmRlZmluZVNlcnZpY2UobG93ZXJTZXJ2aWNlTmFtZSwgYXBpVmVyc2lvbnMpO1xuICAgIH0gZWxzZSB7XG4gICAgICBhd3NTZGsuU2VydmljZS5hZGRWZXJzaW9ucyhhd3NTZGtbc2VydmljZU5hbWVdLCBhcGlWZXJzaW9ucyk7XG4gICAgfVxuICAgIGFwaVZlcnNpb25zLmZvckVhY2goYXBpVmVyc2lvbiA9PiB7XG4gICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoYXBpTG9hZGVyLnNlcnZpY2VzW2xvd2VyU2VydmljZU5hbWVdLCBhcGlWZXJzaW9uLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gZ2V0KCkge1xuICAgICAgICAgIGNvbnN0IG1vZGVsRmlsZVByZWZpeCA9IGBhd3Mtc2RrLXBhdGNoLyR7bG93ZXJTZXJ2aWNlTmFtZX0tJHthcGlWZXJzaW9ufWA7XG4gICAgICAgICAgY29uc3QgbW9kZWwgPSBKU09OLnBhcnNlKGZzLnJlYWRGaWxlU3luYyhqb2luKF9fZGlybmFtZSwgYCR7bW9kZWxGaWxlUHJlZml4fS5zZXJ2aWNlLmpzb25gKSwgJ3V0Zi04JykpO1xuICAgICAgICAgIG1vZGVsLnBhZ2luYXRvcnMgPSBKU09OLnBhcnNlKGZzLnJlYWRGaWxlU3luYyhqb2luKF9fZGlybmFtZSwgYCR7bW9kZWxGaWxlUHJlZml4fS5wYWdpbmF0b3JzLmpzb25gKSwgJ3V0Zi04JykpLnBhZ2luYXRpb247XG4gICAgICAgICAgcmV0dXJuIG1vZGVsO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgICB9KTtcbiAgICB9KTtcbiAgfSk7XG4gIHJldHVybiBhd3NTZGs7XG59XG5cbi8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uby1yZXF1aXJlLWltcG9ydHMsIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llcyAqL1xuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGhhbmRsZXIoZXZlbnQ6IEFXU0xhbWJkYS5DbG91ZEZvcm1hdGlvbkN1c3RvbVJlc291cmNlRXZlbnQsIGNvbnRleHQ6IEFXU0xhbWJkYS5Db250ZXh0KSB7XG4gIHRyeSB7XG4gICAgbGV0IEFXUzogYW55O1xuICAgIGlmICghbGF0ZXN0U2RrSW5zdGFsbGVkICYmIGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5JbnN0YWxsTGF0ZXN0QXdzU2RrID09PSAndHJ1ZScpIHtcbiAgICAgIHRyeSB7XG4gICAgICAgIGluc3RhbGxMYXRlc3RTZGsoKTtcbiAgICAgICAgQVdTID0gcmVxdWlyZSgnL3RtcC9ub2RlX21vZHVsZXMvYXdzLXNkaycpO1xuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICBjb25zb2xlLmxvZyhgRmFpbGVkIHRvIGluc3RhbGwgbGF0ZXN0IEFXUyBTREsgdjI6ICR7ZX1gKTtcbiAgICAgICAgQVdTID0gcmVxdWlyZSgnYXdzLXNkaycpOyAvLyBGYWxsYmFjayB0byBwcmUtaW5zdGFsbGVkIHZlcnNpb25cbiAgICAgIH1cbiAgICB9IGVsc2UgaWYgKGxhdGVzdFNka0luc3RhbGxlZCkge1xuICAgICAgQVdTID0gcmVxdWlyZSgnL3RtcC9ub2RlX21vZHVsZXMvYXdzLXNkaycpO1xuICAgIH0gZWxzZSB7XG4gICAgICBBV1MgPSByZXF1aXJlKCdhd3Mtc2RrJyk7XG4gICAgfVxuICAgIHRyeSB7XG4gICAgICBBV1MgPSBwYXRjaFNkayhBV1MpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIGNvbnNvbGUubG9nKGBGYWlsZWQgdG8gcGF0Y2ggQVdTIFNESzogJHtlfS4gUHJvY2VlZGluZyB3aXRoIHRoZSBpbnN0YWxsZWQgY29weS5gKTtcbiAgICB9XG5cbiAgICBjb25zb2xlLmxvZyhKU09OLnN0cmluZ2lmeSh7IC4uLmV2ZW50LCBSZXNwb25zZVVSTDogJy4uLicgfSkpO1xuICAgIGNvbnNvbGUubG9nKCdBV1MgU0RLIFZFUlNJT046ICcgKyBBV1MuVkVSU0lPTik7XG5cbiAgICBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuQ3JlYXRlID0gZGVjb2RlQ2FsbChldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuQ3JlYXRlKTtcbiAgICBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuVXBkYXRlID0gZGVjb2RlQ2FsbChldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuVXBkYXRlKTtcbiAgICBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuRGVsZXRlID0gZGVjb2RlQ2FsbChldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuRGVsZXRlKTtcbiAgICAvLyBEZWZhdWx0IHBoeXNpY2FsIHJlc291cmNlIGlkXG4gICAgbGV0IHBoeXNpY2FsUmVzb3VyY2VJZDogc3RyaW5nO1xuICAgIHN3aXRjaCAoZXZlbnQuUmVxdWVzdFR5cGUpIHtcbiAgICAgIGNhc2UgJ0NyZWF0ZSc6XG4gICAgICAgIHBoeXNpY2FsUmVzb3VyY2VJZCA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5DcmVhdGU/LnBoeXNpY2FsUmVzb3VyY2VJZD8uaWQgPz9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLlVwZGF0ZT8ucGh5c2ljYWxSZXNvdXJjZUlkPy5pZCA/P1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuRGVsZXRlPy5waHlzaWNhbFJlc291cmNlSWQ/LmlkID8/XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LkxvZ2ljYWxSZXNvdXJjZUlkO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ1VwZGF0ZSc6XG4gICAgICBjYXNlICdEZWxldGUnOlxuICAgICAgICBwaHlzaWNhbFJlc291cmNlSWQgPSBldmVudC5SZXNvdXJjZVByb3BlcnRpZXNbZXZlbnQuUmVxdWVzdFR5cGVdPy5waHlzaWNhbFJlc291cmNlSWQ/LmlkID8/IGV2ZW50LlBoeXNpY2FsUmVzb3VyY2VJZDtcbiAgICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgbGV0IGZsYXREYXRhOiB7IFtrZXk6IHN0cmluZ106IHN0cmluZyB9ID0ge307XG4gICAgbGV0IGRhdGE6IHsgW2tleTogc3RyaW5nXTogc3RyaW5nIH0gPSB7fTtcbiAgICBjb25zdCBjYWxsOiBBd3NTZGtDYWxsIHwgdW5kZWZpbmVkID0gZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzW2V2ZW50LlJlcXVlc3RUeXBlXTtcblxuICAgIGlmIChjYWxsKSB7XG5cbiAgICAgIGxldCBjcmVkZW50aWFscztcbiAgICAgIGlmIChjYWxsLmFzc3VtZWRSb2xlQXJuKSB7XG4gICAgICAgIGNvbnN0IHRpbWVzdGFtcCA9IChuZXcgRGF0ZSgpKS5nZXRUaW1lKCk7XG5cbiAgICAgICAgY29uc3QgcGFyYW1zID0ge1xuICAgICAgICAgIFJvbGVBcm46IGNhbGwuYXNzdW1lZFJvbGVBcm4sXG4gICAgICAgICAgUm9sZVNlc3Npb25OYW1lOiBgJHt0aW1lc3RhbXB9LSR7cGh5c2ljYWxSZXNvdXJjZUlkfWAuc3Vic3RyaW5nKDAsIDY0KSxcbiAgICAgICAgfTtcblxuICAgICAgICBjcmVkZW50aWFscyA9IG5ldyBBV1MuQ2hhaW5hYmxlVGVtcG9yYXJ5Q3JlZGVudGlhbHMoe1xuICAgICAgICAgIHBhcmFtczogcGFyYW1zLFxuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgICAgaWYgKCFPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoQVdTLCBjYWxsLnNlcnZpY2UpKSB7XG4gICAgICAgIHRocm93IEVycm9yKGBTZXJ2aWNlICR7Y2FsbC5zZXJ2aWNlfSBkb2VzIG5vdCBleGlzdCBpbiBBV1MgU0RLIHZlcnNpb24gJHtBV1MuVkVSU0lPTn0uYCk7XG4gICAgICB9XG4gICAgICBjb25zdCBhd3NTZXJ2aWNlID0gbmV3IChBV1MgYXMgYW55KVtjYWxsLnNlcnZpY2VdKHtcbiAgICAgICAgYXBpVmVyc2lvbjogY2FsbC5hcGlWZXJzaW9uLFxuICAgICAgICBjcmVkZW50aWFsczogY3JlZGVudGlhbHMsXG4gICAgICAgIHJlZ2lvbjogY2FsbC5yZWdpb24sXG4gICAgICB9KTtcblxuICAgICAgdHJ5IHtcbiAgICAgICAgY29uc3QgcmVzcG9uc2UgPSBhd2FpdCBhd3NTZXJ2aWNlW2NhbGwuYWN0aW9uXShcbiAgICAgICAgICBjYWxsLnBhcmFtZXRlcnMgJiYgZGVjb2RlU3BlY2lhbFZhbHVlcyhjYWxsLnBhcmFtZXRlcnMsIHBoeXNpY2FsUmVzb3VyY2VJZCkpLnByb21pc2UoKTtcbiAgICAgICAgZmxhdERhdGEgPSB7XG4gICAgICAgICAgYXBpVmVyc2lvbjogYXdzU2VydmljZS5jb25maWcuYXBpVmVyc2lvbiwgLy8gRm9yIHRlc3QgcHVycG9zZXM6IGNoZWNrIGlmIGFwaVZlcnNpb24gd2FzIGNvcnJlY3RseSBwYXNzZWQuXG4gICAgICAgICAgcmVnaW9uOiBhd3NTZXJ2aWNlLmNvbmZpZy5yZWdpb24sIC8vIEZvciB0ZXN0IHB1cnBvc2VzOiBjaGVjayBpZiByZWdpb24gd2FzIGNvcnJlY3RseSBwYXNzZWQuXG4gICAgICAgICAgLi4uZmxhdHRlbihyZXNwb25zZSksXG4gICAgICAgIH07XG5cbiAgICAgICAgbGV0IG91dHB1dFBhdGhzOiBzdHJpbmdbXSB8IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKGNhbGwub3V0cHV0UGF0aCkge1xuICAgICAgICAgIG91dHB1dFBhdGhzID0gW2NhbGwub3V0cHV0UGF0aF07XG4gICAgICAgIH0gZWxzZSBpZiAoY2FsbC5vdXRwdXRQYXRocykge1xuICAgICAgICAgIG91dHB1dFBhdGhzID0gY2FsbC5vdXRwdXRQYXRocztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChvdXRwdXRQYXRocykge1xuICAgICAgICAgIGRhdGEgPSBmaWx0ZXJLZXlzKGZsYXREYXRhLCBzdGFydHNXaXRoT25lT2Yob3V0cHV0UGF0aHMpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBkYXRhID0gZmxhdERhdGE7XG4gICAgICAgIH1cbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgaWYgKCFjYWxsLmlnbm9yZUVycm9yQ29kZXNNYXRjaGluZyB8fCAhbmV3IFJlZ0V4cChjYWxsLmlnbm9yZUVycm9yQ29kZXNNYXRjaGluZykudGVzdChlLmNvZGUpKSB7XG4gICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoY2FsbC5waHlzaWNhbFJlc291cmNlSWQ/LnJlc3BvbnNlUGF0aCkge1xuICAgICAgICBwaHlzaWNhbFJlc291cmNlSWQgPSBmbGF0RGF0YVtjYWxsLnBoeXNpY2FsUmVzb3VyY2VJZC5yZXNwb25zZVBhdGhdO1xuICAgICAgfVxuICAgIH1cblxuICAgIGF3YWl0IHJlc3BvbmQoJ1NVQ0NFU1MnLCAnT0snLCBwaHlzaWNhbFJlc291cmNlSWQsIGRhdGEpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgY29uc29sZS5sb2coZSk7XG4gICAgYXdhaXQgcmVzcG9uZCgnRkFJTEVEJywgZS5tZXNzYWdlIHx8ICdJbnRlcm5hbCBFcnJvcicsIGNvbnRleHQubG9nU3RyZWFtTmFtZSwge30pO1xuICB9XG5cbiAgZnVuY3Rpb24gcmVzcG9uZChyZXNwb25zZVN0YXR1czogc3RyaW5nLCByZWFzb246IHN0cmluZywgcGh5c2ljYWxSZXNvdXJjZUlkOiBzdHJpbmcsIGRhdGE6IGFueSkge1xuICAgIGNvbnN0IHJlc3BvbnNlQm9keSA9IEpTT04uc3RyaW5naWZ5KHtcbiAgICAgIFN0YXR1czogcmVzcG9uc2VTdGF0dXMsXG4gICAgICBSZWFzb246IHJlYXNvbixcbiAgICAgIFBoeXNpY2FsUmVzb3VyY2VJZDogcGh5c2ljYWxSZXNvdXJjZUlkLFxuICAgICAgU3RhY2tJZDogZXZlbnQuU3RhY2tJZCxcbiAgICAgIFJlcXVlc3RJZDogZXZlbnQuUmVxdWVzdElkLFxuICAgICAgTG9naWNhbFJlc291cmNlSWQ6IGV2ZW50LkxvZ2ljYWxSZXNvdXJjZUlkLFxuICAgICAgTm9FY2hvOiBmYWxzZSxcbiAgICAgIERhdGE6IGRhdGEsXG4gICAgfSk7XG5cbiAgICBjb25zb2xlLmxvZygnUmVzcG9uZGluZycsIHJlc3BvbnNlQm9keSk7XG5cbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXJlcXVpcmUtaW1wb3J0c1xuICAgIGNvbnN0IHBhcnNlZFVybCA9IHJlcXVpcmUoJ3VybCcpLnBhcnNlKGV2ZW50LlJlc3BvbnNlVVJMKTtcbiAgICBjb25zdCByZXF1ZXN0T3B0aW9ucyA9IHtcbiAgICAgIGhvc3RuYW1lOiBwYXJzZWRVcmwuaG9zdG5hbWUsXG4gICAgICBwYXRoOiBwYXJzZWRVcmwucGF0aCxcbiAgICAgIG1ldGhvZDogJ1BVVCcsXG4gICAgICBoZWFkZXJzOiB7ICdjb250ZW50LXR5cGUnOiAnJywgJ2NvbnRlbnQtbGVuZ3RoJzogcmVzcG9uc2VCb2R5Lmxlbmd0aCB9LFxuICAgIH07XG5cbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgdHJ5IHtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1yZXF1aXJlLWltcG9ydHNcbiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHJlcXVpcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICAgIHJlcXVlc3Qub24oJ2Vycm9yJywgcmVqZWN0KTtcbiAgICAgICAgcmVxdWVzdC53cml0ZShyZXNwb25zZUJvZHkpO1xuICAgICAgICByZXF1ZXN0LmVuZCgpO1xuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICByZWplY3QoZSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH1cbn1cblxuZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736.bundle/index.js b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736.bundle/index.js deleted file mode 100755 index 83f8199656820..0000000000000 --- a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736.bundle/index.js +++ /dev/null @@ -1,617 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - } - return a; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// lib/assertions/providers/lambda-handler/index.ts -var lambda_handler_exports = {}; -__export(lambda_handler_exports, { - handler: () => handler -}); -module.exports = __toCommonJS(lambda_handler_exports); - -// ../assertions/lib/matcher.ts -var Matcher = class { - static isMatcher(x) { - return x && x instanceof Matcher; - } -}; -var MatchResult = class { - constructor(target) { - this.failures = []; - this.captures = /* @__PURE__ */ new Map(); - this.finalized = false; - this.target = target; - } - push(matcher, path, message) { - return this.recordFailure({ matcher, path, message }); - } - recordFailure(failure) { - this.failures.push(failure); - return this; - } - hasFailed() { - return this.failures.length !== 0; - } - get failCount() { - return this.failures.length; - } - compose(id, inner) { - const innerF = inner.failures; - this.failures.push(...innerF.map((f) => { - return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; - })); - inner.captures.forEach((vals, capture) => { - vals.forEach((value) => this.recordCapture({ capture, value })); - }); - return this; - } - finished() { - if (this.finalized) { - return this; - } - if (this.failCount === 0) { - this.captures.forEach((vals, cap) => cap._captured.push(...vals)); - } - this.finalized = true; - return this; - } - toHumanStrings() { - return this.failures.map((r) => { - const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; - return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; - }); - } - recordCapture(options) { - let values = this.captures.get(options.capture); - if (values === void 0) { - values = []; - } - values.push(options.value); - this.captures.set(options.capture, values); - } -}; - -// ../assertions/lib/private/matchers/absent.ts -var AbsentMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual !== void 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Received ${actual}, but key should be absent` - }); - } - return result; - } -}; - -// ../assertions/lib/private/type.ts -function getType(obj) { - return Array.isArray(obj) ? "array" : typeof obj; -} - -// ../assertions/lib/match.ts -var Match = class { - static absent() { - return new AbsentMatch("absent"); - } - static arrayWith(pattern) { - return new ArrayMatch("arrayWith", pattern); - } - static arrayEquals(pattern) { - return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); - } - static exact(pattern) { - return new LiteralMatch("exact", pattern, { partialObjects: false }); - } - static objectLike(pattern) { - return new ObjectMatch("objectLike", pattern); - } - static objectEquals(pattern) { - return new ObjectMatch("objectEquals", pattern, { partial: false }); - } - static not(pattern) { - return new NotMatch("not", pattern); - } - static serializedJson(pattern) { - return new SerializedJson("serializedJson", pattern); - } - static anyValue() { - return new AnyMatch("anyValue"); - } - static stringLikeRegexp(pattern) { - return new StringLikeRegexpMatch("stringLikeRegexp", pattern); - } -}; -var LiteralMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partialObjects = options.partialObjects ?? false; - if (Matcher.isMatcher(this.pattern)) { - throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); - } - } - test(actual) { - if (Array.isArray(this.pattern)) { - return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); - } - if (typeof this.pattern === "object") { - return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); - } - const result = new MatchResult(actual); - if (typeof this.pattern !== typeof actual) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` - }); - return result; - } - if (actual !== this.pattern) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected ${this.pattern} but received ${actual}` - }); - } - return result; - } -}; -var ArrayMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.subsequence = options.subsequence ?? true; - this.partialObjects = options.partialObjects ?? false; - } - test(actual) { - if (!Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type array but received ${getType(actual)}` - }); - } - if (!this.subsequence && this.pattern.length !== actual.length) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected array of length ${this.pattern.length} but received ${actual.length}` - }); - } - let patternIdx = 0; - let actualIdx = 0; - const result = new MatchResult(actual); - while (patternIdx < this.pattern.length && actualIdx < actual.length) { - const patternElement = this.pattern[patternIdx]; - const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); - const matcherName = matcher.name; - if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { - throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); - } - const innerResult = matcher.test(actual[actualIdx]); - if (!this.subsequence || !innerResult.hasFailed()) { - result.compose(`[${actualIdx}]`, innerResult); - patternIdx++; - actualIdx++; - } else { - actualIdx++; - } - } - for (; patternIdx < this.pattern.length; patternIdx++) { - const pattern = this.pattern[patternIdx]; - const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; - result.recordFailure({ - matcher: this, - path: [], - message: `Missing element${element}at pattern index ${patternIdx}` - }); - } - return result; - } -}; -var ObjectMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partial = options.partial ?? true; - } - test(actual) { - if (typeof actual !== "object" || Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type object but received ${getType(actual)}` - }); - } - const result = new MatchResult(actual); - if (!this.partial) { - for (const a of Object.keys(actual)) { - if (!(a in this.pattern)) { - result.recordFailure({ - matcher: this, - path: [`/${a}`], - message: "Unexpected key" - }); - } - } - } - for (const [patternKey, patternVal] of Object.entries(this.pattern)) { - if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { - result.recordFailure({ - matcher: this, - path: [`/${patternKey}`], - message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` - }); - continue; - } - const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); - const inner = matcher.test(actual[patternKey]); - result.compose(`/${patternKey}`, inner); - } - return result; - } -}; -var SerializedJson = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - if (getType(actual) !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected JSON as a string but found ${getType(actual)}` - }); - return result; - } - let parsed; - try { - parsed = JSON.parse(actual); - } catch (err) { - if (err instanceof SyntaxError) { - result.recordFailure({ - matcher: this, - path: [], - message: `Invalid JSON string: ${actual}` - }); - return result; - } else { - throw err; - } - } - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(parsed); - result.compose(`(${this.name})`, innerResult); - return result; - } -}; -var NotMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(actual); - const result = new MatchResult(actual); - if (innerResult.failCount === 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` - }); - } - return result; - } -}; -var AnyMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual == null) { - result.recordFailure({ - matcher: this, - path: [], - message: "Expected a value but found none" - }); - } - return result; - } -}; -var StringLikeRegexpMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - const regex = new RegExp(this.pattern, "gm"); - if (typeof actual !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected a string, but got '${typeof actual}'` - }); - } - if (!regex.test(actual)) { - result.recordFailure({ - matcher: this, - path: [], - message: `String '${actual}' did not match pattern '${this.pattern}'` - }); - } - return result; - } -}; - -// lib/assertions/providers/lambda-handler/base.ts -var https = __toESM(require("https")); -var url = __toESM(require("url")); -var CustomResourceHandler = class { - constructor(event, context) { - this.event = event; - this.context = context; - this.timedOut = false; - this.timeout = setTimeout(async () => { - await this.respond({ - status: "FAILED", - reason: "Lambda Function Timeout", - data: this.context.logStreamName - }); - this.timedOut = true; - }, context.getRemainingTimeInMillis() - 1200); - this.event = event; - this.physicalResourceId = extractPhysicalResourceId(event); - } - async handle() { - try { - console.log(`Event: ${JSON.stringify(this.event)}`); - const response = await this.processEvent(this.event.ResourceProperties); - console.log(`Event output : ${JSON.stringify(response)}`); - await this.respond({ - status: "SUCCESS", - reason: "OK", - data: response - }); - } catch (e) { - console.log(e); - await this.respond({ - status: "FAILED", - reason: e.message ?? "Internal Error" - }); - } finally { - clearTimeout(this.timeout); - } - } - respond(response) { - if (this.timedOut) { - return; - } - const cfResponse = { - Status: response.status, - Reason: response.reason, - PhysicalResourceId: this.physicalResourceId, - StackId: this.event.StackId, - RequestId: this.event.RequestId, - LogicalResourceId: this.event.LogicalResourceId, - NoEcho: false, - Data: response.data - }; - const responseBody = JSON.stringify(cfResponse); - console.log("Responding to CloudFormation", responseBody); - const parsedUrl = url.parse(this.event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { "content-type": "", "content-length": responseBody.length } - }; - return new Promise((resolve, reject) => { - try { - const request2 = https.request(requestOptions, resolve); - request2.on("error", reject); - request2.write(responseBody); - request2.end(); - } catch (e) { - reject(e); - } - }); - } -}; -function extractPhysicalResourceId(event) { - switch (event.RequestType) { - case "Create": - return event.LogicalResourceId; - case "Update": - case "Delete": - return event.PhysicalResourceId; - } -} - -// lib/assertions/providers/lambda-handler/assertion.ts -var AssertionHandler = class extends CustomResourceHandler { - async processEvent(request2) { - let actual = decodeCall(request2.actual); - const expected = decodeCall(request2.expected); - let result; - const matcher = new MatchCreator(expected).getMatcher(); - console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); - const matchResult = matcher.test(actual); - matchResult.finished(); - if (matchResult.hasFailed()) { - result = { - data: JSON.stringify({ - status: "fail", - message: [ - ...matchResult.toHumanStrings(), - JSON.stringify(matchResult.target, void 0, 2) - ].join("\n") - }) - }; - if (request2.failDeployment) { - throw new Error(result.data); - } - } else { - result = { - data: JSON.stringify({ - status: "pass" - }) - }; - } - return result; - } -}; -var MatchCreator = class { - constructor(obj) { - this.parsedObj = { - matcher: obj - }; - } - getMatcher() { - try { - const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { - const nested = Object.keys(v)[0]; - switch (nested) { - case "$ArrayWith": - return Match.arrayWith(v[nested]); - case "$ObjectLike": - return Match.objectLike(v[nested]); - case "$StringLike": - return Match.stringLikeRegexp(v[nested]); - default: - return v; - } - }); - if (Matcher.isMatcher(final.matcher)) { - return final.matcher; - } - return Match.exact(final.matcher); - } catch { - return Match.exact(this.parsedObj.matcher); - } - } -}; -function decodeCall(call) { - if (!call) { - return void 0; - } - try { - const parsed = JSON.parse(call); - return parsed; - } catch (e) { - return call; - } -} - -// lib/assertions/providers/lambda-handler/utils.ts -function decode(object) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case "TRUE:BOOLEAN": - return true; - case "FALSE:BOOLEAN": - return false; - default: - return v; - } - }); -} - -// lib/assertions/providers/lambda-handler/sdk.ts -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object)); -} -var AwsApiCallHandler = class extends CustomResourceHandler { - async processEvent(request2) { - const AWS = require("aws-sdk"); - console.log(`AWS SDK VERSION: ${AWS.VERSION}`); - const service = new AWS[request2.service](); - const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); - console.log(`SDK response received ${JSON.stringify(response)}`); - delete response.ResponseMetadata; - const respond = { - apiCallResponse: response - }; - const flatData = __spreadValues({}, flatten(respond)); - return request2.flattenResponse === "true" ? flatData : respond; - } -}; - -// lib/assertions/providers/lambda-handler/types.ts -var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; -var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; - -// lib/assertions/providers/lambda-handler/index.ts -async function handler(event, context) { - const provider = createResourceHandler(event, context); - await provider.handle(); -} -function createResourceHandler(event, context) { - if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { - return new AwsApiCallHandler(event, context); - } - switch (event.ResourceType) { - case ASSERT_RESOURCE_TYPE: - return new AssertionHandler(event, context); - default: - throw new Error(`Unsupported resource type "${event.ResourceType}`); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - handler -}); diff --git a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js old mode 100755 new mode 100644 similarity index 99% rename from packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js rename to packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js index b3ec1b8c53d30..ba956d47f51fe --- a/packages/@aws-cdk/aws-appsync/test/log-retention.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js +++ b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js @@ -493,7 +493,7 @@ var AssertionHandler = class extends CustomResourceHandler { } else { result = { data: JSON.stringify({ - status: "pass" + status: "success" }) }; } diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/index.js b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/index.js deleted file mode 100755 index c70e48ee0f357..0000000000000 --- a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/asset.c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/index.js +++ /dev/null @@ -1,252 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.handler = exports.forceSdkInstallation = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/* eslint-disable no-console */ -const child_process_1 = require("child_process"); -const fs = require("fs"); -const path_1 = require("path"); -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -let latestSdkInstalled = false; -function forceSdkInstallation() { - latestSdkInstalled = false; -} -exports.forceSdkInstallation = forceSdkInstallation; -/** - * Installs latest AWS SDK v2 - */ -function installLatestSdk() { - console.log('Installing latest AWS SDK v2'); - // Both HOME and --prefix are needed here because /tmp is the only writable location - child_process_1.execSync('HOME=/tmp npm install aws-sdk@2 --production --no-package-lock --no-save --prefix /tmp'); - latestSdkInstalled = true; -} -// no currently patched services -const patchedServices = []; -/** - * Patches the AWS SDK by loading service models in the same manner as the actual SDK - */ -function patchSdk(awsSdk) { - const apiLoader = awsSdk.apiLoader; - patchedServices.forEach(({ serviceName, apiVersions }) => { - const lowerServiceName = serviceName.toLowerCase(); - if (!awsSdk.Service.hasService(lowerServiceName)) { - apiLoader.services[lowerServiceName] = {}; - awsSdk[serviceName] = awsSdk.Service.defineService(lowerServiceName, apiVersions); - } - else { - awsSdk.Service.addVersions(awsSdk[serviceName], apiVersions); - } - apiVersions.forEach(apiVersion => { - Object.defineProperty(apiLoader.services[lowerServiceName], apiVersion, { - get: function get() { - const modelFilePrefix = `aws-sdk-patch/${lowerServiceName}-${apiVersion}`; - const model = JSON.parse(fs.readFileSync(path_1.join(__dirname, `${modelFilePrefix}.service.json`), 'utf-8')); - model.paginators = JSON.parse(fs.readFileSync(path_1.join(__dirname, `${modelFilePrefix}.paginators.json`), 'utf-8')).pagination; - return model; - }, - enumerable: true, - configurable: true, - }); - }); - }); - return awsSdk; -} -/* eslint-disable @typescript-eslint/no-require-imports, import/no-extraneous-dependencies */ -async function handler(event, context) { - try { - let AWS; - if (!latestSdkInstalled && event.ResourceProperties.InstallLatestAwsSdk === 'true') { - try { - installLatestSdk(); - AWS = require('/tmp/node_modules/aws-sdk'); - } - catch (e) { - console.log(`Failed to install latest AWS SDK v2: ${e}`); - AWS = require('aws-sdk'); // Fallback to pre-installed version - } - } - else if (latestSdkInstalled) { - AWS = require('/tmp/node_modules/aws-sdk'); - } - else { - AWS = require('aws-sdk'); - } - try { - AWS = patchSdk(AWS); - } - catch (e) { - console.log(`Failed to patch AWS SDK: ${e}. Proceeding with the installed copy.`); - } - console.log(JSON.stringify(event)); - console.log('AWS SDK VERSION: ' + AWS.VERSION); - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - // Default physical resource id - let physicalResourceId; - switch (event.RequestType) { - case 'Create': - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? - event.ResourceProperties.Update?.physicalResourceId?.id ?? - event.ResourceProperties.Delete?.physicalResourceId?.id ?? - event.LogicalResourceId; - break; - case 'Update': - case 'Delete': - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - let flatData = {}; - let data = {}; - const call = event.ResourceProperties[event.RequestType]; - if (call) { - let credentials; - if (call.assumedRoleArn) { - const timestamp = (new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64), - }; - credentials = new AWS.ChainableTemporaryCredentials({ - params: params, - }); - } - if (!Object.prototype.hasOwnProperty.call(AWS, call.service)) { - throw Error(`Service ${call.service} does not exist in AWS SDK version ${AWS.VERSION}.`); - } - const awsService = new AWS[call.service]({ - apiVersion: call.apiVersion, - credentials: credentials, - region: call.region, - }); - try { - const response = await awsService[call.action](call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)).promise(); - flatData = { - apiVersion: awsService.config.apiVersion, - region: awsService.config.region, - ...flatten(response), - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } - else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } - else { - data = flatData; - } - } - catch (e) { - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(e.code)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond('SUCCESS', 'OK', physicalResourceId, data); - } - catch (e) { - console.log(e); - await respond('FAILED', e.message || 'Internal Error', context.logStreamName, {}); - } - function respond(responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { 'content-type': '', 'content-length': responseBody.length }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); - } -} -exports.handler = handler; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsaURBQXlDO0FBQ3pDLHlCQUF5QjtBQUN6QiwrQkFBNEI7QUFTNUI7O0dBRUc7QUFDVSxRQUFBLDhCQUE4QixHQUFHLHNCQUFzQixDQUFDO0FBRXJFOzs7OztHQUtHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLE1BQWM7SUFDcEMsT0FBTyxNQUFNLENBQUMsTUFBTSxDQUNsQixFQUFFLEVBQ0YsR0FBRyxTQUFTLFFBQVEsQ0FBQyxLQUFVLEVBQUUsT0FBaUIsRUFBRTtRQUNsRCxPQUFPLEVBQUUsQ0FBQyxNQUFNLENBQUMsR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQzthQUNuQyxHQUFHLENBQUMsR0FBRyxDQUFDLEVBQUU7WUFDVCxNQUFNLFFBQVEsR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7WUFDeEYsT0FBTyxPQUFPLFFBQVEsS0FBSyxRQUFRLElBQUksUUFBUSxLQUFLLElBQUk7Z0JBQ3RELENBQUMsQ0FBQyxRQUFRLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO2dCQUN4QyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsUUFBUSxFQUFFLENBQUMsQ0FBQztRQUNyRCxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ1IsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUNWLENBQUM7QUFDSixDQUFDO0FBYkQsMEJBYUM7QUFFRDs7R0FFRztBQUNILFNBQVMsbUJBQW1CLENBQUMsTUFBYyxFQUFFLGtCQUEwQjtJQUNyRSxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUNsRCxRQUFRLENBQUMsRUFBRTtZQUNULEtBQUssc0NBQThCO2dCQUNqQyxPQUFPLGtCQUFrQixDQUFDO1lBQzVCO2dCQUNFLE9BQU8sQ0FBQyxDQUFDO1NBQ1o7SUFDSCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUM7QUFFRDs7R0FFRztBQUNILFNBQVMsVUFBVSxDQUFDLE1BQWMsRUFBRSxJQUE4QjtJQUNoRSxPQUFPLE1BQU0sQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDO1NBQzFCLE1BQU0sQ0FDTCxDQUFDLEdBQUcsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztRQUN0QixDQUFDLENBQUMsRUFBRSxHQUFHLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRTtRQUNwQixDQUFDLENBQUMsR0FBRyxFQUNQLEVBQUUsQ0FDSCxDQUFDO0FBQ04sQ0FBQztBQUVELElBQUksa0JBQWtCLEdBQUcsS0FBSyxDQUFDO0FBRS9CLFNBQWdCLG9CQUFvQjtJQUNsQyxrQkFBa0IsR0FBRyxLQUFLLENBQUM7QUFDN0IsQ0FBQztBQUZELG9EQUVDO0FBRUQ7O0dBRUc7QUFDSCxTQUFTLGdCQUFnQjtJQUN2QixPQUFPLENBQUMsR0FBRyxDQUFDLDhCQUE4QixDQUFDLENBQUM7SUFDNUMsb0ZBQW9GO0lBQ3BGLHdCQUFRLENBQUMsd0ZBQXdGLENBQUMsQ0FBQztJQUNuRyxrQkFBa0IsR0FBRyxJQUFJLENBQUM7QUFDNUIsQ0FBQztBQUVELGdDQUFnQztBQUNoQyxNQUFNLGVBQWUsR0FBcUQsRUFBRSxDQUFDO0FBQzdFOztHQUVHO0FBQ0gsU0FBUyxRQUFRLENBQUMsTUFBVztJQUMzQixNQUFNLFNBQVMsR0FBRyxNQUFNLENBQUMsU0FBUyxDQUFDO0lBQ25DLGVBQWUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxFQUFFLFdBQVcsRUFBRSxXQUFXLEVBQUUsRUFBRSxFQUFFO1FBQ3ZELE1BQU0sZ0JBQWdCLEdBQUcsV0FBVyxDQUFDLFdBQVcsRUFBRSxDQUFDO1FBQ25ELElBQUksQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxnQkFBZ0IsQ0FBQyxFQUFFO1lBQ2hELFNBQVMsQ0FBQyxRQUFRLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxFQUFFLENBQUM7WUFDMUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLGdCQUFnQixFQUFFLFdBQVcsQ0FBQyxDQUFDO1NBQ25GO2FBQU07WUFDTCxNQUFNLENBQUMsT0FBTyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLEVBQUUsV0FBVyxDQUFDLENBQUM7U0FDOUQ7UUFDRCxXQUFXLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxFQUFFO1lBQy9CLE1BQU0sQ0FBQyxjQUFjLENBQUMsU0FBUyxDQUFDLFFBQVEsQ0FBQyxnQkFBZ0IsQ0FBQyxFQUFFLFVBQVUsRUFBRTtnQkFDdEUsR0FBRyxFQUFFLFNBQVMsR0FBRztvQkFDZixNQUFNLGVBQWUsR0FBRyxpQkFBaUIsZ0JBQWdCLElBQUksVUFBVSxFQUFFLENBQUM7b0JBQzFFLE1BQU0sS0FBSyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxXQUFJLENBQUMsU0FBUyxFQUFFLEdBQUcsZUFBZSxlQUFlLENBQUMsRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFDO29CQUN2RyxLQUFLLENBQUMsVUFBVSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxXQUFJLENBQUMsU0FBUyxFQUFFLEdBQUcsZUFBZSxrQkFBa0IsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDO29CQUMxSCxPQUFPLEtBQUssQ0FBQztnQkFDZixDQUFDO2dCQUNELFVBQVUsRUFBRSxJQUFJO2dCQUNoQixZQUFZLEVBQUUsSUFBSTthQUNuQixDQUFDLENBQUM7UUFDTCxDQUFDLENBQUMsQ0FBQztJQUNMLENBQUMsQ0FBQyxDQUFDO0lBQ0gsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQztBQUVELDZGQUE2RjtBQUN0RixLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQWtELEVBQUUsT0FBMEI7SUFDMUcsSUFBSTtRQUNGLElBQUksR0FBUSxDQUFDO1FBQ2IsSUFBSSxDQUFDLGtCQUFrQixJQUFJLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxtQkFBbUIsS0FBSyxNQUFNLEVBQUU7WUFDbEYsSUFBSTtnQkFDRixnQkFBZ0IsRUFBRSxDQUFDO2dCQUNuQixHQUFHLEdBQUcsT0FBTyxDQUFDLDJCQUEyQixDQUFDLENBQUM7YUFDNUM7WUFBQyxPQUFPLENBQUMsRUFBRTtnQkFDVixPQUFPLENBQUMsR0FBRyxDQUFDLHdDQUF3QyxDQUFDLEVBQUUsQ0FBQyxDQUFDO2dCQUN6RCxHQUFHLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsb0NBQW9DO2FBQy9EO1NBQ0Y7YUFBTSxJQUFJLGtCQUFrQixFQUFFO1lBQzdCLEdBQUcsR0FBRyxPQUFPLENBQUMsMkJBQTJCLENBQUMsQ0FBQztTQUM1QzthQUFNO1lBQ0wsR0FBRyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztTQUMxQjtRQUNELElBQUk7WUFDRixHQUFHLEdBQUcsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1NBQ3JCO1FBQUMsT0FBTyxDQUFDLEVBQUU7WUFDVixPQUFPLENBQUMsR0FBRyxDQUFDLDRCQUE0QixDQUFDLHVDQUF1QyxDQUFDLENBQUM7U0FDbkY7UUFFRCxPQUFPLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQztRQUNuQyxPQUFPLENBQUMsR0FBRyxDQUFDLG1CQUFtQixHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUUvQyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxHQUFHLFVBQVUsQ0FBQyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDOUUsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sR0FBRyxVQUFVLENBQUMsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQzlFLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLEdBQUcsVUFBVSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUM5RSwrQkFBK0I7UUFDL0IsSUFBSSxrQkFBMEIsQ0FBQztRQUMvQixRQUFRLEtBQUssQ0FBQyxXQUFXLEVBQUU7WUFDekIsS0FBSyxRQUFRO2dCQUNYLGtCQUFrQixHQUFHLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLEVBQUUsa0JBQWtCLEVBQUUsRUFBRTtvQkFDdkQsS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sRUFBRSxrQkFBa0IsRUFBRSxFQUFFO29CQUN2RCxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxFQUFFLGtCQUFrQixFQUFFLEVBQUU7b0JBQ3ZELEtBQUssQ0FBQyxpQkFBaUIsQ0FBQztnQkFDN0MsTUFBTTtZQUNSLEtBQUssUUFBUSxDQUFDO1lBQ2QsS0FBSyxRQUFRO2dCQUNYLGtCQUFrQixHQUFHLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLEVBQUUsa0JBQWtCLEVBQUUsRUFBRSxJQUFJLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQztnQkFDckgsTUFBTTtTQUNUO1FBRUQsSUFBSSxRQUFRLEdBQThCLEVBQUUsQ0FBQztRQUM3QyxJQUFJLElBQUksR0FBOEIsRUFBRSxDQUFDO1FBQ3pDLE1BQU0sSUFBSSxHQUEyQixLQUFLLENBQUMsa0JBQWtCLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBRWpGLElBQUksSUFBSSxFQUFFO1lBRVIsSUFBSSxXQUFXLENBQUM7WUFDaEIsSUFBSSxJQUFJLENBQUMsY0FBYyxFQUFFO2dCQUN2QixNQUFNLFNBQVMsR0FBRyxDQUFDLElBQUksSUFBSSxFQUFFLENBQUMsQ0FBQyxPQUFPLEVBQUUsQ0FBQztnQkFFekMsTUFBTSxNQUFNLEdBQUc7b0JBQ2IsT0FBTyxFQUFFLElBQUksQ0FBQyxjQUFjO29CQUM1QixlQUFlLEVBQUUsR0FBRyxTQUFTLElBQUksa0JBQWtCLEVBQUUsQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztpQkFDdkUsQ0FBQztnQkFFRixXQUFXLEdBQUcsSUFBSSxHQUFHLENBQUMsNkJBQTZCLENBQUM7b0JBQ2xELE1BQU0sRUFBRSxNQUFNO2lCQUNmLENBQUMsQ0FBQzthQUNKO1lBRUQsSUFBSSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFO2dCQUM1RCxNQUFNLEtBQUssQ0FBQyxXQUFXLElBQUksQ0FBQyxPQUFPLHNDQUFzQyxHQUFHLENBQUMsT0FBTyxHQUFHLENBQUMsQ0FBQzthQUMxRjtZQUNELE1BQU0sVUFBVSxHQUFHLElBQUssR0FBVyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztnQkFDaEQsVUFBVSxFQUFFLElBQUksQ0FBQyxVQUFVO2dCQUMzQixXQUFXLEVBQUUsV0FBVztnQkFDeEIsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNO2FBQ3BCLENBQUMsQ0FBQztZQUVILElBQUk7Z0JBQ0YsTUFBTSxRQUFRLEdBQUcsTUFBTSxVQUFVLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUM1QyxJQUFJLENBQUMsVUFBVSxJQUFJLG1CQUFtQixDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsa0JBQWtCLENBQUMsQ0FBQyxDQUFDLE9BQU8sRUFBRSxDQUFDO2dCQUN6RixRQUFRLEdBQUc7b0JBQ1QsVUFBVSxFQUFFLFVBQVUsQ0FBQyxNQUFNLENBQUMsVUFBVTtvQkFDeEMsTUFBTSxFQUFFLFVBQVUsQ0FBQyxNQUFNLENBQUMsTUFBTTtvQkFDaEMsR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDO2lCQUNyQixDQUFDO2dCQUVGLElBQUksV0FBaUMsQ0FBQztnQkFDdEMsSUFBSSxJQUFJLENBQUMsVUFBVSxFQUFFO29CQUNuQixXQUFXLEdBQUcsQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUM7aUJBQ2pDO3FCQUFNLElBQUksSUFBSSxDQUFDLFdBQVcsRUFBRTtvQkFDM0IsV0FBVyxHQUFHLElBQUksQ0FBQyxXQUFXLENBQUM7aUJBQ2hDO2dCQUVELElBQUksV0FBVyxFQUFFO29CQUNmLElBQUksR0FBRyxVQUFVLENBQUMsUUFBUSxFQUFFLGVBQWUsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDO2lCQUMzRDtxQkFBTTtvQkFDTCxJQUFJLEdBQUcsUUFBUSxDQUFDO2lCQUNqQjthQUNGO1lBQUMsT0FBTyxDQUFDLEVBQUU7Z0JBQ1YsSUFBSSxDQUFDLElBQUksQ0FBQyx3QkFBd0IsSUFBSSxDQUFDLElBQUksTUFBTSxDQUFDLElBQUksQ0FBQyx3QkFBd0IsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUU7b0JBQzdGLE1BQU0sQ0FBQyxDQUFDO2lCQUNUO2FBQ0Y7WUFFRCxJQUFJLElBQUksQ0FBQyxrQkFBa0IsRUFBRSxZQUFZLEVBQUU7Z0JBQ3pDLGtCQUFrQixHQUFHLFFBQVEsQ0FBQyxJQUFJLENBQUMsa0JBQWtCLENBQUMsWUFBWSxDQUFDLENBQUM7YUFDckU7U0FDRjtRQUVELE1BQU0sT0FBTyxDQUFDLFNBQVMsRUFBRSxJQUFJLEVBQUUsa0JBQWtCLEVBQUUsSUFBSSxDQUFDLENBQUM7S0FDMUQ7SUFBQyxPQUFPLENBQUMsRUFBRTtRQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDZixNQUFNLE9BQU8sQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDLE9BQU8sSUFBSSxnQkFBZ0IsRUFBRSxPQUFPLENBQUMsYUFBYSxFQUFFLEVBQUUsQ0FBQyxDQUFDO0tBQ25GO0lBRUQsU0FBUyxPQUFPLENBQUMsY0FBc0IsRUFBRSxNQUFjLEVBQUUsa0JBQTBCLEVBQUUsSUFBUztRQUM1RixNQUFNLFlBQVksR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDO1lBQ2xDLE1BQU0sRUFBRSxjQUFjO1lBQ3RCLE1BQU0sRUFBRSxNQUFNO1lBQ2Qsa0JBQWtCLEVBQUUsa0JBQWtCO1lBQ3RDLE9BQU8sRUFBRSxLQUFLLENBQUMsT0FBTztZQUN0QixTQUFTLEVBQUUsS0FBSyxDQUFDLFNBQVM7WUFDMUIsaUJBQWlCLEVBQUUsS0FBSyxDQUFDLGlCQUFpQjtZQUMxQyxNQUFNLEVBQUUsS0FBSztZQUNiLElBQUksRUFBRSxJQUFJO1NBQ1gsQ0FBQyxDQUFDO1FBRUgsT0FBTyxDQUFDLEdBQUcsQ0FBQyxZQUFZLEVBQUUsWUFBWSxDQUFDLENBQUM7UUFFeEMsaUVBQWlFO1FBQ2pFLE1BQU0sU0FBUyxHQUFHLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBQzFELE1BQU0sY0FBYyxHQUFHO1lBQ3JCLFFBQVEsRUFBRSxTQUFTLENBQUMsUUFBUTtZQUM1QixJQUFJLEVBQUUsU0FBUyxDQUFDLElBQUk7WUFDcEIsTUFBTSxFQUFFLEtBQUs7WUFDYixPQUFPLEVBQUUsRUFBRSxjQUFjLEVBQUUsRUFBRSxFQUFFLGdCQUFnQixFQUFFLFlBQVksQ0FBQyxNQUFNLEVBQUU7U0FDdkUsQ0FBQztRQUVGLE9BQU8sSUFBSSxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUU7WUFDckMsSUFBSTtnQkFDRixpRUFBaUU7Z0JBQ2pFLE1BQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQyxPQUFPLENBQUMsY0FBYyxFQUFFLE9BQU8sQ0FBQyxDQUFDO2dCQUNsRSxPQUFPLENBQUMsRUFBRSxDQUFDLE9BQU8sRUFBRSxNQUFNLENBQUMsQ0FBQztnQkFDNUIsT0FBTyxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQUMsQ0FBQztnQkFDNUIsT0FBTyxDQUFDLEdBQUcsRUFBRSxDQUFDO2FBQ2Y7WUFBQyxPQUFPLENBQUMsRUFBRTtnQkFDVixNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUM7YUFDWDtRQUNILENBQUMsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztBQUNILENBQUM7QUFqSkQsMEJBaUpDO0FBRUQsU0FBUyxVQUFVLENBQUMsSUFBd0I7SUFDMUMsSUFBSSxDQUFDLElBQUksRUFBRTtRQUFFLE9BQU8sU0FBUyxDQUFDO0tBQUU7SUFDaEMsT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzFCLENBQUM7QUFFRCxTQUFTLGVBQWUsQ0FBQyxhQUF1QjtJQUM5QyxPQUFPLFVBQVMsTUFBYztRQUM1QixLQUFLLE1BQU0sWUFBWSxJQUFJLGFBQWEsRUFBRTtZQUN4QyxJQUFJLE1BQU0sQ0FBQyxVQUFVLENBQUMsWUFBWSxDQUFDLEVBQUU7Z0JBQ25DLE9BQU8sSUFBSSxDQUFDO2FBQ2I7U0FDRjtRQUNELE9BQU8sS0FBSyxDQUFDO0lBQ2YsQ0FBQyxDQUFDO0FBQ0osQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLWNvbnNvbGUgKi9cbmltcG9ydCB7IGV4ZWNTeW5jIH0gZnJvbSAnY2hpbGRfcHJvY2Vzcyc7XG5pbXBvcnQgKiBhcyBmcyBmcm9tICdmcyc7XG5pbXBvcnQgeyBqb2luIH0gZnJvbSAncGF0aCc7XG4vLyBpbXBvcnQgdGhlIEFXU0xhbWJkYSBwYWNrYWdlIGV4cGxpY2l0bHksXG4vLyB3aGljaCBpcyBnbG9iYWxseSBhdmFpbGFibGUgaW4gdGhlIExhbWJkYSBydW50aW1lLFxuLy8gYXMgb3RoZXJ3aXNlIGxpbmtpbmcgdGhpcyByZXBvc2l0b3J5IHdpdGggbGluay1hbGwuc2hcbi8vIGZhaWxzIGluIHRoZSBDREsgYXBwIGV4ZWN1dGVkIHdpdGggdHMtbm9kZVxuLyogZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llcyxpbXBvcnQvbm8tdW5yZXNvbHZlZCAqL1xuaW1wb3J0ICogYXMgQVdTTGFtYmRhIGZyb20gJ2F3cy1sYW1iZGEnO1xuaW1wb3J0IHsgQXdzU2RrQ2FsbCB9IGZyb20gJy4uL2F3cy1jdXN0b20tcmVzb3VyY2UnO1xuXG4vKipcbiAqIFNlcmlhbGl6ZWQgZm9ybSBvZiB0aGUgcGh5c2ljYWwgcmVzb3VyY2UgaWQgZm9yIHVzZSBpbiB0aGUgb3BlcmF0aW9uIHBhcmFtZXRlcnNcbiAqL1xuZXhwb3J0IGNvbnN0IFBIWVNJQ0FMX1JFU09VUkNFX0lEX1JFRkVSRU5DRSA9ICdQSFlTSUNBTDpSRVNPVVJDRUlEOic7XG5cbi8qKlxuICogRmxhdHRlbnMgYSBuZXN0ZWQgb2JqZWN0XG4gKlxuICogQHBhcmFtIG9iamVjdCB0aGUgb2JqZWN0IHRvIGJlIGZsYXR0ZW5lZFxuICogQHJldHVybnMgYSBmbGF0IG9iamVjdCB3aXRoIHBhdGggYXMga2V5c1xuICovXG5leHBvcnQgZnVuY3Rpb24gZmxhdHRlbihvYmplY3Q6IG9iamVjdCk6IHsgW2tleTogc3RyaW5nXTogYW55IH0ge1xuICByZXR1cm4gT2JqZWN0LmFzc2lnbihcbiAgICB7fSxcbiAgICAuLi5mdW5jdGlvbiBfZmxhdHRlbihjaGlsZDogYW55LCBwYXRoOiBzdHJpbmdbXSA9IFtdKTogYW55IHtcbiAgICAgIHJldHVybiBbXS5jb25jYXQoLi4uT2JqZWN0LmtleXMoY2hpbGQpXG4gICAgICAgIC5tYXAoa2V5ID0+IHtcbiAgICAgICAgICBjb25zdCBjaGlsZEtleSA9IEJ1ZmZlci5pc0J1ZmZlcihjaGlsZFtrZXldKSA/IGNoaWxkW2tleV0udG9TdHJpbmcoJ3V0ZjgnKSA6IGNoaWxkW2tleV07XG4gICAgICAgICAgcmV0dXJuIHR5cGVvZiBjaGlsZEtleSA9PT0gJ29iamVjdCcgJiYgY2hpbGRLZXkgIT09IG51bGxcbiAgICAgICAgICAgID8gX2ZsYXR0ZW4oY2hpbGRLZXksIHBhdGguY29uY2F0KFtrZXldKSlcbiAgICAgICAgICAgIDogKHsgW3BhdGguY29uY2F0KFtrZXldKS5qb2luKCcuJyldOiBjaGlsZEtleSB9KTtcbiAgICAgICAgfSkpO1xuICAgIH0ob2JqZWN0KSxcbiAgKTtcbn1cblxuLyoqXG4gKiBEZWNvZGVzIGVuY29kZWQgc3BlY2lhbCB2YWx1ZXMgKHBoeXNpY2FsUmVzb3VyY2VJZClcbiAqL1xuZnVuY3Rpb24gZGVjb2RlU3BlY2lhbFZhbHVlcyhvYmplY3Q6IG9iamVjdCwgcGh5c2ljYWxSZXNvdXJjZUlkOiBzdHJpbmcpIHtcbiAgcmV0dXJuIEpTT04ucGFyc2UoSlNPTi5zdHJpbmdpZnkob2JqZWN0KSwgKF9rLCB2KSA9PiB7XG4gICAgc3dpdGNoICh2KSB7XG4gICAgICBjYXNlIFBIWVNJQ0FMX1JFU09VUkNFX0lEX1JFRkVSRU5DRTpcbiAgICAgICAgcmV0dXJuIHBoeXNpY2FsUmVzb3VyY2VJZDtcbiAgICAgIGRlZmF1bHQ6XG4gICAgICAgIHJldHVybiB2O1xuICAgIH1cbiAgfSk7XG59XG5cbi8qKlxuICogRmlsdGVycyB0aGUga2V5cyBvZiBhbiBvYmplY3QuXG4gKi9cbmZ1bmN0aW9uIGZpbHRlcktleXMob2JqZWN0OiBvYmplY3QsIHByZWQ6IChrZXk6IHN0cmluZykgPT4gYm9vbGVhbikge1xuICByZXR1cm4gT2JqZWN0LmVudHJpZXMob2JqZWN0KVxuICAgIC5yZWR1Y2UoXG4gICAgICAoYWNjLCBbaywgdl0pID0+IHByZWQoaylcbiAgICAgICAgPyB7IC4uLmFjYywgW2tdOiB2IH1cbiAgICAgICAgOiBhY2MsXG4gICAgICB7fSxcbiAgICApO1xufVxuXG5sZXQgbGF0ZXN0U2RrSW5zdGFsbGVkID0gZmFsc2U7XG5cbmV4cG9ydCBmdW5jdGlvbiBmb3JjZVNka0luc3RhbGxhdGlvbigpIHtcbiAgbGF0ZXN0U2RrSW5zdGFsbGVkID0gZmFsc2U7XG59XG5cbi8qKlxuICogSW5zdGFsbHMgbGF0ZXN0IEFXUyBTREsgdjJcbiAqL1xuZnVuY3Rpb24gaW5zdGFsbExhdGVzdFNkaygpOiB2b2lkIHtcbiAgY29uc29sZS5sb2coJ0luc3RhbGxpbmcgbGF0ZXN0IEFXUyBTREsgdjInKTtcbiAgLy8gQm90aCBIT01FIGFuZCAtLXByZWZpeCBhcmUgbmVlZGVkIGhlcmUgYmVjYXVzZSAvdG1wIGlzIHRoZSBvbmx5IHdyaXRhYmxlIGxvY2F0aW9uXG4gIGV4ZWNTeW5jKCdIT01FPS90bXAgbnBtIGluc3RhbGwgYXdzLXNka0AyIC0tcHJvZHVjdGlvbiAtLW5vLXBhY2thZ2UtbG9jayAtLW5vLXNhdmUgLS1wcmVmaXggL3RtcCcpO1xuICBsYXRlc3RTZGtJbnN0YWxsZWQgPSB0cnVlO1xufVxuXG4vLyBubyBjdXJyZW50bHkgcGF0Y2hlZCBzZXJ2aWNlc1xuY29uc3QgcGF0Y2hlZFNlcnZpY2VzOiB7IHNlcnZpY2VOYW1lOiBzdHJpbmc7IGFwaVZlcnNpb25zOiBzdHJpbmdbXSB9W10gPSBbXTtcbi8qKlxuICogUGF0Y2hlcyB0aGUgQVdTIFNESyBieSBsb2FkaW5nIHNlcnZpY2UgbW9kZWxzIGluIHRoZSBzYW1lIG1hbm5lciBhcyB0aGUgYWN0dWFsIFNES1xuICovXG5mdW5jdGlvbiBwYXRjaFNkayhhd3NTZGs6IGFueSk6IGFueSB7XG4gIGNvbnN0IGFwaUxvYWRlciA9IGF3c1Nkay5hcGlMb2FkZXI7XG4gIHBhdGNoZWRTZXJ2aWNlcy5mb3JFYWNoKCh7IHNlcnZpY2VOYW1lLCBhcGlWZXJzaW9ucyB9KSA9PiB7XG4gICAgY29uc3QgbG93ZXJTZXJ2aWNlTmFtZSA9IHNlcnZpY2VOYW1lLnRvTG93ZXJDYXNlKCk7XG4gICAgaWYgKCFhd3NTZGsuU2VydmljZS5oYXNTZXJ2aWNlKGxvd2VyU2VydmljZU5hbWUpKSB7XG4gICAgICBhcGlMb2FkZXIuc2VydmljZXNbbG93ZXJTZXJ2aWNlTmFtZV0gPSB7fTtcbiAgICAgIGF3c1Nka1tzZXJ2aWNlTmFtZV0gPSBhd3NTZGsuU2VydmljZS5kZWZpbmVTZXJ2aWNlKGxvd2VyU2VydmljZU5hbWUsIGFwaVZlcnNpb25zKTtcbiAgICB9IGVsc2Uge1xuICAgICAgYXdzU2RrLlNlcnZpY2UuYWRkVmVyc2lvbnMoYXdzU2RrW3NlcnZpY2VOYW1lXSwgYXBpVmVyc2lvbnMpO1xuICAgIH1cbiAgICBhcGlWZXJzaW9ucy5mb3JFYWNoKGFwaVZlcnNpb24gPT4ge1xuICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGFwaUxvYWRlci5zZXJ2aWNlc1tsb3dlclNlcnZpY2VOYW1lXSwgYXBpVmVyc2lvbiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHtcbiAgICAgICAgICBjb25zdCBtb2RlbEZpbGVQcmVmaXggPSBgYXdzLXNkay1wYXRjaC8ke2xvd2VyU2VydmljZU5hbWV9LSR7YXBpVmVyc2lvbn1gO1xuICAgICAgICAgIGNvbnN0IG1vZGVsID0gSlNPTi5wYXJzZShmcy5yZWFkRmlsZVN5bmMoam9pbihfX2Rpcm5hbWUsIGAke21vZGVsRmlsZVByZWZpeH0uc2VydmljZS5qc29uYCksICd1dGYtOCcpKTtcbiAgICAgICAgICBtb2RlbC5wYWdpbmF0b3JzID0gSlNPTi5wYXJzZShmcy5yZWFkRmlsZVN5bmMoam9pbihfX2Rpcm5hbWUsIGAke21vZGVsRmlsZVByZWZpeH0ucGFnaW5hdG9ycy5qc29uYCksICd1dGYtOCcpKS5wYWdpbmF0aW9uO1xuICAgICAgICAgIHJldHVybiBtb2RlbDtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlLFxuICAgICAgfSk7XG4gICAgfSk7XG4gIH0pO1xuICByZXR1cm4gYXdzU2RrO1xufVxuXG4vKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tcmVxdWlyZS1pbXBvcnRzLCBpbXBvcnQvbm8tZXh0cmFuZW91cy1kZXBlbmRlbmNpZXMgKi9cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBoYW5kbGVyKGV2ZW50OiBBV1NMYW1iZGEuQ2xvdWRGb3JtYXRpb25DdXN0b21SZXNvdXJjZUV2ZW50LCBjb250ZXh0OiBBV1NMYW1iZGEuQ29udGV4dCkge1xuICB0cnkge1xuICAgIGxldCBBV1M6IGFueTtcbiAgICBpZiAoIWxhdGVzdFNka0luc3RhbGxlZCAmJiBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuSW5zdGFsbExhdGVzdEF3c1NkayA9PT0gJ3RydWUnKSB7XG4gICAgICB0cnkge1xuICAgICAgICBpbnN0YWxsTGF0ZXN0U2RrKCk7XG4gICAgICAgIEFXUyA9IHJlcXVpcmUoJy90bXAvbm9kZV9tb2R1bGVzL2F3cy1zZGsnKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgY29uc29sZS5sb2coYEZhaWxlZCB0byBpbnN0YWxsIGxhdGVzdCBBV1MgU0RLIHYyOiAke2V9YCk7XG4gICAgICAgIEFXUyA9IHJlcXVpcmUoJ2F3cy1zZGsnKTsgLy8gRmFsbGJhY2sgdG8gcHJlLWluc3RhbGxlZCB2ZXJzaW9uXG4gICAgICB9XG4gICAgfSBlbHNlIGlmIChsYXRlc3RTZGtJbnN0YWxsZWQpIHtcbiAgICAgIEFXUyA9IHJlcXVpcmUoJy90bXAvbm9kZV9tb2R1bGVzL2F3cy1zZGsnKTtcbiAgICB9IGVsc2Uge1xuICAgICAgQVdTID0gcmVxdWlyZSgnYXdzLXNkaycpO1xuICAgIH1cbiAgICB0cnkge1xuICAgICAgQVdTID0gcGF0Y2hTZGsoQVdTKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICBjb25zb2xlLmxvZyhgRmFpbGVkIHRvIHBhdGNoIEFXUyBTREs6ICR7ZX0uIFByb2NlZWRpbmcgd2l0aCB0aGUgaW5zdGFsbGVkIGNvcHkuYCk7XG4gICAgfVxuXG4gICAgY29uc29sZS5sb2coSlNPTi5zdHJpbmdpZnkoZXZlbnQpKTtcbiAgICBjb25zb2xlLmxvZygnQVdTIFNESyBWRVJTSU9OOiAnICsgQVdTLlZFUlNJT04pO1xuXG4gICAgZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLkNyZWF0ZSA9IGRlY29kZUNhbGwoZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLkNyZWF0ZSk7XG4gICAgZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLlVwZGF0ZSA9IGRlY29kZUNhbGwoZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLlVwZGF0ZSk7XG4gICAgZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLkRlbGV0ZSA9IGRlY29kZUNhbGwoZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLkRlbGV0ZSk7XG4gICAgLy8gRGVmYXVsdCBwaHlzaWNhbCByZXNvdXJjZSBpZFxuICAgIGxldCBwaHlzaWNhbFJlc291cmNlSWQ6IHN0cmluZztcbiAgICBzd2l0Y2ggKGV2ZW50LlJlcXVlc3RUeXBlKSB7XG4gICAgICBjYXNlICdDcmVhdGUnOlxuICAgICAgICBwaHlzaWNhbFJlc291cmNlSWQgPSBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuQ3JlYXRlPy5waHlzaWNhbFJlc291cmNlSWQ/LmlkID8/XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5VcGRhdGU/LnBoeXNpY2FsUmVzb3VyY2VJZD8uaWQgPz9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLkRlbGV0ZT8ucGh5c2ljYWxSZXNvdXJjZUlkPy5pZCA/P1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5Mb2dpY2FsUmVzb3VyY2VJZDtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdVcGRhdGUnOlxuICAgICAgY2FzZSAnRGVsZXRlJzpcbiAgICAgICAgcGh5c2ljYWxSZXNvdXJjZUlkID0gZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzW2V2ZW50LlJlcXVlc3RUeXBlXT8ucGh5c2ljYWxSZXNvdXJjZUlkPy5pZCA/PyBldmVudC5QaHlzaWNhbFJlc291cmNlSWQ7XG4gICAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIGxldCBmbGF0RGF0YTogeyBba2V5OiBzdHJpbmddOiBzdHJpbmcgfSA9IHt9O1xuICAgIGxldCBkYXRhOiB7IFtrZXk6IHN0cmluZ106IHN0cmluZyB9ID0ge307XG4gICAgY29uc3QgY2FsbDogQXdzU2RrQ2FsbCB8IHVuZGVmaW5lZCA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllc1tldmVudC5SZXF1ZXN0VHlwZV07XG5cbiAgICBpZiAoY2FsbCkge1xuXG4gICAgICBsZXQgY3JlZGVudGlhbHM7XG4gICAgICBpZiAoY2FsbC5hc3N1bWVkUm9sZUFybikge1xuICAgICAgICBjb25zdCB0aW1lc3RhbXAgPSAobmV3IERhdGUoKSkuZ2V0VGltZSgpO1xuXG4gICAgICAgIGNvbnN0IHBhcmFtcyA9IHtcbiAgICAgICAgICBSb2xlQXJuOiBjYWxsLmFzc3VtZWRSb2xlQXJuLFxuICAgICAgICAgIFJvbGVTZXNzaW9uTmFtZTogYCR7dGltZXN0YW1wfS0ke3BoeXNpY2FsUmVzb3VyY2VJZH1gLnN1YnN0cmluZygwLCA2NCksXG4gICAgICAgIH07XG5cbiAgICAgICAgY3JlZGVudGlhbHMgPSBuZXcgQVdTLkNoYWluYWJsZVRlbXBvcmFyeUNyZWRlbnRpYWxzKHtcbiAgICAgICAgICBwYXJhbXM6IHBhcmFtcyxcbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIGlmICghT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKEFXUywgY2FsbC5zZXJ2aWNlKSkge1xuICAgICAgICB0aHJvdyBFcnJvcihgU2VydmljZSAke2NhbGwuc2VydmljZX0gZG9lcyBub3QgZXhpc3QgaW4gQVdTIFNESyB2ZXJzaW9uICR7QVdTLlZFUlNJT059LmApO1xuICAgICAgfVxuICAgICAgY29uc3QgYXdzU2VydmljZSA9IG5ldyAoQVdTIGFzIGFueSlbY2FsbC5zZXJ2aWNlXSh7XG4gICAgICAgIGFwaVZlcnNpb246IGNhbGwuYXBpVmVyc2lvbixcbiAgICAgICAgY3JlZGVudGlhbHM6IGNyZWRlbnRpYWxzLFxuICAgICAgICByZWdpb246IGNhbGwucmVnaW9uLFxuICAgICAgfSk7XG5cbiAgICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgYXdzU2VydmljZVtjYWxsLmFjdGlvbl0oXG4gICAgICAgICAgY2FsbC5wYXJhbWV0ZXJzICYmIGRlY29kZVNwZWNpYWxWYWx1ZXMoY2FsbC5wYXJhbWV0ZXJzLCBwaHlzaWNhbFJlc291cmNlSWQpKS5wcm9taXNlKCk7XG4gICAgICAgIGZsYXREYXRhID0ge1xuICAgICAgICAgIGFwaVZlcnNpb246IGF3c1NlcnZpY2UuY29uZmlnLmFwaVZlcnNpb24sIC8vIEZvciB0ZXN0IHB1cnBvc2VzOiBjaGVjayBpZiBhcGlWZXJzaW9uIHdhcyBjb3JyZWN0bHkgcGFzc2VkLlxuICAgICAgICAgIHJlZ2lvbjogYXdzU2VydmljZS5jb25maWcucmVnaW9uLCAvLyBGb3IgdGVzdCBwdXJwb3NlczogY2hlY2sgaWYgcmVnaW9uIHdhcyBjb3JyZWN0bHkgcGFzc2VkLlxuICAgICAgICAgIC4uLmZsYXR0ZW4ocmVzcG9uc2UpLFxuICAgICAgICB9O1xuXG4gICAgICAgIGxldCBvdXRwdXRQYXRoczogc3RyaW5nW10gfCB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChjYWxsLm91dHB1dFBhdGgpIHtcbiAgICAgICAgICBvdXRwdXRQYXRocyA9IFtjYWxsLm91dHB1dFBhdGhdO1xuICAgICAgICB9IGVsc2UgaWYgKGNhbGwub3V0cHV0UGF0aHMpIHtcbiAgICAgICAgICBvdXRwdXRQYXRocyA9IGNhbGwub3V0cHV0UGF0aHM7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAob3V0cHV0UGF0aHMpIHtcbiAgICAgICAgICBkYXRhID0gZmlsdGVyS2V5cyhmbGF0RGF0YSwgc3RhcnRzV2l0aE9uZU9mKG91dHB1dFBhdGhzKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZGF0YSA9IGZsYXREYXRhO1xuICAgICAgICB9XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGlmICghY2FsbC5pZ25vcmVFcnJvckNvZGVzTWF0Y2hpbmcgfHwgIW5ldyBSZWdFeHAoY2FsbC5pZ25vcmVFcnJvckNvZGVzTWF0Y2hpbmcpLnRlc3QoZS5jb2RlKSkge1xuICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGNhbGwucGh5c2ljYWxSZXNvdXJjZUlkPy5yZXNwb25zZVBhdGgpIHtcbiAgICAgICAgcGh5c2ljYWxSZXNvdXJjZUlkID0gZmxhdERhdGFbY2FsbC5waHlzaWNhbFJlc291cmNlSWQucmVzcG9uc2VQYXRoXTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBhd2FpdCByZXNwb25kKCdTVUNDRVNTJywgJ09LJywgcGh5c2ljYWxSZXNvdXJjZUlkLCBkYXRhKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIGNvbnNvbGUubG9nKGUpO1xuICAgIGF3YWl0IHJlc3BvbmQoJ0ZBSUxFRCcsIGUubWVzc2FnZSB8fCAnSW50ZXJuYWwgRXJyb3InLCBjb250ZXh0LmxvZ1N0cmVhbU5hbWUsIHt9KTtcbiAgfVxuXG4gIGZ1bmN0aW9uIHJlc3BvbmQocmVzcG9uc2VTdGF0dXM6IHN0cmluZywgcmVhc29uOiBzdHJpbmcsIHBoeXNpY2FsUmVzb3VyY2VJZDogc3RyaW5nLCBkYXRhOiBhbnkpIHtcbiAgICBjb25zdCByZXNwb25zZUJvZHkgPSBKU09OLnN0cmluZ2lmeSh7XG4gICAgICBTdGF0dXM6IHJlc3BvbnNlU3RhdHVzLFxuICAgICAgUmVhc29uOiByZWFzb24sXG4gICAgICBQaHlzaWNhbFJlc291cmNlSWQ6IHBoeXNpY2FsUmVzb3VyY2VJZCxcbiAgICAgIFN0YWNrSWQ6IGV2ZW50LlN0YWNrSWQsXG4gICAgICBSZXF1ZXN0SWQ6IGV2ZW50LlJlcXVlc3RJZCxcbiAgICAgIExvZ2ljYWxSZXNvdXJjZUlkOiBldmVudC5Mb2dpY2FsUmVzb3VyY2VJZCxcbiAgICAgIE5vRWNobzogZmFsc2UsXG4gICAgICBEYXRhOiBkYXRhLFxuICAgIH0pO1xuXG4gICAgY29uc29sZS5sb2coJ1Jlc3BvbmRpbmcnLCByZXNwb25zZUJvZHkpO1xuXG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1yZXF1aXJlLWltcG9ydHNcbiAgICBjb25zdCBwYXJzZWRVcmwgPSByZXF1aXJlKCd1cmwnKS5wYXJzZShldmVudC5SZXNwb25zZVVSTCk7XG4gICAgY29uc3QgcmVxdWVzdE9wdGlvbnMgPSB7XG4gICAgICBob3N0bmFtZTogcGFyc2VkVXJsLmhvc3RuYW1lLFxuICAgICAgcGF0aDogcGFyc2VkVXJsLnBhdGgsXG4gICAgICBtZXRob2Q6ICdQVVQnLFxuICAgICAgaGVhZGVyczogeyAnY29udGVudC10eXBlJzogJycsICdjb250ZW50LWxlbmd0aCc6IHJlc3BvbnNlQm9keS5sZW5ndGggfSxcbiAgICB9O1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgIHRyeSB7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tcmVxdWlyZS1pbXBvcnRzXG4gICAgICAgIGNvbnN0IHJlcXVlc3QgPSByZXF1aXJlKCdodHRwcycpLnJlcXVlc3QocmVxdWVzdE9wdGlvbnMsIHJlc29sdmUpO1xuICAgICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICAgIHJlcXVlc3Qud3JpdGUocmVzcG9uc2VCb2R5KTtcbiAgICAgICAgcmVxdWVzdC5lbmQoKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgfVxuICAgIH0pO1xuICB9XG59XG5cbmZ1bmN0aW9uIGRlY29kZUNhbGwoY2FsbDogc3RyaW5nIHwgdW5kZWZpbmVkKSB7XG4gIGlmICghY2FsbCkgeyByZXR1cm4gdW5kZWZpbmVkOyB9XG4gIHJldHVybiBKU09OLnBhcnNlKGNhbGwpO1xufVxuXG5mdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/integ.json b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/integ.json index 920644926b3e6..682814dfbc70a 100644 --- a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/integ.json @@ -1,11 +1,12 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "LogGroup/DefaultTest": { "stacks": [ "log-group-events" ], - "assertionStack": "LogGroupDefaultTestDeployAssert353EE07A" + "assertionStack": "LogGroup/DefaultTest/DeployAssert", + "assertionStackName": "LogGroupDefaultTestDeployAssert353EE07A" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/log-group-events.template.json b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/log-group-events.template.json index 87d418fdc2ed4..e984f2b6b1757 100644 --- a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/log-group-events.template.json +++ b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/log-group-events.template.json @@ -60,30 +60,6 @@ ] } }, - "EventsLogGroupPolicyloggroupeventsTimerC63340B0CustomResourcePolicy67B796AA": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:DeleteResourcePolicy", - "logs:PutResourcePolicy" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "EventsLogGroupPolicyloggroupeventsTimerC63340B0CustomResourcePolicy67B796AA", - "Roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - } - }, "EventsLogGroupPolicyloggroupeventsTimerC63340B0C92153CD": { "Type": "Custom::CloudwatchLogResourcePolicy", "Properties": { @@ -132,6 +108,30 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, + "EventsLogGroupPolicyloggroupeventsTimerC63340B0CustomResourcePolicy67B796AA": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:DeleteResourcePolicy", + "logs:PutResourcePolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EventsLogGroupPolicyloggroupeventsTimerC63340B0CustomResourcePolicy67B796AA", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { "Type": "AWS::IAM::Role", "Properties": { @@ -168,7 +168,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3Bucket648C0EE1" + "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3BucketC526447A" }, "S3Key": { "Fn::Join": [ @@ -181,7 +181,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3VersionKeyDCBB7AC4" + "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5" } ] } @@ -194,7 +194,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3VersionKeyDCBB7AC4" + "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5" } ] } @@ -267,30 +267,6 @@ ] } }, - "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6CustomResourcePolicy361E9A96": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:DeleteResourcePolicy", - "logs:PutResourcePolicy" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6CustomResourcePolicy361E9A96", - "Roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - } - }, "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6C647CDBC": { "Type": "Custom::CloudwatchLogResourcePolicy", "Properties": { @@ -339,6 +315,30 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, + "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6CustomResourcePolicy361E9A96": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:DeleteResourcePolicy", + "logs:PutResourcePolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6CustomResourcePolicy361E9A96", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, "dlq09C78ACC": { "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", @@ -388,30 +388,6 @@ ] } }, - "EventsLogGroupPolicyloggroupeventsTimer37DF74C17CustomResourcePolicyAE930E1E": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:DeleteResourcePolicy", - "logs:PutResourcePolicy" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "EventsLogGroupPolicyloggroupeventsTimer37DF74C17CustomResourcePolicyAE930E1E", - "Roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - } - }, "EventsLogGroupPolicyloggroupeventsTimer37DF74C174B3D705D": { "Type": "Custom::CloudwatchLogResourcePolicy", "Properties": { @@ -469,20 +445,44 @@ ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" + }, + "EventsLogGroupPolicyloggroupeventsTimer37DF74C17CustomResourcePolicyAE930E1E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:DeleteResourcePolicy", + "logs:PutResourcePolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EventsLogGroupPolicyloggroupeventsTimer37DF74C17CustomResourcePolicyAE930E1E", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } } }, "Parameters": { - "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3Bucket648C0EE1": { + "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3BucketC526447A": { "Type": "String", - "Description": "S3 bucket for asset \"c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560\"" + "Description": "S3 bucket for asset \"105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286\"" }, - "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3VersionKeyDCBB7AC4": { + "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5": { "Type": "String", - "Description": "S3 key for asset version \"c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560\"" + "Description": "S3 key for asset version \"105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286\"" }, - "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560ArtifactHash99A6E846": { + "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286ArtifactHashC17A8FEC": { "Type": "String", - "Description": "Artifact hash for asset \"c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560\"" + "Description": "Artifact hash for asset \"105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/manifest.json index 7235d59f64494..f8d548557859c 100644 --- a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -19,32 +19,26 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560", - "id": "c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560", + "path": "asset.105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286", + "id": "105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286", "packaging": "zip", - "sourceHash": "c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560", - "s3BucketParameter": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3Bucket648C0EE1", - "s3KeyParameter": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3VersionKeyDCBB7AC4", - "artifactHashParameter": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560ArtifactHash99A6E846" + "sourceHash": "105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286", + "s3BucketParameter": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3BucketC526447A", + "s3KeyParameter": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5", + "artifactHashParameter": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286ArtifactHashC17A8FEC" } } ], "/log-group-events/log-group/Resource": [ { "type": "aws:cdk:logicalId", - "data": "loggroupB02AAEB1", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "loggroupB02AAEB1" } ], "/log-group-events/log-group2/Resource": [ { "type": "aws:cdk:logicalId", - "data": "loggroup2F19C5C9B", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "loggroup2F19C5C9B" } ], "/log-group-events/log-group-imported/Resource": [ @@ -59,16 +53,16 @@ "data": "TimerBF6F831F" } ], - "/log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/CustomResourcePolicy/Resource": [ + "/log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/Resource/Default": [ { "type": "aws:cdk:logicalId", - "data": "EventsLogGroupPolicyloggroupeventsTimerC63340B0CustomResourcePolicy67B796AA" + "data": "EventsLogGroupPolicyloggroupeventsTimerC63340B0C92153CD" } ], - "/log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/Resource/Default": [ + "/log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/CustomResourcePolicy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "EventsLogGroupPolicyloggroupeventsTimerC63340B0C92153CD" + "data": "EventsLogGroupPolicyloggroupeventsTimerC63340B0CustomResourcePolicy67B796AA" } ], "/log-group-events/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/Resource": [ @@ -83,22 +77,22 @@ "data": "AWS679f53fac002430cb0da5b7982bd22872D164C4C" } ], - "/log-group-events/AssetParameters/c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/S3Bucket": [ + "/log-group-events/AssetParameters/105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3Bucket648C0EE1" + "data": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3BucketC526447A" } ], - "/log-group-events/AssetParameters/c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/S3VersionKey": [ + "/log-group-events/AssetParameters/105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3VersionKeyDCBB7AC4" + "data": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5" } ], - "/log-group-events/AssetParameters/c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/ArtifactHash": [ + "/log-group-events/AssetParameters/105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560ArtifactHash99A6E846" + "data": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286ArtifactHashC17A8FEC" } ], "/log-group-events/CustomRule/Resource": [ @@ -107,16 +101,16 @@ "data": "CustomRuleB1CBBADE" } ], - "/log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/CustomResourcePolicy/Resource": [ + "/log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/Resource/Default": [ { "type": "aws:cdk:logicalId", - "data": "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6CustomResourcePolicy361E9A96" + "data": "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6C647CDBC" } ], - "/log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/Resource/Default": [ + "/log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/CustomResourcePolicy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6C647CDBC" + "data": "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6CustomResourcePolicy361E9A96" } ], "/log-group-events/dlq/Resource": [ @@ -131,49 +125,22 @@ "data": "Timer30894E3BB" } ], - "/log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/CustomResourcePolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "EventsLogGroupPolicyloggroupeventsTimer37DF74C17CustomResourcePolicyAE930E1E" - } - ], "/log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "EventsLogGroupPolicyloggroupeventsTimer37DF74C174B3D705D" } ], - "/log-group-events/Exports/Output{\"Ref\":\"loggroup2F19C5C9B\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefloggroup2F19C5C9B4F4C6918" - } - ], - "Timer2B6F162E9": [ - { - "type": "aws:cdk:logicalId", - "data": "Timer2B6F162E9", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "EventsLogGroupPolicyloggroupeventsTimer289E3527ECustomResourcePolicy24E754C4": [ + "/log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/CustomResourcePolicy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "EventsLogGroupPolicyloggroupeventsTimer289E3527ECustomResourcePolicy24E754C4", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "EventsLogGroupPolicyloggroupeventsTimer37DF74C17CustomResourcePolicyAE930E1E" } ], - "EventsLogGroupPolicyloggroupeventsTimer289E3527E78608648": [ + "/log-group-events/Exports/Output{\"Ref\":\"loggroup2F19C5C9B\"}": [ { "type": "aws:cdk:logicalId", - "data": "EventsLogGroupPolicyloggroupeventsTimer289E3527E78608648", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "ExportsOutputRefloggroup2F19C5C9B4F4C6918" } ] }, @@ -194,13 +161,13 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736.bundle", - "id": "41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736", + "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "packaging": "zip", - "sourceHash": "41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736", - "s3BucketParameter": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3BucketA9F12763", - "s3KeyParameter": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3VersionKey589F30A2", - "artifactHashParameter": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736ArtifactHash2CC614EA" + "sourceHash": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "s3BucketParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80", + "s3KeyParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE", + "artifactHashParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } } ], @@ -222,22 +189,22 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/LogGroup/DefaultTest/DeployAssert/AssetParameters/41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736/S3Bucket": [ + "/LogGroup/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3BucketA9F12763" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" } ], - "/LogGroup/DefaultTest/DeployAssert/AssetParameters/41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736/S3VersionKey": [ + "/LogGroup/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736S3VersionKey589F30A2" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ], - "/LogGroup/DefaultTest/DeployAssert/AssetParameters/41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736/ArtifactHash": [ + "/LogGroup/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736ArtifactHash2CC614EA" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } ], "/LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents/Default/Default": [ diff --git a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/tree.json b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/tree.json index 8c3f639bd5fe1..cf9231d53741f 100644 --- a/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-events-targets/test/logs/log-group.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } }, "log-group-events": { @@ -93,8 +93,8 @@ "id": "imported-log-group", "path": "log-group-events/imported-log-group", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Timer": { @@ -162,6 +162,24 @@ "version": "0.0.0" } }, + "Resource": { + "id": "Resource", + "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/Resource", + "children": { + "Default": { + "id": "Default", + "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/Resource/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, "CustomResourcePolicy": { "id": "CustomResourcePolicy", "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/CustomResourcePolicy", @@ -203,24 +221,6 @@ "fqn": "@aws-cdk/aws-iam.Policy", "version": "0.0.0" } - }, - "Resource": { - "id": "Resource", - "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/Resource", - "children": { - "Default": { - "id": "Default", - "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/Resource/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } } }, "constructInfo": { @@ -289,8 +289,8 @@ "id": "Stage", "path": "log-group-events/AWS679f53fac002430cb0da5b7982bd2287/Code/Stage", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssetBucket": { @@ -315,7 +315,7 @@ "aws:cdk:cloudformation:props": { "code": { "s3Bucket": { - "Ref": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3Bucket648C0EE1" + "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3BucketC526447A" }, "s3Key": { "Fn::Join": [ @@ -328,7 +328,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3VersionKeyDCBB7AC4" + "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5" } ] } @@ -341,7 +341,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersc1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560S3VersionKeyDCBB7AC4" + "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5" } ] } @@ -377,44 +377,44 @@ "id": "AssetParameters", "path": "log-group-events/AssetParameters", "children": { - "c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560": { - "id": "c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560", - "path": "log-group-events/AssetParameters/c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560", + "105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286": { + "id": "105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286", + "path": "log-group-events/AssetParameters/105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "log-group-events/AssetParameters/c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/S3Bucket", + "path": "log-group-events/AssetParameters/105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "log-group-events/AssetParameters/c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/S3VersionKey", + "path": "log-group-events/AssetParameters/105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "log-group-events/AssetParameters/c1bc48e68a705504356d7b5178aa4617261dbfcf12b70eb9b10fe1fb207ff560/ArtifactHash", + "path": "log-group-events/AssetParameters/105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } }, "CustomRule": { @@ -496,6 +496,24 @@ "version": "0.0.0" } }, + "Resource": { + "id": "Resource", + "path": "log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/Resource", + "children": { + "Default": { + "id": "Default", + "path": "log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/Resource/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, "CustomResourcePolicy": { "id": "CustomResourcePolicy", "path": "log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/CustomResourcePolicy", @@ -537,24 +555,6 @@ "fqn": "@aws-cdk/aws-iam.Policy", "version": "0.0.0" } - }, - "Resource": { - "id": "Resource", - "path": "log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/Resource", - "children": { - "Default": { - "id": "Default", - "path": "log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/Resource/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } } }, "constructInfo": { @@ -658,6 +658,24 @@ "version": "0.0.0" } }, + "Resource": { + "id": "Resource", + "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/Resource", + "children": { + "Default": { + "id": "Default", + "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/Resource/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, "CustomResourcePolicy": { "id": "CustomResourcePolicy", "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/CustomResourcePolicy", @@ -699,24 +717,6 @@ "fqn": "@aws-cdk/aws-iam.Policy", "version": "0.0.0" } - }, - "Resource": { - "id": "Resource", - "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/Resource", - "children": { - "Default": { - "id": "Default", - "path": "log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/Resource/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } } }, "constructInfo": { @@ -732,20 +732,20 @@ "id": "Output{\"Ref\":\"loggroup2F19C5C9B\"}", "path": "log-group-events/Exports/Output{\"Ref\":\"loggroup2F19C5C9B\"}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "LogGroup": { @@ -761,7 +761,7 @@ "path": "LogGroup/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } }, "DeployAssert": { @@ -781,7 +781,7 @@ "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } } }, @@ -798,14 +798,14 @@ "id": "Default", "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -822,74 +822,74 @@ "id": "Staging", "path": "LogGroup/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", "path": "LogGroup/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", "path": "LogGroup/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters", "children": { - "41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736": { - "id": "41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736", - "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters/41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736", + "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters/41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736/S3Bucket", + "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters/41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736/S3VersionKey", + "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters/41fc8f2dc7c01b34dda9916c7f763e7b7909eb629da9ffe879cb786114aae736/ArtifactHash", + "path": "LogGroup/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } }, "AwsApiCallCloudWatchLogsfilterLogEvents": { @@ -905,7 +905,7 @@ "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } } }, @@ -922,14 +922,14 @@ "id": "Default", "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertEqualsCloudWatchLogsfilterLogEvents": { @@ -945,7 +945,7 @@ "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents/AssertEqualsCloudWatchLogsfilterLogEvents/AssertionProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.85" } } }, @@ -962,22 +962,22 @@ "id": "Default", "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents/AssertEqualsCloudWatchLogsfilterLogEvents/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertionResults": { "id": "AssertionResults", "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents/AssertEqualsCloudWatchLogsfilterLogEvents/AssertionResults", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -994,8 +994,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -1012,8 +1012,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.ts b/packages/@aws-cdk/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.ts index 139d91dbd9f81..d4b5c2ada5ca1 100644 --- a/packages/@aws-cdk/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.ts +++ b/packages/@aws-cdk/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as ga from '@aws-cdk/aws-globalaccelerator'; diff --git a/packages/@aws-cdk/aws-glue/README.md b/packages/@aws-cdk/aws-glue/README.md index 88cf57faaa10b..2c654ff8d25d0 100644 --- a/packages/@aws-cdk/aws-glue/README.md +++ b/packages/@aws-cdk/aws-glue/README.md @@ -72,7 +72,11 @@ new glue.Job(this, 'PythonSparkStreamingJob', { ### Python Shell Jobs A Python shell job runs Python scripts as a shell and supports a Python version that depends on the AWS Glue version you are using. -This can be used to schedule and run tasks that don't require an Apache Spark environment. +This can be used to schedule and run tasks that don't require an Apache Spark environment. Currently, three flavors are supported: + +* PythonVersion.TWO (2.7; EOL) +* PythonVersion.THREE (3.6) +* PythonVersion.THREE_NINE (3.9) ```ts declare const bucket: s3.Bucket; diff --git a/packages/@aws-cdk/aws-glue/lib/job-executable.ts b/packages/@aws-cdk/aws-glue/lib/job-executable.ts index 8fd7c39da5508..57e917575dd1b 100644 --- a/packages/@aws-cdk/aws-glue/lib/job-executable.ts +++ b/packages/@aws-cdk/aws-glue/lib/job-executable.ts @@ -75,6 +75,11 @@ export enum PythonVersion { * Python 3 (the exact version depends on GlueVersion and JobCommand used) */ THREE = '3', + + /** + * Python 3.9 (the exact version depends on GlueVersion and JobCommand used) + */ + THREE_NINE = '3.9', } /** @@ -300,6 +305,9 @@ export class JobExecutable { if (JobLanguage.PYTHON !== config.language && config.extraPythonFiles) { throw new Error('extraPythonFiles is not supported for languages other than JobLanguage.PYTHON'); } + if (config.pythonVersion === PythonVersion.THREE_NINE && config.type !== JobType.PYTHON_SHELL) { + throw new Error('Specified PythonVersion PythonVersion.THREE_NINE is only supported for JobType Python Shell'); + } this.config = config; } diff --git a/packages/@aws-cdk/aws-glue/test/integ.job.ts b/packages/@aws-cdk/aws-glue/test/integ.job.ts index fedbc0b8b8428..2aaa812f9e977 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.job.ts +++ b/packages/@aws-cdk/aws-glue/test/integ.job.ts @@ -86,4 +86,20 @@ new glue.Job(stack, 'ShellJob', { }, }); +new glue.Job(stack, 'ShellJob39', { + jobName: 'ShellJob39', + executable: glue.JobExecutable.pythonShell({ + glueVersion: glue.GlueVersion.V1_0, + pythonVersion: glue.PythonVersion.THREE_NINE, + script, + }), + defaultArguments: { + arg1: 'value1', + arg2: 'value2', + }, + tags: { + key: 'value', + }, +}); + app.synth(); diff --git a/packages/@aws-cdk/aws-glue/test/job-executable.test.ts b/packages/@aws-cdk/aws-glue/test/job-executable.test.ts index 5fcf3b1487764..d7416911df914 100644 --- a/packages/@aws-cdk/aws-glue/test/job-executable.test.ts +++ b/packages/@aws-cdk/aws-glue/test/job-executable.test.ts @@ -14,6 +14,14 @@ describe('GlueVersion', () => { test('of(customVersion) should set the name correctly', () => expect(glue.GlueVersion.of('CustomVersion').name).toEqual('CustomVersion')); }); +describe('PythonVersion', () => { + test('.TWO should set the name correctly', () => expect(glue.PythonVersion.TWO).toEqual('2')); + + test('.THREE should set the name correctly', () => expect(glue.PythonVersion.THREE).toEqual('3')); + + test('.THREE_NINE should set the name correctly', () => expect(glue.PythonVersion.THREE_NINE).toEqual('3.9')); +}); + describe('JobType', () => { test('.ETL should set the name correctly', () => expect(glue.JobType.ETL.name).toEqual('glueetl')); @@ -102,5 +110,25 @@ describe('JobExecutable', () => { })).toThrow(`Specified GlueVersion ${glueVersion.name} does not support PythonVersion 2`); }); }); + + test('with PythonVersion set to PythonVersion.THREE_NINE and JobType not pythonshell should throw', () => { + expect(() => glue.JobExecutable.of({ + type: glue.JobType.ETL, + language: glue.JobLanguage.PYTHON, + pythonVersion: glue.PythonVersion.THREE_NINE, + script, + glueVersion: glue.GlueVersion.V1_0, + })).toThrow('Specified PythonVersion PythonVersion.THREE_NINE is only supported for JobType Python Shell'); + }); + + test('with PythonVersion PythonVersion.THREE_NINE and JobType pythonshell should succeed', () => { + expect(glue.JobExecutable.of({ + type: glue.JobType.PYTHON_SHELL, + glueVersion: glue.GlueVersion.V1_0, + language: glue.JobLanguage.PYTHON, + pythonVersion: glue.PythonVersion.THREE_NINE, + script, + })).toBeDefined(); + }); }); }); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/aws-glue-job.assets.json b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/aws-glue-job.assets.json index 006547f08d0f0..4bf9480e37a53 100644 --- a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/aws-glue-job.assets.json +++ b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/aws-glue-job.assets.json @@ -1,5 +1,5 @@ { - "version": "17.0.0", + "version": "20.0.0", "files": { "432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855": { "source": { @@ -14,7 +14,7 @@ } } }, - "9621659bccc489f1130729575d70f1c13a90dc7584eac90773642d7ad0cc1914": { + "a44de72f7ea39efc17f8c7abc7e0c595ae4651b3e239851c49461fecf09bb151": { "source": { "path": "aws-glue-job.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9621659bccc489f1130729575d70f1c13a90dc7584eac90773642d7ad0cc1914.json", + "objectKey": "a44de72f7ea39efc17f8c7abc7e0c595ae4651b3e239851c49461fecf09bb151.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/aws-glue-job.template.json b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/aws-glue-job.template.json index 8f1f9c4105951..3c7b3a6de7c33 100644 --- a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/aws-glue-job.template.json +++ b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/aws-glue-job.template.json @@ -556,6 +556,157 @@ "key": "value" } } + }, + "ShellJob39ServiceRole2F6F3768": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "glue.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSGlueServiceRole" + ] + ] + } + ] + } + }, + "ShellJob39ServiceRoleDefaultPolicy38A33919": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3Bucket4E517469" + }, + "/*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3Bucket4E517469" + } + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ShellJob39ServiceRoleDefaultPolicy38A33919", + "Roles": [ + { + "Ref": "ShellJob39ServiceRole2F6F3768" + } + ] + } + }, + "ShellJob390C141361": { + "Type": "AWS::Glue::Job", + "Properties": { + "Command": { + "Name": "pythonshell", + "PythonVersion": "3.9", + "ScriptLocation": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3Bucket4E517469" + }, + "/", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3VersionKeyF7753763" + } + ] + } + ] + }, + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3VersionKeyF7753763" + } + ] + } + ] + } + ] + ] + } + }, + "Role": { + "Fn::GetAtt": [ + "ShellJob39ServiceRole2F6F3768", + "Arn" + ] + }, + "DefaultArguments": { + "--job-language": "python", + "arg1": "value1", + "arg2": "value2" + }, + "GlueVersion": "1.0", + "Name": "ShellJob39", + "Tags": { + "key": "value" + } + } } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/cdk.out index 90bef2e09ad39..588d7b269d34f 100644 --- a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"17.0.0"} \ No newline at end of file +{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/manifest.json index 04b50ed25b88a..03176af8b48f1 100644 --- a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "17.0.0", + "version": "20.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -112,6 +112,24 @@ "type": "aws:cdk:logicalId", "data": "ShellJob42E81F95" } + ], + "/aws-glue-job/ShellJob39/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ShellJob39ServiceRole2F6F3768" + } + ], + "/aws-glue-job/ShellJob39/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ShellJob39ServiceRoleDefaultPolicy38A33919" + } + ], + "/aws-glue-job/ShellJob39/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ShellJob390C141361" + } ] }, "displayName": "aws-glue-job" diff --git a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/tree.json b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/tree.json index 7ad2be6bfd7a5..ff026f11dccb0 100644 --- a/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-glue/test/job.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.9" + "version": "10.1.85" } }, "aws-glue-job": { @@ -203,13 +203,13 @@ "version": "0.0.0" } }, - "Code091b8d1d12512c9c73f5ef5b87b54c6b": { - "id": "Code091b8d1d12512c9c73f5ef5b87b54c6b", - "path": "aws-glue-job/EtlJob/Code091b8d1d12512c9c73f5ef5b87b54c6b", + "Codeb466388f7ca2adcca7e8d91f0390ca4f": { + "id": "Codeb466388f7ca2adcca7e8d91f0390ca4f", + "path": "aws-glue-job/EtlJob/Codeb466388f7ca2adcca7e8d91f0390ca4f", "children": { "Stage": { "id": "Stage", - "path": "aws-glue-job/EtlJob/Code091b8d1d12512c9c73f5ef5b87b54c6b/Stage", + "path": "aws-glue-job/EtlJob/Codeb466388f7ca2adcca7e8d91f0390ca4f/Stage", "constructInfo": { "fqn": "@aws-cdk/core.AssetStaging", "version": "0.0.0" @@ -217,7 +217,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-glue-job/EtlJob/Code091b8d1d12512c9c73f5ef5b87b54c6b/AssetBucket", + "path": "aws-glue-job/EtlJob/Codeb466388f7ca2adcca7e8d91f0390ca4f/AssetBucket", "constructInfo": { "fqn": "@aws-cdk/aws-s3.BucketBase", "version": "0.0.0" @@ -421,13 +421,13 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.9" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.9" + "version": "10.1.85" } }, "StreamingJob": { @@ -839,6 +839,211 @@ "fqn": "@aws-cdk/aws-glue.Job", "version": "0.0.0" } + }, + "ShellJob39": { + "id": "ShellJob39", + "path": "aws-glue-job/ShellJob39", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-glue-job/ShellJob39/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-glue-job/ShellJob39/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "glue.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSGlueServiceRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-glue-job/ShellJob39/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-glue-job/ShellJob39/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetBucket*", + "s3:GetObject*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3Bucket4E517469" + }, + "/*" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3Bucket4E517469" + } + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "ShellJob39ServiceRoleDefaultPolicy38A33919", + "roles": [ + { + "Ref": "ShellJob39ServiceRole2F6F3768" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-glue-job/ShellJob39/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Glue::Job", + "aws:cdk:cloudformation:props": { + "command": { + "name": "pythonshell", + "scriptLocation": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3Bucket4E517469" + }, + "/", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3VersionKeyF7753763" + } + ] + } + ] + }, + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855S3VersionKeyF7753763" + } + ] + } + ] + } + ] + ] + }, + "pythonVersion": "3.9" + }, + "role": { + "Fn::GetAtt": [ + "ShellJob39ServiceRole2F6F3768", + "Arn" + ] + }, + "defaultArguments": { + "--job-language": "python", + "arg1": "value1", + "arg2": "value2" + }, + "glueVersion": "1.0", + "name": "ShellJob39", + "tags": { + "key": "value" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-glue.CfnJob", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-glue.Job", + "version": "0.0.0" + } } }, "constructInfo": { @@ -852,4 +1057,4 @@ "version": "0.0.0" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iam/test/integ.condition-with-ref.ts b/packages/@aws-cdk/aws-iam/test/integ.condition-with-ref.ts index 69fe09d6cc3a5..b9a7c77c397a0 100644 --- a/packages/@aws-cdk/aws-iam/test/integ.condition-with-ref.ts +++ b/packages/@aws-cdk/aws-iam/test/integ.condition-with-ref.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { App, CfnJson, CfnParameter, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { AccountRootPrincipal, Role } from '../lib'; diff --git a/packages/@aws-cdk/aws-iam/test/integ.oidc-provider.ts b/packages/@aws-cdk/aws-iam/test/integ.oidc-provider.ts index 19ac58c43ae87..fa7a7982b76df 100644 --- a/packages/@aws-cdk/aws-iam/test/integ.oidc-provider.ts +++ b/packages/@aws-cdk/aws-iam/test/integ.oidc-provider.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { App, Stack } from '@aws-cdk/core'; import * as iam from '../lib'; diff --git a/packages/@aws-cdk/aws-iot-actions/test/sns/integ.sns-topic-action.ts b/packages/@aws-cdk/aws-iot-actions/test/sns/integ.sns-topic-action.ts index 5243ab2effab4..bd943d1fd42c3 100644 --- a/packages/@aws-cdk/aws-iot-actions/test/sns/integ.sns-topic-action.ts +++ b/packages/@aws-cdk/aws-iot-actions/test/sns/integ.sns-topic-action.ts @@ -7,7 +7,6 @@ * * verify that an email was sent from the SNS * * rm testfile.txt */ -/// !cdk-integ pragma:ignore-assets import * as iot from '@aws-cdk/aws-iot'; import * as sns from '@aws-cdk/aws-sns'; import * as cdk from '@aws-cdk/core'; @@ -30,4 +29,4 @@ class TestStack extends cdk.Stack { const app = new cdk.App(); new TestStack(app, 'sns-topic-action-test-stack'); -app.synth(); \ No newline at end of file +app.synth(); diff --git a/packages/@aws-cdk/aws-iot-actions/test/sqs/integ.sqs-queue-action.ts b/packages/@aws-cdk/aws-iot-actions/test/sqs/integ.sqs-queue-action.ts index c383163fd282e..4cac47c34ae40 100644 --- a/packages/@aws-cdk/aws-iot-actions/test/sqs/integ.sqs-queue-action.ts +++ b/packages/@aws-cdk/aws-iot-actions/test/sqs/integ.sqs-queue-action.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as iot from '@aws-cdk/aws-iot'; import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-iot/package.json b/packages/@aws-cdk/aws-iot/package.json index 985ea75c3e20d..09e07ec40d9bd 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -83,6 +83,7 @@ "@aws-cdk/assertions": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", + "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", diff --git a/packages/@aws-cdk/aws-iot/test/integ.topic-rule.ts b/packages/@aws-cdk/aws-iot/test/integ.topic-rule.ts index c5a602141bda6..06df404f8c93e 100644 --- a/packages/@aws-cdk/aws-iot/test/integ.topic-rule.ts +++ b/packages/@aws-cdk/aws-iot/test/integ.topic-rule.ts @@ -1,9 +1,7 @@ -/// !cdk-integ pragma:ignore-assets import * as cdk from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; import * as iot from '../lib'; -const app = new cdk.App(); - class TestStack extends cdk.Stack { constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { super(scope, id, props); @@ -23,5 +21,10 @@ class TestStack extends cdk.Stack { } } -new TestStack(app, 'test-stack'); +const app = new cdk.App(); +const testCase = new TestStack(app, 'topic-rule-test-stack'); +new integ.IntegTest(app, 'TopicRule', { + testCases: [testCase], +}); + app.synth(); diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/TrailIntegTestDefaultTestDeployAssertA42C24D1.template.json b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/TopicRuleDefaultTestDeployAssert86D4DD8C.template.json similarity index 100% rename from packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.integ.snapshot/TrailIntegTestDefaultTestDeployAssertA42C24D1.template.json rename to packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/TopicRuleDefaultTestDeployAssert86D4DD8C.template.json diff --git a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/cdk.out index 90bef2e09ad39..588d7b269d34f 100644 --- a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"17.0.0"} \ No newline at end of file +{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/integ.json b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/integ.json index 191adf9a94ffe..fbd4e6d7be0ba 100644 --- a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/integ.json @@ -1,14 +1,11 @@ { "version": "20.0.0", "testCases": { - "integ.topic-rule": { + "TopicRule/DefaultTest": { "stacks": [ - "test-stack" + "topic-rule-test-stack" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "TopicRule/DefaultTest/DeployAssert" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/manifest.json index 442d0b446c090..9b3475876e317 100644 --- a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "17.0.0", + "version": "20.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -7,22 +7,31 @@ "file": "tree.json" } }, - "test-stack": { + "topic-rule-test-stack": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "test-stack.template.json", + "templateFile": "topic-rule-test-stack.template.json", "validateOnSynth": false }, "metadata": { - "/test-stack/TopicRule/Resource": [ + "/topic-rule-test-stack/TopicRule/Resource": [ { "type": "aws:cdk:logicalId", "data": "TopicRule40A4EA44" } ] }, - "displayName": "test-stack" + "displayName": "topic-rule-test-stack" + }, + "TopicRuleDefaultTestDeployAssert86D4DD8C": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "TopicRuleDefaultTestDeployAssert86D4DD8C.template.json", + "validateOnSynth": false + }, + "displayName": "TopicRule/DefaultTest/DeployAssert" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/test-stack.assets.json b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/test-stack.assets.json deleted file mode 100644 index d94156c2f4cc9..0000000000000 --- a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/test-stack.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "17.0.0", - "files": { - "d50090fbe5678c31ed21caae07c16cfd4767778ce303e452ca29c31ece195f32": { - "source": { - "path": "test-stack.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d50090fbe5678c31ed21caae07c16cfd4767778ce303e452ca29c31ece195f32.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/test-stack.template.json b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/topic-rule-test-stack.template.json similarity index 100% rename from packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/test-stack.template.json rename to packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/topic-rule-test-stack.template.json diff --git a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/tree.json b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/tree.json index f5829e7ea2abf..a974dc54045bb 100644 --- a/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-iot/test/topic-rule.integ.snapshot/tree.json @@ -9,20 +9,20 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.9" + "version": "10.1.85" } }, - "test-stack": { - "id": "test-stack", - "path": "test-stack", + "topic-rule-test-stack": { + "id": "topic-rule-test-stack", + "path": "topic-rule-test-stack", "children": { "TopicRule": { "id": "TopicRule", - "path": "test-stack/TopicRule", + "path": "topic-rule-test-stack/TopicRule", "children": { "Resource": { "id": "Resource", - "path": "test-stack/TopicRule/Resource", + "path": "topic-rule-test-stack/TopicRule/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IoT::TopicRule", "aws:cdk:cloudformation:props": { @@ -55,6 +55,42 @@ "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "TopicRule": { + "id": "TopicRule", + "path": "TopicRule", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "TopicRule/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "TopicRule/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "TopicRule/DefaultTest/DeployAssert", + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-kinesisfirehose-destinations/test/integ.s3-bucket.lit.ts b/packages/@aws-cdk/aws-kinesisfirehose-destinations/test/integ.s3-bucket.lit.ts index 5c6b35a748c98..0527cbd26f7d7 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-destinations/test/integ.s3-bucket.lit.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-destinations/test/integ.s3-bucket.lit.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import * as firehose from '@aws-cdk/aws-kinesisfirehose'; import * as kms from '@aws-cdk/aws-kms'; diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/DestinationsDefaultTestDeployAssertCC49E667.template.json b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/DestinationsDefaultTestDeployAssertCC49E667.template.json index 57bd8ef6a2df0..92aba278f0904 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/DestinationsDefaultTestDeployAssertCC49E667.template.json +++ b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/DestinationsDefaultTestDeployAssertCC49E667.template.json @@ -19,7 +19,7 @@ "Payload": "{\"status\":\"OK\"}" }, "flattenResponse": "false", - "salt": "1651691787842" + "salt": "1661796815696" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -39,50 +39,6 @@ } } }, - "AwsApiCallSQSreceiveMessage": { - "Type": "Custom::DeployAssert@SdkCallSQSreceiveMessage", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "SQS", - "api": "receiveMessage", - "parameters": { - "QueueUrl": { - "Fn::ImportValue": "aws-cdk-lambda-destinations:ExportsOutputRefQueue4A7E3555425E8BD3" - }, - "WaitTimeSeconds": 20 - }, - "flattenResponse": "true", - "salt": "1651691787842" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AwsApiCallSQSreceiveMessageAssertEqualsSQSreceiveMessage56120636": { - "Type": "Custom::DeployAssert@AssertEquals", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "actual": { - "Fn::GetAtt": [ - "AwsApiCallSQSreceiveMessage", - "apiCallResponse.Messages.0.Body" - ] - }, - "expected": "{\"$ObjectLike\":{\"requestContext\":{\"condition\":\"Success\"},\"requestPayload\":{\"status\":\"OK\"},\"responseContext\":{\"statusCode\":200},\"responsePayload\":\"success\"}}", - "salt": "1651691787843" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { "Type": "AWS::IAM::Role", "Properties": { @@ -170,7 +126,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3BucketF7210344" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" }, "S3Key": { "Fn::Join": [ @@ -183,7 +139,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -196,7 +152,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -215,6 +171,64 @@ ] } } + }, + "AwsApiCallSQSreceiveMessage": { + "Type": "Custom::DeployAssert@SdkCallSQSreceiveMessage", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "SQS", + "api": "receiveMessage", + "parameters": { + "QueueUrl": { + "Fn::ImportValue": "aws-cdk-lambda-destinations:ExportsOutputRefQueue4A7E3555425E8BD3" + }, + "WaitTimeSeconds": 20 + }, + "flattenResponse": "true", + "salt": "1661796815696" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AwsApiCallSQSreceiveMessageAssertEqualsSQSreceiveMessage56120636": { + "Type": "Custom::DeployAssert@AssertEquals", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "actual": { + "Fn::GetAtt": [ + "AwsApiCallSQSreceiveMessage", + "apiCallResponse.Messages.0.Body" + ] + }, + "expected": "{\"$ObjectLike\":{\"requestContext\":{\"condition\":\"Success\"},\"requestPayload\":{\"status\":\"OK\"},\"responseContext\":{\"statusCode\":200},\"responsePayload\":\"success\"}}", + "salt": "1661796815696" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80": { + "Type": "String", + "Description": "S3 bucket for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" + }, + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE": { + "Type": "String", + "Description": "S3 key for asset version \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" + }, + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036": { + "Type": "String", + "Description": "Artifact hash for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" } }, "Outputs": { @@ -226,19 +240,5 @@ ] } } - }, - "Parameters": { - "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3BucketF7210344": { - "Type": "String", - "Description": "S3 bucket for asset \"1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b\"" - }, - "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C": { - "Type": "String", - "Description": "S3 key for asset version \"1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b\"" - }, - "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bArtifactHash4F8362F2": { - "Type": "String", - "Description": "Artifact hash for asset \"1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b\"" - } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b.bundle/index.js b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b.bundle/index.js deleted file mode 100644 index 32e3e2c1e5a95..0000000000000 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b.bundle/index.js +++ /dev/null @@ -1,644 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - } - return a; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// lib/assertions/providers/lambda-handler/index.ts -var lambda_handler_exports = {}; -__export(lambda_handler_exports, { - handler: () => handler -}); -module.exports = __toCommonJS(lambda_handler_exports); - -// ../assertions/lib/matcher.ts -var Matcher = class { - static isMatcher(x) { - return x && x instanceof Matcher; - } -}; -var MatchResult = class { - constructor(target) { - this.failures = []; - this.captures = /* @__PURE__ */ new Map(); - this.finalized = false; - this.target = target; - } - push(matcher, path, message) { - return this.recordFailure({ matcher, path, message }); - } - recordFailure(failure) { - this.failures.push(failure); - return this; - } - hasFailed() { - return this.failures.length !== 0; - } - get failCount() { - return this.failures.length; - } - compose(id, inner) { - const innerF = inner.failures; - this.failures.push(...innerF.map((f) => { - return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; - })); - inner.captures.forEach((vals, capture) => { - vals.forEach((value) => this.recordCapture({ capture, value })); - }); - return this; - } - finished() { - if (this.finalized) { - return this; - } - if (this.failCount === 0) { - this.captures.forEach((vals, cap) => cap._captured.push(...vals)); - } - this.finalized = true; - return this; - } - toHumanStrings() { - return this.failures.map((r) => { - const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; - return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; - }); - } - recordCapture(options) { - let values = this.captures.get(options.capture); - if (values === void 0) { - values = []; - } - values.push(options.value); - this.captures.set(options.capture, values); - } -}; - -// ../assertions/lib/private/matchers/absent.ts -var AbsentMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual !== void 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Received ${actual}, but key should be absent` - }); - } - return result; - } -}; - -// ../assertions/lib/private/type.ts -function getType(obj) { - return Array.isArray(obj) ? "array" : typeof obj; -} - -// ../assertions/lib/match.ts -var Match = class { - static absent() { - return new AbsentMatch("absent"); - } - static arrayWith(pattern) { - return new ArrayMatch("arrayWith", pattern); - } - static arrayEquals(pattern) { - return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); - } - static exact(pattern) { - return new LiteralMatch("exact", pattern, { partialObjects: false }); - } - static objectLike(pattern) { - return new ObjectMatch("objectLike", pattern); - } - static objectEquals(pattern) { - return new ObjectMatch("objectEquals", pattern, { partial: false }); - } - static not(pattern) { - return new NotMatch("not", pattern); - } - static serializedJson(pattern) { - return new SerializedJson("serializedJson", pattern); - } - static anyValue() { - return new AnyMatch("anyValue"); - } - static stringLikeRegexp(pattern) { - return new StringLikeRegexpMatch("stringLikeRegexp", pattern); - } -}; -var LiteralMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partialObjects = options.partialObjects ?? false; - if (Matcher.isMatcher(this.pattern)) { - throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); - } - } - test(actual) { - if (Array.isArray(this.pattern)) { - return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); - } - if (typeof this.pattern === "object") { - return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); - } - const result = new MatchResult(actual); - if (typeof this.pattern !== typeof actual) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` - }); - return result; - } - if (actual !== this.pattern) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected ${this.pattern} but received ${actual}` - }); - } - return result; - } -}; -var ArrayMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.subsequence = options.subsequence ?? true; - this.partialObjects = options.partialObjects ?? false; - } - test(actual) { - if (!Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type array but received ${getType(actual)}` - }); - } - if (!this.subsequence && this.pattern.length !== actual.length) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected array of length ${this.pattern.length} but received ${actual.length}` - }); - } - let patternIdx = 0; - let actualIdx = 0; - const result = new MatchResult(actual); - while (patternIdx < this.pattern.length && actualIdx < actual.length) { - const patternElement = this.pattern[patternIdx]; - const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); - const matcherName = matcher.name; - if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { - throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); - } - const innerResult = matcher.test(actual[actualIdx]); - if (!this.subsequence || !innerResult.hasFailed()) { - result.compose(`[${actualIdx}]`, innerResult); - patternIdx++; - actualIdx++; - } else { - actualIdx++; - } - } - for (; patternIdx < this.pattern.length; patternIdx++) { - const pattern = this.pattern[patternIdx]; - const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; - result.recordFailure({ - matcher: this, - path: [], - message: `Missing element${element}at pattern index ${patternIdx}` - }); - } - return result; - } -}; -var ObjectMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partial = options.partial ?? true; - } - test(actual) { - if (typeof actual !== "object" || Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type object but received ${getType(actual)}` - }); - } - const result = new MatchResult(actual); - if (!this.partial) { - for (const a of Object.keys(actual)) { - if (!(a in this.pattern)) { - result.recordFailure({ - matcher: this, - path: [`/${a}`], - message: "Unexpected key" - }); - } - } - } - for (const [patternKey, patternVal] of Object.entries(this.pattern)) { - if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { - result.recordFailure({ - matcher: this, - path: [`/${patternKey}`], - message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` - }); - continue; - } - const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); - const inner = matcher.test(actual[patternKey]); - result.compose(`/${patternKey}`, inner); - } - return result; - } -}; -var SerializedJson = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - if (getType(actual) !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected JSON as a string but found ${getType(actual)}` - }); - return result; - } - let parsed; - try { - parsed = JSON.parse(actual); - } catch (err) { - if (err instanceof SyntaxError) { - result.recordFailure({ - matcher: this, - path: [], - message: `Invalid JSON string: ${actual}` - }); - return result; - } else { - throw err; - } - } - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(parsed); - result.compose(`(${this.name})`, innerResult); - return result; - } -}; -var NotMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(actual); - const result = new MatchResult(actual); - if (innerResult.failCount === 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` - }); - } - return result; - } -}; -var AnyMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual == null) { - result.recordFailure({ - matcher: this, - path: [], - message: "Expected a value but found none" - }); - } - return result; - } -}; -var StringLikeRegexpMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - const regex = new RegExp(this.pattern, "gm"); - if (typeof actual !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected a string, but got '${typeof actual}'` - }); - } - if (!regex.test(actual)) { - result.recordFailure({ - matcher: this, - path: [], - message: `String '${actual}' did not match pattern '${this.pattern}'` - }); - } - return result; - } -}; - -// lib/assertions/providers/lambda-handler/base.ts -var https = __toESM(require("https")); -var url = __toESM(require("url")); -var CustomResourceHandler = class { - constructor(event, context) { - this.event = event; - this.context = context; - this.timedOut = false; - this.timeout = setTimeout(async () => { - await this.respond({ - status: "FAILED", - reason: "Lambda Function Timeout", - data: this.context.logStreamName - }); - this.timedOut = true; - }, context.getRemainingTimeInMillis() - 1200); - this.event = event; - this.physicalResourceId = extractPhysicalResourceId(event); - } - async handle() { - try { - console.log(`Event: ${JSON.stringify(this.event)}`); - const response = await this.processEvent(this.event.ResourceProperties); - console.log(`Event output : ${JSON.stringify(response)}`); - await this.respond({ - status: "SUCCESS", - reason: "OK", - data: response - }); - } catch (e) { - console.log(e); - await this.respond({ - status: "FAILED", - reason: e.message ?? "Internal Error" - }); - } finally { - clearTimeout(this.timeout); - } - } - respond(response) { - if (this.timedOut) { - return; - } - const cfResponse = { - Status: response.status, - Reason: response.reason, - PhysicalResourceId: this.physicalResourceId, - StackId: this.event.StackId, - RequestId: this.event.RequestId, - LogicalResourceId: this.event.LogicalResourceId, - NoEcho: false, - Data: response.data - }; - const responseBody = JSON.stringify(cfResponse); - console.log("Responding to CloudFormation", responseBody); - const parsedUrl = url.parse(this.event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { "content-type": "", "content-length": responseBody.length } - }; - return new Promise((resolve, reject) => { - try { - const request2 = https.request(requestOptions, resolve); - request2.on("error", reject); - request2.write(responseBody); - request2.end(); - } catch (e) { - reject(e); - } - }); - } -}; -function extractPhysicalResourceId(event) { - switch (event.RequestType) { - case "Create": - return event.LogicalResourceId; - case "Update": - case "Delete": - return event.PhysicalResourceId; - } -} - -// lib/assertions/providers/lambda-handler/assertion.ts -var AssertionHandler = class extends CustomResourceHandler { - async processEvent(request2) { - let actual = decodeCall(request2.actual); - const expected = decodeCall(request2.expected); - let result; - const matcher = new MatchCreator(expected).getMatcher(); - console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); - const matchResult = matcher.test(actual); - matchResult.finished(); - if (matchResult.hasFailed()) { - result = { - data: JSON.stringify({ - status: "fail", - message: [ - ...matchResult.toHumanStrings(), - JSON.stringify(matchResult.target, void 0, 2) - ].join("\n") - }) - }; - } else { - result = { - data: JSON.stringify({ - status: "pass" - }) - }; - } - return result; - } -}; -var MatchCreator = class { - constructor(obj) { - switch (Object.keys(obj)[0]) { - case "$ObjectLike": - this.type = "objectLike"; - this.parsedObj = obj.$ObjectLike; - break; - case "$ArrayWith": - this.type = "arrayWith"; - this.parsedObj = obj.$ArrayWith; - break; - case "$Exact": - this.type = "exact"; - this.parsedObj = obj.$Exact; - break; - case "$StringLike": - this.type = "stringLikeRegexp"; - this.parsedObj = obj.$StringLike; - break; - default: - this.type = "exact"; - this.parsedObj = obj; - } - } - getMatcher() { - try { - const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { - const nested = Object.keys(v)[0]; - switch (nested) { - case "$ArrayWith": - return Match.arrayWith(v[nested]); - case "$ObjectLike": - return Match.objectLike(v[nested]); - case "$StringLike": - return Match.stringLikeRegexp(v[nested]); - default: - return v; - } - }); - return Match[this.type](final); - } catch { - return Match[this.type](this.parsedObj); - } - } -}; -function decodeCall(call) { - if (!call) { - return void 0; - } - try { - const parsed = JSON.parse(call); - return parsed; - } catch (e) { - return call; - } -} - -// lib/assertions/providers/lambda-handler/results.ts -var ResultsCollectionHandler = class extends CustomResourceHandler { - async processEvent(request2) { - const reduced = request2.assertionResults.reduce((agg, result, idx) => { - const msg = result.status === "pass" ? "pass" : `fail - ${result.message}`; - return `${agg} -Test${idx}: ${msg}`; - }, "").trim(); - return { message: reduced }; - } -}; - -// lib/assertions/providers/lambda-handler/utils.ts -function decode(object) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case "TRUE:BOOLEAN": - return true; - case "FALSE:BOOLEAN": - return false; - default: - return v; - } - }); -} - -// lib/assertions/providers/lambda-handler/sdk.ts -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object)); -} -var AwsApiCallHandler = class extends CustomResourceHandler { - async processEvent(request2) { - const AWS = require("aws-sdk"); - console.log(`AWS SDK VERSION: ${AWS.VERSION}`); - const service = new AWS[request2.service](); - const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); - console.log(`SDK response received ${JSON.stringify(response)}`); - delete response.ResponseMetadata; - const respond = { - apiCallResponse: response - }; - const flatData = __spreadValues({}, flatten(respond)); - return request2.flattenResponse === "true" ? flatData : respond; - } -}; - -// lib/assertions/providers/lambda-handler/types.ts -var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; -var RESULTS_RESOURCE_TYPE = "Custom::DeployAssert@ResultsCollection"; -var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; - -// lib/assertions/providers/lambda-handler/index.ts -async function handler(event, context) { - const provider = createResourceHandler(event, context); - await provider.handle(); -} -function createResourceHandler(event, context) { - if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { - return new AwsApiCallHandler(event, context); - } - switch (event.ResourceType) { - case ASSERT_RESOURCE_TYPE: - return new AssertionHandler(event, context); - case RESULTS_RESOURCE_TYPE: - return new ResultsCollectionHandler(event, context); - default: - throw new Error(`Unsupported resource type "${event.ResourceType}`); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - handler -}); diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js new file mode 100644 index 0000000000000..ba956d47f51fe --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js @@ -0,0 +1,612 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failures = []; + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.target = target; + } + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + recordFailure(failure) { + this.failures.push(failure); + return this; + } + hasFailed() { + return this.failures.length !== 0; + } + get failCount() { + return this.failures.length; + } + compose(id, inner) { + const innerF = inner.failures; + this.failures.push(...innerF.map((f) => { + return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; + })); + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + toHumanStrings() { + return this.failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + } + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + static absent() { + return new AbsentMatch("absent"); + } + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + static not(pattern) { + return new NotMatch("not", pattern); + } + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + static anyValue() { + return new AnyMatch("anyValue"); + } + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + if (!this.subsequence && this.pattern.length !== actual.length) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected array of length ${this.pattern.length} but received ${actual.length}` + }); + } + let patternIdx = 0; + let actualIdx = 0; + const result = new MatchResult(actual); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + if (!this.subsequence || !innerResult.hasFailed()) { + result.compose(`[${actualIdx}]`, innerResult); + patternIdx++; + actualIdx++; + } else { + actualIdx++; + } + } + for (; patternIdx < this.pattern.length; patternIdx++) { + const pattern = this.pattern[patternIdx]; + const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; + result.recordFailure({ + matcher: this, + path: [], + message: `Missing element${element}at pattern index ${patternIdx}` + }); + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [`/${a}`], + message: "Unexpected key" + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [`/${patternKey}`], + message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(`/${patternKey}`, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + if (getType(actual) !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + return result; + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + result.recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + return result; + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + result.compose(`(${this.name})`, innerResult); + return result; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + async handle() { + try { + console.log(`Event: ${JSON.stringify({ ...this.event, ResponseURL: "..." })}`); + const response = await this.processEvent(this.event.ResourceProperties); + console.log(`Event output : ${JSON.stringify(response)}`); + await this.respond({ + status: "SUCCESS", + reason: "OK", + data: response + }); + } catch (e) { + console.log(e); + await this.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + data: JSON.stringify({ + status: "fail", + message: [ + ...matchResult.toHumanStrings(), + JSON.stringify(matchResult.target, void 0, 2) + ].join("\n") + }) + }; + if (request2.failDeployment) { + throw new Error(result.data); + } + } else { + result = { + data: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS.VERSION}`); + const service = new AWS[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + return request2.flattenResponse === "true" ? flatData : respond; + } +}; + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + const provider = createResourceHandler(event, context); + await provider.handle(); +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } + switch (event.ResourceType) { + case ASSERT_RESOURCE_TYPE: + return new AssertionHandler(event, context); + default: + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler +}); diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/aws-cdk-lambda-destinations.assets.json b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/aws-cdk-lambda-destinations.assets.json deleted file mode 100644 index bd82b455d9a91..0000000000000 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/aws-cdk-lambda-destinations.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "17.0.0", - "files": { - "476828076c099a22440fd1246ae789476cab04cb80080db5c91b577ec07db938": { - "source": { - "path": "aws-cdk-lambda-destinations.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "476828076c099a22440fd1246ae789476cab04cb80080db5c91b577ec07db938.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/cdk.out index ccdfc1ff96a9d..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"19.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/integ.json index 4e8898a726ff8..2a51e26d991f3 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/integ.json @@ -1,11 +1,12 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "Destinations/DefaultTest": { "stacks": [ "aws-cdk-lambda-destinations" ], - "assertionStack": "DestinationsDefaultTestDeployAssertCC49E667" + "assertionStack": "Destinations/DefaultTest/DeployAssert", + "assertionStackName": "DestinationsDefaultTestDeployAssertCC49E667" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/manifest.json index 87df11e84970f..780b70011a142 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "19.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -135,74 +135,74 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b.bundle", - "id": "1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b", + "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "packaging": "zip", - "sourceHash": "1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b", - "s3BucketParameter": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3BucketF7210344", - "s3KeyParameter": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C", - "artifactHashParameter": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bArtifactHash4F8362F2" + "sourceHash": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "s3BucketParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80", + "s3KeyParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE", + "artifactHashParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } } ], - "/Destinations/DefaultTest/DeployAssert/Default/LambdaInvoked12df417a1b74909abb3ea643735a310/Default/Default": [ + "/Destinations/DefaultTest/DeployAssert/LambdaInvoked12df417a1b74909abb3ea643735a310/Default/Default": [ { "type": "aws:cdk:logicalId", "data": "LambdaInvoked12df417a1b74909abb3ea643735a310" } ], - "/Destinations/DefaultTest/DeployAssert/Default/LambdaInvoked12df417a1b74909abb3ea643735a310/Invoke": [ + "/Destinations/DefaultTest/DeployAssert/LambdaInvoked12df417a1b74909abb3ea643735a310/Invoke": [ { "type": "aws:cdk:logicalId", "data": "LambdaInvoked12df417a1b74909abb3ea643735a310InvokeF590C289" } ], - "/Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/Default/Default": [ + "/Destinations/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ { "type": "aws:cdk:logicalId", - "data": "AwsApiCallSQSreceiveMessage" + "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" } ], - "/Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/Default/Default": [ + "/Destinations/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ { "type": "aws:cdk:logicalId", - "data": "AwsApiCallSQSreceiveMessageAssertEqualsSQSreceiveMessage56120636" + "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/AssertionResults": [ + "/Destinations/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsAssertEqualsSQSreceiveMessage" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" } ], - "/Destinations/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ + "/Destinations/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ], - "/Destinations/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ + "/Destinations/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } ], - "/Destinations/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/S3Bucket": [ + "/Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3BucketF7210344" + "data": "AwsApiCallSQSreceiveMessage" } ], - "/Destinations/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/S3VersionKey": [ + "/Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C" + "data": "AwsApiCallSQSreceiveMessageAssertEqualsSQSreceiveMessage56120636" } ], - "/Destinations/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/ArtifactHash": [ + "/Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bArtifactHash4F8362F2" + "data": "AssertionResultsAssertEqualsSQSreceiveMessage" } ] }, diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/tree.json index 53a29b1fdc866..34975c0e50cdb 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.9" + "version": "10.1.85" } }, "aws-cdk-lambda-destinations": { @@ -520,8 +520,8 @@ "id": "DefaultEventBus", "path": "aws-cdk-lambda-destinations/EventBusLambda/EventInvokeConfig/DefaultEventBus", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Resource": { @@ -616,8 +616,8 @@ "id": "ScalingRole", "path": "aws-cdk-lambda-destinations/MySpecialAlias/ScalingRole", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "EventInvokeConfig": { @@ -690,28 +690,28 @@ "id": "Output{\"Ref\":\"SnsSqsC4810B27\"}", "path": "aws-cdk-lambda-destinations/Exports/Output{\"Ref\":\"SnsSqsC4810B27\"}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Output{\"Ref\":\"Queue4A7E3555\"}": { "id": "Output{\"Ref\":\"Queue4A7E3555\"}", "path": "aws-cdk-lambda-destinations/Exports/Output{\"Ref\":\"Queue4A7E3555\"}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Destinations": { @@ -722,171 +722,69 @@ "id": "DefaultTest", "path": "Destinations/DefaultTest", "children": { + "Default": { + "id": "Default", + "path": "Destinations/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, "DeployAssert": { "id": "DeployAssert", "path": "Destinations/DefaultTest/DeployAssert", "children": { - "Default": { - "id": "Default", - "path": "Destinations/DefaultTest/DeployAssert/Default", + "LambdaInvoked12df417a1b74909abb3ea643735a310": { + "id": "LambdaInvoked12df417a1b74909abb3ea643735a310", + "path": "Destinations/DefaultTest/DeployAssert/LambdaInvoked12df417a1b74909abb3ea643735a310", "children": { - "LambdaInvoked12df417a1b74909abb3ea643735a310": { - "id": "LambdaInvoked12df417a1b74909abb3ea643735a310", - "path": "Destinations/DefaultTest/DeployAssert/Default/LambdaInvoked12df417a1b74909abb3ea643735a310", + "SdkProvider": { + "id": "SdkProvider", + "path": "Destinations/DefaultTest/DeployAssert/LambdaInvoked12df417a1b74909abb3ea643735a310/SdkProvider", "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "Destinations/DefaultTest/DeployAssert/Default/LambdaInvoked12df417a1b74909abb3ea643735a310/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "Destinations/DefaultTest/DeployAssert/Default/LambdaInvoked12df417a1b74909abb3ea643735a310/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "Destinations/DefaultTest/DeployAssert/Default/LambdaInvoked12df417a1b74909abb3ea643735a310/Default", - "children": { - "Default": { - "id": "Default", - "path": "Destinations/DefaultTest/DeployAssert/Default/LambdaInvoked12df417a1b74909abb3ea643735a310/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "Destinations/DefaultTest/DeployAssert/LambdaInvoked12df417a1b74909abb3ea643735a310/SdkProvider/AssertionsProvider", "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "Destinations/DefaultTest/DeployAssert/Default/LambdaInvoked12df417a1b74909abb3ea643735a310/Invoke", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", "version": "0.0.0" } }, - "AwsApiCallSQSreceiveMessage": { - "id": "AwsApiCallSQSreceiveMessage", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage", + "Default": { + "id": "Default", + "path": "Destinations/DefaultTest/DeployAssert/LambdaInvoked12df417a1b74909abb3ea643735a310/Default", "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, "Default": { "id": "Default", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/Default", - "children": { - "Default": { - "id": "Default", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, + "path": "Destinations/DefaultTest/DeployAssert/LambdaInvoked12df417a1b74909abb3ea643735a310/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertEqualsSQSreceiveMessage": { - "id": "AssertEqualsSQSreceiveMessage", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage", - "children": { - "AssertionProvider": { - "id": "AssertionProvider", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/AssertionProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/AssertionProvider/AssertionsProvider", - "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/Default", - "children": { - "Default": { - "id": "Default", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "Destinations/DefaultTest/DeployAssert/Default/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.EqualsAssertion", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AwsApiCall", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, + "Invoke": { + "id": "Invoke", + "path": "Destinations/DefaultTest/DeployAssert/LambdaInvoked12df417a1b74909abb3ea643735a310/Invoke", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.DeployAssert", + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", "version": "0.0.0" } }, @@ -898,98 +796,198 @@ "id": "Staging", "path": "Destinations/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", "path": "Destinations/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", "path": "Destinations/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", "path": "Destinations/DefaultTest/DeployAssert/AssetParameters", "children": { - "1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b": { - "id": "1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b", - "path": "Destinations/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b", + "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "path": "Destinations/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "Destinations/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/S3Bucket", + "path": "Destinations/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "Destinations/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/S3VersionKey", + "path": "Destinations/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "Destinations/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/ArtifactHash", + "path": "Destinations/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, + "AwsApiCallSQSreceiveMessage": { + "id": "AwsApiCallSQSreceiveMessage", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/SdkProvider/AssertionsProvider", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/Default", + "children": { + "Default": { + "id": "Default", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/Default/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, + "AssertEqualsSQSreceiveMessage": { + "id": "AssertEqualsSQSreceiveMessage", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage", + "children": { + "AssertionProvider": { + "id": "AssertionProvider", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/AssertionProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/AssertionProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", "version": "0.0.0" } + }, + "Default": { + "id": "Default", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/Default", + "children": { + "Default": { + "id": "Default", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/Default/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "Destinations/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertEqualsSQSreceiveMessage/AssertionResults", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", + "fqn": "@aws-cdk/integ-tests.EqualsAssertion", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", + "fqn": "@aws-cdk/integ-tests.AwsApiCall", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", + "fqn": "@aws-cdk/integ-tests.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", + "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.ts b/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.ts index 5dd67661acbb8..f3d6293fc2455 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.ts @@ -96,5 +96,3 @@ message.assertAtPath('Messages.0.Body', ExpectedResult.objectLike({ }, responsePayload: 'success', })); - -app.synth(); diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 1b77cea06daa7..7e26c84541628 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -79,7 +79,7 @@ "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", "delay": "5.0.0", - "esbuild": "^0.15.5" + "esbuild": "^0.15.6" }, "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.compilations.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.compilations.ts index 2c78bde18bbf7..e59cbb58ef794 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.compilations.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.compilations.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import { Runtime } from '@aws-cdk/aws-lambda'; import { App, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies.ts index 853eae6f1d8e0..6bc1182573aa4 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import { Runtime } from '@aws-cdk/aws-lambda'; import { App, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.function.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.function.ts index f65770c5a3499..2dc25ef3679dc 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.function.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.function.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import { Vpc } from '@aws-cdk/aws-ec2'; import { Runtime } from '@aws-cdk/aws-lambda'; diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.template.json b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/DockerOptsBundlingDefaultTestDeployAssert72BE28F7.template.json similarity index 80% rename from packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.template.json rename to packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/DockerOptsBundlingDefaultTestDeployAssert72BE28F7.template.json index 7db53b9a92c99..cb1ed28148757 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.template.json +++ b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/DockerOptsBundlingDefaultTestDeployAssert72BE28F7.template.json @@ -17,7 +17,7 @@ } }, "flattenResponse": "false", - "salt": "1659700764721" + "salt": "1661796444486" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -53,7 +53,7 @@ ] }, "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "salt": "1659700764722" + "salt": "1661796444487" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -136,7 +136,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" }, "S3Key": { "Fn::Join": [ @@ -149,7 +149,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -162,7 +162,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -194,17 +194,17 @@ } }, "Parameters": { - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80": { "Type": "String", - "Description": "S3 bucket for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 bucket for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE": { "Type": "String", - "Description": "S3 key for asset version \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 key for asset version \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036": { "Type": "String", - "Description": "Artifact hash for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "Artifact hash for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/integ.json b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/integ.json index 73d0ae4a3a54f..03558532ae524 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/integ.json @@ -1,12 +1,13 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { - "Bundling/DefaultTest": { + "DockerOptsBundling/DefaultTest": { "stacks": [ "cdk-integ-lambda-bundling-docker-bundling-opts" ], "stackUpdateWorkflow": false, - "assertionStack": "BundlingDefaultTestDeployAssertAACA0CAF" + "assertionStack": "DockerOptsBundling/DefaultTest/DeployAssert", + "assertionStackName": "DockerOptsBundlingDefaultTestDeployAssert72BE28F7" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/manifest.json index def0254a06124..36aa82fdc6297 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -68,87 +68,87 @@ }, "displayName": "cdk-integ-lambda-bundling-docker-bundling-opts" }, - "BundlingDefaultTestDeployAssertAACA0CAF": { + "DockerOptsBundlingDefaultTestDeployAssert72BE28F7": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "BundlingDefaultTestDeployAssertAACA0CAF.template.json", + "templateFile": "DockerOptsBundlingDefaultTestDeployAssert72BE28F7.template.json", "validateOnSynth": false }, "dependencies": [ "cdk-integ-lambda-bundling-docker-bundling-opts" ], "metadata": { - "/Bundling/DefaultTest/DeployAssert": [ + "/DockerOptsBundling/DefaultTest/DeployAssert": [ { "type": "aws:cdk:asset", "data": { - "path": "asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle", - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "packaging": "zip", - "sourceHash": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "s3BucketParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7", - "s3KeyParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E", - "artifactHashParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "sourceHash": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "s3BucketParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80", + "s3KeyParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE", + "artifactHashParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } } ], - "/Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default/Default": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default/Default": [ { "type": "aws:cdk:logicalId", "data": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8" } ], - "/Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Invoke": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Invoke": [ { "type": "aws:cdk:logicalId", "data": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8InvokeA3F6E40A" } ], - "/Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default/Default": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default/Default": [ { "type": "aws:cdk:logicalId", "data": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8AssertEqualsLambdainvoke89C63F4A" } ], - "/Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionResults": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionResults": [ { "type": "aws:cdk:logicalId", "data": "AssertionResultsAssertEqualsLambdainvoke" } ], - "/Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ { "type": "aws:cdk:logicalId", "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" } ], - "/Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ { "type": "aws:cdk:logicalId", "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/Bundling/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" } ], - "/Bundling/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ], - "/Bundling/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash": [ + "/DockerOptsBundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } ] }, - "displayName": "Bundling/DefaultTest/DeployAssert" + "displayName": "DockerOptsBundling/DefaultTest/DeployAssert" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/tree.json b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/tree.json index 3528b43171152..95bd619d10d50 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda/test/bundling.docker-opts.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } }, "cdk-integ-lambda-bundling-docker-bundling-opts": { @@ -77,8 +77,8 @@ "id": "Stage", "path": "cdk-integ-lambda-bundling-docker-bundling-opts/Function/Code/Stage", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssetBucket": { @@ -172,36 +172,36 @@ "id": "S3Bucket", "path": "cdk-integ-lambda-bundling-docker-bundling-opts/AssetParameters/badc2d9df4b50b7ee1eaf05b055fa93217d48bfecf7ad59a8fdac427eea82668/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", "path": "cdk-integ-lambda-bundling-docker-bundling-opts/AssetParameters/badc2d9df4b50b7ee1eaf05b055fa93217d48bfecf7ad59a8fdac427eea82668/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", "path": "cdk-integ-lambda-bundling-docker-bundling-opts/AssetParameters/badc2d9df4b50b7ee1eaf05b055fa93217d48bfecf7ad59a8fdac427eea82668/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } }, "Exports": { @@ -212,56 +212,56 @@ "id": "Output{\"Ref\":\"Function76856677\"}", "path": "cdk-integ-lambda-bundling-docker-bundling-opts/Exports/Output{\"Ref\":\"Function76856677\"}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, - "Bundling": { - "id": "Bundling", - "path": "Bundling", + "DockerOptsBundling": { + "id": "DockerOptsBundling", + "path": "DockerOptsBundling", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "Bundling/DefaultTest", + "path": "DockerOptsBundling/DefaultTest", "children": { "Default": { "id": "Default", - "path": "Bundling/DefaultTest/Default", + "path": "DockerOptsBundling/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } }, "DeployAssert": { "id": "DeployAssert", - "path": "Bundling/DefaultTest/DeployAssert", + "path": "DockerOptsBundling/DefaultTest/DeployAssert", "children": { "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8": { "id": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/SdkProvider", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/SdkProvider/AssertionsProvider", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } } }, @@ -272,44 +272,44 @@ }, "Default": { "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default", "children": { "Default": { "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default/Default", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Invoke": { "id": "Invoke", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Invoke", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Invoke", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertEqualsLambdainvoke": { "id": "AssertEqualsLambdainvoke", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke", "children": { "AssertionProvider": { "id": "AssertionProvider", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionProvider", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionProvider/AssertionsProvider", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } } }, @@ -320,28 +320,28 @@ }, "Default": { "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default", "children": { "Default": { "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default/Default", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertionResults": { "id": "AssertionResults", - "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionResults", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionResults", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -358,86 +358,86 @@ }, "SingletonFunction1488541a7b23466481b69b4408076b81": { "id": "SingletonFunction1488541a7b23466481b69b4408076b81", - "path": "Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", "children": { "Staging": { "id": "Staging", - "path": "Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", - "path": "Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", - "path": "Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/AssetParameters", "children": { - "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd": { - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash", + "path": "DockerOptsBundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.58" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -454,8 +454,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.template.json b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.template.json index f1587148e1a58..fe04bd587cdcd 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.template.json +++ b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.template.json @@ -17,7 +17,7 @@ } }, "flattenResponse": "false", - "salt": "1651691789905" + "salt": "1661796444483" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -53,7 +53,7 @@ ] }, "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "salt": "1651691789906" + "salt": "1661796444484" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -136,7 +136,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3BucketF7210344" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" }, "S3Key": { "Fn::Join": [ @@ -149,7 +149,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -162,7 +162,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -194,17 +194,17 @@ } }, "Parameters": { - "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3BucketF7210344": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80": { "Type": "String", - "Description": "S3 bucket for asset \"1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b\"" + "Description": "S3 bucket for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE": { "Type": "String", - "Description": "S3 key for asset version \"1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b\"" + "Description": "S3 key for asset version \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bArtifactHash4F8362F2": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036": { "Type": "String", - "Description": "Artifact hash for asset \"1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b\"" + "Description": "Artifact hash for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/cdk.out index ccdfc1ff96a9d..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"19.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/integ.json b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/integ.json index a439fddd2630b..40a0f64769c3b 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/integ.json @@ -1,12 +1,13 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "Bundling/DefaultTest": { "stacks": [ "cdk-integ-lambda-bundling" ], "stackUpdateWorkflow": false, - "assertionStack": "BundlingDefaultTestDeployAssertAACA0CAF" + "assertionStack": "Bundling/DefaultTest/DeployAssert", + "assertionStackName": "BundlingDefaultTestDeployAssertAACA0CAF" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/manifest.json index d49cacb755c4f..35e22f802aa36 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "19.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -83,35 +83,35 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b.bundle", - "id": "1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b", + "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "packaging": "zip", - "sourceHash": "1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b", - "s3BucketParameter": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3BucketF7210344", - "s3KeyParameter": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C", - "artifactHashParameter": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bArtifactHash4F8362F2" + "sourceHash": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "s3BucketParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80", + "s3KeyParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE", + "artifactHashParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } } ], - "/Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default/Default": [ + "/Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default/Default": [ { "type": "aws:cdk:logicalId", "data": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8" } ], - "/Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Invoke": [ + "/Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Invoke": [ { "type": "aws:cdk:logicalId", "data": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8InvokeA3F6E40A" } ], - "/Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default/Default": [ + "/Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default/Default": [ { "type": "aws:cdk:logicalId", "data": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8AssertEqualsLambdainvoke89C63F4A" } ], - "/Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionResults": [ + "/Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionResults": [ { "type": "aws:cdk:logicalId", "data": "AssertionResultsAssertEqualsLambdainvoke" @@ -129,22 +129,22 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/Bundling/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/S3Bucket": [ + "/Bundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3BucketF7210344" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" } ], - "/Bundling/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/S3VersionKey": [ + "/Bundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bS3VersionKey1E71961C" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ], - "/Bundling/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/ArtifactHash": [ + "/Bundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38bArtifactHash4F8362F2" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } ] }, diff --git a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/tree.json b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/tree.json index 55062d01c72fa..deafa7bce9745 100644 --- a/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda/test/bundling.integ.snapshot/tree.json @@ -8,8 +8,8 @@ "id": "Tree", "path": "Tree", "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "cdk-integ-lambda-bundling": { @@ -77,8 +77,8 @@ "id": "Stage", "path": "cdk-integ-lambda-bundling/Function/Code/Stage", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssetBucket": { @@ -172,36 +172,36 @@ "id": "S3Bucket", "path": "cdk-integ-lambda-bundling/AssetParameters/b0011b8704c0cceee88b3cdf79d915b7babbe192f420c472879803f44c2c374e/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", "path": "cdk-integ-lambda-bundling/AssetParameters/b0011b8704c0cceee88b3cdf79d915b7babbe192f420c472879803f44c2c374e/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", "path": "cdk-integ-lambda-bundling/AssetParameters/b0011b8704c0cceee88b3cdf79d915b7babbe192f420c472879803f44c2c374e/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Exports": { @@ -212,20 +212,20 @@ "id": "Output{\"Ref\":\"Function76856677\"}", "path": "cdk-integ-lambda-bundling/Exports/Output{\"Ref\":\"Function76856677\"}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Bundling": { @@ -236,28 +236,80 @@ "id": "DefaultTest", "path": "Bundling/DefaultTest", "children": { + "Default": { + "id": "Default", + "path": "Bundling/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, "DeployAssert": { "id": "DeployAssert", "path": "Bundling/DefaultTest/DeployAssert", "children": { - "Default": { - "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/Default", + "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8": { + "id": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8", "children": { - "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8": { - "id": "LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8", + "SdkProvider": { + "id": "SdkProvider", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default", + "children": { + "Default": { + "id": "Default", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, + "Invoke": { + "id": "Invoke", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Invoke", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.85" + } + }, + "AssertEqualsLambdainvoke": { + "id": "AssertEqualsLambdainvoke", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke", "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/SdkProvider", + "AssertionProvider": { + "id": "AssertionProvider", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/SdkProvider/AssertionsProvider", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionProvider/AssertionsProvider", "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -268,93 +320,39 @@ }, "Default": { "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default", "children": { "Default": { "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Default/Default", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, - "Invoke": { - "id": "Invoke", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/Invoke", + "AssertionResults": { + "id": "AssertionResults", + "path": "Bundling/DefaultTest/DeployAssert/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionResults", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "AssertEqualsLambdainvoke": { - "id": "AssertEqualsLambdainvoke", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke", - "children": { - "AssertionProvider": { - "id": "AssertionProvider", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionProvider/AssertionsProvider", - "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default", - "children": { - "Default": { - "id": "Default", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "Bundling/DefaultTest/DeployAssert/Default/LambdaInvoke55933c6da447c7ea94ebd3a50e8557a8/AssertEqualsLambdainvoke/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.EqualsAssertion", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "fqn": "@aws-cdk/integ-tests.EqualsAssertion", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.DeployAssert", + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", "version": "0.0.0" } }, @@ -366,98 +364,98 @@ "id": "Staging", "path": "Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", "path": "Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", "path": "Bundling/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", "path": "Bundling/DefaultTest/DeployAssert/AssetParameters", "children": { - "1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b": { - "id": "1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b", + "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/S3Bucket", + "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/S3VersionKey", + "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/1bc7cf3a01a7153f942391263b3bac937812996cc28f9abaf83ffebbbe03e38b/ArtifactHash", + "path": "Bundling/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", + "fqn": "@aws-cdk/integ-tests.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Construct", + "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/integ.bundling.docker-opts.ts b/packages/@aws-cdk/aws-lambda/test/integ.bundling.docker-opts.ts index 80441cf6ab906..37d7b70dc1f55 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.bundling.docker-opts.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.bundling.docker-opts.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:disable-update-workflow import * as path from 'path'; import { App, Stack, StackProps } from '@aws-cdk/core'; import { IntegTest, ExpectedResult } from '@aws-cdk/integ-tests'; @@ -43,7 +42,7 @@ class TestStack extends Stack { const app = new App(); const stack = new TestStack(app, 'cdk-integ-lambda-bundling-docker-bundling-opts'); -const integ = new IntegTest(app, 'Bundling', { +const integ = new IntegTest(app, 'DockerOptsBundling', { testCases: [stack], stackUpdateWorkflow: false, }); @@ -54,4 +53,4 @@ const invoke = integ.assertions.invokeFunction({ invoke.expect(ExpectedResult.objectLike({ Payload: '200', })); -app.synth(); \ No newline at end of file +app.synth(); diff --git a/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts b/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts index 8549134ca9e5b..6e22153aff953 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:disable-update-workflow import * as path from 'path'; import { App, Stack, StackProps } from '@aws-cdk/core'; import { IntegTest, ExpectedResult } from '@aws-cdk/integ-tests'; @@ -53,4 +52,3 @@ const invoke = integ.assertions.invokeFunction({ invoke.expect(ExpectedResult.objectLike({ Payload: '200', })); -app.synth(); diff --git a/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts b/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts index 965a04c5597d6..7fd38e6395683 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as logs from '@aws-cdk/aws-logs'; import * as cdk from '@aws-cdk/core'; import * as lambda from '../lib'; diff --git a/packages/@aws-cdk/aws-msk/README.md b/packages/@aws-cdk/aws-msk/README.md index dc99262aff6f7..3ca501bfb4908 100644 --- a/packages/@aws-cdk/aws-msk/README.md +++ b/packages/@aws-cdk/aws-msk/README.md @@ -65,6 +65,7 @@ declare const cluster: msk.Cluster; new CfnOutput(this, 'BootstrapBrokers', { value: cluster.bootstrapBrokers }); new CfnOutput(this, 'BootstrapBrokersTls', { value: cluster.bootstrapBrokersTls }); new CfnOutput(this, 'BootstrapBrokersSaslScram', { value: cluster.bootstrapBrokersSaslScram }); +new CfnOutput(this, 'BootstrapBrokerStringSaslIam', { value: cluster.bootstrapBrokersSaslIam }); new CfnOutput(this, 'ZookeeperConnection', { value: cluster.zookeeperConnectionString }); new CfnOutput(this, 'ZookeeperConnectionTls', { value: cluster.zookeeperConnectionStringTls }); ``` diff --git a/packages/@aws-cdk/aws-msk/lib/cluster.ts b/packages/@aws-cdk/aws-msk/lib/cluster.ts index 11660067d4263..7b604deab2cd7 100644 --- a/packages/@aws-cdk/aws-msk/lib/cluster.ts +++ b/packages/@aws-cdk/aws-msk/lib/cluster.ts @@ -6,13 +6,13 @@ import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as core from '@aws-cdk/core'; +import { FeatureFlags } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; +import { S3_CREATE_DEFAULT_LOGGING_POLICY } from '@aws-cdk/cx-api'; import * as constructs from 'constructs'; import { addressOf } from 'constructs/lib/private/uniqueid'; import { KafkaVersion } from './'; import { CfnCluster } from './msk.generated'; -import { FeatureFlags } from '@aws-cdk/core'; -import { S3_CREATE_DEFAULT_LOGGING_POLICY } from '@aws-cdk/cx-api'; /** * Represents a MSK Cluster @@ -790,6 +790,17 @@ export class Cluster extends ClusterBase { return this._bootstrapBrokers('BootstrapBrokerStringSaslScram'); } + /** + * Get the list of brokers that a SASL/IAM authenticated client application can use to bootstrap + * + * Uses a Custom Resource to make an API call to `getBootstrapBrokers` using the Javascript SDK + * + * @returns - A string containing one or more DNS names (or IP) and TLS port pairs. + */ + public get bootstrapBrokersSaslIam() { + return this._bootstrapBrokers('BootstrapBrokerStringSaslIam'); + } + /** * A list of usersnames to register with the cluster. The password will automatically be generated using Secrets * Manager and the { username, password } JSON object stored in Secrets Manager as `AmazonMSK_username`. diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json index de05cffa11df3..71ab9375f0684 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json +++ b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/MskLoggingDefaultTestDeployAssertC2F074AF.template.json @@ -30,7 +30,7 @@ } }, "flattenResponse": "false", - "salt": "1660927365216" + "salt": "1661748273588" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -51,7 +51,7 @@ ] }, "expected": "{\"$ObjectLike\":{\"KeyCount\":1}}", - "salt": "1660927365216" + "salt": "1661748273588" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -133,7 +133,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "Ref": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3Bucket4DAC9CD3" }, "S3Key": { "Fn::Join": [ @@ -146,7 +146,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3VersionKey22D10A47" } ] } @@ -159,7 +159,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3VersionKey22D10A47" } ] } @@ -191,17 +191,17 @@ } }, "Parameters": { - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7": { + "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3Bucket4DAC9CD3": { "Type": "String", - "Description": "S3 bucket for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 bucket for asset \"374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E": { + "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3VersionKey22D10A47": { "Type": "String", - "Description": "S3 key for asset version \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 key for asset version \"374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9": { + "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458ArtifactHash5A9F2F48": { "Type": "String", - "Description": "Artifact hash for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "Artifact hash for asset \"374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458.bundle/index.js b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458.bundle/index.js new file mode 100644 index 0000000000000..09ec17c1ae178 --- /dev/null +++ b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458.bundle/index.js @@ -0,0 +1,611 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failures = []; + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.target = target; + } + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + recordFailure(failure) { + this.failures.push(failure); + return this; + } + hasFailed() { + return this.failures.length !== 0; + } + get failCount() { + return this.failures.length; + } + compose(id, inner) { + const innerF = inner.failures; + this.failures.push(...innerF.map((f) => { + return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; + })); + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + toHumanStrings() { + return this.failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + } + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + static absent() { + return new AbsentMatch("absent"); + } + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + static not(pattern) { + return new NotMatch("not", pattern); + } + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + static anyValue() { + return new AnyMatch("anyValue"); + } + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + if (!this.subsequence && this.pattern.length !== actual.length) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected array of length ${this.pattern.length} but received ${actual.length}` + }); + } + let patternIdx = 0; + let actualIdx = 0; + const result = new MatchResult(actual); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + if (!this.subsequence || !innerResult.hasFailed()) { + result.compose(`[${actualIdx}]`, innerResult); + patternIdx++; + actualIdx++; + } else { + actualIdx++; + } + } + for (; patternIdx < this.pattern.length; patternIdx++) { + const pattern = this.pattern[patternIdx]; + const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; + result.recordFailure({ + matcher: this, + path: [], + message: `Missing element${element}at pattern index ${patternIdx}` + }); + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [`/${a}`], + message: "Unexpected key" + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [`/${patternKey}`], + message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(`/${patternKey}`, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + if (getType(actual) !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + return result; + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + result.recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + return result; + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + result.compose(`(${this.name})`, innerResult); + return result; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + async handle() { + try { + console.log(`Event: ${JSON.stringify({ ...this.event, ResponseURL: "..." })}`); + const response = await this.processEvent(this.event.ResourceProperties); + console.log(`Event output : ${JSON.stringify(response)}`); + await this.respond({ + status: "SUCCESS", + reason: "OK", + data: response + }); + } catch (e) { + console.log(e); + await this.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + data: JSON.stringify({ + status: "fail", + message: [ + ...matchResult.toHumanStrings(), + JSON.stringify(matchResult.target, void 0, 2) + ].join("\n") + }) + }; + if (request2.failDeployment) { + throw new Error(result.data); + } + } else { + result = { + data: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS.VERSION}`); + const service = new AWS[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + return request2.flattenResponse === "true" ? flatData : respond; + } +}; + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + const provider = createResourceHandler(event, context); + await provider.handle(); +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } + switch (event.ResourceType) { + case ASSERT_RESOURCE_TYPE: + return new AssertionHandler(event, context); + default: + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler +}); diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js new file mode 100644 index 0000000000000..ba956d47f51fe --- /dev/null +++ b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js @@ -0,0 +1,612 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failures = []; + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.target = target; + } + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + recordFailure(failure) { + this.failures.push(failure); + return this; + } + hasFailed() { + return this.failures.length !== 0; + } + get failCount() { + return this.failures.length; + } + compose(id, inner) { + const innerF = inner.failures; + this.failures.push(...innerF.map((f) => { + return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; + })); + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + toHumanStrings() { + return this.failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + } + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + static absent() { + return new AbsentMatch("absent"); + } + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + static not(pattern) { + return new NotMatch("not", pattern); + } + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + static anyValue() { + return new AnyMatch("anyValue"); + } + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + if (!this.subsequence && this.pattern.length !== actual.length) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected array of length ${this.pattern.length} but received ${actual.length}` + }); + } + let patternIdx = 0; + let actualIdx = 0; + const result = new MatchResult(actual); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + if (!this.subsequence || !innerResult.hasFailed()) { + result.compose(`[${actualIdx}]`, innerResult); + patternIdx++; + actualIdx++; + } else { + actualIdx++; + } + } + for (; patternIdx < this.pattern.length; patternIdx++) { + const pattern = this.pattern[patternIdx]; + const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; + result.recordFailure({ + matcher: this, + path: [], + message: `Missing element${element}at pattern index ${patternIdx}` + }); + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [`/${a}`], + message: "Unexpected key" + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [`/${patternKey}`], + message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(`/${patternKey}`, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + if (getType(actual) !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + return result; + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + result.recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + return result; + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + result.compose(`(${this.name})`, innerResult); + return result; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + async handle() { + try { + console.log(`Event: ${JSON.stringify({ ...this.event, ResponseURL: "..." })}`); + const response = await this.processEvent(this.event.ResourceProperties); + console.log(`Event output : ${JSON.stringify(response)}`); + await this.respond({ + status: "SUCCESS", + reason: "OK", + data: response + }); + } catch (e) { + console.log(e); + await this.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + data: JSON.stringify({ + status: "fail", + message: [ + ...matchResult.toHumanStrings(), + JSON.stringify(matchResult.target, void 0, 2) + ].join("\n") + }) + }; + if (request2.failDeployment) { + throw new Error(result.data); + } + } else { + result = { + data: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS.VERSION}`); + const service = new AWS[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + return request2.flattenResponse === "true" ? flatData : respond; + } +}; + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + const provider = createResourceHandler(event, context); + await provider.handle(); +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } + switch (event.ResourceType) { + case ASSERT_RESOURCE_TYPE: + return new AssertionHandler(event, context); + default: + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler +}); diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/aws-cdk-msk-integ.template.json b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/aws-cdk-msk-integ.template.json index 9e5c03338593e..949bb850dab60 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/aws-cdk-msk-integ.template.json +++ b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/aws-cdk-msk-integ.template.json @@ -885,6 +885,149 @@ "DependsOn": [ "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" ] + }, + "ClusterIAMSecurityGroupA09813F0": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "MSK security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "ClusterIAMC4B15B57": { + "Type": "AWS::MSK::Cluster", + "Properties": { + "BrokerNodeGroupInfo": { + "ClientSubnets": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "InstanceType": "kafka.m5.large", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "ClusterIAMSecurityGroupA09813F0", + "GroupId" + ] + } + ], + "StorageInfo": { + "EBSStorageInfo": { + "VolumeSize": 1000 + } + } + }, + "ClusterName": "integ-test-iam-auth", + "KafkaVersion": "2.8.1", + "NumberOfBrokerNodes": 2, + "ClientAuthentication": { + "Sasl": { + "Iam": { + "Enabled": true + } + } + }, + "EncryptionInfo": { + "EncryptionInTransit": { + "ClientBroker": "TLS", + "InCluster": true + } + }, + "LoggingInfo": { + "BrokerLogs": { + "CloudWatchLogs": { + "Enabled": false + }, + "Firehose": { + "Enabled": false + }, + "S3": { + "Bucket": { + "Ref": "LoggingBucket1E5A6F3B" + }, + "Enabled": true + } + } + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterIAMBootstrapBrokersBootstrapBrokerStringSaslIamEB333452": { + "Type": "Custom::AWS", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd22872D164C4C", + "Arn" + ] + }, + "Create": { + "Fn::Join": [ + "", + [ + "{\"service\":\"Kafka\",\"action\":\"getBootstrapBrokers\",\"parameters\":{\"ClusterArn\":\"", + { + "Ref": "ClusterIAMC4B15B57" + }, + "\"},\"physicalResourceId\":{\"id\":\"BootstrapBrokers\"}}" + ] + ] + }, + "Update": { + "Fn::Join": [ + "", + [ + "{\"service\":\"Kafka\",\"action\":\"getBootstrapBrokers\",\"parameters\":{\"ClusterArn\":\"", + { + "Ref": "ClusterIAMC4B15B57" + }, + "\"},\"physicalResourceId\":{\"id\":\"BootstrapBrokers\"}}" + ] + ] + }, + "InstallLatestAwsSdk": true + }, + "DependsOn": [ + "ClusterIAMBootstrapBrokersBootstrapBrokerStringSaslIamCustomResourcePolicy51509D99" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterIAMBootstrapBrokersBootstrapBrokerStringSaslIamCustomResourcePolicy51509D99": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "kafka:GetBootstrapBrokers", + "Effect": "Allow", + "Resource": { + "Ref": "ClusterIAMC4B15B57" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterIAMBootstrapBrokersBootstrapBrokerStringSaslIamCustomResourcePolicy51509D99", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } } }, "Parameters": { @@ -948,6 +1091,14 @@ "BootstrapBrokerStringTls" ] } + }, + "BootstrapBrokers3": { + "Value": { + "Fn::GetAtt": [ + "ClusterIAMBootstrapBrokersBootstrapBrokerStringSaslIamEB333452", + "BootstrapBrokerStringSaslIam" + ] + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/integ.json b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/integ.json index cd779dff79bc4..f4bcd128b85cc 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/integ.json @@ -1,11 +1,12 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "MskLogging/DefaultTest": { "stacks": [ "aws-cdk-msk-integ" ], - "assertionStack": "MskLogging/DefaultTest/DeployAssert" + "assertionStack": "MskLogging/DefaultTest/DeployAssert", + "assertionStackName": "MskLoggingDefaultTestDeployAssertC2F074AF" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/manifest.json index 8c4ba3a32707b..442a923ed3060 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/manifest.json @@ -304,6 +304,36 @@ "type": "aws:cdk:logicalId", "data": "BootstrapBrokers2" } + ], + "/aws-cdk-msk-integ/ClusterIAM/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterIAMSecurityGroupA09813F0" + } + ], + "/aws-cdk-msk-integ/ClusterIAM/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterIAMC4B15B57" + } + ], + "/aws-cdk-msk-integ/ClusterIAM/BootstrapBrokersBootstrapBrokerStringSaslIam/Resource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterIAMBootstrapBrokersBootstrapBrokerStringSaslIamEB333452" + } + ], + "/aws-cdk-msk-integ/ClusterIAM/BootstrapBrokersBootstrapBrokerStringSaslIam/CustomResourcePolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterIAMBootstrapBrokersBootstrapBrokerStringSaslIamCustomResourcePolicy51509D99" + } + ], + "/aws-cdk-msk-integ/BootstrapBrokers3": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapBrokers3" + } ] }, "displayName": "aws-cdk-msk-integ" @@ -323,13 +353,13 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle", - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "path": "asset.374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458.bundle", + "id": "374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458", "packaging": "zip", - "sourceHash": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "s3BucketParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7", - "s3KeyParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E", - "artifactHashParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "sourceHash": "374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458", + "s3BucketParameter": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3Bucket4DAC9CD3", + "s3KeyParameter": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3VersionKey22D10A47", + "artifactHashParameter": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458ArtifactHash5A9F2F48" } } ], @@ -363,22 +393,22 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/MskLogging/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket": [ + "/MskLogging/DefaultTest/DeployAssert/AssetParameters/374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "data": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3Bucket4DAC9CD3" } ], - "/MskLogging/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey": [ + "/MskLogging/DefaultTest/DeployAssert/AssetParameters/374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "data": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458S3VersionKey22D10A47" } ], - "/MskLogging/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash": [ + "/MskLogging/DefaultTest/DeployAssert/AssetParameters/374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "data": "AssetParameters374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458ArtifactHash5A9F2F48" } ] }, diff --git a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/tree.json b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/tree.json index 70c692e26321a..b6317d86beff1 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-msk/test/cluster.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "aws-cdk-msk-integ": { @@ -944,7 +944,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286": { @@ -978,13 +978,13 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "Cluster": { @@ -1193,7 +1193,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "AWS679f53fac002430cb0da5b7982bd2287": { @@ -1356,6 +1356,204 @@ "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" } + }, + "ClusterIAM": { + "id": "ClusterIAM", + "path": "aws-cdk-msk-integ/ClusterIAM", + "children": { + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-cdk-msk-integ/ClusterIAM/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-msk-integ/ClusterIAM/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "MSK security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-msk-integ/ClusterIAM/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::MSK::Cluster", + "aws:cdk:cloudformation:props": { + "brokerNodeGroupInfo": { + "instanceType": "kafka.m5.large", + "clientSubnets": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "ClusterIAMSecurityGroupA09813F0", + "GroupId" + ] + } + ], + "storageInfo": { + "ebsStorageInfo": { + "volumeSize": 1000 + } + } + }, + "clusterName": "integ-test-iam-auth", + "kafkaVersion": "2.8.1", + "numberOfBrokerNodes": 2, + "clientAuthentication": { + "sasl": { + "iam": { + "enabled": true + } + } + }, + "encryptionInfo": { + "encryptionInTransit": { + "clientBroker": "TLS", + "inCluster": true + } + }, + "loggingInfo": { + "brokerLogs": { + "cloudWatchLogs": { + "enabled": false + }, + "firehose": { + "enabled": false + }, + "s3": { + "enabled": true, + "bucket": { + "Ref": "LoggingBucket1E5A6F3B" + } + } + } + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-msk.CfnCluster", + "version": "0.0.0" + } + }, + "BootstrapBrokersBootstrapBrokerStringSaslIam": { + "id": "BootstrapBrokersBootstrapBrokerStringSaslIam", + "path": "aws-cdk-msk-integ/ClusterIAM/BootstrapBrokersBootstrapBrokerStringSaslIam", + "children": { + "Provider": { + "id": "Provider", + "path": "aws-cdk-msk-integ/ClusterIAM/BootstrapBrokersBootstrapBrokerStringSaslIam/Provider", + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-msk-integ/ClusterIAM/BootstrapBrokersBootstrapBrokerStringSaslIam/Resource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-msk-integ/ClusterIAM/BootstrapBrokersBootstrapBrokerStringSaslIam/Resource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "CustomResourcePolicy": { + "id": "CustomResourcePolicy", + "path": "aws-cdk-msk-integ/ClusterIAM/BootstrapBrokersBootstrapBrokerStringSaslIam/CustomResourcePolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-msk-integ/ClusterIAM/BootstrapBrokersBootstrapBrokerStringSaslIam/CustomResourcePolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "kafka:GetBootstrapBrokers", + "Effect": "Allow", + "Resource": { + "Ref": "ClusterIAMC4B15B57" + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterIAMBootstrapBrokersBootstrapBrokerStringSaslIamCustomResourcePolicy51509D99", + "roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/custom-resources.AwsCustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-msk.Cluster", + "version": "0.0.0" + } + }, + "BootstrapBrokers3": { + "id": "BootstrapBrokers3", + "path": "aws-cdk-msk-integ/BootstrapBrokers3", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } } }, "constructInfo": { @@ -1376,7 +1574,7 @@ "path": "MskLogging/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "DeployAssert": { @@ -1396,7 +1594,7 @@ "path": "MskLogging/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV2/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, @@ -1436,7 +1634,7 @@ "path": "MskLogging/DefaultTest/DeployAssert/AwsApiCallS3listObjectsV2/AssertEqualsS3listObjectsV2/AssertionProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, @@ -1514,20 +1712,20 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters", "children": { - "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd": { - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458": { + "id": "374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458", + "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters/374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket", + "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters/374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458/S3Bucket", "constructInfo": { "fqn": "@aws-cdk/core.CfnParameter", "version": "0.0.0" @@ -1535,7 +1733,7 @@ }, "S3VersionKey": { "id": "S3VersionKey", - "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey", + "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters/374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458/S3VersionKey", "constructInfo": { "fqn": "@aws-cdk/core.CfnParameter", "version": "0.0.0" @@ -1543,7 +1741,7 @@ }, "ArtifactHash": { "id": "ArtifactHash", - "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash", + "path": "MskLogging/DefaultTest/DeployAssert/AssetParameters/374e4c6bf67290e7a1839e32e1c4ec413fe48477e9585dc2e042bc07509f7458/ArtifactHash", "constructInfo": { "fqn": "@aws-cdk/core.CfnParameter", "version": "0.0.0" @@ -1552,13 +1750,13 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.78" + "version": "10.1.85" } } }, diff --git a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts b/packages/@aws-cdk/aws-msk/test/integ.cluster.ts index 55aa8dd6948d2..177f06ba51e2c 100644 --- a/packages/@aws-cdk/aws-msk/test/integ.cluster.ts +++ b/packages/@aws-cdk/aws-msk/test/integ.cluster.ts @@ -1,6 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import * as cdk from '@aws-cdk/core'; import * as s3 from '@aws-cdk/aws-s3'; +import * as cdk from '@aws-cdk/core'; import { IntegTest, AssertionsProvider, ExpectedResult } from '@aws-cdk/integ-tests'; import * as msk from '../lib'; @@ -34,6 +34,28 @@ class FeatureFlagStack extends cdk.Stack { // Test lazy instance of the AwsCustomResource new cdk.CfnOutput(this, 'BootstrapBrokers', { value: cluster.bootstrapBrokersTls }); new cdk.CfnOutput(this, 'BootstrapBrokers2', { value: cluster.bootstrapBrokersTls }); + + // iam authenticated msk cluster integ test + const cluster2 = new msk.Cluster(this, 'ClusterIAM', { + clusterName: 'integ-test-iam-auth', + kafkaVersion: msk.KafkaVersion.V2_8_1, + vpc, + logging: { + s3: { + bucket: this.bucket, + }, + }, + encryptionInTransit: { + clientBroker: msk.ClientBrokerEncryption.TLS, + }, + clientAuthentication: msk.ClientAuthentication.sasl({ + iam: true, + }), + removalPolicy: cdk.RemovalPolicy.DESTROY, + }); + + // Test lazy instance of the AwsCustomResource + new cdk.CfnOutput(this, 'BootstrapBrokers3', { value: cluster2.bootstrapBrokersSaslIam }); } } diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.cognitodashboardsauth.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.cognitodashboardsauth.ts index 42642148dcff7..1ae65595e94b9 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.cognitodashboardsauth.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.cognitodashboardsauth.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as cognito from '@aws-cdk/aws-cognito'; import * as iam from '@aws-cdk/aws-iam'; import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.custom-kms-key.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.custom-kms-key.ts index 533300c2cc4fe..fd6e1bb48ab17 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.custom-kms-key.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.custom-kms-key.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.ts index ffa07c27995fc..e7e9c2e6e75ee 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.ts index 7678bee89c365..b9115efaeaf70 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as opensearch from '../lib'; diff --git a/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts b/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts index a697bceaaf928..db5b00c545b2a 100644 --- a/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts @@ -310,13 +310,25 @@ class AuroraClusterEngine extends MySqlClusterEngineBase { * https://docs.aws.amazon.com/AmazonRDS/latest/AuroraMySQLReleaseNotes/Welcome.html */ export class AuroraMysqlEngineVersion { - /** Version "5.7.12". */ + /** + * Version "5.7.12". + * @deprecated Version 5.7.12 is no longer supported by Amazon RDS. + */ public static readonly VER_5_7_12 = AuroraMysqlEngineVersion.builtIn_5_7('12', false); - /** Version "5.7.mysql_aurora.2.03.2". */ + /** + * Version "5.7.mysql_aurora.2.03.2". + * @deprecated Version 5.7.mysql_aurora.2.03.2 is no longer supported by Amazon RDS. + */ public static readonly VER_2_03_2 = AuroraMysqlEngineVersion.builtIn_5_7('2.03.2'); - /** Version "5.7.mysql_aurora.2.03.3". */ + /** + * Version "5.7.mysql_aurora.2.03.3". + * @deprecated Version 5.7.mysql_aurora.2.03.3 is no longer supported by Amazon RDS. + */ public static readonly VER_2_03_3 = AuroraMysqlEngineVersion.builtIn_5_7('2.03.3'); - /** Version "5.7.mysql_aurora.2.03.4". */ + /** + * Version "5.7.mysql_aurora.2.03.4". + * @deprecated Version 5.7.mysql_aurora.2.03.4 is no longer supported by Amazon RDS. + */ public static readonly VER_2_03_4 = AuroraMysqlEngineVersion.builtIn_5_7('2.03.4'); /** Version "5.7.mysql_aurora.2.04.0". */ public static readonly VER_2_04_0 = AuroraMysqlEngineVersion.builtIn_5_7('2.04.0'); @@ -336,9 +348,15 @@ export class AuroraMysqlEngineVersion { public static readonly VER_2_04_7 = AuroraMysqlEngineVersion.builtIn_5_7('2.04.7'); /** Version "5.7.mysql_aurora.2.04.8". */ public static readonly VER_2_04_8 = AuroraMysqlEngineVersion.builtIn_5_7('2.04.8'); - /** Version "5.7.mysql_aurora.2.05.0". */ + /** + * Version "5.7.mysql_aurora.2.05.0". + * @deprecated Version 5.7.mysql_aurora.2.05.0 is no longer supported by Amazon RDS. + */ public static readonly VER_2_05_0 = AuroraMysqlEngineVersion.builtIn_5_7('2.05.0'); - /** Version "5.7.mysql_aurora.2.06.0". */ + /** + * Version "5.7.mysql_aurora.2.06.0". + * @deprecated Version 5.7.mysql_aurora.2.06.0 is no longer supported by Amazon RDS. + */ public static readonly VER_2_06_0 = AuroraMysqlEngineVersion.builtIn_5_7('2.06.0'); /** Version "5.7.mysql_aurora.2.07.0". */ public static readonly VER_2_07_0 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.0'); @@ -487,40 +505,90 @@ export interface AuroraPostgresEngineFeatures { * https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Updates.html */ export class AuroraPostgresEngineVersion { - /** Version "9.6.8". */ + /** + * Version "9.6.8". + * @deprecated Version 9.6.8 is no longer supported by Amazon RDS. + */ public static readonly VER_9_6_8 = AuroraPostgresEngineVersion.of('9.6.8', '9.6'); - /** Version "9.6.9". */ + /** + * Version "9.6.9". + * @deprecated Version 9.6.9 is no longer supported by Amazon RDS. + */ public static readonly VER_9_6_9 = AuroraPostgresEngineVersion.of('9.6.9', '9.6'); - /** Version "9.6.11". */ + /** + * Version "9.6.11". + * @deprecated Version 9.6.11 is no longer supported by Amazon RDS. + */ public static readonly VER_9_6_11 = AuroraPostgresEngineVersion.of('9.6.11', '9.6'); - /** Version "9.6.12". */ + /** + * Version "9.6.12". + * @deprecated Version 9.6.12 is no longer supported by Amazon RDS. + */ public static readonly VER_9_6_12 = AuroraPostgresEngineVersion.of('9.6.12', '9.6'); - /** Version "9.6.16". */ + /** + * Version "9.6.16". + * @deprecated Version 9.6.16 is no longer supported by Amazon RDS. + */ public static readonly VER_9_6_16 = AuroraPostgresEngineVersion.of('9.6.16', '9.6'); - /** Version "9.6.17". */ + /** + * Version "9.6.17". + * @deprecated Version 9.6.17 is no longer supported by Amazon RDS. + */ public static readonly VER_9_6_17 = AuroraPostgresEngineVersion.of('9.6.17', '9.6'); - /** Version "9.6.18". */ + /** + * Version "9.6.18". + * @deprecated Version 9.6.18 is no longer supported by Amazon RDS. + */ public static readonly VER_9_6_18 = AuroraPostgresEngineVersion.of('9.6.18', '9.6'); - /** Version "9.6.19". */ + /** + * Version "9.6.19". + * @deprecated Version 9.6.19 is no longer supported by Amazon RDS. + */ public static readonly VER_9_6_19 = AuroraPostgresEngineVersion.of('9.6.19', '9.6'); - /** Version "10.4". */ + /** + * Version "10.4". + * @deprecated Version 10.4 is no longer supported by Amazon RDS. + */ public static readonly VER_10_4 = AuroraPostgresEngineVersion.of('10.4', '10'); - /** Version "10.5". */ + /** + * Version "10.5". + * @deprecated Version 10.5 is no longer supported by Amazon RDS. + */ public static readonly VER_10_5 = AuroraPostgresEngineVersion.of('10.5', '10'); - /** Version "10.6". */ + /** + * Version "10.6". + * @deprecated Version 10.6 is no longer supported by Amazon RDS. + */ public static readonly VER_10_6 = AuroraPostgresEngineVersion.of('10.6', '10'); - /** Version "10.7". */ + /** + * Version "10.7". + * @deprecated Version 10.7 is no longer supported by Amazon RDS. + */ public static readonly VER_10_7 = AuroraPostgresEngineVersion.of('10.7', '10', { s3Import: true }); - /** Version "10.11". */ + /** + * Version "10.11". + * @deprecated Version 10.11 is no longer supported by Amazon RDS. + */ public static readonly VER_10_11 = AuroraPostgresEngineVersion.of('10.11', '10', { s3Import: true, s3Export: true }); - /** Version "10.12". */ + /** + * Version "10.12". + * @deprecated Version 10.12 is no longer supported by Amazon RDS. + */ public static readonly VER_10_12 = AuroraPostgresEngineVersion.of('10.12', '10', { s3Import: true, s3Export: true }); - /** Version "10.13". */ + /** + * Version "10.13". + * @deprecated Version 10.13 is no longer supported by Amazon RDS. + */ public static readonly VER_10_13 = AuroraPostgresEngineVersion.of('10.13', '10', { s3Import: true, s3Export: true }); - /** Version "10.14". */ + /** + * Version "10.14". + * @deprecated Version 10.14 is no longer supported by Amazon RDS. + */ public static readonly VER_10_14 = AuroraPostgresEngineVersion.of('10.14', '10', { s3Import: true, s3Export: true }); /** Version "10.16". */ public static readonly VER_10_16 = AuroraPostgresEngineVersion.of('10.16', '10', { s3Import: true, s3Export: true }); + /** Version "10.17". */ + public static readonly VER_10_17 = AuroraPostgresEngineVersion.of('10.17', '10', { s3Import: true, s3Export: true }); /** Version "10.18". */ public static readonly VER_10_18 = AuroraPostgresEngineVersion.of('10.18', '10', { s3Import: true, s3Export: true }); /** Version "10.19". */ @@ -529,18 +597,32 @@ export class AuroraPostgresEngineVersion { public static readonly VER_10_20 = AuroraPostgresEngineVersion.of('10.20', '10', { s3Import: true, s3Export: true }); /** Version "10.21". */ public static readonly VER_10_21 = AuroraPostgresEngineVersion.of('10.21', '10', { s3Import: true, s3Export: true }); - /** Version "11.4". */ + /** + * Version "11.4". + * @deprecated Version 11.4 is no longer supported by Amazon RDS. + */ public static readonly VER_11_4 = AuroraPostgresEngineVersion.of('11.4', '11', { s3Import: true }); - /** Version "11.6". */ + /** + * Version "11.6". + * @deprecated Version 11.6 is no longer supported by Amazon RDS. + */ public static readonly VER_11_6 = AuroraPostgresEngineVersion.of('11.6', '11', { s3Import: true, s3Export: true }); - /** Version "11.7". */ + /** + * Version "11.7". + * @deprecated Version 11.7 is no longer supported by Amazon RDS. + */ public static readonly VER_11_7 = AuroraPostgresEngineVersion.of('11.7', '11', { s3Import: true, s3Export: true }); - /** Version "11.8". */ + /** + * Version "11.8". + * @deprecated Version 11.8 is no longer supported by Amazon RDS. + */ public static readonly VER_11_8 = AuroraPostgresEngineVersion.of('11.8', '11', { s3Import: true, s3Export: true }); /** Version "11.9". */ public static readonly VER_11_9 = AuroraPostgresEngineVersion.of('11.9', '11', { s3Import: true, s3Export: true }); /** Version "11.11". */ public static readonly VER_11_11 = AuroraPostgresEngineVersion.of('11.11', '11', { s3Import: true, s3Export: true }); + /** Version "11.12". */ + public static readonly VER_11_12 = AuroraPostgresEngineVersion.of('11.12', '11', { s3Import: true, s3Export: true }); /** Version "11.13". */ public static readonly VER_11_13 = AuroraPostgresEngineVersion.of('11.13', '11', { s3Import: true, s3Export: true }); /** Version "11.14". */ @@ -553,9 +635,11 @@ export class AuroraPostgresEngineVersion { public static readonly VER_12_4 = AuroraPostgresEngineVersion.of('12.4', '12', { s3Import: true, s3Export: true }); /** Version "12.6". */ public static readonly VER_12_6 = AuroraPostgresEngineVersion.of('12.6', '12', { s3Import: true, s3Export: true }); + /** Version "12.7". */ + public static readonly VER_12_7 = AuroraPostgresEngineVersion.of('12.7', '12', { s3Import: true, s3Export: true }); /** Version "12.8". */ public static readonly VER_12_8 = AuroraPostgresEngineVersion.of('12.8', '12', { s3Import: true, s3Export: true }); - /** Version "12.8". */ + /** Version "12.9". */ public static readonly VER_12_9 = AuroraPostgresEngineVersion.of('12.9', '12', { s3Import: true, s3Export: true }); /** Version "12.10". */ public static readonly VER_12_10 = AuroraPostgresEngineVersion.of('12.10', '12', { s3Import: true, s3Export: true }); diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts index 8e539e7700cae..4fb96853335d9 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as targets from '@aws-cdk/aws-events-targets'; diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-loggingbucket.ts b/packages/@aws-cdk/aws-redshift/test/integ.cluster-loggingbucket.ts index e32fdb6f80434..a92fadd51280a 100644 --- a/packages/@aws-cdk/aws-redshift/test/integ.cluster-loggingbucket.ts +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-loggingbucket.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node -/// !cdk-integ pragma:ignore-assets import * as ec2 from '@aws-cdk/aws-ec2'; import * as s3 from '@aws-cdk/aws-s3'; import { Stack, App, StackProps } from '@aws-cdk/core'; @@ -36,4 +35,4 @@ new integ.IntegTest(app, 'LoggingBucketInteg', { testCases: [new RedshiftEnv(app, 'redshift-loggingbucket-integ')], }); -app.synth(); \ No newline at end of file +app.synth(); diff --git a/packages/@aws-cdk/aws-redshift/test/integ.database.ts b/packages/@aws-cdk/aws-redshift/test/integ.database.ts index d5079b83f0c1b..c2a362310cf5c 100644 --- a/packages/@aws-cdk/aws-redshift/test/integ.database.ts +++ b/packages/@aws-cdk/aws-redshift/test/integ.database.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node -/// !cdk-integ pragma:ignore-assets import * as ec2 from '@aws-cdk/aws-ec2'; import * as kms from '@aws-cdk/aws-kms'; import * as cdk from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-route53/test/integ.vpc-endpoint-service-domain-name.ts b/packages/@aws-cdk/aws-route53/test/integ.vpc-endpoint-service-domain-name.ts index a2ca642d1137f..672b2133f077b 100644 --- a/packages/@aws-cdk/aws-route53/test/integ.vpc-endpoint-service-domain-name.ts +++ b/packages/@aws-cdk/aws-route53/test/integ.vpc-endpoint-service-domain-name.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.ts index a399108c686e6..1ecd9ae6f8dea 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import { App, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; diff --git a/packages/@aws-cdk/aws-servicecatalog/lib/portfolio.ts b/packages/@aws-cdk/aws-servicecatalog/lib/portfolio.ts index 376824d664af6..91167f2454695 100644 --- a/packages/@aws-cdk/aws-servicecatalog/lib/portfolio.ts +++ b/packages/@aws-cdk/aws-servicecatalog/lib/portfolio.ts @@ -329,7 +329,7 @@ export class Portfolio extends PortfolioBase { }); this.portfolioId = this.portfolio.ref; this.portfolioArn = cdk.Stack.of(this).formatArn({ - service: 'servicecatalog', + service: 'catalog', resource: 'portfolio', resourceName: this.portfolioId, }); diff --git a/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts b/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts index e53062e0a6752..1785393db5afd 100644 --- a/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts +++ b/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts @@ -62,6 +62,14 @@ describe('Portfolio', () => { }).toThrowError(/Missing required Portfolio ID from Portfolio ARN/); }), + test('portfolio arn formatting', () => { + const portfolio = new servicecatalog.Portfolio(stack, 'Portfolio', { + displayName: 'MyPortfolio', + providerName: 'testProvider', + }); + expect(portfolio.portfolioArn).toEqual(`arn:${stack.partition}:catalog:${stack.region}:${stack.account}:portfolio/${portfolio.portfolioId}`); + }), + test('fails portfolio creation with short name', () => { expect(() => { new servicecatalog.Portfolio(stack, 'MyPortfolio', { diff --git a/packages/@aws-cdk/aws-ses-actions/test/integ.actions.ts b/packages/@aws-cdk/aws-ses-actions/test/integ.actions.ts index b07f286a9f4f3..b4c7122bf1cce 100644 --- a/packages/@aws-cdk/aws-ses-actions/test/integ.actions.ts +++ b/packages/@aws-cdk/aws-ses-actions/test/integ.actions.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as kms from '@aws-cdk/aws-kms'; import * as lambda from '@aws-cdk/aws-lambda'; import * as s3 from '@aws-cdk/aws-s3'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.ts index 3f8c4442a84c8..3da8491f26743 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.ts @@ -1,4 +1,4 @@ -/// !cdk-integ pragma:ignore-assets pragma:disable-update-workflow +/// !cdk-integ pragma:disable-update-workflow import * as eks from '@aws-cdk/aws-eks'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/PutEventsDefaultTestDeployAssert1A6BA3F3.template.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/PutEventsDefaultTestDeployAssert1A6BA3F3.template.json index f778c81df30ee..bce33613745d0 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/PutEventsDefaultTestDeployAssert1A6BA3F3.template.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/PutEventsDefaultTestDeployAssert1A6BA3F3.template.json @@ -17,7 +17,7 @@ } }, "flattenResponse": "true", - "salt": "1660753069000" + "salt": "1661796815777" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -78,7 +78,7 @@ "Runtime": "nodejs14.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" }, "S3Key": { "Fn::Join": [ @@ -91,7 +91,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -104,7 +104,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "Ref": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ] } @@ -144,7 +144,7 @@ } }, "flattenResponse": "false", - "salt": "1660753069000" + "salt": "1661796815778" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -165,24 +165,24 @@ ] }, "expected": "{\"$ObjectLike\":{\"status\":\"SUCCEEDED\"}}", - "salt": "1660753069001" + "salt": "1661796815778" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" } }, "Parameters": { - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80": { "Type": "String", - "Description": "S3 bucket for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 bucket for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE": { "Type": "String", - "Description": "S3 key for asset version \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "S3 key for asset version \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" }, - "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9": { + "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036": { "Type": "String", - "Description": "Artifact hash for asset \"0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd\"" + "Description": "Artifact hash for asset \"84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js deleted file mode 100755 index b3ec1b8c53d30..0000000000000 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle/index.js +++ /dev/null @@ -1,612 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// lib/assertions/providers/lambda-handler/index.ts -var lambda_handler_exports = {}; -__export(lambda_handler_exports, { - handler: () => handler -}); -module.exports = __toCommonJS(lambda_handler_exports); - -// ../assertions/lib/matcher.ts -var Matcher = class { - static isMatcher(x) { - return x && x instanceof Matcher; - } -}; -var MatchResult = class { - constructor(target) { - this.failures = []; - this.captures = /* @__PURE__ */ new Map(); - this.finalized = false; - this.target = target; - } - push(matcher, path, message) { - return this.recordFailure({ matcher, path, message }); - } - recordFailure(failure) { - this.failures.push(failure); - return this; - } - hasFailed() { - return this.failures.length !== 0; - } - get failCount() { - return this.failures.length; - } - compose(id, inner) { - const innerF = inner.failures; - this.failures.push(...innerF.map((f) => { - return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; - })); - inner.captures.forEach((vals, capture) => { - vals.forEach((value) => this.recordCapture({ capture, value })); - }); - return this; - } - finished() { - if (this.finalized) { - return this; - } - if (this.failCount === 0) { - this.captures.forEach((vals, cap) => cap._captured.push(...vals)); - } - this.finalized = true; - return this; - } - toHumanStrings() { - return this.failures.map((r) => { - const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; - return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; - }); - } - recordCapture(options) { - let values = this.captures.get(options.capture); - if (values === void 0) { - values = []; - } - values.push(options.value); - this.captures.set(options.capture, values); - } -}; - -// ../assertions/lib/private/matchers/absent.ts -var AbsentMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual !== void 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Received ${actual}, but key should be absent` - }); - } - return result; - } -}; - -// ../assertions/lib/private/type.ts -function getType(obj) { - return Array.isArray(obj) ? "array" : typeof obj; -} - -// ../assertions/lib/match.ts -var Match = class { - static absent() { - return new AbsentMatch("absent"); - } - static arrayWith(pattern) { - return new ArrayMatch("arrayWith", pattern); - } - static arrayEquals(pattern) { - return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); - } - static exact(pattern) { - return new LiteralMatch("exact", pattern, { partialObjects: false }); - } - static objectLike(pattern) { - return new ObjectMatch("objectLike", pattern); - } - static objectEquals(pattern) { - return new ObjectMatch("objectEquals", pattern, { partial: false }); - } - static not(pattern) { - return new NotMatch("not", pattern); - } - static serializedJson(pattern) { - return new SerializedJson("serializedJson", pattern); - } - static anyValue() { - return new AnyMatch("anyValue"); - } - static stringLikeRegexp(pattern) { - return new StringLikeRegexpMatch("stringLikeRegexp", pattern); - } -}; -var LiteralMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partialObjects = options.partialObjects ?? false; - if (Matcher.isMatcher(this.pattern)) { - throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); - } - } - test(actual) { - if (Array.isArray(this.pattern)) { - return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); - } - if (typeof this.pattern === "object") { - return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); - } - const result = new MatchResult(actual); - if (typeof this.pattern !== typeof actual) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` - }); - return result; - } - if (actual !== this.pattern) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected ${this.pattern} but received ${actual}` - }); - } - return result; - } -}; -var ArrayMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.subsequence = options.subsequence ?? true; - this.partialObjects = options.partialObjects ?? false; - } - test(actual) { - if (!Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type array but received ${getType(actual)}` - }); - } - if (!this.subsequence && this.pattern.length !== actual.length) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected array of length ${this.pattern.length} but received ${actual.length}` - }); - } - let patternIdx = 0; - let actualIdx = 0; - const result = new MatchResult(actual); - while (patternIdx < this.pattern.length && actualIdx < actual.length) { - const patternElement = this.pattern[patternIdx]; - const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); - const matcherName = matcher.name; - if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { - throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); - } - const innerResult = matcher.test(actual[actualIdx]); - if (!this.subsequence || !innerResult.hasFailed()) { - result.compose(`[${actualIdx}]`, innerResult); - patternIdx++; - actualIdx++; - } else { - actualIdx++; - } - } - for (; patternIdx < this.pattern.length; patternIdx++) { - const pattern = this.pattern[patternIdx]; - const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; - result.recordFailure({ - matcher: this, - path: [], - message: `Missing element${element}at pattern index ${patternIdx}` - }); - } - return result; - } -}; -var ObjectMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partial = options.partial ?? true; - } - test(actual) { - if (typeof actual !== "object" || Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type object but received ${getType(actual)}` - }); - } - const result = new MatchResult(actual); - if (!this.partial) { - for (const a of Object.keys(actual)) { - if (!(a in this.pattern)) { - result.recordFailure({ - matcher: this, - path: [`/${a}`], - message: "Unexpected key" - }); - } - } - } - for (const [patternKey, patternVal] of Object.entries(this.pattern)) { - if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { - result.recordFailure({ - matcher: this, - path: [`/${patternKey}`], - message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` - }); - continue; - } - const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); - const inner = matcher.test(actual[patternKey]); - result.compose(`/${patternKey}`, inner); - } - return result; - } -}; -var SerializedJson = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - if (getType(actual) !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected JSON as a string but found ${getType(actual)}` - }); - return result; - } - let parsed; - try { - parsed = JSON.parse(actual); - } catch (err) { - if (err instanceof SyntaxError) { - result.recordFailure({ - matcher: this, - path: [], - message: `Invalid JSON string: ${actual}` - }); - return result; - } else { - throw err; - } - } - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(parsed); - result.compose(`(${this.name})`, innerResult); - return result; - } -}; -var NotMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(actual); - const result = new MatchResult(actual); - if (innerResult.failCount === 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` - }); - } - return result; - } -}; -var AnyMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual == null) { - result.recordFailure({ - matcher: this, - path: [], - message: "Expected a value but found none" - }); - } - return result; - } -}; -var StringLikeRegexpMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - const regex = new RegExp(this.pattern, "gm"); - if (typeof actual !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected a string, but got '${typeof actual}'` - }); - } - if (!regex.test(actual)) { - result.recordFailure({ - matcher: this, - path: [], - message: `String '${actual}' did not match pattern '${this.pattern}'` - }); - } - return result; - } -}; - -// lib/assertions/providers/lambda-handler/base.ts -var https = __toESM(require("https")); -var url = __toESM(require("url")); -var CustomResourceHandler = class { - constructor(event, context) { - this.event = event; - this.context = context; - this.timedOut = false; - this.timeout = setTimeout(async () => { - await this.respond({ - status: "FAILED", - reason: "Lambda Function Timeout", - data: this.context.logStreamName - }); - this.timedOut = true; - }, context.getRemainingTimeInMillis() - 1200); - this.event = event; - this.physicalResourceId = extractPhysicalResourceId(event); - } - async handle() { - try { - console.log(`Event: ${JSON.stringify({ ...this.event, ResponseURL: "..." })}`); - const response = await this.processEvent(this.event.ResourceProperties); - console.log(`Event output : ${JSON.stringify(response)}`); - await this.respond({ - status: "SUCCESS", - reason: "OK", - data: response - }); - } catch (e) { - console.log(e); - await this.respond({ - status: "FAILED", - reason: e.message ?? "Internal Error" - }); - } finally { - clearTimeout(this.timeout); - } - } - respond(response) { - if (this.timedOut) { - return; - } - const cfResponse = { - Status: response.status, - Reason: response.reason, - PhysicalResourceId: this.physicalResourceId, - StackId: this.event.StackId, - RequestId: this.event.RequestId, - LogicalResourceId: this.event.LogicalResourceId, - NoEcho: false, - Data: response.data - }; - const responseBody = JSON.stringify(cfResponse); - console.log("Responding to CloudFormation", responseBody); - const parsedUrl = url.parse(this.event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { "content-type": "", "content-length": responseBody.length } - }; - return new Promise((resolve, reject) => { - try { - const request2 = https.request(requestOptions, resolve); - request2.on("error", reject); - request2.write(responseBody); - request2.end(); - } catch (e) { - reject(e); - } - }); - } -}; -function extractPhysicalResourceId(event) { - switch (event.RequestType) { - case "Create": - return event.LogicalResourceId; - case "Update": - case "Delete": - return event.PhysicalResourceId; - } -} - -// lib/assertions/providers/lambda-handler/assertion.ts -var AssertionHandler = class extends CustomResourceHandler { - async processEvent(request2) { - let actual = decodeCall(request2.actual); - const expected = decodeCall(request2.expected); - let result; - const matcher = new MatchCreator(expected).getMatcher(); - console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); - const matchResult = matcher.test(actual); - matchResult.finished(); - if (matchResult.hasFailed()) { - result = { - data: JSON.stringify({ - status: "fail", - message: [ - ...matchResult.toHumanStrings(), - JSON.stringify(matchResult.target, void 0, 2) - ].join("\n") - }) - }; - if (request2.failDeployment) { - throw new Error(result.data); - } - } else { - result = { - data: JSON.stringify({ - status: "pass" - }) - }; - } - return result; - } -}; -var MatchCreator = class { - constructor(obj) { - this.parsedObj = { - matcher: obj - }; - } - getMatcher() { - try { - const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { - const nested = Object.keys(v)[0]; - switch (nested) { - case "$ArrayWith": - return Match.arrayWith(v[nested]); - case "$ObjectLike": - return Match.objectLike(v[nested]); - case "$StringLike": - return Match.stringLikeRegexp(v[nested]); - default: - return v; - } - }); - if (Matcher.isMatcher(final.matcher)) { - return final.matcher; - } - return Match.exact(final.matcher); - } catch { - return Match.exact(this.parsedObj.matcher); - } - } -}; -function decodeCall(call) { - if (!call) { - return void 0; - } - try { - const parsed = JSON.parse(call); - return parsed; - } catch (e) { - return call; - } -} - -// lib/assertions/providers/lambda-handler/utils.ts -function decode(object) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case "TRUE:BOOLEAN": - return true; - case "FALSE:BOOLEAN": - return false; - default: - return v; - } - }); -} - -// lib/assertions/providers/lambda-handler/sdk.ts -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -var AwsApiCallHandler = class extends CustomResourceHandler { - async processEvent(request2) { - const AWS = require("aws-sdk"); - console.log(`AWS SDK VERSION: ${AWS.VERSION}`); - const service = new AWS[request2.service](); - const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); - console.log(`SDK response received ${JSON.stringify(response)}`); - delete response.ResponseMetadata; - const respond = { - apiCallResponse: response - }; - const flatData = { - ...flatten(respond) - }; - return request2.flattenResponse === "true" ? flatData : respond; - } -}; - -// lib/assertions/providers/lambda-handler/types.ts -var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; -var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; - -// lib/assertions/providers/lambda-handler/index.ts -async function handler(event, context) { - const provider = createResourceHandler(event, context); - await provider.handle(); -} -function createResourceHandler(event, context) { - if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { - return new AwsApiCallHandler(event, context); - } - switch (event.ResourceType) { - case ASSERT_RESOURCE_TYPE: - return new AssertionHandler(event, context); - default: - throw new Error(`Unsupported resource type "${event.ResourceType}`); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - handler -}); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js new file mode 100644 index 0000000000000..ba956d47f51fe --- /dev/null +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js @@ -0,0 +1,612 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failures = []; + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.target = target; + } + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + recordFailure(failure) { + this.failures.push(failure); + return this; + } + hasFailed() { + return this.failures.length !== 0; + } + get failCount() { + return this.failures.length; + } + compose(id, inner) { + const innerF = inner.failures; + this.failures.push(...innerF.map((f) => { + return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; + })); + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + toHumanStrings() { + return this.failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + } + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + static absent() { + return new AbsentMatch("absent"); + } + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + static not(pattern) { + return new NotMatch("not", pattern); + } + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + static anyValue() { + return new AnyMatch("anyValue"); + } + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + if (!this.subsequence && this.pattern.length !== actual.length) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected array of length ${this.pattern.length} but received ${actual.length}` + }); + } + let patternIdx = 0; + let actualIdx = 0; + const result = new MatchResult(actual); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + if (!this.subsequence || !innerResult.hasFailed()) { + result.compose(`[${actualIdx}]`, innerResult); + patternIdx++; + actualIdx++; + } else { + actualIdx++; + } + } + for (; patternIdx < this.pattern.length; patternIdx++) { + const pattern = this.pattern[patternIdx]; + const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; + result.recordFailure({ + matcher: this, + path: [], + message: `Missing element${element}at pattern index ${patternIdx}` + }); + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [`/${a}`], + message: "Unexpected key" + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [`/${patternKey}`], + message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(`/${patternKey}`, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + if (getType(actual) !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + return result; + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + result.recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + return result; + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + result.compose(`(${this.name})`, innerResult); + return result; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + async handle() { + try { + console.log(`Event: ${JSON.stringify({ ...this.event, ResponseURL: "..." })}`); + const response = await this.processEvent(this.event.ResourceProperties); + console.log(`Event output : ${JSON.stringify(response)}`); + await this.respond({ + status: "SUCCESS", + reason: "OK", + data: response + }); + } catch (e) { + console.log(e); + await this.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + data: JSON.stringify({ + status: "fail", + message: [ + ...matchResult.toHumanStrings(), + JSON.stringify(matchResult.target, void 0, 2) + ].join("\n") + }) + }; + if (request2.failDeployment) { + throw new Error(result.data); + } + } else { + result = { + data: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS.VERSION}`); + const service = new AWS[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + return request2.flattenResponse === "true" ? flatData : respond; + } +}; + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + const provider = createResourceHandler(event, context); + await provider.handle(); +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } + switch (event.ResourceType) { + case ASSERT_RESOURCE_TYPE: + return new AssertionHandler(event, context); + default: + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler +}); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/integ.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/integ.json index f017363e897e9..8bc3eb27a6a40 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/integ.json @@ -1,11 +1,12 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { "PutEvents/DefaultTest": { "stacks": [ "aws-stepfunctions-tasks-eventbridge-put-events-integ" ], - "assertionStack": "PutEvents/DefaultTest/DeployAssert" + "assertionStack": "PutEvents/DefaultTest/DeployAssert", + "assertionStackName": "PutEventsDefaultTestDeployAssert1A6BA3F3" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/manifest.json index 1e8a9d29e9571..8b86f822d7770 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -69,13 +69,13 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd.bundle", - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "packaging": "zip", - "sourceHash": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "s3BucketParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7", - "s3KeyParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E", - "artifactHashParameter": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "sourceHash": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "s3BucketParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80", + "s3KeyParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE", + "artifactHashParameter": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } } ], @@ -97,22 +97,22 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/PutEvents/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket": [ + "/PutEvents/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3BucketF94385B7" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3BucketA2BC9E80" } ], - "/PutEvents/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey": [ + "/PutEvents/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdS3VersionKey66DB0F9E" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7S3VersionKeyB8E92EFE" } ], - "/PutEvents/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash": [ + "/PutEvents/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParameters0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbdArtifactHash2AC894D9" + "data": "AssetParameters84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7ArtifactHashB8137036" } ], "/PutEvents/DefaultTest/DeployAssert/AwsApiCallStepFunctionsdescribeExecution/Default/Default": [ diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/tree.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/tree.json index 535dc2b5a827f..ceb519d0a082e 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eventbridge/put-events.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "aws-stepfunctions-tasks-eventbridge-put-events-integ": { @@ -209,8 +209,8 @@ "id": "Service-principalMap", "path": "aws-stepfunctions-tasks-eventbridge-put-events-integ/Service-principalMap", "constructInfo": { - "fqn": "@aws-cdk/core.CfnMapping", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Exports": { @@ -221,20 +221,20 @@ "id": "Output{\"Ref\":\"StateMachine2E01A3A5\"}", "path": "aws-stepfunctions-tasks-eventbridge-put-events-integ/Exports/Output{\"Ref\":\"StateMachine2E01A3A5\"}", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "PutEvents": { @@ -250,7 +250,7 @@ "path": "PutEvents/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "DeployAssert": { @@ -270,7 +270,7 @@ "path": "PutEvents/DefaultTest/DeployAssert/AwsApiCallStepFunctionsstartExecution/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, @@ -287,14 +287,14 @@ "id": "Default", "path": "PutEvents/DefaultTest/DeployAssert/AwsApiCallStepFunctionsstartExecution/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -311,74 +311,74 @@ "id": "Staging", "path": "PutEvents/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Role": { "id": "Role", "path": "PutEvents/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "Handler": { "id": "Handler", "path": "PutEvents/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "AssetParameters": { "id": "AssetParameters", "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters", "children": { - "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd": { - "id": "0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", - "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd", + "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "id": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", + "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3Bucket", + "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3Bucket", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "S3VersionKey": { "id": "S3VersionKey", - "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/S3VersionKey", + "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/S3VersionKey", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "ArtifactHash": { "id": "ArtifactHash", - "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters/0d8d96305807ac805d23c6d7b279eef238715605efad63c839ad1e7e8236bdbd/ArtifactHash", + "path": "PutEvents/DefaultTest/DeployAssert/AssetParameters/84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7/ArtifactHash", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } }, "AwsApiCallStepFunctionsdescribeExecution": { @@ -394,7 +394,7 @@ "path": "PutEvents/DefaultTest/DeployAssert/AwsApiCallStepFunctionsdescribeExecution/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, @@ -411,14 +411,14 @@ "id": "Default", "path": "PutEvents/DefaultTest/DeployAssert/AwsApiCallStepFunctionsdescribeExecution/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertEqualsStepFunctionsdescribeExecution": { @@ -434,7 +434,7 @@ "path": "PutEvents/DefaultTest/DeployAssert/AwsApiCallStepFunctionsdescribeExecution/AssertEqualsStepFunctionsdescribeExecution/AssertionProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.71" + "version": "10.1.85" } } }, @@ -451,22 +451,22 @@ "id": "Default", "path": "PutEvents/DefaultTest/DeployAssert/AwsApiCallStepFunctionsdescribeExecution/AssertEqualsStepFunctionsdescribeExecution/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } }, "AssertionResults": { "id": "AssertionResults", "path": "PutEvents/DefaultTest/DeployAssert/AwsApiCallStepFunctionsdescribeExecution/AssertEqualsStepFunctionsdescribeExecution/AssertionResults", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -483,8 +483,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } }, @@ -501,8 +501,8 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.85" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.evaluate-expression.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.evaluate-expression.ts index 905ce9d65bfe3..8034635352b32 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.evaluate-expression.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.evaluate-expression.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as sfn from '@aws-cdk/aws-stepfunctions'; import * as cdk from '@aws-cdk/core'; import * as tasks from '../lib'; diff --git a/packages/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.ts b/packages/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.ts index c3de8c8711853..6878f9da2563c 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.ts +++ b/packages/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.ts @@ -75,11 +75,19 @@ export interface TestCase extends TestOptions { readonly stacks: string[]; /** - * The name of the stack that contains assertions + * The node id of the stack that contains assertions. + * This is the value that can be used to deploy the stack with the CDK CLI * * @default - no assertion stack */ readonly assertionStack?: string; + + /** + * The name of the stack that contains assertions + * + * @default - no assertion stack + */ + readonly assertionStackName?: string; } /** diff --git a/packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.schema.json b/packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.schema.json index 7f877222e4563..506e0992c7259 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.schema.json +++ b/packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.schema.json @@ -639,7 +639,7 @@ } }, "returnAsymmetricSubnets": { - "description": "Whether to populate the subnetGroups field of the{@linkVpcContextResponse},\nwhich contains potentially asymmetric subnet groups.", + "description": "Whether to populate the subnetGroups field of the {@link VpcContextResponse},\nwhich contains potentially asymmetric subnet groups.", "default": false, "type": "boolean" }, diff --git a/packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.version.json b/packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.version.json index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.version.json +++ b/packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.version.json @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/cloud-assembly-schema/schema/integ.schema.json b/packages/@aws-cdk/cloud-assembly-schema/schema/integ.schema.json index f18827244648c..a098e4d72a134 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/schema/integ.schema.json +++ b/packages/@aws-cdk/cloud-assembly-schema/schema/integ.schema.json @@ -46,6 +46,10 @@ } }, "assertionStack": { + "description": "The node id of the stack that contains assertions.\nThis is the value that can be used to deploy the stack with the CDK CLI (Default - no assertion stack)", + "type": "string" + }, + "assertionStackName": { "description": "The name of the stack that contains assertions (Default - no assertion stack)", "type": "string" }, diff --git a/packages/@aws-cdk/core/README.md b/packages/@aws-cdk/core/README.md index e4b33d2f9f5c8..54a0e38446481 100644 --- a/packages/@aws-cdk/core/README.md +++ b/packages/@aws-cdk/core/README.md @@ -821,6 +821,9 @@ can be accessed from the `Fn` class, which provides type-safe methods for each intrinsic function as well as condition expressions: ```ts +declare const myObjectOrArray: any; +declare const myArray: any; + // To use Fn::Base64 Fn.base64('SGVsbG8gQ0RLIQo='); @@ -832,6 +835,12 @@ Fn.conditionAnd( // The AWS::Region pseudo-parameter value is NOT equal to "us-east-1" Fn.conditionNot(Fn.conditionEquals('us-east-1', Aws.REGION)), ); + +// To use Fn::ToJsonString +Fn.toJsonString(myObjectOrArray); + +// To use Fn::Length +Fn.len(Fn.split(',', myArray)); ``` When working with deploy-time values (those for which `Token.isUnresolved` diff --git a/packages/@aws-cdk/core/lib/cfn-fn.ts b/packages/@aws-cdk/core/lib/cfn-fn.ts index 673784e0e2a5b..b0793e0beb514 100644 --- a/packages/@aws-cdk/core/lib/cfn-fn.ts +++ b/packages/@aws-cdk/core/lib/cfn-fn.ts @@ -3,6 +3,7 @@ import { minimalCloudFormationJoin } from './private/cloudformation-lang'; import { Intrinsic } from './private/intrinsic'; import { Reference } from './reference'; import { IResolvable, IResolveContext } from './resolvable'; +import { Stack } from './stack'; import { captureStackTrace } from './stack-trace'; import { Token } from './token'; @@ -412,6 +413,37 @@ export class Fn { return Token.asList(new FnValueOfAll(parameterType, attribute)); } + /** + * The `Fn::ToJsonString` intrinsic function converts an object or array to its + * corresponding JSON string. + * + * @param object The object or array to stringify + */ + public static toJsonString(object: any): string { + // short-circut if object is not a token + if (!Token.isUnresolved(object)) { + return JSON.stringify(object); + } + return new FnToJsonString(object).toString(); + } + + /** + * The intrinsic function `Fn::Length` returns the number of elements within an array + * or an intrinsic function that returns an array. + * + * @param array The array you want to return the number of elements from + */ + public static len(array: any): number { + // short-circut if array is not a token + if (!Token.isUnresolved(array)) { + if (!Array.isArray(array)) { + throw new Error('Fn.length() needs an array'); + } + return array.length; + } + return Token.asNumber(new FnLength(array)); + } + private constructor() { } } @@ -829,6 +861,62 @@ class FnJoin implements IResolvable { } } +/** + * The `Fn::ToJsonString` intrinsic function converts an object or array to its + * corresponding JSON string. + */ +class FnToJsonString implements IResolvable { + public readonly creationStack: string[]; + + private readonly object: any; + + constructor(object: any) { + this.object = object; + this.creationStack = captureStackTrace(); + } + + public resolve(context: IResolveContext): any { + Stack.of(context.scope).addTransform('AWS::LanguageExtensions'); + return { 'Fn::ToJsonString': this.object }; + } + + public toString() { + return Token.asString(this, { displayHint: 'Fn::ToJsonString' }); + } + + public toJSON() { + return ''; + } +} + +/** + * The intrinsic function `Fn::Length` returns the number of elements within an array + * or an intrinsic function that returns an array. + */ +class FnLength implements IResolvable { + public readonly creationStack: string[]; + + private readonly array: any; + + constructor(array: any) { + this.array = array; + this.creationStack = captureStackTrace(); + } + + public resolve(context: IResolveContext): any { + Stack.of(context.scope).addTransform('AWS::LanguageExtensions'); + return { 'Fn::Length': this.array }; + } + + public toString() { + return Token.asString(this, { displayHint: 'Fn::Length' }); + } + + public toJSON() { + return ''; + } +} + function _inGroupsOf(array: T[], maxGroup: number): T[][] { const result = new Array(); for (let i = 0; i < array.length; i += maxGroup) { @@ -843,4 +931,4 @@ function range(n: number): number[] { ret.push(i); } return ret; -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/core/test/fn.test.ts b/packages/@aws-cdk/core/test/fn.test.ts index 2e213020b4ee3..cd29f060b8b30 100644 --- a/packages/@aws-cdk/core/test/fn.test.ts +++ b/packages/@aws-cdk/core/test/fn.test.ts @@ -266,6 +266,43 @@ test('Fn.importListValue produces lists of known length', () => { ]); }); +test('Fn.toJsonString', () => { + const stack = new Stack(); + const token = Token.asAny({ key: 'value' }); + + expect(stack.resolve(Fn.toJsonString(token))).toEqual({ 'Fn::ToJsonString': { key: 'value' } }); + expect(stack.templateOptions.transforms).toEqual(expect.arrayContaining([ + 'AWS::LanguageExtensions', + ])); +}); + +test('Fn.toJsonString with resolved value', () => { + expect(Fn.toJsonString({ key: 'value' })).toEqual('{\"key\":\"value\"}'); +}); + +test('Fn.len', () => { + const stack = new Stack(); + const token = Fn.split('|', Token.asString({ ThisIsASplittable: 'list' })); + + expect(stack.resolve(Fn.len(token))).toEqual({ + 'Fn::Length': { + 'Fn::Split': [ + '|', + { + ThisIsASplittable: 'list', + }, + ], + }, + }); + expect(stack.templateOptions.transforms).toEqual(expect.arrayContaining([ + 'AWS::LanguageExtensions', + ])); +}); + +test('Fn.len with resolved value', () => { + expect(Fn.len(Fn.split('|', 'a|b|c'))).toBe(3); +}); + function stringListToken(o: any): string[] { return Token.asList(new Intrinsic(o)); } diff --git a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts index 58ee0bbae8172..f3af6ff2514d2 100644 --- a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts +++ b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node -/// !cdk-integ pragma:ignore-assets import * as iam from '@aws-cdk/aws-iam'; import * as sns from '@aws-cdk/aws-sns'; import * as ssm from '@aws-cdk/aws-ssm'; diff --git a/packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts b/packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts index 282395b1b9096..c981c4b1d7551 100644 --- a/packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts +++ b/packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts @@ -1,4 +1,4 @@ -/// !cdk-integ * pragma:ignore-assets +/// !cdk-integ * import * as s3 from '@aws-cdk/aws-s3'; import { App, CfnOutput, Stack } from '@aws-cdk/core'; import { Construct, Node } from 'constructs'; diff --git a/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES b/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES index a8a8eb24aa8fa..b259f40c9fca3 100644 --- a/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES +++ b/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES @@ -156,7 +156,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1205.0 - https://www.npmjs.com/package/aws-sdk/v/2.1205.0 | Apache-2.0 +** aws-sdk@2.1206.0 - https://www.npmjs.com/package/aws-sdk/v/2.1206.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/integ-runner/lib/cli.ts b/packages/@aws-cdk/integ-runner/lib/cli.ts index 8058a3b9cd457..0904ffb96d438 100644 --- a/packages/@aws-cdk/integ-runner/lib/cli.ts +++ b/packages/@aws-cdk/integ-runner/lib/cli.ts @@ -22,9 +22,9 @@ async function main() { .option('dry-run', { type: 'boolean', default: false, desc: 'do not actually deploy the stack. just update the snapshot (not recommended!)' }) .option('update-on-failed', { type: 'boolean', default: false, desc: 'rerun integration tests and update snapshots for failed tests.' }) .option('force', { type: 'boolean', default: false, desc: 'Rerun all integration tests even if tests are passing' }) - .option('parallel-regions', { type: 'array', desc: 'Tests are run in parallel across these regions. To prevent tests from running in parallel, provide only a single region', nargs: 1, default: [] }) + .option('parallel-regions', { type: 'array', desc: 'Tests are run in parallel across these regions. To prevent tests from running in parallel, provide only a single region', default: [] }) .options('directory', { type: 'string', default: 'test', desc: 'starting directory to discover integration tests. Tests will be discovered recursively from this directory' }) - .options('profiles', { type: 'array', desc: 'list of AWS profiles to use. Tests will be run in parallel across each profile+regions', nargs: 1, default: [] }) + .options('profiles', { type: 'array', desc: 'list of AWS profiles to use. Tests will be run in parallel across each profile+regions', default: [] }) .options('max-workers', { type: 'number', desc: 'The max number of workerpool workers to use when running integration tests in parallel', default: 16 }) .options('exclude', { type: 'boolean', desc: 'Run all tests in the directory, except the specified TESTs', default: false }) .options('from-file', { type: 'string', desc: 'Read TEST names from a file (one TEST per line)' }) diff --git a/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts b/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts index ce2a40e6e5e6b..2845680063439 100644 --- a/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts +++ b/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts @@ -184,9 +184,9 @@ export class IntegTestRunner extends IntegRunner { output: path.relative(this.directory, this.cdkOutDir), }); } - // only create the snapshot if there are no assertion assertion results + // only create the snapshot if there are no failed assertion results // (i.e. no failures) - if (!assertionResults) { + if (!assertionResults || !Object.values(assertionResults).some(result => result.status === 'fail')) { this.createSnapshot(); } } catch (e) { @@ -300,9 +300,10 @@ export class IntegTestRunner extends IntegRunner { }); } - if (actualTestCase.assertionStack) { + if (actualTestCase.assertionStack && actualTestCase.assertionStackName) { return this.processAssertionResults( path.join(this.cdkOutDir, 'assertion-results.json'), + actualTestCase.assertionStackName, actualTestCase.assertionStack, ); } @@ -319,17 +320,17 @@ export class IntegTestRunner extends IntegRunner { * Process the outputsFile which contains the assertions results as stack * outputs */ - private processAssertionResults(file: string, assertionStackId: string): AssertionResults | undefined { + private processAssertionResults(file: string, assertionStackName: string, assertionStackId: string): AssertionResults | undefined { const results: AssertionResults = {}; if (fs.existsSync(file)) { try { const outputs: { [key: string]: { [key: string]: string } } = fs.readJSONSync(file); - if (assertionStackId in outputs) { - for (const [assertionId, result] of Object.entries(outputs[assertionStackId])) { + if (assertionStackName in outputs) { + for (const [assertionId, result] of Object.entries(outputs[assertionStackName])) { if (assertionId.startsWith('AssertionResults')) { const assertionResult: AssertionResult = JSON.parse(result.replace(/\n/g, '\\n')); - if (assertionResult.status === 'fail') { + if (assertionResult.status === 'fail' || assertionResult.status === 'success') { results[assertionId] = assertionResult; } } diff --git a/packages/@aws-cdk/integ-runner/lib/workers/common.ts b/packages/@aws-cdk/integ-runner/lib/workers/common.ts index 739dc55f2ac5a..7f49cb73b864c 100644 --- a/packages/@aws-cdk/integ-runner/lib/workers/common.ts +++ b/packages/@aws-cdk/integ-runner/lib/workers/common.ts @@ -256,8 +256,8 @@ export function printSummary(total: number, failed: number): void { */ export function formatAssertionResults(results: AssertionResults): string { return Object.entries(results) - .map(([id, result]) => format('%s\n%s', id, result.message)) - .join('\n'); + .map(([id, result]) => format('%s%s', id, result.status === 'success' ? ` - ${result.status}` : `\n${result.message}`)) + .join('\n '); } /** @@ -269,7 +269,7 @@ export function printResults(diagnostic: Diagnostic): void { logger.success(' UNCHANGED %s %s', diagnostic.testName, chalk.gray(`${diagnostic.duration}s`)); break; case DiagnosticReason.TEST_SUCCESS: - logger.success(' SUCCESS %s %s', diagnostic.testName, chalk.gray(`${diagnostic.duration}s`)); + logger.success(' SUCCESS %s %s\n ', diagnostic.testName, chalk.gray(`${diagnostic.duration}s`), diagnostic.message); break; case DiagnosticReason.NO_SNAPSHOT: logger.error(' NEW %s %s', diagnostic.testName, chalk.gray(`${diagnostic.duration}s`)); @@ -301,4 +301,4 @@ export function printLaggards(testNames: Set) { ]; logger.print(chalk.grey(parts.filter(x => x).join(' '))); -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/integ-runner/lib/workers/extract/extract_worker.ts b/packages/@aws-cdk/integ-runner/lib/workers/extract/extract_worker.ts index 35ed78d91c68b..a8166680fb7ba 100644 --- a/packages/@aws-cdk/integ-runner/lib/workers/extract/extract_worker.ts +++ b/packages/@aws-cdk/integ-runner/lib/workers/extract/extract_worker.ts @@ -44,7 +44,7 @@ export function integTestWorker(request: IntegTestBatchRequest): IntegTestWorker updateWorkflow: request.updateWorkflow, verbosity, }); - if (results) { + if (results && Object.values(results).some(result => result.status === 'fail')) { failures.push(testInfo); workerpool.workerEmit({ reason: DiagnosticReason.ASSERTION_FAILED, @@ -56,7 +56,7 @@ export function integTestWorker(request: IntegTestBatchRequest): IntegTestWorker workerpool.workerEmit({ reason: DiagnosticReason.TEST_SUCCESS, testName: `${runner.testName}-${testCaseName}`, - message: 'Success', + message: results ? formatAssertionResults(results) : 'NO ASSERTIONS', duration: (Date.now() - start) / 1000, }); } diff --git a/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.integ-test1.ts b/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.integ-test1.ts index 26679b49d93bc..fa2f705543d80 100644 --- a/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.integ-test1.ts +++ b/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.integ-test1.ts @@ -1,2 +1 @@ -/// !cdk-integ stack1 pragma:ignore-assets -/// !cdk-integ pragma:ignore-assets +/// !cdk-integ stack1 diff --git a/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.test-with-snapshot.ts b/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.test-with-snapshot.ts index c3548a8acffcc..e43a408f7b31c 100644 --- a/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.test-with-snapshot.ts +++ b/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.test-with-snapshot.ts @@ -1,2 +1 @@ -/// !cdk-integ test-stack pragma:ignore-assets -/// !cdk-integ pragma:ignore-assets +/// !cdk-integ test-stack diff --git a/packages/@aws-cdk/integ-tests/lib/assertions/providers/lambda-handler/assertion.ts b/packages/@aws-cdk/integ-tests/lib/assertions/providers/lambda-handler/assertion.ts index fdb7bb04b7bdd..b8fba80266edb 100644 --- a/packages/@aws-cdk/integ-tests/lib/assertions/providers/lambda-handler/assertion.ts +++ b/packages/@aws-cdk/integ-tests/lib/assertions/providers/lambda-handler/assertion.ts @@ -30,7 +30,7 @@ export class AssertionHandler extends CustomResourceHandler s.node.path), }; } diff --git a/packages/@aws-cdk/integ-tests/test/assertions/providers/lambda-handler/assertion.test.ts b/packages/@aws-cdk/integ-tests/test/assertions/providers/lambda-handler/assertion.test.ts index 05740c33cc09b..0abda7d477de7 100644 --- a/packages/@aws-cdk/integ-tests/test/assertions/providers/lambda-handler/assertion.test.ts +++ b/packages/@aws-cdk/integ-tests/test/assertions/providers/lambda-handler/assertion.test.ts @@ -50,7 +50,7 @@ describe('AssertionHandler', () => { const response: AssertionResult = await handler.processEvent(request); // THEN - expect(response.data).toEqual('{"status":"pass"}'); + expect(response.data).toEqual('{"status":"success"}'); }); test('fail', async () => { @@ -95,7 +95,7 @@ describe('AssertionHandler', () => { const response: AssertionResult = await handler.processEvent(request); // THEN - expect(response.data).toEqual('{"status":"pass"}'); + expect(response.data).toEqual('{"status":"success"}'); }); test('fail', async () => { @@ -159,7 +159,7 @@ describe('AssertionHandler', () => { const response: AssertionResult = await handler.processEvent(request); // THEN - expect(response.data).toEqual('{"status":"pass"}'); + expect(response.data).toEqual('{"status":"success"}'); }); test('fail', async () => { @@ -209,7 +209,7 @@ describe('AssertionHandler', () => { const response: AssertionResult = await handler.processEvent(request); // THEN - expect(response.data).toEqual('{"status":"pass"}'); + expect(response.data).toEqual('{"status":"success"}'); }); test('string equals pass', async () => { @@ -224,7 +224,7 @@ describe('AssertionHandler', () => { const response: AssertionResult = await handler.processEvent(request); // THEN - expect(response.data).toEqual('{"status":"pass"}'); + expect(response.data).toEqual('{"status":"success"}'); }); test('fail', async () => { diff --git a/packages/@aws-cdk/integ-tests/test/manifest-synthesizer.test.ts b/packages/@aws-cdk/integ-tests/test/manifest-synthesizer.test.ts index 6d69140cd47e9..7c448b7467a52 100644 --- a/packages/@aws-cdk/integ-tests/test/manifest-synthesizer.test.ts +++ b/packages/@aws-cdk/integ-tests/test/manifest-synthesizer.test.ts @@ -45,10 +45,12 @@ describe(IntegManifestSynthesizer, () => { testCases: { ['stack/case1']: { assertionStack: 'stack/case1/DeployAssert', + assertionStackName: 'stackcase1DeployAssert491B3C7C', stacks: ['stack-under-test-1'], }, ['stack/case2']: { assertionStack: 'stack/case2/DeployAssert', + assertionStackName: 'stackcase2DeployAssert3B5E6392', stacks: ['stack-under-test-2'], }, }, @@ -73,6 +75,7 @@ describe(IntegManifestSynthesizer, () => { testCases: { ['Integ/DefaultTest']: { assertionStack: 'Integ/DefaultTest/DeployAssert', + assertionStackName: 'IntegDefaultTestDeployAssert4E6713E1', stacks: ['stack'], }, }, @@ -100,10 +103,12 @@ describe(IntegManifestSynthesizer, () => { testCases: { ['Integ/DefaultTest']: { assertionStack: 'Integ/DefaultTest/DeployAssert', + assertionStackName: 'IntegDefaultTestDeployAssert4E6713E1', stacks: ['stack'], }, ['Case/CaseTestCase']: { assertionStack: 'Case/CaseTestCase/DeployAssert', + assertionStackName: 'CaseCaseTestCaseDeployAssertF0B5763D', diffAssets: true, stacks: ['Case'], }, diff --git a/packages/@aws-cdk/lambda-layer-awscli/layer/requirements.txt b/packages/@aws-cdk/lambda-layer-awscli/layer/requirements.txt index c11c62b2004e6..b122685ccd4c1 100644 --- a/packages/@aws-cdk/lambda-layer-awscli/layer/requirements.txt +++ b/packages/@aws-cdk/lambda-layer-awscli/layer/requirements.txt @@ -1 +1 @@ -awscli==1.25.58 +awscli==1.25.62 diff --git a/packages/aws-cdk-lib/README.md b/packages/aws-cdk-lib/README.md index d211e0067b8e5..63be77ed01bbb 100644 --- a/packages/aws-cdk-lib/README.md +++ b/packages/aws-cdk-lib/README.md @@ -852,6 +852,9 @@ can be accessed from the `Fn` class, which provides type-safe methods for each intrinsic function as well as condition expressions: ```ts +declare const myObjectOrArray: any; +declare const myArray: any; + // To use Fn::Base64 Fn.base64('SGVsbG8gQ0RLIQo='); @@ -863,6 +866,12 @@ Fn.conditionAnd( // The AWS::Region pseudo-parameter value is NOT equal to "us-east-1" Fn.conditionNot(Fn.conditionEquals('us-east-1', Aws.REGION)), ); + +// To use Fn::ToJsonString +Fn.toJsonString(myObjectOrArray); + +// To use Fn::Length +Fn.len(Fn.split(',', myArray)); ``` When working with deploy-time values (those for which `Token.isUnresolved` diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 14a7dfd9f24e3..875b7d872789b 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -361,7 +361,7 @@ "@types/fs-extra": "^8.1.2", "@types/node": "^14.18.26", "constructs": "^10.0.0", - "esbuild": "^0.15.5", + "esbuild": "^0.15.6", "fs-extra": "^9.1.0", "ts-node": "^9.1.1", "typescript": "~3.8.3" diff --git a/packages/aws-cdk/THIRD_PARTY_LICENSES b/packages/aws-cdk/THIRD_PARTY_LICENSES index bd7fe98a0d1c5..a9900d6b86fa7 100644 --- a/packages/aws-cdk/THIRD_PARTY_LICENSES +++ b/packages/aws-cdk/THIRD_PARTY_LICENSES @@ -1,6 +1,6 @@ The aws-cdk package includes the following third-party software/licensing: -** @jsii/check-node@1.65.1 - https://www.npmjs.com/package/@jsii/check-node/v/1.65.1 | Apache-2.0 +** @jsii/check-node@1.66.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.66.0 | Apache-2.0 jsii Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -268,7 +268,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1205.0 - https://www.npmjs.com/package/aws-sdk/v/2.1205.0 | Apache-2.0 +** aws-sdk@2.1206.0 - https://www.npmjs.com/package/aws-sdk/v/2.1206.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index 4d12e2613d237..884e39bf001c0 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -930,7 +930,7 @@ interface WatchOptions extends Omit { readonly traceLogs?: boolean; /** - * Maximum number of simulatenous deployments (dependency permitting) to execute. + * Maximum number of simultaneous deployments (dependency permitting) to execute. * The default is '1', which executes all deployments serially. * * @default 1 @@ -1009,7 +1009,7 @@ export interface DeployOptions extends CfnDeployOptions, WatchOptions { readonly cloudWatchLogMonitor?: CloudWatchLogEventMonitor; /** - * Maximum number of simulatenous deployments (dependency permitting) to execute. + * Maximum number of simultaneous deployments (dependency permitting) to execute. * The default is '1', which executes all deployments serially. * * @default 1 diff --git a/packages/aws-cdk/lib/cli.ts b/packages/aws-cdk/lib/cli.ts index 94fa333b41009..28fd01f308e39 100644 --- a/packages/aws-cdk/lib/cli.ts +++ b/packages/aws-cdk/lib/cli.ts @@ -147,7 +147,7 @@ async function parseCommandLineArguments() { "'true' by default, use --no-logs to turn off. " + "Only in effect if specified alongside the '--watch' option", }) - .option('concurrency', { type: 'number', desc: 'Maximum number of simulatenous deployments (dependency permitting) to execute.', default: 1, requiresArg: true }), + .option('concurrency', { type: 'number', desc: 'Maximum number of simultaneous deployments (dependency permitting) to execute.', default: 1, requiresArg: true }), ) .command('import [STACK]', 'Import existing resource(s) into the given STACK', (yargs: Argv) => yargs .option('execute', { type: 'boolean', desc: 'Whether to execute ChangeSet (--no-execute will NOT execute the ChangeSet)', default: true }) @@ -217,7 +217,7 @@ async function parseCommandLineArguments() { desc: 'Show CloudWatch log events from all resources in the selected Stacks in the terminal. ' + "'true' by default, use --no-logs to turn off", }) - .option('concurrency', { type: 'number', desc: 'Maximum number of simulatenous deployments (dependency permitting) to execute.', default: 1, requiresArg: true }), + .option('concurrency', { type: 'number', desc: 'Maximum number of simultaneous deployments (dependency permitting) to execute.', default: 1, requiresArg: true }), ) .command('destroy [STACKS..]', 'Destroy the stack(s) named STACKS', (yargs: Argv) => yargs .option('all', { type: 'boolean', default: false, desc: 'Destroy all available stacks' }) diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 731bc6f3c7b7b..d161ef35d56db 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -95,7 +95,7 @@ "@aws-cdk/cloudformation-diff": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "@jsii/check-node": "1.65.1", + "@jsii/check-node": "1.66.0", "archiver": "^5.3.1", "aws-sdk": "^2.1093.0", "camelcase": "^6.3.0", diff --git a/packages/awslint/package.json b/packages/awslint/package.json index 849ab3ef769c6..823db28b11d50 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -18,11 +18,11 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "^1.65.1", + "@jsii/spec": "^1.66.0", "camelcase": "^6.3.0", "chalk": "^4", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.65.1", + "jsii-reflect": "^1.66.0", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/cdk-cli-wrapper/lib/cdk-wrapper.ts b/packages/cdk-cli-wrapper/lib/cdk-wrapper.ts index feff205db1001..db9b559062226 100644 --- a/packages/cdk-cli-wrapper/lib/cdk-wrapper.ts +++ b/packages/cdk-cli-wrapper/lib/cdk-wrapper.ts @@ -1,4 +1,4 @@ -import { DefaultCdkOptions, DeployOptions, DestroyOptions, SynthOptions, ListOptions } from './commands'; +import { DefaultCdkOptions, DeployOptions, DestroyOptions, SynthOptions, ListOptions, StackActivityProgress } from './commands'; import { exec } from './utils'; /** @@ -161,6 +161,7 @@ export class CdkCliWrapper implements ICdk { ...options.requireApproval ? ['--require-approval', options.requireApproval] : [], ...options.changeSetName ? ['--change-set-name', options.changeSetName] : [], ...options.toolkitStackName ? ['--toolkit-stack-name', options.toolkitStackName] : [], + ...options.progress ? ['--progress', options.progress] : ['--progress', StackActivityProgress.EVENTS], ...this.createDefaultArguments(options), ]; diff --git a/packages/cdk-cli-wrapper/lib/commands/deploy.ts b/packages/cdk-cli-wrapper/lib/commands/deploy.ts index 09a20c610f12d..6d05f0d9f1e6d 100644 --- a/packages/cdk-cli-wrapper/lib/commands/deploy.ts +++ b/packages/cdk-cli-wrapper/lib/commands/deploy.ts @@ -94,4 +94,30 @@ export interface DeployOptions extends DefaultCdkOptions { * @default false */ readonly ci?: boolean; + + /** + * Display mode for stack activity events + * + * The default in the CLI is StackActivityProgress.BAR, but + * since the cli-wrapper will most likely be run in automation it makes + * more sense to set the default to StackActivityProgress.EVENTS + * + * @default StackActivityProgress.EVENTS + */ + readonly progress?: StackActivityProgress; +} + +/** + * Supported display modes for stack deployment activity + */ +export enum StackActivityProgress { + /** + * Displays a progress bar with only the events for the resource currently being deployed + */ + BAR = 'bar', + + /** + * Displays complete history with all CloudFormation stack events + */ + EVENTS = 'events', } diff --git a/packages/cdk-cli-wrapper/test/cdk-wrapper.test.ts b/packages/cdk-cli-wrapper/test/cdk-wrapper.test.ts index 91c6871e0ec81..c16e94d069b07 100644 --- a/packages/cdk-cli-wrapper/test/cdk-wrapper.test.ts +++ b/packages/cdk-cli-wrapper/test/cdk-wrapper.test.ts @@ -1,6 +1,6 @@ import * as child_process from 'child_process'; import { CdkCliWrapper } from '../lib/cdk-wrapper'; -import { RequireApproval } from '../lib/commands'; +import { RequireApproval, StackActivityProgress } from '../lib/commands'; let spawnSyncMock: jest.SpyInstance; beforeEach(() => { @@ -33,7 +33,7 @@ test('default deploy', () => { // THEN expect(spawnSyncMock).toHaveBeenCalledWith( expect.stringMatching(/cdk/), - ['deploy', '--app', 'node bin/my-app.js', 'test-stack1'], + ['deploy', '--progress', 'events', '--app', 'node bin/my-app.js', 'test-stack1'], expect.objectContaining({ env: expect.anything(), cwd: '/project', @@ -82,6 +82,7 @@ test('deploy with all arguments', () => { toolkitStackName: 'Toolkit', versionReporting: true, usePreviousParameters: true, + progress: StackActivityProgress.BAR, }); // THEN @@ -120,6 +121,7 @@ test('deploy with all arguments', () => { '--change-set-name', 'my-change-set', '--toolkit-stack-name', 'Toolkit', '--previous-parameters', + '--progress', 'bar', '--app', 'node bin/my-app.js', 'test-stack1', @@ -149,6 +151,7 @@ test('can parse boolean arguments', () => { expect.stringMatching(/cdk/), [ 'deploy', + '--progress', 'events', '--app', 'node bin/my-app.js', '--json', @@ -184,6 +187,7 @@ test('can parse parameters', () => { 'deploy', '--parameters', 'myparam=test', '--parameters', 'test-stack1:myotherparam=test', + '--progress', 'events', '--app', 'node bin/my-app.js', 'test-stack1', @@ -214,6 +218,7 @@ test('can parse context', () => { expect.stringMatching(/cdk/), [ 'deploy', + '--progress', 'events', '--app', 'node bin/my-app.js', '--context', 'myContext=value', @@ -248,6 +253,7 @@ test('can parse array arguments', () => { 'deploy', '--notification-arns', 'arn:aws:us-east-1:1111111111:some:resource', '--notification-arns', 'arn:aws:us-east-1:1111111111:some:other-resource', + '--progress', 'events', '--app', 'node bin/my-app.js', 'test-stack1', @@ -275,7 +281,7 @@ test('can provide additional environment', () => { // THEN expect(spawnSyncMock).toHaveBeenCalledWith( expect.stringMatching(/cdk/), - ['deploy', '--app', 'node bin/my-app.js', 'test-stack1'], + ['deploy', '--progress', 'events', '--app', 'node bin/my-app.js', 'test-stack1'], expect.objectContaining({ env: expect.objectContaining({ KEY: 'value', diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index 9e1b2de8e5449..a1c1f2a8f41ef 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -30,7 +30,7 @@ }, "license": "Apache-2.0", "dependencies": { - "codemaker": "^1.65.1", + "codemaker": "^1.66.0", "yaml": "1.10.2" }, "devDependencies": { diff --git a/tools/@aws-cdk/cdk-build-tools/package.json b/tools/@aws-cdk/cdk-build-tools/package.json index 53c5d8e4356e5..8ba36312755f7 100644 --- a/tools/@aws-cdk/cdk-build-tools/package.json +++ b/tools/@aws-cdk/cdk-build-tools/package.json @@ -57,9 +57,9 @@ "fs-extra": "^9.1.0", "jest": "^27.5.1", "jest-junit": "^13.2.0", - "jsii": "^1.65.1", - "jsii-pacmak": "^1.65.1", - "jsii-reflect": "^1.65.1", + "jsii": "^1.66.0", + "jsii-pacmak": "^1.66.0", + "jsii-reflect": "^1.66.0", "markdownlint-cli": "^0.32.2", "nyc": "^15.1.0", "semver": "^7.3.7", diff --git a/tools/@aws-cdk/cfn2ts/package.json b/tools/@aws-cdk/cfn2ts/package.json index ab686024c022f..92014e5210e0f 100644 --- a/tools/@aws-cdk/cfn2ts/package.json +++ b/tools/@aws-cdk/cfn2ts/package.json @@ -32,7 +32,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-cdk/cfnspec": "0.0.0", - "codemaker": "^1.65.1", + "codemaker": "^1.66.0", "fast-json-patch": "^3.1.1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" diff --git a/tools/@aws-cdk/node-bundle/package.json b/tools/@aws-cdk/node-bundle/package.json index 50f947a6c8a31..931d081840840 100644 --- a/tools/@aws-cdk/node-bundle/package.json +++ b/tools/@aws-cdk/node-bundle/package.json @@ -40,13 +40,13 @@ "jest-junit": "^13", "json-schema": "^0.4.0", "npm-check-updates": "^12", - "projen": "^0.61.33", + "projen": "^0.61.37", "standard-version": "^9", "ts-jest": "^27", "typescript": "^4.5.5" }, "dependencies": { - "esbuild": "^0.15.5", + "esbuild": "^0.15.6", "fs-extra": "^10.1.0", "license-checker": "^25.0.1", "madge": "^5.0.1", diff --git a/version.v2.json b/version.v2.json index 16fdb647e798d..35a6cf30c0ef3 100644 --- a/version.v2.json +++ b/version.v2.json @@ -1,4 +1,4 @@ { - "version": "2.39.1", - "alphaVersion": "2.39.1-alpha.0" + "version": "2.40.0", + "alphaVersion": "2.40.0-alpha.0" } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 08bbd25cd12ff..f2c9506459b7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -340,10 +340,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@esbuild/linux-loong64@0.15.5": - version "0.15.5" - resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.5.tgz#91aef76d332cdc7c8942b600fa2307f3387e6f82" - integrity sha512-UHkDFCfSGTuXq08oQltXxSZmH1TXyWsL+4QhZDWvvLl6mEJQqk3u7/wq1LjhrrAXYIllaTtRSzUXl4Olkf2J8A== +"@esbuild/linux-loong64@0.15.6": + version "0.15.6" + resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.6.tgz#45be4184f00e505411bc265a05e709764114acd8" + integrity sha512-hqmVU2mUjH6J2ZivHphJ/Pdse2ZD+uGCHK0uvsiLDk/JnSedEVj77CiVUnbMKuU4tih1TZZL8tG9DExQg/GZsw== "@eslint/eslintrc@^0.4.3": version "0.4.3" @@ -667,18 +667,18 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jsii/check-node@1.65.1": - version "1.65.1" - resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.65.1.tgz#f2bc117ab704488d712d6a853ab830aee51bdc03" - integrity sha512-w4ErL8aQy/4hY4AlDVX4vf6k05pd0ZvFQH2qAQj0bk0b22uBaufRF3BO6+TlJFfwyIFVxT32npFkGC/9pbtFhA== +"@jsii/check-node@1.66.0": + version "1.66.0" + resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.66.0.tgz#df8472efad9e436097461bbca89d514a4677634b" + integrity sha512-UVEH+23fTkjJux2DCzDMJFjmEAMwGSpiiMW7xPAYNO8F/sjGE8VkRB847twJi9SX3sJZNIYa3lcEQpQ1Hr92Yg== dependencies: chalk "^4.1.2" semver "^7.3.7" -"@jsii/spec@1.65.1", "@jsii/spec@^1.64.0", "@jsii/spec@^1.65.1": - version "1.65.1" - resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.65.1.tgz#8d0bfe27a0b0b1238e4af7c7cce3f95393dbf0a8" - integrity sha512-jHSrhQ0cdZP0NuBWQAI8EnDXOxbI5LH8jdRS09OX2d96n8H3bn2Gor1LV2YuFzabF8S96tjKJFAogf8UdGaH+A== +"@jsii/spec@1.66.0", "@jsii/spec@^1.64.0", "@jsii/spec@^1.66.0": + version "1.66.0" + resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.66.0.tgz#cada7b01c8ab48cb5340c98e60f7d357eefa4b6b" + integrity sha512-xY8/viaIpzPmr5APKgXQ6TkUsEhYFcp/pjUQmLqVnS4MssS8uETfhUvtNgGe/lsJoEUnqF8N+DLsHeCS/ad43w== dependencies: ajv "^8.11.0" @@ -1820,9 +1820,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.18.0" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.0.tgz#8134fd78cb39567465be65b9fdc16d378095f41f" - integrity sha512-v4Vwdko+pgymgS+A2UIaJru93zQd85vIGWObM5ekZNdXCKtDYqATlEYnWgfo86Q6I1Lh0oXnksDnMU1cwmlPDw== + version "7.18.1" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.1.tgz#ce5e2c8c272b99b7a9fd69fa39f0b4cd85028bd9" + integrity sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA== dependencies: "@babel/types" "^7.3.0" @@ -1858,7 +1858,15 @@ dependencies: "@types/node" "*" -"@types/glob@*", "@types/glob@^7.2.0": +"@types/glob@*": + version "8.0.0" + resolved "https://registry.npmjs.org/@types/glob/-/glob-8.0.0.tgz#321607e9cbaec54f687a0792b2d1d370739455d2" + integrity sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA== + dependencies: + "@types/minimatch" "*" + "@types/node" "*" + +"@types/glob@^7.2.0": version "7.2.0" resolved "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== @@ -1946,9 +1954,9 @@ integrity sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q== "@types/minimatch@*": - version "5.1.0" - resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.0.tgz#c3018161691376002f8a22ebb87f341e0dba3219" - integrity sha512-0RJHq5FqDWo17kdHe+SMDJLfxmLaqHbWnqZ6gNKzDvStUlrmx/eKIY17+ifLS1yybo7X86aUshQMlittDOVNnw== + version "5.1.1" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.1.tgz#b1429c0c016cd50e105f3166bf179f6918b7365f" + integrity sha512-v55NF6Dz0wrj14Rn8iEABTWrhYRmgkJYuokduunSiq++t3hZ9VZ6dvcDt+850Pm5sGJZk8RaHzkFCXPxVINZ+g== "@types/minimatch@^3.0.3", "@types/minimatch@^3.0.5": version "3.0.5" @@ -1973,9 +1981,9 @@ integrity sha512-uv53RrNdhbkV/3VmVCtfImfYCWC3GTTRn3R11Whni3EJ+gb178tkZBVNj2edLY5CMrB749dQi+SJkg87jsN8UQ== "@types/node@*", "@types/node@>= 8": - version "18.7.13" - resolved "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz#23e6c5168333480d454243378b69e861ab5c011a" - integrity sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw== + version "18.7.14" + resolved "https://registry.npmjs.org/@types/node/-/node-18.7.14.tgz#0fe081752a3333392d00586d815485a17c2cf3c9" + integrity sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA== "@types/node@^14.18.26": version "14.18.26" @@ -2130,13 +2138,13 @@ tsutils "^3.21.0" "@typescript-eslint/eslint-plugin@^5": - version "5.35.1" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.35.1.tgz#0d822bfea7469904dfc1bb8f13cabd362b967c93" - integrity sha512-RBZZXZlI4XCY4Wzgy64vB+0slT9+yAPQRjj/HSaRwUot33xbDjF1oN9BLwOLTewoOI0jothIltZRe9uJCHf8gg== + version "5.36.1" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.1.tgz#471f64dc53600025e470dad2ca4a9f2864139019" + integrity sha512-iC40UK8q1tMepSDwiLbTbMXKDxzNy+4TfPWgIL661Ym0sD42vRcQU93IsZIrmi+x292DBr60UI/gSwfdVYexCA== dependencies: - "@typescript-eslint/scope-manager" "5.35.1" - "@typescript-eslint/type-utils" "5.35.1" - "@typescript-eslint/utils" "5.35.1" + "@typescript-eslint/scope-manager" "5.36.1" + "@typescript-eslint/type-utils" "5.36.1" + "@typescript-eslint/utils" "5.36.1" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -2167,13 +2175,13 @@ debug "^4.3.1" "@typescript-eslint/parser@^5": - version "5.35.1" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.35.1.tgz#bf2ee2ebeaa0a0567213748243fb4eec2857f04f" - integrity sha512-XL2TBTSrh3yWAsMYpKseBYTVpvudNf69rPOWXWVBI08My2JVT5jR66eTt4IgQFHA/giiKJW5dUD4x/ZviCKyGg== + version "5.36.1" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.36.1.tgz#931c22c7bacefd17e29734628cdec8b2acdcf1ce" + integrity sha512-/IsgNGOkBi7CuDfUbwt1eOqUXF9WGVBW9dwEe1pi+L32XrTsZIgmDFIi2RxjzsvB/8i+MIf5JIoTEH8LOZ368A== dependencies: - "@typescript-eslint/scope-manager" "5.35.1" - "@typescript-eslint/types" "5.35.1" - "@typescript-eslint/typescript-estree" "5.35.1" + "@typescript-eslint/scope-manager" "5.36.1" + "@typescript-eslint/types" "5.36.1" + "@typescript-eslint/typescript-estree" "5.36.1" debug "^4.3.4" "@typescript-eslint/scope-manager@4.33.0": @@ -2184,20 +2192,21 @@ "@typescript-eslint/types" "4.33.0" "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/scope-manager@5.35.1": - version "5.35.1" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.35.1.tgz#ccb69d54b7fd0f2d0226a11a75a8f311f525ff9e" - integrity sha512-kCYRSAzIW9ByEIzmzGHE50NGAvAP3wFTaZevgWva7GpquDyFPFcmvVkFJGWJJktg/hLwmys/FZwqM9EKr2u24Q== +"@typescript-eslint/scope-manager@5.36.1": + version "5.36.1" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.36.1.tgz#23c49b7ddbcffbe09082e6694c2524950766513f" + integrity sha512-pGC2SH3/tXdu9IH3ItoqciD3f3RRGCh7hb9zPdN2Drsr341zgd6VbhP5OHQO/reUqihNltfPpMpTNihFMarP2w== dependencies: - "@typescript-eslint/types" "5.35.1" - "@typescript-eslint/visitor-keys" "5.35.1" + "@typescript-eslint/types" "5.36.1" + "@typescript-eslint/visitor-keys" "5.36.1" -"@typescript-eslint/type-utils@5.35.1": - version "5.35.1" - resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.35.1.tgz#d50903b56758c5c8fc3be52b3be40569f27f9c4a" - integrity sha512-8xT8ljvo43Mp7BiTn1vxLXkjpw8wS4oAc00hMSB4L1/jIiYbjjnc3Qp2GAUOG/v8zsNCd1qwcqfCQ0BuishHkw== +"@typescript-eslint/type-utils@5.36.1": + version "5.36.1" + resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.36.1.tgz#016fc2bff6679f54c0b2df848a493f0ca3d4f625" + integrity sha512-xfZhfmoQT6m3lmlqDvDzv9TiCYdw22cdj06xY0obSznBsT///GK5IEZQdGliXpAOaRL34o8phEvXzEo/VJx13Q== dependencies: - "@typescript-eslint/utils" "5.35.1" + "@typescript-eslint/typescript-estree" "5.36.1" + "@typescript-eslint/utils" "5.36.1" debug "^4.3.4" tsutils "^3.21.0" @@ -2206,10 +2215,10 @@ resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/types@5.35.1": - version "5.35.1" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.35.1.tgz#af355fe52a0cc88301e889bc4ada72f279b63d61" - integrity sha512-FDaujtsH07VHzG0gQ6NDkVVhi1+rhq0qEvzHdJAQjysN+LHDCKDKCBRlZFFE0ec0jKxiv0hN63SNfExy0KrbQQ== +"@typescript-eslint/types@5.36.1": + version "5.36.1" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.36.1.tgz#1cf0e28aed1cb3ee676917966eb23c2f8334ce2c" + integrity sha512-jd93ShpsIk1KgBTx9E+hCSEuLCUFwi9V/urhjOWnOaksGZFbTOxAT47OH2d4NLJnLhkVD+wDbB48BuaycZPLBg== "@typescript-eslint/typescript-estree@4.33.0", "@typescript-eslint/typescript-estree@^4.33.0": version "4.33.0" @@ -2224,28 +2233,28 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.35.1": - version "5.35.1" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.35.1.tgz#db878a39a0dbdc9bb133f11cdad451770bfba211" - integrity sha512-JUqE1+VRTGyoXlDWWjm6MdfpBYVq+hixytrv1oyjYIBEOZhBCwtpp5ZSvBt4wIA1MKWlnaC2UXl2XmYGC3BoQA== +"@typescript-eslint/typescript-estree@5.36.1": + version "5.36.1" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.1.tgz#b857f38d6200f7f3f4c65cd0a5afd5ae723f2adb" + integrity sha512-ih7V52zvHdiX6WcPjsOdmADhYMDN15SylWRZrT2OMy80wzKbc79n8wFW0xpWpU0x3VpBz/oDgTm2xwDAnFTl+g== dependencies: - "@typescript-eslint/types" "5.35.1" - "@typescript-eslint/visitor-keys" "5.35.1" + "@typescript-eslint/types" "5.36.1" + "@typescript-eslint/visitor-keys" "5.36.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.35.1": - version "5.35.1" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.35.1.tgz#ae1399afbfd6aa7d0ed1b7d941e9758d950250eb" - integrity sha512-v6F8JNXgeBWI4pzZn36hT2HXXzoBBBJuOYvoQiaQaEEjdi5STzux3Yj8v7ODIpx36i/5s8TdzuQ54TPc5AITQQ== +"@typescript-eslint/utils@5.36.1": + version "5.36.1" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.36.1.tgz#136d5208cc7a3314b11c646957f8f0b5c01e07ad" + integrity sha512-lNj4FtTiXm5c+u0pUehozaUWhh7UYKnwryku0nxJlYUEWetyG92uw2pr+2Iy4M/u0ONMKzfrx7AsGBTCzORmIg== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.35.1" - "@typescript-eslint/types" "5.35.1" - "@typescript-eslint/typescript-estree" "5.35.1" + "@typescript-eslint/scope-manager" "5.36.1" + "@typescript-eslint/types" "5.36.1" + "@typescript-eslint/typescript-estree" "5.36.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -2257,12 +2266,12 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@5.35.1": - version "5.35.1" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.35.1.tgz#285e9e34aed7c876f16ff646a3984010035898e6" - integrity sha512-cEB1DvBVo1bxbW/S5axbGPE6b7FIMAbo3w+AGq6zNDA7+NYJOIkKj/sInfTv4edxd4PxJSgdN4t6/pbvgA+n5g== +"@typescript-eslint/visitor-keys@5.36.1": + version "5.36.1" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.1.tgz#7731175312d65738e501780f923896d200ad1615" + integrity sha512-ojB9aRyRFzVMN3b5joSYni6FAS10BBSCAfKJhjJAV08t/a95aM6tAhz+O1jF+EtgxktuSO3wJysp2R+Def/IWQ== dependencies: - "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/types" "5.36.1" eslint-visitor-keys "^3.3.0" "@xmldom/xmldom@^0.8.2": @@ -2661,9 +2670,9 @@ aws-sdk-mock@5.6.0: traverse "^0.6.6" aws-sdk@^2.1093.0, aws-sdk@^2.596.0, aws-sdk@^2.848.0, aws-sdk@^2.928.0: - version "2.1205.0" - resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1205.0.tgz#606d9317c57c7ec18ab3f89a5c856185fc107fd1" - integrity sha512-L/ndK2cwWfj1peFO1cMtXeey7rMrbE3bksiQjaa96TZi9C70qMYqhrBy4XKok1AC84dcTsHrEOjFTFWr8rvmdg== + version "2.1206.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1206.0.tgz#8c5ed249952fb86b29cb4cf037e03b3136247341" + integrity sha512-rQckMXO+O1j7RxuC9Ic6+OjroLm4t9vYHCubSeSEj8bJCFEh/1aRO1eiMHcLGhI4jl3LijfTCX56YZJjDp2PdQ== dependencies: buffer "4.9.2" events "1.1.1" @@ -3031,9 +3040,9 @@ camelcase@^6.2.0, camelcase@^6.3.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001370: - version "1.0.30001384" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001384.tgz#029527c2d781a3cfef13fa63b3a78a6088e35973" - integrity sha512-BBWt57kqWbc0GYZXb47wTXpmAgqr5LSibPzNjk/AWMdmJMQhLqOl3c/Kd4OAU/tu4NLfYkMx8Tlq3RVBkOBolQ== + version "1.0.30001387" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001387.tgz#90d2b9bdfcc3ab9a5b9addee00a25ef86c9e2e1e" + integrity sha512-fKDH0F1KOJvR+mWSOvhj8lVRr/Q/mc5u5nabU2vi1/sgvlSqEsE8dOq0Hy/BqVbDkCYQPRRHB1WRjW6PGB/7PA== case@1.6.3, case@^1.6.3: version "1.6.3" @@ -3065,10 +3074,10 @@ cdk8s-plus-21@^2.0.0-beta.12: minimatch "^3.1.2" safe-stable-stringify "*" -cdk8s@^2.4.14: - version "2.4.14" - resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.4.14.tgz#3b78f41bafb8bf11bb2ad919d66637586e55399f" - integrity sha512-H/cZE3fX6gl0bgxb/dt0ITOjfwmdY1/Yz6tctVnJqMUkuIjC2JBB5BXPwxBBO7E0YTIOWhyoVV51j/dij6+/cg== +cdk8s@^2.4.17: + version "2.4.17" + resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.4.17.tgz#377a76f13c2783d4e0b6721004247c7b3cef698d" + integrity sha512-zxMwRlWfSIkqLnRvbsmQTuVuz71kAAI+SgD5flwjjTf2ClYvxgfJsc9tJvLKHu8KloeYPS6NBem7Y3hUi5Yh3A== dependencies: fast-json-patch "^3.1.1" follow-redirects "^1.15.1" @@ -3260,10 +3269,10 @@ co@^4.6.0: resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -codemaker@^1.65.1: - version "1.65.1" - resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.65.1.tgz#4c2b205d660e1f8197a1d5da521cb98a624bd847" - integrity sha512-JsNZFa7gWtlu+Ld1qU3g8o3dJmDg2ZZCYRU1ORo8U/rFTlkYvo8x+IEos5nBnrAAkUlVqCmAMfVEaaXSlaHPww== +codemaker@^1.66.0: + version "1.66.0" + resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.66.0.tgz#834158b43beabfed15069e7b19a689f4390a8711" + integrity sha512-GSNazNdimFf5/hnY9dZUiAX67SM8erRkwcynQgw7v1yeoytrkenQ1253sbdY2XqOpwa2G3i/f9zzDr0kwVykuw== dependencies: camelcase "^6.3.0" decamelize "^5.0.1" @@ -3412,9 +3421,9 @@ console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control- integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== constructs@^10.0.0: - version "10.1.90" - resolved "https://registry.npmjs.org/constructs/-/constructs-10.1.90.tgz#d137be1933ea8904ea84de36d9ddde8224a2c55a" - integrity sha512-Ml8OpG1TheafXy4tYW2NhIc9T7gkMK0vQnd3JyhA69+8PUD834EjZznbzyYLaAplwNjn2p32t58bkgzPeLTrRg== + version "10.1.92" + resolved "https://registry.npmjs.org/constructs/-/constructs-10.1.92.tgz#3341afb381c3127a3ff52517fbafaf1c4fcd3db8" + integrity sha512-ksULq4jw2mQyWGBJoxVktwhwsIkkWZFoxeCsWbiB9dt1hkXbK6z18R7FRsS/Ku7h6eGZo+odi699zC9hfZhvTg== conventional-changelog-angular@^5.0.12: version "5.0.13" @@ -4127,9 +4136,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.202: - version "1.4.233" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.233.tgz#aa142e45468bda111b88abc9cc59d573b75d6a60" - integrity sha512-ejwIKXTg1wqbmkcRJh9Ur3hFGHFDZDw1POzdsVrB2WZjgRuRMHIQQKNpe64N/qh3ZtH2otEoRoS+s6arAAuAAw== + version "1.4.237" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.237.tgz#c695c5fedc3bb48f04ba1b39470c5aef2aaafd84" + integrity sha512-vxVyGJcsgArNOVUJcXm+7iY3PJAfmSapEszQD1HbyPLl0qoCmNQ1o/EX3RI7Et5/88In9oLxX3SGF8J3orkUgA== emittery@^0.8.1: version "0.8.1" @@ -4293,132 +4302,132 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -esbuild-android-64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.5.tgz#3c7b2f2a59017dab3f2c0356188a8dd9cbdc91c8" - integrity sha512-dYPPkiGNskvZqmIK29OPxolyY3tp+c47+Fsc2WYSOVjEPWNCHNyqhtFqQadcXMJDQt8eN0NMDukbyQgFcHquXg== - -esbuild-android-arm64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.5.tgz#e301db818c5a67b786bf3bb7320e414ac0fcf193" - integrity sha512-YyEkaQl08ze3cBzI/4Cm1S+rVh8HMOpCdq8B78JLbNFHhzi4NixVN93xDrHZLztlocEYqi45rHHCgA8kZFidFg== - -esbuild-darwin-64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.5.tgz#11726de5d0bf5960b92421ef433e35871c091f8d" - integrity sha512-Cr0iIqnWKx3ZTvDUAzG0H/u9dWjLE4c2gTtRLz4pqOBGjfjqdcZSfAObFzKTInLLSmD0ZV1I/mshhPoYSBMMCQ== - -esbuild-darwin-arm64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.5.tgz#ad89dafebb3613fd374f5a245bb0ce4132413997" - integrity sha512-WIfQkocGtFrz7vCu44ypY5YmiFXpsxvz2xqwe688jFfSVCnUsCn2qkEVDo7gT8EpsLOz1J/OmqjExePL1dr1Kg== - -esbuild-freebsd-64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.5.tgz#6bfb52b4a0d29c965aa833e04126e95173289c8a" - integrity sha512-M5/EfzV2RsMd/wqwR18CELcenZ8+fFxQAAEO7TJKDmP3knhWSbD72ILzrXFMMwshlPAS1ShCZ90jsxkm+8FlaA== - -esbuild-freebsd-arm64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.5.tgz#38a3fed8c6398072f9914856c7c3e3444f9ef4dd" - integrity sha512-2JQQ5Qs9J0440F/n/aUBNvY6lTo4XP/4lt1TwDfHuo0DY3w5++anw+jTjfouLzbJmFFiwmX7SmUhMnysocx96w== - -esbuild-linux-32@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.5.tgz#942dc70127f0c0a7ea91111baf2806e61fc81b32" - integrity sha512-gO9vNnIN0FTUGjvTFucIXtBSr1Woymmx/aHQtuU+2OllGU6YFLs99960UD4Dib1kFovVgs59MTXwpFdVoSMZoQ== - -esbuild-linux-64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.5.tgz#6d748564492d5daaa7e62420862c31ac3a44aed9" - integrity sha512-ne0GFdNLsm4veXbTnYAWjbx3shpNKZJUd6XpNbKNUZaNllDZfYQt0/zRqOg0sc7O8GQ+PjSMv9IpIEULXVTVmg== - -esbuild-linux-arm64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.5.tgz#28cd899beb2d2b0a3870fd44f4526835089a318d" - integrity sha512-7EgFyP2zjO065XTfdCxiXVEk+f83RQ1JsryN1X/VSX2li9rnHAt2swRbpoz5Vlrl6qjHrCmq5b6yxD13z6RheA== - -esbuild-linux-arm@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.5.tgz#6441c256225564d8794fdef5b0a69bc1a43051b5" - integrity sha512-wvAoHEN+gJ/22gnvhZnS/+2H14HyAxM07m59RSLn3iXrQsdS518jnEWRBnJz3fR6BJa+VUTo0NxYjGaNt7RA7Q== - -esbuild-linux-mips64le@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.5.tgz#d4927f817290eaffc062446896b2a553f0e11981" - integrity sha512-KdnSkHxWrJ6Y40ABu+ipTZeRhFtc8dowGyFsZY5prsmMSr1ZTG9zQawguN4/tunJ0wy3+kD54GaGwdcpwWAvZQ== - -esbuild-linux-ppc64le@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.5.tgz#b6d660dc6d5295f89ac51c675f1a2f639e2fb474" - integrity sha512-QdRHGeZ2ykl5P0KRmfGBZIHmqcwIsUKWmmpZTOq573jRWwmpfRmS7xOhmDHBj9pxv+6qRMH8tLr2fe+ZKQvCYw== - -esbuild-linux-riscv64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.5.tgz#2801bf18414dc3d3ad58d1ea83084f00d9d84896" - integrity sha512-p+WE6RX+jNILsf+exR29DwgV6B73khEQV0qWUbzxaycxawZ8NE0wA6HnnTxbiw5f4Gx9sJDUBemh9v49lKOORA== - -esbuild-linux-s390x@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.5.tgz#12a634ae6d3384cacc2b8f4201047deafe596eae" - integrity sha512-J2ngOB4cNzmqLHh6TYMM/ips8aoZIuzxJnDdWutBw5482jGXiOzsPoEF4j2WJ2mGnm7FBCO4StGcwzOgic70JQ== - -esbuild-netbsd-64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.5.tgz#951bbf87600512dfcfbe3b8d9d117d684d26c1b8" - integrity sha512-MmKUYGDizYjFia0Rwt8oOgmiFH7zaYlsoQ3tIOfPxOqLssAsEgG0MUdRDm5lliqjiuoog8LyDu9srQk5YwWF3w== - -esbuild-openbsd-64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.5.tgz#26705b61961d525d79a772232e8b8f211fdbb035" - integrity sha512-2mMFfkLk3oPWfopA9Plj4hyhqHNuGyp5KQyTT9Rc8hFd8wAn5ZrbJg+gNcLMo2yzf8Uiu0RT6G9B15YN9WQyMA== - -esbuild-sunos-64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.5.tgz#d794da1ae60e6e2f6194c44d7b3c66bf66c7a141" - integrity sha512-2sIzhMUfLNoD+rdmV6AacilCHSxZIoGAU2oT7XmJ0lXcZWnCvCtObvO6D4puxX9YRE97GodciRGDLBaiC6x1SA== - -esbuild-windows-32@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.5.tgz#0670326903f421424be86bc03b7f7b3ff86a9db7" - integrity sha512-e+duNED9UBop7Vnlap6XKedA/53lIi12xv2ebeNS4gFmu7aKyTrok7DPIZyU5w/ftHD4MUDs5PJUkQPP9xJRzg== - -esbuild-windows-64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.5.tgz#64f32acb7341f3f0a4d10e8ff1998c2d1ebfc0a9" - integrity sha512-v+PjvNtSASHOjPDMIai9Yi+aP+Vwox+3WVdg2JB8N9aivJ7lyhp4NVU+J0MV2OkWFPnVO8AE/7xH+72ibUUEnw== - -esbuild-windows-arm64@0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.5.tgz#4fe7f333ce22a922906b10233c62171673a3854b" - integrity sha512-Yz8w/D8CUPYstvVQujByu6mlf48lKmXkq6bkeSZZxTA626efQOJb26aDGLzmFWx6eg/FwrXgt6SZs9V8Pwy/aA== - -esbuild@^0.15.5: - version "0.15.5" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.15.5.tgz#5effd05666f621d4ff2fe2c76a67c198292193ff" - integrity sha512-VSf6S1QVqvxfIsSKb3UKr3VhUCis7wgDbtF4Vd9z84UJr05/Sp2fRKmzC+CSPG/dNAPPJZ0BTBLTT1Fhd6N9Gg== +esbuild-android-64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.6.tgz#baaed943ca510c2ad546e116728132e76d1d2044" + integrity sha512-Z1CHSgB1crVQi2LKSBwSkpaGtaloVz0ZIYcRMsvHc3uSXcR/x5/bv9wcZspvH/25lIGTaViosciS/NS09ERmVA== + +esbuild-android-arm64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.6.tgz#1c33c73d4c074969e014e31958116460c8e75a7a" + integrity sha512-mvM+gqNxqKm2pCa3dnjdRzl7gIowuc4ga7P7c3yHzs58Im8v/Lfk1ixSgQ2USgIywT48QWaACRa3F4MG7djpSw== + +esbuild-darwin-64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.6.tgz#388592ba61bf31993d79f6311f7452aa1ef255b9" + integrity sha512-BsfVt3usScAfGlXJiGtGamwVEOTM8AiYiw1zqDWhGv6BncLXCnTg1As+90mxWewdTZKq3iIy8s9g8CKkrrAXVw== + +esbuild-darwin-arm64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.6.tgz#194e987849dc4688654008a1792f26e948f52e74" + integrity sha512-CnrAeJaEpPakUobhqO4wVSA4Zm6TPaI5UY4EsI62j9mTrjIyQPXA1n4Ju6Iu5TVZRnEqV6q8blodgYJ6CJuwCA== + +esbuild-freebsd-64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.6.tgz#daa72faee585ec2ec27cc65e86a6ce0786373e66" + integrity sha512-+qFdmqi+jkAsxsNJkaWVrnxEUUI50nu6c3MBVarv3RCDCbz7ZS1a4ZrdkwEYFnKcVWu6UUE0Kkb1SQ1yGEG6sg== + +esbuild-freebsd-arm64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.6.tgz#70c8a2a30bf6bb9d547a0d8dc93aa015ec4f77f9" + integrity sha512-KtQkQOhnNciXm2yrTYZMD3MOm2zBiiwFSU+dkwNbcfDumzzUprr1x70ClTdGuZwieBS1BM/k0KajRQX7r504Xw== + +esbuild-linux-32@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.6.tgz#d69ed2335b2d68c00b3248254b432172077b7ced" + integrity sha512-IAkDNz3TpxwISTGVdQijwyHBZrbFgLlRi5YXcvaEHtgbmayLSDcJmH5nV1MFgo/x2QdKcHBkOYHdjhKxUAcPwg== + +esbuild-linux-64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.6.tgz#dca821e8f129cccde23ac947fd0d4bea3b333808" + integrity sha512-gQPksyrEYfA4LJwyfTQWAZaVZCx4wpaLrSzo2+Xc9QLC+i/sMWmX31jBjrn4nLJCd79KvwCinto36QC7BEIU/A== + +esbuild-linux-arm64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.6.tgz#c9e8bc86f3c58a7c8ff1ded5880c6a39ade7621b" + integrity sha512-aovDkclFa6C9EdZVBuOXxqZx83fuoq8097xZKhEPSygwuy4Lxs8J4anHG7kojAsR+31lfUuxzOo2tHxv7EiNHA== + +esbuild-linux-arm@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.6.tgz#354ecad0223f5b176995cf4462560eec2633de24" + integrity sha512-xZ0Bq2aivsthDjA/ytQZzxrxIZbG0ATJYMJxNeOIBc1zUjpbVpzBKgllOZMsTSXMHFHGrow6TnCcgwqY0+oEoQ== + +esbuild-linux-mips64le@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.6.tgz#f4fb941a4ff0af437deed69a2e0712983c8fff3e" + integrity sha512-wVpW8wkWOGizsCqCwOR/G3SHwhaecpGy3fic9BF1r7vq4djLjUcA8KunDaBCjJ6TgLQFhJ98RjDuyEf8AGjAvw== + +esbuild-linux-ppc64le@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.6.tgz#19774a8b52c77173f2d4f171b8a8cf839b12e686" + integrity sha512-z6w6gsPH/Y77uchocluDC8tkCg9rfkcPTePzZKNr879bF4tu7j9t255wuNOCE396IYEGxY7y8u2HJ9i7kjCLVw== + +esbuild-linux-riscv64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.6.tgz#66bd83b065c4a1e623df02c122bc7e4e15fd8486" + integrity sha512-pfK/3MJcmbfU399TnXW5RTPS1S+ID6ra+CVj9TFZ2s0q9Ja1F5A1VirUUvViPkjiw+Kq3zveyn6U09Wg1zJXrw== + +esbuild-linux-s390x@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.6.tgz#1e024bddc75afe8dc70ed48fc9627af770d7f34b" + integrity sha512-OZeeDu32liefcwAE63FhVqM4heWTC8E3MglOC7SK0KYocDdY/6jyApw0UDkDHlcEK9mW6alX/SH9r3PDjcCo/Q== + +esbuild-netbsd-64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.6.tgz#c11477d197f059c8794ee1691e3399201f7c4b9a" + integrity sha512-kaxw61wcHMyiEsSsi5ut1YYs/hvTC2QkxJwyRvC2Cnsz3lfMLEu8zAjpBKWh9aU/N0O/gsRap4wTur5GRuSvBA== + +esbuild-openbsd-64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.6.tgz#b29e7faed5b8d2aeaf3884c47c1a96b1cba8e263" + integrity sha512-CuoY60alzYfIZapUHqFXqXbj88bbRJu8Fp9okCSHRX2zWIcGz4BXAHXiG7dlCye5nFVrY72psesLuWdusyf2qw== + +esbuild-sunos-64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.6.tgz#9668f39e47179f50c0435040904b9c6e10e84a70" + integrity sha512-1ceefLdPWcd1nW/ZLruPEYxeUEAVX0YHbG7w+BB4aYgfknaLGotI/ZvPWUZpzhC8l1EybrVlz++lm3E6ODIJOg== + +esbuild-windows-32@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.6.tgz#9ddcd56e3c4fb9729a218c713c4e76bdbc1678b4" + integrity sha512-pBqdOsKqCD5LRYiwF29PJRDJZi7/Wgkz46u3d17MRFmrLFcAZDke3nbdDa1c8YgY78RiemudfCeAemN8EBlIpA== + +esbuild-windows-64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.6.tgz#1eaadeadfd995e9d065d35cb3e9f02607202f339" + integrity sha512-KpPOh4aTOo//g9Pk2oVAzXMpc9Sz9n5A9sZTmWqDSXCiiachfFhbuFlsKBGATYCVitXfmBIJ4nNYYWSOdz4hQg== + +esbuild-windows-arm64@0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.6.tgz#e18a778d354fc2ca2306688f3fedad8a3e57819e" + integrity sha512-DB3G2x9OvFEa00jV+OkDBYpufq5x/K7a6VW6E2iM896DG4ZnAvJKQksOsCPiM1DUaa+DrijXAQ/ZOcKAqf/3Hg== + +esbuild@^0.15.6: + version "0.15.6" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.15.6.tgz#626e5941b98de506b862047be3c4b33f89278923" + integrity sha512-sgLOv3l4xklvXzzczhRwKRotyrfyZ2i1fCS6PTOLPd9wevDPArGU8HFtHrHCOcsMwTjLjzGm15gvC8uxVzQf+w== optionalDependencies: - "@esbuild/linux-loong64" "0.15.5" - esbuild-android-64 "0.15.5" - esbuild-android-arm64 "0.15.5" - esbuild-darwin-64 "0.15.5" - esbuild-darwin-arm64 "0.15.5" - esbuild-freebsd-64 "0.15.5" - esbuild-freebsd-arm64 "0.15.5" - esbuild-linux-32 "0.15.5" - esbuild-linux-64 "0.15.5" - esbuild-linux-arm "0.15.5" - esbuild-linux-arm64 "0.15.5" - esbuild-linux-mips64le "0.15.5" - esbuild-linux-ppc64le "0.15.5" - esbuild-linux-riscv64 "0.15.5" - esbuild-linux-s390x "0.15.5" - esbuild-netbsd-64 "0.15.5" - esbuild-openbsd-64 "0.15.5" - esbuild-sunos-64 "0.15.5" - esbuild-windows-32 "0.15.5" - esbuild-windows-64 "0.15.5" - esbuild-windows-arm64 "0.15.5" + "@esbuild/linux-loong64" "0.15.6" + esbuild-android-64 "0.15.6" + esbuild-android-arm64 "0.15.6" + esbuild-darwin-64 "0.15.6" + esbuild-darwin-arm64 "0.15.6" + esbuild-freebsd-64 "0.15.6" + esbuild-freebsd-arm64 "0.15.6" + esbuild-linux-32 "0.15.6" + esbuild-linux-64 "0.15.6" + esbuild-linux-arm "0.15.6" + esbuild-linux-arm64 "0.15.6" + esbuild-linux-mips64le "0.15.6" + esbuild-linux-ppc64le "0.15.6" + esbuild-linux-riscv64 "0.15.6" + esbuild-linux-s390x "0.15.6" + esbuild-netbsd-64 "0.15.6" + esbuild-openbsd-64 "0.15.6" + esbuild-sunos-64 "0.15.6" + esbuild-windows-32 "0.15.6" + esbuild-windows-64 "0.15.6" + esbuild-windows-arm64 "0.15.6" escalade@^3.1.1: version "3.1.1" @@ -4811,11 +4820,11 @@ expect@^27.5.1: jest-message-util "^27.5.1" ext@^1.1.2: - version "1.6.0" - resolved "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== + version "1.7.0" + resolved "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" + integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== dependencies: - type "^2.5.0" + type "^2.7.2" extend@~3.0.2: version "3.0.2" @@ -6790,73 +6799,73 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@^1.65.1: - version "1.65.1" - resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.65.1.tgz#4994949cd064d3cc8d497e25780ef2195ed50aef" - integrity sha512-T4bLMalvNWJOkDtQIsBkN+IkwpBlO/i9H9+XmjzzRYVq+N2ZJOvk+lA7fMJB0wHYD2cKB2iBJcj4rcbKk9gZWA== +jsii-diff@^1.66.0: + version "1.66.0" + resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.66.0.tgz#945f5ad99c747e2079e79a32bd05dab182ca1b32" + integrity sha512-ZxnAhkhDhoYObac0JnOl8YbLD+CESHRr2O7d5Iuoxtm8wZFy2AVQpYrgsy5zroyv0s26g+EcDorT7pzci67Rzw== dependencies: - "@jsii/check-node" "1.65.1" - "@jsii/spec" "^1.65.1" + "@jsii/check-node" "1.66.0" + "@jsii/spec" "^1.66.0" fs-extra "^10.1.0" - jsii-reflect "^1.65.1" + jsii-reflect "^1.66.0" log4js "^6.6.1" yargs "^16.2.0" -jsii-pacmak@^1.65.1: - version "1.65.1" - resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.65.1.tgz#085a6c14230b3cd8ce187d74ac2cedcf2504278b" - integrity sha512-Ts8JkjXWdyRD/zjDpJxbhuI+kMwTFWx06doZTkaTSbBENu/KlzR4dhHQI4HqITRUtgmShdPJVt7Pu0Ush0WyUQ== +jsii-pacmak@^1.66.0: + version "1.66.0" + resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.66.0.tgz#991b9ca38860065f9b673e53175e2873c2007cb0" + integrity sha512-7WRyAzwJ/WvFms5zdO3+UEsOoijTn1/zNbNJMUZ+C3vUgsdUQKyKn+qa/kSSGjNeLnW5JffXWlOF3Ik9sHSXDg== dependencies: - "@jsii/check-node" "1.65.1" - "@jsii/spec" "^1.65.1" + "@jsii/check-node" "1.66.0" + "@jsii/spec" "^1.66.0" clone "^2.1.2" - codemaker "^1.65.1" + codemaker "^1.66.0" commonmark "^0.30.0" escape-string-regexp "^4.0.0" fs-extra "^10.1.0" - jsii-reflect "^1.65.1" - jsii-rosetta "^1.65.1" + jsii-reflect "^1.66.0" + jsii-rosetta "^1.66.0" semver "^7.3.7" spdx-license-list "^6.6.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@^1.64.0, jsii-reflect@^1.65.1: - version "1.65.1" - resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.65.1.tgz#3beacc3d66e63ad957f9d93fbb328d9388f1a737" - integrity sha512-e2t5vE4504UQg2rZp8woBoXREUqJScedIBGGjl69gNKv7/Dwalz9ynlX9WkapNzPOBOVkQOWcahjz7hkPlWJyQ== +jsii-reflect@^1.64.0, jsii-reflect@^1.66.0: + version "1.66.0" + resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.66.0.tgz#c737248e68145eea8f586e0f93ca7affeb6de8cc" + integrity sha512-vkETnprRy1Iqa3Tj/cSRcK5I5a/KiVKCOcnR9+fasEqdHeTU28rqpqIEndKBc90ysKSZcldOzH0f3SyoYwEFDg== dependencies: - "@jsii/check-node" "1.65.1" - "@jsii/spec" "^1.65.1" + "@jsii/check-node" "1.66.0" + "@jsii/spec" "^1.66.0" chalk "^4" fs-extra "^10.1.0" - oo-ascii-tree "^1.65.1" + oo-ascii-tree "^1.66.0" yargs "^16.2.0" -jsii-rosetta@^1.64.0, jsii-rosetta@^1.65.1: - version "1.65.1" - resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.65.1.tgz#99b016474386407925e57770e77e87f890fca055" - integrity sha512-/9jlgeCQ9wR/CrbHsArihg5j6FFUe4CGq92+kxiEqtdAj7XrBvDS4OpRe9ettlzZ8pg2I647OlBCnDkubEizHw== +jsii-rosetta@^1.64.0, jsii-rosetta@^1.66.0: + version "1.66.0" + resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.66.0.tgz#a0c338879a7569b6dd8b91760b05fb19366a5dc5" + integrity sha512-LS1Bdsb7OQ9foa6TxKj2TS+CQL2NXiUo4YUXjy6+c7DfcAU+Dw/9IChyRyq0iesK4JeFM3Vve3ViWzuSAUUYqg== dependencies: - "@jsii/check-node" "1.65.1" - "@jsii/spec" "1.65.1" + "@jsii/check-node" "1.66.0" + "@jsii/spec" "1.66.0" "@xmldom/xmldom" "^0.8.2" commonmark "^0.30.0" fast-glob "^3.2.11" - jsii "1.65.1" + jsii "1.66.0" semver "^7.3.7" semver-intersect "^1.4.0" typescript "~3.9.10" workerpool "^6.2.1" yargs "^16.2.0" -jsii@1.65.1, jsii@^1.64.0, jsii@^1.65.1: - version "1.65.1" - resolved "https://registry.npmjs.org/jsii/-/jsii-1.65.1.tgz#d97f53d252608e985c303a2c57aaaea83693fbd8" - integrity sha512-XHFxKlY5BCnxIXUf3OxwmVhNHzbYHid8KJHUhy3AZH6mKgIi4CIn41XSN19TMHboFKzBiSYPlcUl6HseW7zvNw== +jsii@1.66.0, jsii@^1.64.0, jsii@^1.66.0: + version "1.66.0" + resolved "https://registry.npmjs.org/jsii/-/jsii-1.66.0.tgz#ce02c20fa28228fadf646fdb15ab0700153b941b" + integrity sha512-xk28Cf+Wj2Ei9+UkWm1f9/Luqg77MpkCqRwx/bkErtI5uMA01kRzwrYwV4ZyjrMY5m5L57GUB4SBYOnVmPOckA== dependencies: - "@jsii/check-node" "1.65.1" - "@jsii/spec" "^1.65.1" + "@jsii/check-node" "1.66.0" + "@jsii/spec" "^1.66.0" case "^1.6.3" chalk "^4" fast-deep-equal "^3.1.3" @@ -8385,10 +8394,10 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.65.1: - version "1.65.1" - resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.65.1.tgz#06faa6ece178e75033ab4ac1061529e0f1b2664b" - integrity sha512-tIKGRh/sFXX8KBCZva9S61gjQlwY4xx7No8RCR5UmobohavtQKaw/aHGl2bPOmBRl48d9L+JwCGYIRn8nM13wA== +oo-ascii-tree@^1.66.0: + version "1.66.0" + resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.66.0.tgz#4384daefa449b3e387f5f6de043cb1d79e53e40a" + integrity sha512-qWv4ygUPK2GfX/Pbm72IirXyzxz85bRRIrQQh0BG/kuHjHJk2H3yETL9ypnKP6q87+4179KFlzl740OQzPmosg== open@^7.4.2: version "7.4.2" @@ -8978,10 +8987,10 @@ progress@^2.0.0, progress@^2.0.3: resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -projen@^0.61.33: - version "0.61.33" - resolved "https://registry.npmjs.org/projen/-/projen-0.61.33.tgz#c45de83b15497c0d677ce9a265ab5b6a386b387b" - integrity sha512-NCUPOG33h9KeC8Kfms8nkoxIj+vO3Gs47jy0ifblcTsazuwut41SS3JIcesLBOlCnmr+rFQVDECuJ6AnOXPNZw== +projen@^0.61.37: + version "0.61.37" + resolved "https://registry.npmjs.org/projen/-/projen-0.61.37.tgz#93b66f7e78db56c604670dcd01a38225607447bb" + integrity sha512-Cb83rR7MmAwIBy09X+4209axhpd+4cQdLTLxUEtIxOarYA5Yy4S/e3qGiftnmfMhUH2aw877D2D5IofIeQtNjQ== dependencies: "@iarna/toml" "^2.2.5" case "^1.6.3" @@ -10630,7 +10639,7 @@ type@^1.0.1: resolved "https://registry.npmjs.org/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== -type@^2.5.0: +type@^2.7.2: version "2.7.2" resolved "https://registry.npmjs.org/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==