diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js new file mode 100644 index 0000000000000..ff3a517fba12d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.external = void 0; +exports.handler = handler; +exports.withRetries = withRetries; +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); + } +} +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; + } + } + }; +} +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.windows-machine-image.js.snapshot/asset.e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da/__entrypoint__.js deleted file mode 100644 index 9271364bb7e49..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/asset.e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da/__entrypoint__.js +++ /dev/null @@ -1,156 +0,0 @@ -"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)); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBRTNCLGlCQUFpQjtBQUNKLFFBQUEsUUFBUSxHQUFHO0lBQ3RCLGVBQWUsRUFBRSxzQkFBc0I7SUFDdkMsR0FBRyxFQUFFLFVBQVU7SUFDZixrQkFBa0IsRUFBRSxJQUFJO0lBQ3hCLGdCQUFnQixFQUFFL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+IHNldFRpbWVvdXQob2ssIG1zKSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/cdk.out index 1f0068d32659a..c6e612584e352 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.assets.json similarity index 83% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.assets.json index ec84e28385abe..a516f3654e43f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.assets.json @@ -1,9 +1,9 @@ { - "version": "36.0.0", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "integ-ec2-windows-image-ids.template.json", + "path": "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-instance-Windows-Server-2016-English-Core-Base.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-instance-Windows-Server-2016-English-Core-Base.assets.json index 6c9d3197b5253..3edb9bcb13ea2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-instance-Windows-Server-2016-English-Core-Base.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-instance-Windows-Server-2016-English-Core-Base.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "38.0.1", "files": { "ff635b23b1a8753a3ad0a8d7cd461d5d2b7efeeec341d9dd40b1c38be1b4e4d0": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-instance-Windows-Server-2022-Dutch-Full-Base.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-instance-Windows-Server-2022-Dutch-Full-Base.assets.json index 202fc04ec4de1..97c03150fa65d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-instance-Windows-Server-2022-Dutch-Full-Base.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-instance-Windows-Server-2022-Dutch-Full-Base.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "38.0.1", "files": { "afb982706a8c5b4742057e12b14294004045a70deea6875421aa0a8a4c27627d": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-vpc.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-vpc.assets.json index f08064a4e6b9d..0cce9196e8c5e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-vpc.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-vpc.assets.json @@ -1,21 +1,21 @@ { - "version": "36.0.0", + "version": "38.0.1", "files": { - "e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da": { + "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c": { "source": { - "path": "asset.e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da", + "path": "asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c", "packaging": "zip" }, "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da.zip", + "objectKey": "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c.zip", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } } }, - "5dd390bb81d4583b2c98763d129b4d5dea2709867dbf31b9502234d8ef5c7b05": { + "0d7bc26eb204455ddf49f69e2143561c51f0961da9497bddb0bc5c2975cd566b": { "source": { "path": "integ-ec2-windows-vpc.template.json", "packaging": "file" @@ -23,7 +23,7 @@ "destinations": { "12345678-test-region": { "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "5dd390bb81d4583b2c98763d129b4d5dea2709867dbf31b9502234d8ef5c7b05.json", + "objectKey": "0d7bc26eb204455ddf49f69e2143561c51f0961da9497bddb0bc5c2975cd566b.json", "region": "test-region", "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-vpc.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-vpc.template.json index 758e8d96016ec..4f57bbf7473ed 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-vpc.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ-ec2-windows-vpc.template.json @@ -253,7 +253,7 @@ "Properties": { "Code": { "S3Bucket": "cdk-hnb659fds-assets-12345678-test-region", - "S3Key": "e978ad4ad0dca7e1c6be5f49cbbd1c5a150ee050c24052fedfe5a42f835d55da.zip" + "S3Key": "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c.zip" }, "Timeout": 900, "MemorySize": 128, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ.json index 6bea714f8cda3..8eacf4ec2129e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/integ.json @@ -1,15 +1,15 @@ { "enableLookups": true, - "version": "36.0.0", + "version": "38.0.1", "testCases": { - "windows-machine-image-integ-test/DefaultTest": { + "windows-machine-image-ids-integ-test/DefaultTest": { "stacks": [ - "integ-ec2-windows-image-ids", + "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82", "integ-ec2-windows-instance-Windows-Server-2016-English-Core-Base", "integ-ec2-windows-instance-Windows-Server-2022-Dutch-Full-Base" ], - "assertionStack": "windows-machine-image-integ-test/DefaultTest/DeployAssert", - "assertionStackName": "windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7" + "assertionStack": "windows-machine-image-ids-integ-test/DefaultTest/DeployAssert", + "assertionStackName": "windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/manifest.json index 3db1c6611aebf..2d4fd70d8001a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "38.0.1", "artifacts": { "integ-ec2-windows-vpc.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/5dd390bb81d4583b2c98763d129b4d5dea2709867dbf31b9502234d8ef5c7b05.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/0d7bc26eb204455ddf49f69e2143561c51f0961da9497bddb0bc5c2975cd566b.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -106,6 +106,12 @@ "data": "VpcRestrictDefaultSecurityGroupCustomResourceC73DA2BE" } ], + "/integ-ec2-windows-vpc/Custom::VpcRestrictDefaultSGCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/integ-ec2-windows-vpc/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", @@ -145,19 +151,19 @@ }, "displayName": "integ-ec2-windows-vpc" }, - "integ-ec2-windows-image-ids.assets": { + "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "integ-ec2-windows-image-ids.assets.json", + "file": "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "integ-ec2-windows-image-ids": { + "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82": { "type": "aws:cloudformation:stack", "environment": "aws://12345678/test-region", "properties": { - "templateFile": "integ-ec2-windows-image-ids.template.json", + "templateFile": "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", @@ -166,7 +172,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "integ-ec2-windows-image-ids.assets" + "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-lookup-role-12345678-test-region", @@ -175,23 +181,23 @@ } }, "dependencies": [ - "integ-ec2-windows-image-ids.assets" + "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82.assets" ], "metadata": { - "/integ-ec2-windows-image-ids/BootstrapVersion": [ + "/integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/integ-ec2-windows-image-ids/CheckBootstrapVersion": [ + "/integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "integ-ec2-windows-image-ids" + "displayName": "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82" }, "integ-ec2-windows-instance-Windows-Server-2016-English-Core-Base.assets": { "type": "cdk:asset-manifest", @@ -248,10 +254,7 @@ "/integ-ec2-windows-instance-Windows-Server-2016-English-Core-Base/Instance/Resource": [ { "type": "aws:cdk:logicalId", - "data": "InstanceC1063A87", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "InstanceC1063A87" } ], "/integ-ec2-windows-instance-Windows-Server-2016-English-Core-Base/SsmParameterValue:--aws--service--ami-windows-latest--Windows_Server-2016-English-Core-Base:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ @@ -330,10 +333,7 @@ "/integ-ec2-windows-instance-Windows-Server-2022-Dutch-Full-Base/Instance/Resource": [ { "type": "aws:cdk:logicalId", - "data": "InstanceC1063A87", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "InstanceC1063A87" } ], "/integ-ec2-windows-instance-Windows-Server-2022-Dutch-Full-Base/SsmParameterValue:--aws--service--ami-windows-latest--Windows_Server-2022-Dutch-Full-Base:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ @@ -357,19 +357,19 @@ }, "displayName": "integ-ec2-windows-instance-Windows-Server-2022-Dutch-Full-Base" }, - "windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.assets": { + "windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.assets.json", + "file": "windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7": { + "windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.template.json", + "templateFile": "windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -378,7 +378,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.assets" + "windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -387,23 +387,23 @@ } }, "dependencies": [ - "windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.assets" + "windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.assets" ], "metadata": { - "/windows-machine-image-integ-test/DefaultTest/DeployAssert/BootstrapVersion": [ + "/windows-machine-image-ids-integ-test/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/windows-machine-image-integ-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/windows-machine-image-ids-integ-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "windows-machine-image-integ-test/DefaultTest/DeployAssert" + "displayName": "windows-machine-image-ids-integ-test/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/tree.json index 2d4445075f5ea..d3b8c9add948b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/tree.json @@ -378,7 +378,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "BootstrapVersion": { @@ -403,13 +403,13 @@ "version": "0.0.0" } }, - "integ-ec2-windows-image-ids": { - "id": "integ-ec2-windows-image-ids", - "path": "integ-ec2-windows-image-ids", + "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82": { + "id": "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82", + "path": "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "integ-ec2-windows-image-ids/BootstrapVersion", + "path": "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -417,7 +417,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "integ-ec2-windows-image-ids/CheckBootstrapVersion", + "path": "integ-ec2-windows-image-ids-c42a03e507b385cc94e919240a4cac82/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -841,29 +841,29 @@ "version": "0.0.0" } }, - "windows-machine-image-integ-test": { - "id": "windows-machine-image-integ-test", - "path": "windows-machine-image-integ-test", + "windows-machine-image-ids-integ-test": { + "id": "windows-machine-image-ids-integ-test", + "path": "windows-machine-image-ids-integ-test", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "windows-machine-image-integ-test/DefaultTest", + "path": "windows-machine-image-ids-integ-test/DefaultTest", "children": { "Default": { "id": "Default", - "path": "windows-machine-image-integ-test/DefaultTest/Default", + "path": "windows-machine-image-ids-integ-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "DeployAssert": { "id": "DeployAssert", - "path": "windows-machine-image-integ-test/DefaultTest/DeployAssert", + "path": "windows-machine-image-ids-integ-test/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "windows-machine-image-integ-test/DefaultTest/DeployAssert/BootstrapVersion", + "path": "windows-machine-image-ids-integ-test/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -871,7 +871,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "windows-machine-image-integ-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "windows-machine-image-ids-integ-test/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -900,7 +900,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.assets.json similarity index 83% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.assets.json index 31abefdd04725..f4a238ca99b79 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.assets.json @@ -1,9 +1,9 @@ { - "version": "36.0.0", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.template.json", + "path": "windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageintegtestDefaultTestDeployAssertB65E22D7.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.js.snapshot/windowsmachineimageidsintegtestDefaultTestDeployAssert275BD33B.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.ts index 1339d13160581..8214f94f5fdc6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.windows-machine-image.ts @@ -8,6 +8,7 @@ import * as jsii from 'jsii'; import * as reflect from 'jsii-reflect'; import * as path from 'path'; import * as fs from 'fs'; +import { md5hash } from 'aws-cdk-lib/core/lib/helpers-internal'; const env = { account: process.env.CDK_INTEG_ACCOUNT ?? process.env.CDK_DEFAULT_ACCOUNT, @@ -56,9 +57,7 @@ class ImageIdTestCase extends Stack { super(scope, id, props); for (const version of props.windowsVersions) { - const member = windowsVersionReflector.findMember(getWindowsVersionEnumKey(version)); - if (!member) throw new Error(`Could not find enum member for: ${version}`); - if (member.docs.deprecated) { + if (isWindowsVersionDeprecated(version)) { try { // Expecting this to throw, if not, the image should not have been deprecated retrieveWindowsImage(version); @@ -112,15 +111,21 @@ const app = new App(); const { vpc } = new VpcStack(app, 'integ-ec2-windows-vpc', { env }); -new IntegTest(app, 'windows-machine-image-integ-test', { +const windowsVersions = Object.values(ec2.WindowsVersion); +// Hash calculated to detect changes made to the WindowsVersion enum +// This will detect additions, deletions, renames or changes to their deprecation status. +const windowsVersionsHash = md5hash( + windowsVersions.reduce((hash, version) => + [hash, slugifyVersion(version), isWindowsVersionDeprecated(version) ? 'deprecated' : ''].join(','), + ''), +); + +new IntegTest(app, 'windows-machine-image-ids-integ-test', { testCases: [ new ImageIdTestCase( app, - 'integ-ec2-windows-image-ids', - { - windowsVersions: Object.values(ec2.WindowsVersion), - env, - }, + `integ-ec2-windows-image-ids-${windowsVersionsHash}`, + { windowsVersions, env }, ), ...[ @@ -143,6 +148,12 @@ function getWindowsVersionEnumKey(windowsVersion: ec2.WindowsVersion) { return windowsVersion.toLocaleUpperCase().replace(/[-.]/g, '_'); } +function isWindowsVersionDeprecated(version: ec2.WindowsVersion): boolean { + const member = windowsVersionReflector.findMember(getWindowsVersionEnumKey(version)); + if (!member) throw new Error(`Could not find enum member for: ${version}`); + return member.docs.deprecated; +} + function retrieveWindowsImage(version: ec2.WindowsVersion) { return ec2.MachineImage.fromSsmParameter( '/aws/service/ami-windows-latest/' + version,