From 31896af7f29becb55a852b4635e7ed1576ee178b Mon Sep 17 00:00:00 2001 From: AWS CDK Team Date: Wed, 15 May 2024 20:34:12 +0000 Subject: [PATCH 01/21] chore(release): 2.142.0 --- CHANGELOG.v2.alpha.md | 8 ++++++++ CHANGELOG.v2.md | 27 +++++++++++++++++++++++++++ version.v2.json | 4 ++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index 787befd4a4a26..858ac0810b88c 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,14 @@ 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.142.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.141.0-alpha.0...v2.142.0-alpha.0) (2024-05-15) + + +### Features + +* **pipes-targets:** add step function target ([#29987](https://github.com/aws/aws-cdk/issues/29987)) ([b0975e4](https://github.com/aws/aws-cdk/commit/b0975e410a404d07952e01303af01224ccfad864)), closes [#29665](https://github.com/aws/aws-cdk/issues/29665) [#29665](https://github.com/aws/aws-cdk/issues/29665) +* **redshift:** multi AZ cluster ([#29976](https://github.com/aws/aws-cdk/issues/29976)) ([a53517c](https://github.com/aws/aws-cdk/commit/a53517c6772332cc2a15c9b38e964a933e9c8355)) + ## [2.141.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.140.0-alpha.0...v2.141.0-alpha.0) (2024-05-08) ## [2.140.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.139.1-alpha.0...v2.140.0-alpha.0) (2024-05-02) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index 4ca4d7f42cd11..c6331e662ec09 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,33 @@ 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.142.0](https://github.com/aws/aws-cdk/compare/v2.141.0...v2.142.0) (2024-05-15) + + +### Features + +* **asg:** support keypair functionality for asg ([#29679](https://github.com/aws/aws-cdk/issues/29679)) ([f6b649d](https://github.com/aws/aws-cdk/commit/f6b649d47f8bc30ca741fbb7a4852d51e8275002)), closes [#29237](https://github.com/aws/aws-cdk/issues/29237) +* **codepipeline:** `GitPullRequestFilter` for pipeline trigger ([#29128](https://github.com/aws/aws-cdk/issues/29128)) ([5ce1b64](https://github.com/aws/aws-cdk/commit/5ce1b6485eb4336634f4f14bfe3d0b17b071e83b)), closes [#29126](https://github.com/aws/aws-cdk/issues/29126) +* **docdb:** add copyTagsToSnapshot property to the DatabaseCluster Construct ([#30120](https://github.com/aws/aws-cdk/issues/30120)) ([30f0db6](https://github.com/aws/aws-cdk/commit/30f0db6ad810f0e93187082bd50ddb46726d8f5f)), closes [#30090](https://github.com/aws/aws-cdk/issues/30090) +* **docdb:** support CA certificate for cluster instances ([#28791](https://github.com/aws/aws-cdk/issues/28791)) ([e87f25e](https://github.com/aws/aws-cdk/commit/e87f25e1e93350e53aadb15e19ed7a9bf378c315)), closes [#27138](https://github.com/aws/aws-cdk/issues/27138) [#28356](https://github.com/aws/aws-cdk/issues/28356) +* **events-targets:** add support for AppSync as an EventBridge rule target ([#29584](https://github.com/aws/aws-cdk/issues/29584)) ([5be88a3](https://github.com/aws/aws-cdk/commit/5be88a3055fe1e6b55884847d1b8a75b03341b39)), closes [#29884](https://github.com/aws/aws-cdk/issues/29884) +* **servicecatalog:** `ProductStack` memoryLimit prop ([#30105](https://github.com/aws/aws-cdk/issues/30105)) ([4b6dc8c](https://github.com/aws/aws-cdk/commit/4b6dc8c650822bcd0231c8890bd94a934a0cd34d)), closes [#29862](https://github.com/aws/aws-cdk/issues/29862) + + +### Bug Fixes + +* **apigateway:** set authorization scope when authorization type is Cognito ([#30035](https://github.com/aws/aws-cdk/issues/30035)) ([38a2284](https://github.com/aws/aws-cdk/commit/38a2284bccd9119f3bcc8d0baef8525ab416bb67)) +* **autoscaling:** cooldown cannot be set with step scaling actions ([#30150](https://github.com/aws/aws-cdk/issues/30150)) ([6810762](https://github.com/aws/aws-cdk/commit/68107624e50d738be7e10fd22072b5a40983e720)), closes [#29779](https://github.com/aws/aws-cdk/issues/29779) +* **cli:** cdk bootstrap --help does not show some options ([#30113](https://github.com/aws/aws-cdk/issues/30113)) ([8debd20](https://github.com/aws/aws-cdk/commit/8debd205b1f52e172de844f349d4e76e39df269d)) +* **cli:** handle attributes of AWS::KMS::Key when hotswapping ([#30112](https://github.com/aws/aws-cdk/issues/30112)) ([a1dcaa6](https://github.com/aws/aws-cdk/commit/a1dcaa6c4a3db245d1becf0e9ace1d488b6d528d)), closes [#25418](https://github.com/aws/aws-cdk/issues/25418) +* **cli:** template created during import should be written to assets folder ([#29830](https://github.com/aws/aws-cdk/issues/29830)) ([a96cf55](https://github.com/aws/aws-cdk/commit/a96cf5500242890cddbbaa46af7f7228c7126d98)), closes [#22928](https://github.com/aws/aws-cdk/issues/22928) [#22530](https://github.com/aws/aws-cdk/issues/22530) +* **diff:** properties from ChangeSet diff were ignored ([#30093](https://github.com/aws/aws-cdk/issues/30093)) ([9c3f3f5](https://github.com/aws/aws-cdk/commit/9c3f3f5dbb9b4b9f86911d9cd7c056a9fc0432b3)), closes [#29731](https://github.com/aws/aws-cdk/issues/29731) +* **ecs:** require task pidMode for Linux-based Fargate tasks, not host ([#30020](https://github.com/aws/aws-cdk/issues/30020)) ([3e9e0a8](https://github.com/aws/aws-cdk/commit/3e9e0a8696630c9368adf012aff1fb919e398164)), closes [#29995](https://github.com/aws/aws-cdk/issues/29995) +* **eks:** in place updates for EKS security group and Subnets ([#30114](https://github.com/aws/aws-cdk/issues/30114)) ([eb39d9e](https://github.com/aws/aws-cdk/commit/eb39d9e1924240d433dc91b7f8d98ebcf5cd87c8)), closes [#28584](https://github.com/aws/aws-cdk/issues/28584) +* **iam:** fromUserArn returns incorrect principalAccount ([#30023](https://github.com/aws/aws-cdk/issues/30023)) ([f9f3681](https://github.com/aws/aws-cdk/commit/f9f3681be9fc6a0c998cd26119053c5832ef9806)), closes [/github.com/aws/aws-cdk/issues/29999#issuecomment-2087672380](https://github.com/aws//github.com/aws/aws-cdk/issues/29999/issues/issuecomment-2087672380) +* **s3:** add bucket policy dependency to notification resource ([#30053](https://github.com/aws/aws-cdk/issues/30053)) ([71986ff](https://github.com/aws/aws-cdk/commit/71986ff986d13bbb496b33c0554f657e77dbb2d0)), closes [#27600](https://github.com/aws/aws-cdk/issues/27600) [#16811](https://github.com/aws/aws-cdk/issues/16811) +* **stepfunctions-tasks:** documentation fix for retryOnServiceExceptions ([#30077](https://github.com/aws/aws-cdk/issues/30077)) ([205163f](https://github.com/aws/aws-cdk/commit/205163fc0d2cac84d3d746a98c393e137f0e2388)) + ## [2.141.0](https://github.com/aws/aws-cdk/compare/v2.140.0...v2.141.0) (2024-05-08) diff --git a/version.v2.json b/version.v2.json index ff56352639123..004aacd35c9e1 100644 --- a/version.v2.json +++ b/version.v2.json @@ -1,4 +1,4 @@ { - "version": "2.141.0", - "alphaVersion": "2.141.0-alpha.0" + "version": "2.142.0", + "alphaVersion": "2.142.0-alpha.0" } \ No newline at end of file From b0b71aa475c95f086bda655ab4db4f50775a2f5c Mon Sep 17 00:00:00 2001 From: maz Date: Thu, 16 May 2024 13:11:36 +0900 Subject: [PATCH 02/21] feat: add nitroEnclave and hibenartion --- .../__entrypoint__.js | 155 +++ .../index.js | 1 + .../cdk.out | 1 + ...efaultTestDeployAssertDE7E123E.assets.json | 19 + ...aultTestDeployAssertDE7E123E.template.json | 36 + ...nce-nitro-enclaves-hibernation.assets.json | 32 + ...e-nitro-enclaves-hibernation.template.json | 745 +++++++++++ .../integ.json | 12 + .../manifest.json | 311 +++++ .../tree.json | 1124 +++++++++++++++++ ...eg.instance-nitoro-envlaves-hibernation.ts | 49 + packages/aws-cdk-lib/aws-ec2/README.md | 36 +- packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 22 + .../aws-cdk-lib/aws-ec2/test/instance.test.ts | 71 +- 14 files changed, 2610 insertions(+), 4 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js new file mode 100644 index 0000000000000..02033f55cf612 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withRetries = exports.handler = exports.external = void 0; +const https = require("https"); +const url = require("url"); +// for unit tests +exports.external = { + sendHttpRequest: defaultSendHttpRequest, + log: defaultLog, + includeStackTraces: true, + userHandlerIndex: './index', +}; +const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function handler(event, context) { + const sanitizedEvent = { ...event, ResponseURL: '...' }; + exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); + // 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 === CREATE_FAILED_PHYSICAL_ID_MARKER) { + exports.external.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + // invoke the user handler. this is intentionally inside the try-catch to + // ensure that if there is an error it's reported as a failure to + // cloudformation (otherwise cfn waits). + // eslint-disable-next-line @typescript-eslint/no-require-imports + const userHandler = require(exports.external.userHandlerIndex).handler; + const result = await userHandler(sanitizedEvent, context); + // validate user response and create the combined event + const responseEvent = renderResponse(event, result); + // submit to cfn as success + await submitResponse('SUCCESS', responseEvent); + } + catch (e) { + const resp = { + ...event, + Reason: exports.external.includeStackTraces ? e.stack : e.message, + }; + if (!resp.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') { + exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', resp); + } +} +exports.handler = handler; +function renderResponse(cfnRequest, handlerResponse = {}) { + // if physical ID is not returned, we have some defaults for you based + // on the request type. + const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; + // 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 "${handlerResponse.PhysicalResourceId}" during deletion`); + } + // merge request event and result event (result prevails). + return { + ...cfnRequest, + ...handlerResponse, + PhysicalResourceId: physicalResourceId, + }; +} +async function submitResponse(status, event) { + const json = { + Status: status, + Reason: event.Reason ?? status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: event.NoEcho, + Data: event.Data, + }; + const parsedUrl = url.parse(event.ResponseURL); + const loggingSafeUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}/${parsedUrl.pathname}?***`; + exports.external.log('submit response to cloudformation', loggingSafeUrl, json); + const responseBody = JSON.stringify(json); + const req = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + const retryOptions = { + attempts: 5, + sleep: 1000, + }; + await withRetries(retryOptions, exports.external.sendHttpRequest)(req, responseBody); +} +async function defaultSendHttpRequest(options, requestBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, (response) => { + response.resume(); // Consume the response but don't care about it + if (!response.statusCode || response.statusCode >= 400) { + reject(new Error(`Unsuccessful HTTP response: ${response.statusCode}`)); + } + else { + resolve(); + } + }); + request.on('error', reject); + request.write(requestBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +function defaultLog(fmt, ...params) { + // eslint-disable-next-line no-console + console.log(fmt, ...params); +} +function withRetries(options, fn) { + return async (...xs) => { + let attempts = options.attempts; + let ms = options.sleep; + while (true) { + try { + return await fn(...xs); + } + catch (e) { + if (attempts-- <= 0) { + throw e; + } + await sleep(Math.floor(Math.random() * ms)); + ms *= 2; + } + } + }; +} +exports.withRetries = withRetries; +async function sleep(ms) { + return new Promise((ok) => setTimeout(ok, ms)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js new file mode 100644 index 0000000000000..013bcaffd8fe5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js @@ -0,0 +1 @@ +"use strict";var I=Object.create;var t=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var G=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},n=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!l.call(r,s)&&s!==o&&t(r,s,{get:()=>e[s],enumerable:!(i=y(e,s))||i.enumerable});return r};var R=(r,e,o)=>(o=r!=null?I(g(r)):{},n(e||!r||!r.__esModule?t(o,"default",{value:r,enumerable:!0}):o,r)),S=r=>n(t({},"__esModule",{value:!0}),r);var k={};G(k,{handler:()=>f});module.exports=S(k);var a=R(require("@aws-sdk/client-ec2")),u=new a.EC2({});function c(r,e){return{GroupId:r,IpPermissions:[{UserIdGroupPairs:[{GroupId:r,UserId:e}],IpProtocol:"-1"}]}}function d(r){return{GroupId:r,IpPermissions:[{IpRanges:[{CidrIp:"0.0.0.0/0"}],IpProtocol:"-1"}]}}async function f(r){let e=r.ResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.Account;switch(r.RequestType){case"Create":return p(e,o);case"Update":return h(r);case"Delete":return m(e,o)}}async function h(r){let e=r.OldResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.DefaultSecurityGroupId;e!==o&&(await m(e,r.ResourceProperties.Account),await p(o,r.ResourceProperties.Account))}async function p(r,e){try{await u.revokeSecurityGroupEgress(d(r))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}try{await u.revokeSecurityGroupIngress(c(r,e))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}}async function m(r,e){await u.authorizeSecurityGroupIngress(c(r,e)),await u.authorizeSecurityGroupEgress(d(r))}0&&(module.exports={handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json new file mode 100644 index 0000000000000..cc8bc7ce2d108 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.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-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json new file mode 100644 index 0000000000000..9eb5fe673f5a1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json @@ -0,0 +1,32 @@ +{ + "version": "36.0.0", + "files": { + "bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1": { + "source": { + "path": "asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3": { + "source": { + "path": "integ-ec2-instance-nitro-enclaves-hibernation.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3.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-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json new file mode 100644 index 0000000000000..6464b8b77d212 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json @@ -0,0 +1,745 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet1DefaultRoute91CEF279", + "VPCPublicSubnet1RouteTableAssociation0B0896DC" + ] + }, + "VPCPublicSubnet2Subnet74179F39": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet2EIP4947BC00": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet2DefaultRouteB7481BBA", + "VPCPublicSubnet2RouteTableAssociation5A808732" + ] + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCRestrictDefaultSecurityGroupCustomResource59474679": { + "Type": "Custom::VpcRestrictDefaultSG", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E", + "Arn" + ] + }, + "DefaultSecurityGroupId": { + "Fn::GetAtt": [ + "VPCB9E5F0B4", + "DefaultSecurityGroup" + ] + }, + "Account": { + "Ref": "AWS::AccountId" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "ec2:AuthorizeSecurityGroupIngress", + "ec2:AuthorizeSecurityGroupEgress", + "ec2:RevokeSecurityGroupIngress", + "ec2:RevokeSecurityGroupEgress" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":security-group/", + { + "Fn::GetAtt": [ + "VPCB9E5F0B4", + "DefaultSecurityGroup" + ] + } + ] + ] + } + ] + } + ] + } + } + ] + } + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1.zip" + }, + "Timeout": 900, + "MemorySize": 128, + "Handler": "__entrypoint__.handler", + "Role": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group" + }, + "DependsOn": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + ] + }, + "IntegSg68DC2C7E": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "integ-ec2-instance-nitro-enclaves-hibernation/IntegSg", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + }, + { + "CidrIpv6": "::/0", + "Description": "Allow all outbound ipv6 traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "InstanceNitroEnclavesEnabledInstanceRoleE0CDB1BC": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled" + } + ] + } + }, + "InstanceNitroEnclavesEnabledInstanceProfile9E95679C": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "InstanceNitroEnclavesEnabledInstanceRoleE0CDB1BC" + } + ] + } + }, + "InstanceNitroEnclavesEnabledB4F56EB8": { + "Type": "AWS::EC2::Instance", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "EnclaveOptions": { + "Enabled": true + }, + "HibernationOptions": { + "Configured": false + }, + "IamInstanceProfile": { + "Ref": "InstanceNitroEnclavesEnabledInstanceProfile9E95679C" + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "m5.xlarge", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "IntegSg68DC2C7E", + "GroupId" + ] + } + ], + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled" + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "DependsOn": [ + "InstanceNitroEnclavesEnabledInstanceRoleE0CDB1BC" + ] + }, + "InstanceHibernationEnabledInstanceRole88195D69": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled" + } + ] + } + }, + "InstanceHibernationEnabledInstanceProfile2F0E93E0": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "InstanceHibernationEnabledInstanceRole88195D69" + } + ] + } + }, + "InstanceHibernationEnabledF668067C": { + "Type": "AWS::EC2::Instance", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/xvda", + "Ebs": { + "DeleteOnTermination": true, + "Encrypted": true, + "VolumeSize": 30, + "VolumeType": "gp3" + } + } + ], + "EnclaveOptions": { + "Enabled": false + }, + "HibernationOptions": { + "Configured": true + }, + "IamInstanceProfile": { + "Ref": "InstanceHibernationEnabledInstanceProfile2F0E93E0" + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "m5.xlarge", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "IntegSg68DC2C7E", + "GroupId" + ] + } + ], + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled" + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "DependsOn": [ + "InstanceHibernationEnabledInstanceRole88195D69" + ] + } + }, + "Parameters": { + "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64" + }, + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ.json new file mode 100644 index 0000000000000..ff618b8ee1f42 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "instance-nitro-enclaves-hibernation/DefaultTest": { + "stacks": [ + "integ-ec2-instance-nitro-enclaves-hibernation" + ], + "assertionStack": "instance-nitro-enclaves-hibernation/DefaultTest/DeployAssert", + "assertionStackName": "instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/manifest.json new file mode 100644 index 0000000000000..9a01d453d6012 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/manifest.json @@ -0,0 +1,311 @@ +{ + "version": "36.0.0", + "artifacts": { + "integ-ec2-instance-nitro-enclaves-hibernation.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-ec2-instance-nitro-enclaves-hibernation.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-ec2-instance-nitro-enclaves-hibernation": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-ec2-instance-nitro-enclaves-hibernation.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-ec2-instance-nitro-enclaves-hibernation.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-ec2-instance-nitro-enclaves-hibernation.assets" + ], + "metadata": { + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2EIP4947BC00" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2NATGateway3C070193" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/VPC/RestrictDefaultSecurityGroupCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCRestrictDefaultSecurityGroupCustomResource59474679" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/IntegSg/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegSg68DC2C7E" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceNitroEnclavesEnabledInstanceRoleE0CDB1BC" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceNitroEnclavesEnabledInstanceProfile9E95679C" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceNitroEnclavesEnabledB4F56EB8" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + { + "type": "aws:cdk:logicalId", + "data": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceHibernationEnabledInstanceRole88195D69" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceHibernationEnabledInstanceProfile2F0E93E0" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceHibernationEnabledF668067C" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-ec2-instance-nitro-enclaves-hibernation/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-ec2-instance-nitro-enclaves-hibernation" + }, + "instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets" + ], + "metadata": { + "/instance-nitro-enclaves-hibernation/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/instance-nitro-enclaves-hibernation/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "instance-nitro-enclaves-hibernation/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/tree.json new file mode 100644 index 0000000000000..c2d428f3c6234 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/tree.json @@ -0,0 +1,1124 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-ec2-instance-nitro-enclaves-hibernation": { + "id": "integ-ec2-instance-nitro-enclaves-hibernation", + "path": "integ-ec2-instance-nitro-enclaves-hibernation", + "children": { + "VPC": { + "id": "VPC", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "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": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + }, + "RestrictDefaultSecurityGroupCustomResource": { + "id": "RestrictDefaultSecurityGroupCustomResource", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/RestrictDefaultSecurityGroupCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/VPC/RestrictDefaultSecurityGroupCustomResource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "Custom::VpcRestrictDefaultSGCustomResourceProvider": { + "id": "Custom::VpcRestrictDefaultSGCustomResourceProvider", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/Custom::VpcRestrictDefaultSGCustomResourceProvider", + "children": { + "Staging": { + "id": "Staging", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/Custom::VpcRestrictDefaultSGCustomResourceProvider/Staging", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResourceProviderBase", + "version": "0.0.0" + } + }, + "IntegSg": { + "id": "IntegSg", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/IntegSg", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/IntegSg/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "integ-ec2-instance-nitro-enclaves-hibernation/IntegSg", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + }, + { + "ipProtocol": "-1", + "cidrIpv6": "::/0", + "description": "Allow all outbound ipv6 traffic by default" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "InstanceNitroEnclavesEnabled": { + "id": "InstanceNitroEnclavesEnabled", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled", + "children": { + "InstanceRole": { + "id": "InstanceRole", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "InstanceNitroEnclavesEnabledInstanceRoleE0CDB1BC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Instance", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "enclaveOptions": { + "enabled": true + }, + "hibernationOptions": { + "configured": false + }, + "iamInstanceProfile": { + "Ref": "InstanceNitroEnclavesEnabledInstanceProfile9E95679C" + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "m5.xlarge", + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "IntegSg68DC2C7E", + "GroupId" + ] + } + ], + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled" + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInstance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Instance", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "InstanceHibernationEnabled": { + "id": "InstanceHibernationEnabled", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled", + "children": { + "InstanceRole": { + "id": "InstanceRole", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "InstanceHibernationEnabledInstanceRole88195D69" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Instance", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "blockDeviceMappings": [ + { + "deviceName": "/dev/xvda", + "ebs": { + "encrypted": true, + "deleteOnTermination": true, + "volumeSize": 30, + "volumeType": "gp3" + } + } + ], + "enclaveOptions": { + "enabled": false + }, + "hibernationOptions": { + "configured": true + }, + "iamInstanceProfile": { + "Ref": "InstanceHibernationEnabledInstanceProfile2F0E93E0" + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "m5.xlarge", + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "IntegSg68DC2C7E", + "GroupId" + ] + } + ], + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + "tags": [ + { + "key": "Name", + "value": "integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled" + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInstance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Instance", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "instance-nitro-enclaves-hibernation": { + "id": "instance-nitro-enclaves-hibernation", + "path": "instance-nitro-enclaves-hibernation", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "instance-nitro-enclaves-hibernation/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "instance-nitro-enclaves-hibernation/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "instance-nitro-enclaves-hibernation/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "instance-nitro-enclaves-hibernation/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "instance-nitro-enclaves-hibernation/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts new file mode 100644 index 0000000000000..1c23304da04ed --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts @@ -0,0 +1,49 @@ +import * as cdk from 'aws-cdk-lib'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as ec2 from 'aws-cdk-lib/aws-ec2'; + +const app = new cdk.App(); + +class TestStack extends cdk.Stack { + constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const vpc = new ec2.Vpc(this, 'VPC'); + const securityGroup = new ec2.SecurityGroup(this, 'IntegSg', { + vpc, + allowAllIpv6Outbound: true, + }); + + new ec2.Instance(this, 'InstanceNitroEnclavesEnabled', { + vpc, + securityGroup, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE), + machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023 }), + nitroEnclaveEnabled: true, + hibernationConfigured: false, + }); + + new ec2.Instance(this, 'InstanceHibernationEnabled', { + vpc, + securityGroup, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE), + machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023 }), + nitroEnclaveEnabled: false, + hibernationConfigured: true, + blockDevices: [{ + deviceName: '/dev/xvda', + volume: ec2.BlockDeviceVolume.ebs(30, { + volumeType: ec2.EbsDeviceVolumeType.GP3, + encrypted: true, + deleteOnTermination: true, + }), + }], + }); + } +} + +const testCase = new TestStack(app, 'integ-ec2-instance-nitro-enclaves-hibernation'); + +new IntegTest(app, 'instance-nitro-enclaves-hibernation', { + testCases: [testCase], +}); diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index 900dddf2f20cb..5f930dca708fd 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -253,7 +253,7 @@ for (const gateway of provider.gatewayInstances) { [using NAT instances](test/integ.nat-instances.lit.ts) [Deprecated] The V1 `NatProvider.instance` construct will use the AWS official NAT instance AMI, which has already -reached EOL on Dec 31, 2023. For more information, see the following blog post: +reached EOL on Dec 31, 2023. For more information, see the following blog post: [Amazon Linux AMI end of life](https://aws.amazon.com/blogs/aws/update-on-amazon-linux-ami-end-of-life/). ```ts @@ -451,7 +451,7 @@ Here is a break down of IPv4 and IPv6 specifc `subnetConfiguration` properties i ```ts const vpc = new ec2.Vpc(this, 'TheVPC', { ipProtocol: ec2.IpProtocol.DUAL_STACK, - + subnetConfiguration: [ { // general properties @@ -474,7 +474,7 @@ The property `mapPublicIpOnLaunch` controls if a public IPv4 address will be ass The `ipv6AssignAddressOnCreation` property controls the same behavior for the IPv6 address. It defaults to true. -Using IPv6 specific properties in an IPv4 only VPC will result in errors. +Using IPv6 specific properties in an IPv4 only VPC will result in errors. ### Accessing the Internet Gateway @@ -1894,6 +1894,36 @@ new ec2.Vpc(this, 'VPC', { **Note**: `CpuCredits.UNLIMITED` mode is not supported for T3 instances that are launched on a Dedicated Host. + +### Enabling Nitro Enclaves + +You can enable [AWS Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html) for your EC2 instances by setting the `nitroEnclaveEnabled` property to `true`. Nitro Enclaves are a feature of AWS Nitro System that enables creating isolated and highly constrained CPU environments known as enclaves. + +```ts +declare const vpc: ec2.Vpc; + +const instance = new ec2.Instance(this, 'Instance', { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.T4G, ec2.InstanceSize.LARGE), + machineImage: new ec2.AmazonLinuxImage(), + vpc: vpc, + nitroEnclaveEnabled: true, +}); +``` + +### Enabling Instance Hibernation + +You can enable [Instance Hibernation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) for your EC2 instances by setting the `hibernationConfigured` property to `true`. Instance Hibernation saves the instance's in-memory (RAM) state when an instance is stopped, and restores that state when the instance is started. + +```ts +const instance = new ec2.Instance(this, 'Instance', { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.T4G, ec2.InstanceSize.LARGE), + machineImage: new ec2.AmazonLinuxImage(), + vpc: vpc, + hibernationConfigured: true, +}); +``` + + ## VPC Flow Logs VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. Flow log data can be published to Amazon CloudWatch Logs and Amazon S3. After you've created a flow log, you can retrieve and view its data in the chosen destination. (). diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index c5ac35416e9f4..ccd465dc7e9cb 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -315,6 +315,22 @@ export interface InstanceProps { * @default false */ readonly ebsOptimized?: boolean; + + /** + * If this parameter is set to true, the instance is enabled for AWS Nitro Enclaves; otherwise, it is not enabled for AWS Nitro Enclaves. + * + * @default false. + */ + readonly nitroEnclaveEnabled?: boolean; + + /** + * If you set this parameter to true, the instance is enabled for hibernation. + * You can't enable hibernation and AWS Nitro Enclaves on the same instance. + * + * @default false + */ + readonly hibernationConfigured?: boolean; + } /** @@ -466,6 +482,10 @@ export class Instance extends Resource implements IInstance { throw new Error(`${props.keyPair.type} keys are not compatible with the chosen AMI`); } + if (props.nitroEnclaveEnabled && props.hibernationConfigured) { + throw new Error('You can\'t enable hibernation and AWS Nitro Enclaves on the same instance.'); + } + // if network interfaces array is configured then subnetId, securityGroupIds, // and privateIpAddress are configured on the network interface level and // there is no need to configure them on the instance level @@ -486,6 +506,8 @@ export class Instance extends Resource implements IInstance { monitoring: props.detailedMonitoring, creditSpecification: props.creditSpecification ? { cpuCredits: props.creditSpecification } : undefined, ebsOptimized: props.ebsOptimized, + enclaveOptions: props.nitroEnclaveEnabled !== undefined ? { enabled: props.nitroEnclaveEnabled } : undefined, + hibernationOptions: props.hibernationConfigured !== undefined ? { configured: props.hibernationConfigured } : undefined, }); this.instance.node.addDependency(this.role); diff --git a/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts b/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts index 6db4d2256bd8b..d1fe3329b52b7 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts @@ -904,4 +904,73 @@ test('specify ebs optimized instance', () => { InstanceType: 't3.large', EbsOptimized: true, }); -}); \ No newline at end of file +}); + +test.each([ + [true, true], + [false, false], +])('given nitroEnclaveEnabled %p', (given: boolean, expected: boolean) => { + // WHEN + new Instance(stack, 'Instance', { + vpc, + machineImage: new AmazonLinuxImage(), + instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.XLARGE), + nitroEnclaveEnabled: given, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::EC2::Instance', { + EnclaveOptions: { + Enabled: expected, + }, + }); +}); + +test.each([ + [true, true], + [false, false], +])('given hibernationConfigured %p', (given: boolean, expected: boolean) => { + // WHEN + new Instance(stack, 'Instance', { + vpc, + machineImage: new AmazonLinuxImage(), + instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.XLARGE), + hibernationConfigured: given, + blockDevices: [{ + deviceName: '/dev/xvda', + volume: BlockDeviceVolume.ebs(30, { + volumeType: EbsDeviceVolumeType.GP3, + encrypted: true, + deleteOnTermination: true, + }), + }], + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::EC2::Instance', { + HibernationOptions: { + Configured: expected, + }, + }); +}); + +test('throw if AWS Nitro Enclaves and hibernation are enabled', () => { + // WHEN/THEN + expect(() => { + new Instance(stack, 'Instance', { + vpc, + machineImage: new AmazonLinuxImage(), + instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE), + nitroEnclaveEnabled: true, + hibernationConfigured: true, + blockDevices: [{ + deviceName: '/dev/xvda', + volume: BlockDeviceVolume.ebs(30, { + volumeType: EbsDeviceVolumeType.GP3, + encrypted: true, + deleteOnTermination: true, + }), + }], + }); + }).toThrow('You can\'t enable hibernation and AWS Nitro Enclaves on the same instance.'); +}); From 73b1f155b39ea5b9e5d542a11d54b2f14b924e5a Mon Sep 17 00:00:00 2001 From: maz Date: Thu, 16 May 2024 13:28:23 +0900 Subject: [PATCH 03/21] fix update README --- packages/aws-cdk-lib/aws-ec2/README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index 5f930dca708fd..a323b37b424c3 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1903,7 +1903,7 @@ You can enable [AWS Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/ declare const vpc: ec2.Vpc; const instance = new ec2.Instance(this, 'Instance', { - instanceType: ec2.InstanceType.of(ec2.InstanceClass.T4G, ec2.InstanceSize.LARGE), + instanceType: ec2.InstanceType.of(ec2.InstanceClass.T5, ec2.InstanceSize.XLARGE), machineImage: new ec2.AmazonLinuxImage(), vpc: vpc, nitroEnclaveEnabled: true, @@ -1916,10 +1916,18 @@ You can enable [Instance Hibernation](https://docs.aws.amazon.com/AWSEC2/latest/ ```ts const instance = new ec2.Instance(this, 'Instance', { - instanceType: ec2.InstanceType.of(ec2.InstanceClass.T4G, ec2.InstanceSize.LARGE), + instanceType: ec2.InstanceType.of(ec2.InstanceClass.T5, ec2.InstanceSize.XLARGE), machineImage: new ec2.AmazonLinuxImage(), vpc: vpc, hibernationConfigured: true, + blockDevices: [{ + deviceName: '/dev/xvda', + volume: BlockDeviceVolume.ebs(30, { + volumeType: EbsDeviceVolumeType.GP3, + encrypted: true, + deleteOnTermination: true, + }), + }], }); ``` From d978fc82579b4b1e66a2b265b35aca34583b10cf Mon Sep 17 00:00:00 2001 From: maz Date: Thu, 16 May 2024 14:03:59 +0900 Subject: [PATCH 04/21] fix: README --- packages/aws-cdk-lib/aws-ec2/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index a323b37b424c3..0df9754fd93ae 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1903,7 +1903,7 @@ You can enable [AWS Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/ declare const vpc: ec2.Vpc; const instance = new ec2.Instance(this, 'Instance', { - instanceType: ec2.InstanceType.of(ec2.InstanceClass.T5, ec2.InstanceSize.XLARGE), + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE), machineImage: new ec2.AmazonLinuxImage(), vpc: vpc, nitroEnclaveEnabled: true, @@ -1915,15 +1915,17 @@ const instance = new ec2.Instance(this, 'Instance', { You can enable [Instance Hibernation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) for your EC2 instances by setting the `hibernationConfigured` property to `true`. Instance Hibernation saves the instance's in-memory (RAM) state when an instance is stopped, and restores that state when the instance is started. ```ts +declare const vpc: ec2.Vpc; + const instance = new ec2.Instance(this, 'Instance', { - instanceType: ec2.InstanceType.of(ec2.InstanceClass.T5, ec2.InstanceSize.XLARGE), + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE), machineImage: new ec2.AmazonLinuxImage(), vpc: vpc, hibernationConfigured: true, blockDevices: [{ deviceName: '/dev/xvda', - volume: BlockDeviceVolume.ebs(30, { - volumeType: EbsDeviceVolumeType.GP3, + volume: ec2.BlockDeviceVolume.ebs(30, { + volumeType: ec2.EbsDeviceVolumeType.GP3, encrypted: true, deleteOnTermination: true, }), From e6e209e52cd5ee009ab09109af0b1ae1dc3e2474 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:45:39 +0900 Subject: [PATCH 05/21] Update packages/aws-cdk-lib/aws-ec2/README.md Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index 3c82606dfbe32..da7ac61f08ded 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1951,8 +1951,6 @@ const instance = new ec2.Instance(this, 'Instance', { }], }); ``` - - ## VPC Flow Logs VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. Flow log data can be published to Amazon CloudWatch Logs and Amazon S3. After you've created a flow log, you can retrieve and view its data in the chosen destination. (). From ef219e8539470bcf1708e9209dd8a11557edd338 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:45:48 +0900 Subject: [PATCH 06/21] Update packages/aws-cdk-lib/aws-ec2/lib/instance.ts Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index d61c9fce052de..879c2c864879d 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -327,7 +327,7 @@ export interface InstanceProps { /** * If this parameter is set to true, the instance is enabled for AWS Nitro Enclaves; otherwise, it is not enabled for AWS Nitro Enclaves. * - * @default false. + * @default - false */ readonly nitroEnclaveEnabled?: boolean; From 21be6d49193d7ba5f396e799699ee1f66cf11169 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:46:05 +0900 Subject: [PATCH 07/21] Update packages/aws-cdk-lib/aws-ec2/lib/instance.ts Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index 879c2c864879d..ff0d9be4a337f 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -325,7 +325,9 @@ export interface InstanceProps { readonly placementGroup?: IPlacementGroup; /** - * If this parameter is set to true, the instance is enabled for AWS Nitro Enclaves; otherwise, it is not enabled for AWS Nitro Enclaves. + * Whether the instance is enabled for AWS Nitro Enclaves. + * + * You can't set both `nitroEnclaveEnabled` and `hibernationConfigured` to true on the same instance. * * @default - false */ From f7c0284f3d1b1dcf08b42b7db5c12dfbd386733b Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:46:13 +0900 Subject: [PATCH 08/21] Update packages/aws-cdk-lib/aws-ec2/lib/instance.ts Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index ff0d9be4a337f..ef04d94b1c8fc 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -337,7 +337,7 @@ export interface InstanceProps { * If you set this parameter to true, the instance is enabled for hibernation. * You can't enable hibernation and AWS Nitro Enclaves on the same instance. * - * @default false + * @default - false */ readonly hibernationConfigured?: boolean; } From 3d1533b7c1e45594c60c5ebceb694a60a7566485 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:46:24 +0900 Subject: [PATCH 09/21] Update packages/aws-cdk-lib/aws-ec2/lib/instance.ts Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index ef04d94b1c8fc..79dc1d2923d2d 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -492,7 +492,7 @@ export class Instance extends Resource implements IInstance { } if (props.nitroEnclaveEnabled && props.hibernationConfigured) { - throw new Error('You can\'t enable hibernation and AWS Nitro Enclaves on the same instance.'); + throw new Error('You can\'t set both `nitroEnclaveEnabled` and `hibernationConfigured` to true on the same instance'); } // if network interfaces array is configured then subnetId, securityGroupIds, From 5ac126fc7478133e9c626d6b1196b4f85ac3fa35 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:46:36 +0900 Subject: [PATCH 10/21] Update packages/aws-cdk-lib/aws-ec2/README.md Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index da7ac61f08ded..8003c4273ce57 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1913,7 +1913,6 @@ new ec2.Vpc(this, 'VPC', { **Note**: `CpuCredits.UNLIMITED` mode is not supported for T3 instances that are launched on a Dedicated Host. - ### Enabling Nitro Enclaves You can enable [AWS Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html) for your EC2 instances by setting the `nitroEnclaveEnabled` property to `true`. Nitro Enclaves are a feature of AWS Nitro System that enables creating isolated and highly constrained CPU environments known as enclaves. From 2cacc1f4246a711691bc7bed96d8cc5c457abef1 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:47:35 +0900 Subject: [PATCH 11/21] Update packages/aws-cdk-lib/aws-ec2/README.md Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index 8003c4273ce57..cd367de2e8e71 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1915,7 +1915,9 @@ new ec2.Vpc(this, 'VPC', { ### Enabling Nitro Enclaves -You can enable [AWS Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html) for your EC2 instances by setting the `nitroEnclaveEnabled` property to `true`. Nitro Enclaves are a feature of AWS Nitro System that enables creating isolated and highly constrained CPU environments known as enclaves. +You can enable [AWS Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html) for +your EC2 instances by setting the `nitroEnclaveEnabled` property to `true`. Nitro Enclaves is a feature of +AWS Nitro System that enables creating isolated and highly constrained CPU environments known as enclaves. ```ts declare const vpc: ec2.Vpc; From b6821b6592b37b347e101ca4c44d6c4465895094 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:48:22 +0900 Subject: [PATCH 12/21] Update packages/aws-cdk-lib/aws-ec2/README.md Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index cd367de2e8e71..f7cbb2ed444e6 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1932,7 +1932,9 @@ const instance = new ec2.Instance(this, 'Instance', { ### Enabling Instance Hibernation -You can enable [Instance Hibernation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) for your EC2 instances by setting the `hibernationConfigured` property to `true`. Instance Hibernation saves the instance's in-memory (RAM) state when an instance is stopped, and restores that state when the instance is started. +You can enable [Instance Hibernation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) for +your EC2 instances by setting the `hibernationConfigured` property to `true`. Instance Hibernation saves the +instance's in-memory (RAM) state when an instance is stopped, and restores that state when the instance is started. ```ts declare const vpc: ec2.Vpc; From 90792c4470af6d401955369842eadc347623b3d5 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 20:48:47 +0900 Subject: [PATCH 13/21] Update packages/aws-cdk-lib/aws-ec2/lib/instance.ts Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index 79dc1d2923d2d..ef7f19174bd9a 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -334,8 +334,9 @@ export interface InstanceProps { readonly nitroEnclaveEnabled?: boolean; /** - * If you set this parameter to true, the instance is enabled for hibernation. - * You can't enable hibernation and AWS Nitro Enclaves on the same instance. + * Whether the instance is enabled for hibernation. + * + * You can't set both `nitroEnclaveEnabled` and `hibernationConfigured` to true on the same instance. * * @default - false */ From 35956486400cf8525cfb8831bcdb66ce5cffb674 Mon Sep 17 00:00:00 2001 From: maz Date: Thu, 23 May 2024 21:05:07 +0900 Subject: [PATCH 14/21] fix: Incorporate review comments --- ...teg.instance-nitoro-envlaves-hibernation.ts | 8 ++++---- packages/aws-cdk-lib/aws-ec2/README.md | 10 +++++----- packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 18 +++++++++--------- .../aws-cdk-lib/aws-ec2/test/instance.test.ts | 16 ++++++++-------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts index 1c23304da04ed..56299f54efd3f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts @@ -19,8 +19,8 @@ class TestStack extends cdk.Stack { securityGroup, instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE), machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023 }), - nitroEnclaveEnabled: true, - hibernationConfigured: false, + enclaveEnabled: true, + hibernationEnabled: false, }); new ec2.Instance(this, 'InstanceHibernationEnabled', { @@ -28,8 +28,8 @@ class TestStack extends cdk.Stack { securityGroup, instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE), machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023 }), - nitroEnclaveEnabled: false, - hibernationConfigured: true, + enclaveEnabled: false, + hibernationEnabled: true, blockDevices: [{ deviceName: '/dev/xvda', volume: ec2.BlockDeviceVolume.ebs(30, { diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index f7cbb2ed444e6..9c31b16fbde08 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1521,7 +1521,7 @@ const host = new ec2.BastionHostLinux(this, 'BastionHost', { }); ``` -### Placement Group +### Placement Group Specify `placementGroup` to enable the placement group support: @@ -1916,7 +1916,7 @@ new ec2.Vpc(this, 'VPC', { ### Enabling Nitro Enclaves You can enable [AWS Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html) for -your EC2 instances by setting the `nitroEnclaveEnabled` property to `true`. Nitro Enclaves is a feature of +your EC2 instances by setting the `enclaveEnabled` property to `true`. Nitro Enclaves is a feature of AWS Nitro System that enables creating isolated and highly constrained CPU environments known as enclaves. ```ts @@ -1926,14 +1926,14 @@ const instance = new ec2.Instance(this, 'Instance', { instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE), machineImage: new ec2.AmazonLinuxImage(), vpc: vpc, - nitroEnclaveEnabled: true, + enclaveEnabled: true, }); ``` ### Enabling Instance Hibernation You can enable [Instance Hibernation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) for -your EC2 instances by setting the `hibernationConfigured` property to `true`. Instance Hibernation saves the +your EC2 instances by setting the `hibernationEnabled` property to `true`. Instance Hibernation saves the instance's in-memory (RAM) state when an instance is stopped, and restores that state when the instance is started. ```ts @@ -1943,7 +1943,7 @@ const instance = new ec2.Instance(this, 'Instance', { instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE), machineImage: new ec2.AmazonLinuxImage(), vpc: vpc, - hibernationConfigured: true, + hibernationEnabled: true, blockDevices: [{ deviceName: '/dev/xvda', volume: ec2.BlockDeviceVolume.ebs(30, { diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index ef7f19174bd9a..a49320acf2a2a 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -323,24 +323,24 @@ export interface InstanceProps { * @default - no placement group will be used for this instance. */ readonly placementGroup?: IPlacementGroup; - + /** * Whether the instance is enabled for AWS Nitro Enclaves. * - * You can't set both `nitroEnclaveEnabled` and `hibernationConfigured` to true on the same instance. + * You can't set both `enclaveEnabled` and `hibernationEnabled` to true on the same instance. * * @default - false */ - readonly nitroEnclaveEnabled?: boolean; + readonly enclaveEnabled?: boolean; /** * Whether the instance is enabled for hibernation. * - * You can't set both `nitroEnclaveEnabled` and `hibernationConfigured` to true on the same instance. + * You can't set both `enclaveEnabled` and `hibernationEnabled` to true on the same instance. * * @default - false */ - readonly hibernationConfigured?: boolean; + readonly hibernationEnabled?: boolean; } /** @@ -492,8 +492,8 @@ export class Instance extends Resource implements IInstance { throw new Error(`${props.keyPair.type} keys are not compatible with the chosen AMI`); } - if (props.nitroEnclaveEnabled && props.hibernationConfigured) { - throw new Error('You can\'t set both `nitroEnclaveEnabled` and `hibernationConfigured` to true on the same instance'); + if (props.enclaveEnabled && props.hibernationEnabled) { + throw new Error('You can\'t set both `enclaveEnabled` and `hibernationEnabled` to true on the same instance'); } // if network interfaces array is configured then subnetId, securityGroupIds, @@ -517,8 +517,8 @@ export class Instance extends Resource implements IInstance { creditSpecification: props.creditSpecification ? { cpuCredits: props.creditSpecification } : undefined, ebsOptimized: props.ebsOptimized, placementGroupName: props.placementGroup?.placementGroupName, - enclaveOptions: props.nitroEnclaveEnabled !== undefined ? { enabled: props.nitroEnclaveEnabled } : undefined, - hibernationOptions: props.hibernationConfigured !== undefined ? { configured: props.hibernationConfigured } : undefined, + enclaveOptions: props.enclaveEnabled !== undefined ? { enabled: props.enclaveEnabled } : undefined, + hibernationOptions: props.hibernationEnabled !== undefined ? { configured: props.hibernationEnabled } : undefined, }); this.instance.node.addDependency(this.role); diff --git a/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts b/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts index cd8eb839659d3..a58307b6a9090 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts @@ -942,13 +942,13 @@ test('specify ebs optimized instance', () => { test.each([ [true, true], [false, false], -])('given nitroEnclaveEnabled %p', (given: boolean, expected: boolean) => { +])('given enclaveEnabled %p', (given: boolean, expected: boolean) => { // WHEN new Instance(stack, 'Instance', { vpc, machineImage: new AmazonLinuxImage(), instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.XLARGE), - nitroEnclaveEnabled: given, + enclaveEnabled: given, }); // THEN @@ -962,13 +962,13 @@ test.each([ test.each([ [true, true], [false, false], -])('given hibernationConfigured %p', (given: boolean, expected: boolean) => { +])('given hibernationEnabled %p', (given: boolean, expected: boolean) => { // WHEN new Instance(stack, 'Instance', { vpc, machineImage: new AmazonLinuxImage(), instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.XLARGE), - hibernationConfigured: given, + hibernationEnabled: given, blockDevices: [{ deviceName: '/dev/xvda', volume: BlockDeviceVolume.ebs(30, { @@ -987,15 +987,15 @@ test.each([ }); }); -test('throw if AWS Nitro Enclaves and hibernation are enabled', () => { +test('throw if both enclaveEnabled and hibernationEnabled are set to true', () => { // WHEN/THEN expect(() => { new Instance(stack, 'Instance', { vpc, machineImage: new AmazonLinuxImage(), instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE), - nitroEnclaveEnabled: true, - hibernationConfigured: true, + enclaveEnabled: true, + hibernationEnabled: true, blockDevices: [{ deviceName: '/dev/xvda', volume: BlockDeviceVolume.ebs(30, { @@ -1005,5 +1005,5 @@ test('throw if AWS Nitro Enclaves and hibernation are enabled', () => { }), }], }); - }).toThrow('You can\'t enable hibernation and AWS Nitro Enclaves on the same instance.'); + }).toThrow('You can\'t set both `enclaveEnabled` and `hibernationEnabled` to true on the same instance'); }); From 30733875e001543b3c179a344110e01b892c9a0c Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Thu, 23 May 2024 22:34:34 +0900 Subject: [PATCH 15/21] Update packages/aws-cdk-lib/aws-ec2/README.md Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-ec2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index 9c31b16fbde08..303e36605daff 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1954,6 +1954,7 @@ const instance = new ec2.Instance(this, 'Instance', { }], }); ``` + ## VPC Flow Logs VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. Flow log data can be published to Amazon CloudWatch Logs and Amazon S3. After you've created a flow log, you can retrieve and view its data in the chosen destination. (). From 981b1c35b00445b8ffe13fa4c410e5d7ff461f68 Mon Sep 17 00:00:00 2001 From: maz Date: Sat, 25 May 2024 12:19:35 +0900 Subject: [PATCH 16/21] fix: Incorporate review comments --- .../__entrypoint__.js | 0 .../index.js | 0 .../cdk.out | 0 ...nationDefaultTestDeployAssertDE7E123E.assets.json | 0 ...tionDefaultTestDeployAssertDE7E123E.template.json | 0 ...2-instance-nitro-enclaves-hibernation.assets.json | 4 ++-- ...instance-nitro-enclaves-hibernation.template.json | 12 ------------ .../integ.json | 0 .../manifest.json | 2 +- .../tree.json | 12 ------------ ... => integ.instance-nitro-envlaves-hibernation.ts} | 0 packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 8 ++++++++ 12 files changed, 11 insertions(+), 27 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/cdk.out (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/integ-ec2-instance-nitro-enclaves-hibernation.assets.json (87%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/integ-ec2-instance-nitro-enclaves-hibernation.template.json (98%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/integ.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/manifest.json (99%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.js.snapshot => integ.instance-nitro-envlaves-hibernation.js.snapshot}/tree.json (99%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitoro-envlaves-hibernation.ts => integ.instance-nitro-envlaves-hibernation.ts} (100%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/cdk.out similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/cdk.out rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/cdk.out diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json similarity index 87% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json index 9eb5fe673f5a1..d5c2882fdb866 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json @@ -14,7 +14,7 @@ } } }, - "ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3": { + "3ef18bf0e011f6da1ad94cce6f6d5f392e617b6092af52d8101e723cb7614ba4": { "source": { "path": "integ-ec2-instance-nitro-enclaves-hibernation.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3.json", + "objectKey": "3ef18bf0e011f6da1ad94cce6f6d5f392e617b6092af52d8101e723cb7614ba4.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json similarity index 98% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json index 6464b8b77d212..2a684e89aba43 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json @@ -572,12 +572,6 @@ } ] }, - "EnclaveOptions": { - "Enabled": true - }, - "HibernationOptions": { - "Configured": false - }, "IamInstanceProfile": { "Ref": "InstanceNitroEnclavesEnabledInstanceProfile9E95679C" }, @@ -665,12 +659,6 @@ } } ], - "EnclaveOptions": { - "Enabled": false - }, - "HibernationOptions": { - "Configured": true - }, "IamInstanceProfile": { "Ref": "InstanceHibernationEnabledInstanceProfile2F0E93E0" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/integ.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json similarity index 99% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/manifest.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json index 9a01d453d6012..c7bb691ad8a1c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3ef18bf0e011f6da1ad94cce6f6d5f392e617b6092af52d8101e723cb7614ba4.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json similarity index 99% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/tree.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json index c2d428f3c6234..3b2cad11a8332 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json @@ -827,12 +827,6 @@ } ] }, - "enclaveOptions": { - "enabled": true - }, - "hibernationOptions": { - "configured": false - }, "iamInstanceProfile": { "Ref": "InstanceNitroEnclavesEnabledInstanceProfile9E95679C" }, @@ -985,12 +979,6 @@ } } ], - "enclaveOptions": { - "enabled": false - }, - "hibernationOptions": { - "configured": true - }, "iamInstanceProfile": { "Ref": "InstanceHibernationEnabledInstanceProfile2F0E93E0" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitoro-envlaves-hibernation.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.ts diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index a49320acf2a2a..976125672217e 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -327,8 +327,14 @@ export interface InstanceProps { /** * Whether the instance is enabled for AWS Nitro Enclaves. * + * Nitro Enclaves requires a Nitro-based virtualized parent instance with specific Intel/AMD with at least 4 vCPUs + * or Graviton with at least 2 vCPUs instance types and Linux/Windows host OS, + * while the enclave itself supports only Linux OS. + * * You can't set both `enclaveEnabled` and `hibernationEnabled` to true on the same instance. * + * @see https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html#nitro-enclave-reqs + * * @default - false */ readonly enclaveEnabled?: boolean; @@ -338,6 +344,8 @@ export interface InstanceProps { * * You can't set both `enclaveEnabled` and `hibernationEnabled` to true on the same instance. * + * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-hibernationoptions.html + * * @default - false */ readonly hibernationEnabled?: boolean; From 0d71e3c35929b0d858cd25cae88a6bae28c8affe Mon Sep 17 00:00:00 2001 From: maz Date: Sat, 25 May 2024 13:49:14 +0900 Subject: [PATCH 17/21] fix: update integ-test --- ...2-instance-nitro-enclaves-hibernation.assets.json | 4 ++-- ...instance-nitro-enclaves-hibernation.template.json | 12 ++++++++++++ .../manifest.json | 2 +- .../tree.json | 12 ++++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json index d5c2882fdb866..9eb5fe673f5a1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json @@ -14,7 +14,7 @@ } } }, - "3ef18bf0e011f6da1ad94cce6f6d5f392e617b6092af52d8101e723cb7614ba4": { + "ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3": { "source": { "path": "integ-ec2-instance-nitro-enclaves-hibernation.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3ef18bf0e011f6da1ad94cce6f6d5f392e617b6092af52d8101e723cb7614ba4.json", + "objectKey": "ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json index 2a684e89aba43..6464b8b77d212 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json @@ -572,6 +572,12 @@ } ] }, + "EnclaveOptions": { + "Enabled": true + }, + "HibernationOptions": { + "Configured": false + }, "IamInstanceProfile": { "Ref": "InstanceNitroEnclavesEnabledInstanceProfile9E95679C" }, @@ -659,6 +665,12 @@ } } ], + "EnclaveOptions": { + "Enabled": false + }, + "HibernationOptions": { + "Configured": true + }, "IamInstanceProfile": { "Ref": "InstanceHibernationEnabledInstanceProfile2F0E93E0" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json index c7bb691ad8a1c..9a01d453d6012 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3ef18bf0e011f6da1ad94cce6f6d5f392e617b6092af52d8101e723cb7614ba4.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json index 3b2cad11a8332..c2d428f3c6234 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json @@ -827,6 +827,12 @@ } ] }, + "enclaveOptions": { + "enabled": true + }, + "hibernationOptions": { + "configured": false + }, "iamInstanceProfile": { "Ref": "InstanceNitroEnclavesEnabledInstanceProfile9E95679C" }, @@ -979,6 +985,12 @@ } } ], + "enclaveOptions": { + "enabled": false + }, + "hibernationOptions": { + "configured": true + }, "iamInstanceProfile": { "Ref": "InstanceHibernationEnabledInstanceProfile2F0E93E0" }, From 646064812a28d7743bbb0eb38d6afd2d4fc72441 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Mon, 27 May 2024 14:58:15 +0900 Subject: [PATCH 18/21] Update README.md --- packages/aws-cdk-lib/aws-ec2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index 620148a2a8e64..db307429ea608 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1967,6 +1967,7 @@ const instance = new ec2.Instance(this, 'Instance', { deleteOnTermination: true, }), }], +}); ``` ## VPC Flow Logs From f13430982cf75459f142a456c51a698844dcbb8d Mon Sep 17 00:00:00 2001 From: maz Date: Fri, 31 May 2024 12:21:32 +0900 Subject: [PATCH 19/21] docs: update README --- packages/aws-cdk-lib/aws-ec2/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index db307429ea608..5d10fd95d7e5f 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -1945,6 +1945,9 @@ const instance = new ec2.Instance(this, 'Instance', { }); ``` +> NOTE: You must use an instance type and operating system that support Nitro Enclaves. +> For more information, see [Requirements](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html#nitro-enclave-reqs). + ### Enabling Instance Hibernation You can enable [Instance Hibernation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) for @@ -1970,6 +1973,10 @@ const instance = new ec2.Instance(this, 'Instance', { }); ``` +> NOTE: You must use an instance and a volume that meet the requirements for hibernation. +> For more information, see [Prerequisites for Amazon EC2 instance hibernation](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html#nitro-enclave-reqs). + + ## VPC Flow Logs VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. Flow log data can be published to Amazon CloudWatch Logs and Amazon S3. After you've created a flow log, you can retrieve and view its data in the chosen destination. (). From 2a5b07326d4a38916da854bcc3641ea11975f92a Mon Sep 17 00:00:00 2001 From: maz Date: Sat, 1 Jun 2024 12:11:00 +0900 Subject: [PATCH 20/21] fix: update integ test --- .../__entrypoint__.js | 0 .../index.js | 0 .../cdk.out | 0 ...ernationDefaultTestDeployAssertDE7E123E.assets.json | 0 ...nationDefaultTestDeployAssertDE7E123E.template.json | 0 ...ec2-instance-nitro-enclaves-hibernation.assets.json | 0 ...2-instance-nitro-enclaves-hibernation.template.json | 0 .../integ.json | 0 .../manifest.json | 10 ++++++++-- .../tree.json | 0 ...ts => integ.instance-nitro-enclaves-hibernation.ts} | 0 11 files changed, 8 insertions(+), 2 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/cdk.out (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/integ-ec2-instance-nitro-enclaves-hibernation.assets.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/integ-ec2-instance-nitro-enclaves-hibernation.template.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/integ.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/manifest.json (97%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.js.snapshot => integ.instance-nitro-enclaves-hibernation.js.snapshot}/tree.json (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/{integ.instance-nitro-envlaves-hibernation.ts => integ.instance-nitro-enclaves-hibernation.ts} (100%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/cdk.out similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/cdk.out rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/cdk.out diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.assets.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/instancenitroenclaveshibernationDefaultTestDeployAssertDE7E123E.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/integ.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/manifest.json similarity index 97% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/manifest.json index 9a01d453d6012..1cdedd24afd86 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/manifest.json @@ -211,7 +211,10 @@ "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/Resource": [ { "type": "aws:cdk:logicalId", - "data": "InstanceNitroEnclavesEnabledB4F56EB8" + "data": "InstanceNitroEnclavesEnabledB4F56EB8", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/integ-ec2-instance-nitro-enclaves-hibernation/SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ @@ -235,7 +238,10 @@ "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/Resource": [ { "type": "aws:cdk:logicalId", - "data": "InstanceHibernationEnabledF668067C" + "data": "InstanceHibernationEnabledF668067C", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/integ-ec2-instance-nitro-enclaves-hibernation/BootstrapVersion": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/tree.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.js.snapshot/tree.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/tree.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.ts similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-envlaves-hibernation.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.ts From e204709d5a391308e1e9d304770fcfe7e45d3963 Mon Sep 17 00:00:00 2001 From: maz Date: Fri, 14 Jun 2024 09:58:28 +0900 Subject: [PATCH 21/21] fix: update integ test --- ...nce-nitro-enclaves-hibernation.assets.json | 4 +- ...e-nitro-enclaves-hibernation.template.json | 119 +++++++++++++++++- .../manifest.json | 18 +-- .../tree.json | 8 ++ 4 files changed, 137 insertions(+), 12 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json index 9eb5fe673f5a1..eca24f8b78edd 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.assets.json @@ -14,7 +14,7 @@ } } }, - "ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3": { + "cf4dc9185f361bb2ff2a3d69114521d946af5b1dca9de6ba570ca952acd95e68": { "source": { "path": "integ-ec2-instance-nitro-enclaves-hibernation.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3.json", + "objectKey": "cf4dc9185f361bb2ff2a3d69114521d946af5b1dca9de6ba570ca952acd95e68.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json index 6464b8b77d212..4e15e214c76f4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/integ-ec2-instance-nitro-enclaves-hibernation.template.json @@ -500,7 +500,15 @@ "Arn" ] }, - "Runtime": "nodejs18.x", + "Runtime": { + "Fn::FindInMap": [ + "LatestNodeRuntimeMap", + { + "Ref": "AWS::Region" + }, + "value" + ] + }, "Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group" }, "DependsOn": [ @@ -704,6 +712,115 @@ ] } }, + "Mappings": { + "LatestNodeRuntimeMap": { + "af-south-1": { + "value": "nodejs20.x" + }, + "ap-east-1": { + "value": "nodejs20.x" + }, + "ap-northeast-1": { + "value": "nodejs20.x" + }, + "ap-northeast-2": { + "value": "nodejs20.x" + }, + "ap-northeast-3": { + "value": "nodejs20.x" + }, + "ap-south-1": { + "value": "nodejs20.x" + }, + "ap-south-2": { + "value": "nodejs20.x" + }, + "ap-southeast-1": { + "value": "nodejs20.x" + }, + "ap-southeast-2": { + "value": "nodejs20.x" + }, + "ap-southeast-3": { + "value": "nodejs20.x" + }, + "ap-southeast-4": { + "value": "nodejs20.x" + }, + "ca-central-1": { + "value": "nodejs20.x" + }, + "cn-north-1": { + "value": "nodejs18.x" + }, + "cn-northwest-1": { + "value": "nodejs18.x" + }, + "eu-central-1": { + "value": "nodejs20.x" + }, + "eu-central-2": { + "value": "nodejs20.x" + }, + "eu-north-1": { + "value": "nodejs20.x" + }, + "eu-south-1": { + "value": "nodejs20.x" + }, + "eu-south-2": { + "value": "nodejs20.x" + }, + "eu-west-1": { + "value": "nodejs20.x" + }, + "eu-west-2": { + "value": "nodejs20.x" + }, + "eu-west-3": { + "value": "nodejs20.x" + }, + "il-central-1": { + "value": "nodejs20.x" + }, + "me-central-1": { + "value": "nodejs20.x" + }, + "me-south-1": { + "value": "nodejs20.x" + }, + "sa-east-1": { + "value": "nodejs20.x" + }, + "us-east-1": { + "value": "nodejs20.x" + }, + "us-east-2": { + "value": "nodejs20.x" + }, + "us-gov-east-1": { + "value": "nodejs18.x" + }, + "us-gov-west-1": { + "value": "nodejs18.x" + }, + "us-iso-east-1": { + "value": "nodejs18.x" + }, + "us-iso-west-1": { + "value": "nodejs18.x" + }, + "us-isob-east-1": { + "value": "nodejs18.x" + }, + "us-west-1": { + "value": "nodejs20.x" + }, + "us-west-2": { + "value": "nodejs20.x" + } + } + }, "Parameters": { "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter": { "Type": "AWS::SSM::Parameter::Value", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/manifest.json index 1cdedd24afd86..b579f4b36aaae 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/manifest.json @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ce16a8eea19398bb6dc883e46109909f5c1ff79171de8fd85b0bdf40681d04f3.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cf4dc9185f361bb2ff2a3d69114521d946af5b1dca9de6ba570ca952acd95e68.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -178,6 +178,12 @@ "data": "VPCRestrictDefaultSecurityGroupCustomResource59474679" } ], + "/integ-ec2-instance-nitro-enclaves-hibernation/LatestNodeRuntimeMap": [ + { + "type": "aws:cdk:logicalId", + "data": "LatestNodeRuntimeMap" + } + ], "/integ-ec2-instance-nitro-enclaves-hibernation/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", @@ -211,10 +217,7 @@ "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceNitroEnclavesEnabled/Resource": [ { "type": "aws:cdk:logicalId", - "data": "InstanceNitroEnclavesEnabledB4F56EB8", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "InstanceNitroEnclavesEnabledB4F56EB8" } ], "/integ-ec2-instance-nitro-enclaves-hibernation/SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ @@ -238,10 +241,7 @@ "/integ-ec2-instance-nitro-enclaves-hibernation/InstanceHibernationEnabled/Resource": [ { "type": "aws:cdk:logicalId", - "data": "InstanceHibernationEnabledF668067C", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "InstanceHibernationEnabledF668067C" } ], "/integ-ec2-instance-nitro-enclaves-hibernation/BootstrapVersion": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/tree.json index c2d428f3c6234..0e7979fe0a9dc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.instance-nitro-enclaves-hibernation.js.snapshot/tree.json @@ -669,6 +669,14 @@ "version": "0.0.0" } }, + "LatestNodeRuntimeMap": { + "id": "LatestNodeRuntimeMap", + "path": "integ-ec2-instance-nitro-enclaves-hibernation/LatestNodeRuntimeMap", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnMapping", + "version": "0.0.0" + } + }, "Custom::VpcRestrictDefaultSGCustomResourceProvider": { "id": "Custom::VpcRestrictDefaultSGCustomResourceProvider", "path": "integ-ec2-instance-nitro-enclaves-hibernation/Custom::VpcRestrictDefaultSGCustomResourceProvider",