cdk-real-drift 0.2.44 → 0.2.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -3168,6 +3168,36 @@ function parseCfnTemplate(text) {
3168
3168
  function parseTemplateBody(body) {
3169
3169
  return parseCfnTemplate(body);
3170
3170
  }
3171
+ function partitionForRegion(region) {
3172
+ if (region.startsWith("us-gov-")) return {
3173
+ partition: "aws-us-gov",
3174
+ urlSuffix: "amazonaws.com"
3175
+ };
3176
+ if (region.startsWith("cn-")) return {
3177
+ partition: "aws-cn",
3178
+ urlSuffix: "amazonaws.com.cn"
3179
+ };
3180
+ if (region.startsWith("us-iso-")) return {
3181
+ partition: "aws-iso",
3182
+ urlSuffix: "c2s.ic.gov"
3183
+ };
3184
+ if (region.startsWith("us-isob-")) return {
3185
+ partition: "aws-iso-b",
3186
+ urlSuffix: "sc2s.sgov.gov"
3187
+ };
3188
+ if (region.startsWith("us-isof-")) return {
3189
+ partition: "aws-iso-f",
3190
+ urlSuffix: "csp.hci.ic.gov"
3191
+ };
3192
+ if (region.startsWith("eu-isoe-")) return {
3193
+ partition: "aws-iso-e",
3194
+ urlSuffix: "cloud.adc-e.uk"
3195
+ };
3196
+ return {
3197
+ partition: "aws",
3198
+ urlSuffix: "amazonaws.com"
3199
+ };
3200
+ }
3171
3201
  function buildResolverContext(template, stackParams, physIds, region, accountId, stackName, stackId) {
3172
3202
  const paramDefs = template.Parameters ?? {};
3173
3203
  const isList = (k) => {
@@ -3185,13 +3215,14 @@ function buildResolverContext(template, stackParams, physIds, region, accountId,
3185
3215
  if (res?.Type) typeOf[lid] = res.Type;
3186
3216
  if (res?.Properties) declaredRawProps[lid] = res.Properties;
3187
3217
  }
3218
+ const { partition, urlSuffix } = partitionForRegion(region);
3188
3219
  return {
3189
3220
  params,
3190
3221
  pseudo: {
3191
3222
  "AWS::Region": region,
3192
3223
  "AWS::AccountId": accountId,
3193
- "AWS::Partition": "aws",
3194
- "AWS::URLSuffix": "amazonaws.com",
3224
+ "AWS::Partition": partition,
3225
+ "AWS::URLSuffix": urlSuffix,
3195
3226
  "AWS::StackName": stackName,
3196
3227
  "AWS::StackId": stackId
3197
3228
  },