diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/index.js deleted file mode 100644 index d108d3ce36d09..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/index.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Z(e))!N.call(t,n)&&n!==r&&a(t,n,{get:()=>e[n],enumerable:!(o=f(e,n))||o.enumerable});return t};var E=t=>h(a({},"__esModule",{value:!0}),t);var T={};P(T,{handler:()=>D});module.exports=E(T);var c=require("@aws-sdk/client-route-53"),u=require("@aws-sdk/credential-providers");async function D(t){let e=t.ResourceProperties;switch(t.RequestType){case"Create":return s(e,!1);case"Update":return w(e,t.OldResourceProperties);case"Delete":return s(e,!0)}}async function w(t,e){e&&t.DelegatedZoneName!==e.DelegatedZoneName&&await s(e,!0),await s(t,!1)}async function s(t,e){let{AssumeRoleArn:r,ParentZoneId:o,ParentZoneName:n,DelegatedZoneName:d,DelegatedZoneNameServers:m,TTL:g}=t;if(!o&&!n)throw Error("One of ParentZoneId or ParentZoneName must be specified");let l=new Date().getTime(),i=new c.Route53({credentials:(0,u.fromTemporaryCredentials)({clientConfig:{region:S(process.env.AWS_REGION??process.env.AWS_DEFAULT_REGION??"")},params:{RoleArn:r,RoleSessionName:`cross-account-zone-delegation-${l}`}})}),R=o??await A(n,i);await i.changeResourceRecordSets({HostedZoneId:R,ChangeBatch:{Changes:[{Action:e?"DELETE":"UPSERT",ResourceRecordSet:{Name:d,Type:"NS",TTL:g,ResourceRecords:m.map(p=>({Value:p}))}}]}})}async function A(t,e){let o=(await e.listHostedZonesByName({DNSName:t})).HostedZones?.filter(n=>n.Name===`${t}.`)??[];if(o&&o.length!==1)throw Error(`Expected one hosted zone to match the given name but found ${o.length}`);return o[0].Id}function S(t){let e={cn:"cn-northwest-1","us-gov":"us-gov-west-1","us-iso":"us-iso-east-1","us-isob":"us-isob-east-1"};for(let[r,o]of Object.entries(e))if(t.startsWith(`${r}-`))return o;return"us-east-1"}0&&(module.exports={handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/__entrypoint__.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/__entrypoint__.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/__entrypoint__.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/index.js new file mode 100644 index 0000000000000..d69c0934f88d4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/index.js @@ -0,0 +1 @@ +"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var h=(o,e)=>{for(var s in e)a(o,s,{get:e[s],enumerable:!0})},P=(o,e,s,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Z(e))!N.call(o,n)&&n!==s&&a(o,n,{get:()=>e[n],enumerable:!(t=p(e,n))||t.enumerable});return o};var E=o=>P(a({},"__esModule",{value:!0}),o);var T={};h(T,{handler:()=>w});module.exports=E(T);var c=require("@aws-sdk/client-route-53"),u=require("@aws-sdk/credential-providers");async function w(o){let e=o.ResourceProperties;switch(o.RequestType){case"Create":return r(e,!1);case"Update":return D(e,o.OldResourceProperties);case"Delete":return r(e,!0)}}async function D(o,e){e&&o.DelegatedZoneName!==e.DelegatedZoneName&&await r(e,!0),await r(o,!1)}async function r(o,e){let{AssumeRoleArn:s,ParentZoneId:t,ParentZoneName:n,DelegatedZoneName:d,DelegatedZoneNameServers:m,TTL:g}=o;if(!t&&!n)throw Error("One of ParentZoneId or ParentZoneName must be specified");let l=new Date().getTime(),i=new c.Route53({credentials:(0,u.fromTemporaryCredentials)({clientConfig:{region:S(process.env.AWS_REGION??process.env.AWS_DEFAULT_REGION??"")},params:{RoleArn:s,RoleSessionName:`cross-account-zone-delegation-${l}`}})}),R=t??await A(n,i);await i.changeResourceRecordSets({HostedZoneId:R,ChangeBatch:{Changes:[{Action:e?"DELETE":"UPSERT",ResourceRecordSet:{Name:d,Type:"NS",TTL:g,ResourceRecords:m.map(f=>({Value:f}))}}]}})}async function A(o,e){let t=(await e.listHostedZonesByName({DNSName:o})).HostedZones?.filter(n=>n.Name===`${o}.`)??[];if(t&&t.length!==1)throw Error(`Expected one hosted zone to match the given name but found ${t.length}`);return t[0].Id}function S(o){let e={cn:"cn-northwest-1","us-gov":"us-gov-west-1","us-iso":"us-iso-east-1","us-isob":"us-isob-east-1","eu-isoe":"eu-isoe-west-1","us-isof":"us-isof-south-1"};for(let[s,t]of Object.entries(e))if(o.startsWith(`${s}-`))return t;return"us-east-1"}0&&(module.exports={handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-opt-in-stack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-opt-in-stack.assets.json index fd75a43874a44..71e2bce9c16b6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-opt-in-stack.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-opt-in-stack.assets.json @@ -1,21 +1,21 @@ { "version": "36.0.0", "files": { - "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9": { + "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a": { "source": { - "path": "asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9", + "path": "asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a", "packaging": "zip" }, "destinations": { "234567890123-af-south-1": { "bucketName": "cdk-hnb659fds-assets-234567890123-af-south-1", - "objectKey": "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9.zip", + "objectKey": "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a.zip", "region": "af-south-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-file-publishing-role-234567890123-af-south-1" } } }, - "c691e2667a0fcaa091fcc80b87990cd2ab0c8271317bc51c37c0aaaf37e871e6": { + "34da3610276ae2d635b15c43c511f47cbd7b4f6e3b7de7b82b980f76956011b1": { "source": { "path": "child-opt-in-stack.template.json", "packaging": "file" @@ -23,7 +23,7 @@ "destinations": { "234567890123-af-south-1": { "bucketName": "cdk-hnb659fds-assets-234567890123-af-south-1", - "objectKey": "c691e2667a0fcaa091fcc80b87990cd2ab0c8271317bc51c37c0aaaf37e871e6.json", + "objectKey": "34da3610276ae2d635b15c43c511f47cbd7b4f6e3b7de7b82b980f76956011b1.json", "region": "af-south-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-file-publishing-role-234567890123-af-south-1" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-opt-in-stack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-opt-in-stack.template.json index 1a2d444829645..fb9d627591fd9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-opt-in-stack.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-opt-in-stack.template.json @@ -103,7 +103,7 @@ "Properties": { "Code": { "S3Bucket": "cdk-hnb659fds-assets-234567890123-af-south-1", - "S3Key": "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9.zip" + "S3Key": "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a.zip" }, "Timeout": 900, "MemorySize": 128, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-stack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-stack.assets.json index e52bfa536432f..3e9342b96558d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-stack.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-stack.assets.json @@ -1,21 +1,21 @@ { "version": "36.0.0", "files": { - "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9": { + "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a": { "source": { - "path": "asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9", + "path": "asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a", "packaging": "zip" }, "destinations": { "234567890123-us-east-1": { "bucketName": "cdk-hnb659fds-assets-234567890123-us-east-1", - "objectKey": "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9.zip", + "objectKey": "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a.zip", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-file-publishing-role-234567890123-us-east-1" } } }, - "8830d36005b1bf5ac6f0bea89067c6f6ea2b4009fe6e6b4a2cb159c2429fc84d": { + "3e4b4f51ab2cf9d297070625300465aeacdc41af65e442818c5ef6c17e800728": { "source": { "path": "child-stack.template.json", "packaging": "file" @@ -23,7 +23,7 @@ "destinations": { "234567890123-us-east-1": { "bucketName": "cdk-hnb659fds-assets-234567890123-us-east-1", - "objectKey": "8830d36005b1bf5ac6f0bea89067c6f6ea2b4009fe6e6b4a2cb159c2429fc84d.json", + "objectKey": "3e4b4f51ab2cf9d297070625300465aeacdc41af65e442818c5ef6c17e800728.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-file-publishing-role-234567890123-us-east-1" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-stack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-stack.template.json index 32880f7ebd948..0e056b8c4a286 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-stack.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/child-stack.template.json @@ -103,7 +103,7 @@ "Properties": { "Code": { "S3Bucket": "cdk-hnb659fds-assets-234567890123-us-east-1", - "S3Key": "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9.zip" + "S3Key": "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a.zip" }, "Timeout": 900, "MemorySize": 128, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/manifest.json index a216ab06a9cde..e880c00afc438 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/manifest.json @@ -84,7 +84,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-deploy-role-234567890123-us-east-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-cfn-exec-role-234567890123-us-east-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-234567890123-us-east-1/8830d36005b1bf5ac6f0bea89067c6f6ea2b4009fe6e6b4a2cb159c2429fc84d.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-234567890123-us-east-1/3e4b4f51ab2cf9d297070625300465aeacdc41af65e442818c5ef6c17e800728.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -163,7 +163,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-deploy-role-234567890123-af-south-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-cfn-exec-role-234567890123-af-south-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-234567890123-af-south-1/c691e2667a0fcaa091fcc80b87990cd2ab0c8271317bc51c37c0aaaf37e871e6.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-234567890123-af-south-1/34da3610276ae2d635b15c43c511f47cbd7b4f6e3b7de7b82b980f76956011b1.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/index.js deleted file mode 100644 index d108d3ce36d09..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/index.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Z(e))!N.call(t,n)&&n!==r&&a(t,n,{get:()=>e[n],enumerable:!(o=f(e,n))||o.enumerable});return t};var E=t=>h(a({},"__esModule",{value:!0}),t);var T={};P(T,{handler:()=>D});module.exports=E(T);var c=require("@aws-sdk/client-route-53"),u=require("@aws-sdk/credential-providers");async function D(t){let e=t.ResourceProperties;switch(t.RequestType){case"Create":return s(e,!1);case"Update":return w(e,t.OldResourceProperties);case"Delete":return s(e,!0)}}async function w(t,e){e&&t.DelegatedZoneName!==e.DelegatedZoneName&&await s(e,!0),await s(t,!1)}async function s(t,e){let{AssumeRoleArn:r,ParentZoneId:o,ParentZoneName:n,DelegatedZoneName:d,DelegatedZoneNameServers:m,TTL:g}=t;if(!o&&!n)throw Error("One of ParentZoneId or ParentZoneName must be specified");let l=new Date().getTime(),i=new c.Route53({credentials:(0,u.fromTemporaryCredentials)({clientConfig:{region:S(process.env.AWS_REGION??process.env.AWS_DEFAULT_REGION??"")},params:{RoleArn:r,RoleSessionName:`cross-account-zone-delegation-${l}`}})}),R=o??await A(n,i);await i.changeResourceRecordSets({HostedZoneId:R,ChangeBatch:{Changes:[{Action:e?"DELETE":"UPSERT",ResourceRecordSet:{Name:d,Type:"NS",TTL:g,ResourceRecords:m.map(p=>({Value:p}))}}]}})}async function A(t,e){let o=(await e.listHostedZonesByName({DNSName:t})).HostedZones?.filter(n=>n.Name===`${t}.`)??[];if(o&&o.length!==1)throw Error(`Expected one hosted zone to match the given name but found ${o.length}`);return o[0].Id}function S(t){let e={cn:"cn-northwest-1","us-gov":"us-gov-west-1","us-iso":"us-iso-east-1","us-isob":"us-isob-east-1"};for(let[r,o]of Object.entries(e))if(t.startsWith(`${r}-`))return o;return"us-east-1"}0&&(module.exports={handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/__entrypoint__.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9/__entrypoint__.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/__entrypoint__.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/index.js new file mode 100644 index 0000000000000..d69c0934f88d4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a/index.js @@ -0,0 +1 @@ +"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var h=(o,e)=>{for(var s in e)a(o,s,{get:e[s],enumerable:!0})},P=(o,e,s,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Z(e))!N.call(o,n)&&n!==s&&a(o,n,{get:()=>e[n],enumerable:!(t=p(e,n))||t.enumerable});return o};var E=o=>P(a({},"__esModule",{value:!0}),o);var T={};h(T,{handler:()=>w});module.exports=E(T);var c=require("@aws-sdk/client-route-53"),u=require("@aws-sdk/credential-providers");async function w(o){let e=o.ResourceProperties;switch(o.RequestType){case"Create":return r(e,!1);case"Update":return D(e,o.OldResourceProperties);case"Delete":return r(e,!0)}}async function D(o,e){e&&o.DelegatedZoneName!==e.DelegatedZoneName&&await r(e,!0),await r(o,!1)}async function r(o,e){let{AssumeRoleArn:s,ParentZoneId:t,ParentZoneName:n,DelegatedZoneName:d,DelegatedZoneNameServers:m,TTL:g}=o;if(!t&&!n)throw Error("One of ParentZoneId or ParentZoneName must be specified");let l=new Date().getTime(),i=new c.Route53({credentials:(0,u.fromTemporaryCredentials)({clientConfig:{region:S(process.env.AWS_REGION??process.env.AWS_DEFAULT_REGION??"")},params:{RoleArn:s,RoleSessionName:`cross-account-zone-delegation-${l}`}})}),R=t??await A(n,i);await i.changeResourceRecordSets({HostedZoneId:R,ChangeBatch:{Changes:[{Action:e?"DELETE":"UPSERT",ResourceRecordSet:{Name:d,Type:"NS",TTL:g,ResourceRecords:m.map(f=>({Value:f}))}}]}})}async function A(o,e){let t=(await e.listHostedZonesByName({DNSName:o})).HostedZones?.filter(n=>n.Name===`${o}.`)??[];if(t&&t.length!==1)throw Error(`Expected one hosted zone to match the given name but found ${t.length}`);return t[0].Id}function S(o){let e={cn:"cn-northwest-1","us-gov":"us-gov-west-1","us-iso":"us-iso-east-1","us-isob":"us-isob-east-1","eu-isoe":"eu-isoe-west-1","us-isof":"us-isof-south-1"};for(let[s,t]of Object.entries(e))if(o.startsWith(`${s}-`))return t;return"us-east-1"}0&&(module.exports={handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/child-stack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/child-stack.assets.json index 3558484bfff3c..9f17e5a71f2d7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/child-stack.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/child-stack.assets.json @@ -1,21 +1,21 @@ { "version": "36.0.0", "files": { - "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9": { + "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a": { "source": { - "path": "asset.5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9", + "path": "asset.aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a", "packaging": "zip" }, "destinations": { "234567890123-us-east-1": { "bucketName": "cdk-hnb659fds-assets-234567890123-us-east-1", - "objectKey": "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9.zip", + "objectKey": "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a.zip", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-file-publishing-role-234567890123-us-east-1" } } }, - "f6830a6eaa888f5b36392a0cc2b5850266cf11e1dc7bd19c1c7d55228af904fb": { + "29bfebfb05b102586faa0f38d585a3aea3433366ba19f4b7f213dbc46a9e7544": { "source": { "path": "child-stack.template.json", "packaging": "file" @@ -23,7 +23,7 @@ "destinations": { "234567890123-us-east-1": { "bucketName": "cdk-hnb659fds-assets-234567890123-us-east-1", - "objectKey": "f6830a6eaa888f5b36392a0cc2b5850266cf11e1dc7bd19c1c7d55228af904fb.json", + "objectKey": "29bfebfb05b102586faa0f38d585a3aea3433366ba19f4b7f213dbc46a9e7544.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-file-publishing-role-234567890123-us-east-1" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/child-stack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/child-stack.template.json index aa7138a0428b8..b510dd3a2b69f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/child-stack.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/child-stack.template.json @@ -103,7 +103,7 @@ "Properties": { "Code": { "S3Bucket": "cdk-hnb659fds-assets-234567890123-us-east-1", - "S3Key": "5e6e9858d1b0f5ba042ceacb850822cb985861c7bd174ceb7659a10daebe43e9.zip" + "S3Key": "aca4a134bf7ace6088b21213be7ab4357e3705f714362b690d76376b8f1df53a.zip" }, "Timeout": 900, "MemorySize": 128, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/manifest.json index 21bdd3fe8b930..b5cc97c012268 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.rename-cross-account-zone-delegation.js.snapshot/manifest.json @@ -84,7 +84,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-deploy-role-234567890123-us-east-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::234567890123:role/cdk-hnb659fds-cfn-exec-role-234567890123-us-east-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-234567890123-us-east-1/f6830a6eaa888f5b36392a0cc2b5850266cf11e1dc7bd19c1c7d55228af904fb.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-234567890123-us-east-1/29bfebfb05b102586faa0f38d585a3aea3433366ba19f4b7f213dbc46a9e7544.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/custom-resource-handlers/lib/aws-route53/cross-account-zone-delegation-handler/index.ts b/packages/@aws-cdk/custom-resource-handlers/lib/aws-route53/cross-account-zone-delegation-handler/index.ts index c39fd03b0926f..833ec0cb5d3b9 100644 --- a/packages/@aws-cdk/custom-resource-handlers/lib/aws-route53/cross-account-zone-delegation-handler/index.ts +++ b/packages/@aws-cdk/custom-resource-handlers/lib/aws-route53/cross-account-zone-delegation-handler/index.ts @@ -111,6 +111,8 @@ function route53Region(region: string) { 'us-gov': 'us-gov-west-1', 'us-iso': 'us-iso-east-1', 'us-isob': 'us-isob-east-1', + 'eu-isoe': 'eu-isoe-west-1', + 'us-isof': 'us-isof-south-1', }; for (const [prefix, mainRegion] of Object.entries(partitions)) {