@kensio/yulin 0.18.0 → 0.19.0
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/docs/tsconfig.tsbuildinfo +1 -1
- package/dist/service/aws/factory/sim-aws-service-factory.d.ts +1 -1
- package/dist/service/aws/factory/sim-aws-service-factory.d.ts.map +1 -1
- package/dist/service/aws/factory/sim-aws-service-factory.js +1 -1
- package/dist/service/aws/factory/sim-aws-service-factory.js.map +1 -1
- package/dist/service/aws/sim-aws.d.ts +1 -1
- package/dist/service/aws/sim-aws.d.ts.map +1 -1
- package/dist/service/cloudformation/command/create-stack/create-stack.handler.d.ts.map +1 -1
- package/dist/service/cloudformation/command/create-stack/create-stack.handler.js +1 -0
- package/dist/service/cloudformation/command/create-stack/create-stack.handler.js.map +1 -1
- package/dist/service/cloudformation/command/describe-stacks/describe-stacks.cmd.d.ts +11 -0
- package/dist/service/cloudformation/command/describe-stacks/describe-stacks.cmd.d.ts.map +1 -1
- package/dist/service/cloudformation/command/describe-stacks/describe-stacks.handler.d.ts +3 -1
- package/dist/service/cloudformation/command/describe-stacks/describe-stacks.handler.d.ts.map +1 -1
- package/dist/service/cloudformation/command/describe-stacks/describe-stacks.handler.js +6 -11
- package/dist/service/cloudformation/command/describe-stacks/describe-stacks.handler.js.map +1 -1
- package/dist/service/cloudformation/command/describe-stacks/sim-cfn-stack-describer.d.ts +23 -0
- package/dist/service/cloudformation/command/describe-stacks/sim-cfn-stack-describer.d.ts.map +1 -0
- package/dist/service/cloudformation/command/describe-stacks/sim-cfn-stack-describer.js +34 -0
- package/dist/service/cloudformation/command/describe-stacks/sim-cfn-stack-describer.js.map +1 -0
- package/dist/service/cloudformation/parameters/pseudo/sim-cfn-pseudo-parameters.d.ts +20 -0
- package/dist/service/cloudformation/parameters/pseudo/sim-cfn-pseudo-parameters.d.ts.map +1 -0
- package/dist/service/cloudformation/parameters/pseudo/sim-cfn-pseudo-parameters.js +49 -0
- package/dist/service/cloudformation/parameters/pseudo/sim-cfn-pseudo-parameters.js.map +1 -0
- package/dist/service/cloudformation/resource/resolve/property/sim-cfn-resource-property-resolver.d.ts +3 -0
- package/dist/service/cloudformation/resource/resolve/property/sim-cfn-resource-property-resolver.d.ts.map +1 -1
- package/dist/service/cloudformation/resource/resolve/property/sim-cfn-resource-property-resolver.js +3 -0
- package/dist/service/cloudformation/resource/resolve/property/sim-cfn-resource-property-resolver.js.map +1 -1
- package/dist/service/cloudformation/stack/output/sim-cfn-stack-output-resolver.d.ts +29 -0
- package/dist/service/cloudformation/stack/output/sim-cfn-stack-output-resolver.d.ts.map +1 -0
- package/dist/service/cloudformation/stack/output/sim-cfn-stack-output-resolver.js +80 -0
- package/dist/service/cloudformation/stack/output/sim-cfn-stack-output-resolver.js.map +1 -0
- package/dist/service/cloudformation/stack/output/sim-cfn-stack-output.d.ts +11 -0
- package/dist/service/cloudformation/stack/output/sim-cfn-stack-output.d.ts.map +1 -0
- package/dist/service/cloudformation/stack/output/sim-cfn-stack-output.js +2 -0
- package/dist/service/cloudformation/stack/output/sim-cfn-stack-output.js.map +1 -0
- package/dist/service/cloudformation/stack/sim-cfn-stack.d.ts +3 -0
- package/dist/service/cloudformation/stack/sim-cfn-stack.d.ts.map +1 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.js +9 -0
- package/dist/service/cloudformation/stack/sim-cfn-stack.js.map +1 -1
- package/dist/service/cloudformation/template/node/sim-cfn-node.d.ts +3 -1
- package/dist/service/cloudformation/template/node/sim-cfn-node.d.ts.map +1 -1
- package/dist/service/cloudformation/template/node/sim-cfn-node.js +3 -1
- package/dist/service/cloudformation/template/node/sim-cfn-node.js.map +1 -1
- package/dist/service/cloudformation/template/node/sim-cfn-ref.d.ts.map +1 -1
- package/dist/service/cloudformation/template/node/sim-cfn-ref.js +4 -0
- package/dist/service/cloudformation/template/node/sim-cfn-ref.js.map +1 -1
- package/dist/service/cloudformation/template/sim-cfn-template.d.ts +23 -0
- package/dist/service/cloudformation/template/sim-cfn-template.d.ts.map +1 -1
- package/dist/service/cloudformation/template/sim-cfn-template.js +37 -1
- package/dist/service/cloudformation/template/sim-cfn-template.js.map +1 -1
- package/dist/service/cloudformation/template/value/sim-cfn-template-value-resolver.d.ts +2 -0
- package/dist/service/cloudformation/template/value/sim-cfn-template-value-resolver.d.ts.map +1 -1
- package/dist/service/cloudformation/template/value/sim-cfn-template-value-resolver.js +1 -1
- package/dist/service/cloudformation/template/value/sim-cfn-template-value-resolver.js.map +1 -1
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +1 -1
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts.map +1 -1
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js +3 -0
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js.map +1 -1
- package/dist/service/cloudfront/controller/dependency/sim-cf-controller-dependency.d.ts +1 -1
- package/dist/service/cloudfront/controller/dependency/sim-cf-controller-dependency.d.ts.map +1 -1
- package/dist/service/cloudfront/registry/sim-cloud-front-registry.d.ts +35 -0
- package/dist/service/cloudfront/registry/sim-cloud-front-registry.d.ts.map +1 -0
- package/dist/service/cloudfront/registry/sim-cloud-front-registry.js +60 -0
- package/dist/service/cloudfront/registry/sim-cloud-front-registry.js.map +1 -0
- package/dist/service/cloudfront/router/alternate-domain/sim-cf-alternate-domain-router.d.ts +27 -0
- package/dist/service/cloudfront/router/alternate-domain/sim-cf-alternate-domain-router.d.ts.map +1 -0
- package/dist/service/cloudfront/router/alternate-domain/sim-cf-alternate-domain-router.js +50 -0
- package/dist/service/cloudfront/router/alternate-domain/sim-cf-alternate-domain-router.js.map +1 -0
- package/dist/service/cloudfront/router/distro-id/extract-cf-host-distro-id.d.ts +10 -0
- package/dist/service/cloudfront/router/distro-id/extract-cf-host-distro-id.d.ts.map +1 -0
- package/dist/service/cloudfront/router/distro-id/extract-cf-host-distro-id.js +24 -0
- package/dist/service/cloudfront/router/distro-id/extract-cf-host-distro-id.js.map +1 -0
- package/dist/service/cloudfront/router/distro-id/sim-cf-distro-id-router.d.ts +33 -0
- package/dist/service/cloudfront/router/distro-id/sim-cf-distro-id-router.d.ts.map +1 -0
- package/dist/service/cloudfront/router/distro-id/sim-cf-distro-id-router.js +52 -0
- package/dist/service/cloudfront/router/distro-id/sim-cf-distro-id-router.js.map +1 -0
- package/dist/service/cloudfront/router/sim-cloud-front-distro-router.d.ts +1 -1
- package/dist/service/cloudfront/router/sim-cloud-front-distro-router.d.ts.map +1 -1
- package/dist/service/cloudfront/router/sim-cloud-front-distro-router.js +3 -3
- package/dist/service/cloudfront/router/sim-cloud-front-distro-router.js.map +1 -1
- package/dist/service/cloudfront/sim-cloudfront.d.ts +1 -1
- package/dist/service/cloudfront/sim-cloudfront.d.ts.map +1 -1
- package/dist/service/cloudfront/sim-cloudfront.js +1 -1
- package/dist/service/cloudfront/sim-cloudfront.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SimCfnStackResourceCreator } from "./deploy/sim-cfn-stack-resource-creator.js";
|
|
2
2
|
import { makeSimCfnStackResourceMap } from "./resource-map/sim-cfn-stack-resource-map.js";
|
|
3
3
|
import { SimCfnStackDeploymentLifecycle } from "./deploy/sim-cfn-stack-deployment-lifecycle.js";
|
|
4
|
+
import { SimCfnStackOutputResolver } from "./output/sim-cfn-stack-output-resolver.js";
|
|
4
5
|
/**
|
|
5
6
|
* Lightweight simulated CloudFormation Stack.
|
|
6
7
|
*
|
|
@@ -24,6 +25,7 @@ export class SimCfnStack {
|
|
|
24
25
|
stackName;
|
|
25
26
|
template;
|
|
26
27
|
resources;
|
|
28
|
+
outputs = new Map();
|
|
27
29
|
constructor(props) {
|
|
28
30
|
const { simAws, accountRegionScope, background, stackName, template, cdkOutContext, bindings, } = props;
|
|
29
31
|
this.simAws = simAws;
|
|
@@ -84,6 +86,13 @@ export class SimCfnStack {
|
|
|
84
86
|
skippedResources: this.skippedResourceList,
|
|
85
87
|
});
|
|
86
88
|
await resourceCreator.createAll();
|
|
89
|
+
this.resolveOutputs();
|
|
90
|
+
}
|
|
91
|
+
resolveOutputs() {
|
|
92
|
+
this.outputs = new SimCfnStackOutputResolver({
|
|
93
|
+
template: this.cfnTemplate,
|
|
94
|
+
resources: this.resources,
|
|
95
|
+
}).resolve();
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
98
|
//# sourceMappingURL=sim-cfn-stack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-stack.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/stack/sim-cfn-stack.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-stack.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/stack/sim-cfn-stack.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;AAIhG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAuBtF;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,WAAW;IACL,MAAM,CAAS;IACf,WAAW,CAAiB;IAC5B,aAAa,CAA+B;IAC5C,QAAQ,CAEX;IACG,mBAAmB,GAAqB,EAAE,CAAC;IAC5C,SAAS,CAAiC;IAE1C,SAAS,CAA6B;IACtC,QAAQ,CAAwB;IAChC,SAAS,CAA8B;IAChD,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;IAEtD,YAAY,KAAkC;QAC5C,MAAM,EACJ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B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,gBAAgB,EAAE,IAAI,CAAC,mBAAmB;SAC3C,CAAC,CAAC;QAEH,MAAM,eAAe,CAAC,SAAS,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAEO,cAAc;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,yBAAyB,CAAC;YAC3C,QAAQ,EAAE,IAAI,CAAC,WAAW;YAC1B,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CAAC,OAAO,EAAE,CAAC;IACf,CAAC;CACF"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { SimCfnParameters } from "../../parameters/sim-cfn-parameters.js";
|
|
2
2
|
import type { SimCfnTemplateValue } from "../value/sim-cfn-template-value.js";
|
|
3
3
|
import type { SimCfnResourceRefResolver } from "../resolve/sim-cfn-resource-ref-resolver.js";
|
|
4
|
+
import type { SimCfnPseudoParameters } from "../../parameters/pseudo/sim-cfn-pseudo-parameters.js";
|
|
4
5
|
/**
|
|
5
6
|
* Context available while resolving a parsed CloudFormation node tree.
|
|
6
7
|
*/
|
|
7
8
|
export declare class SimCfnResolveContext {
|
|
8
9
|
readonly parameters: SimCfnParameters;
|
|
9
10
|
readonly resources?: SimCfnResourceRefResolver | undefined;
|
|
10
|
-
|
|
11
|
+
readonly pseudoParameters?: SimCfnPseudoParameters | undefined;
|
|
12
|
+
constructor(parameters: SimCfnParameters, resources?: SimCfnResourceRefResolver | undefined, pseudoParameters?: SimCfnPseudoParameters | undefined);
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* A parsed CloudFormation template value.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-node.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/node/sim-cfn-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-node.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/node/sim-cfn-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAEnG;;GAEG;AACH,qBAAa,oBAAoB;IAE7B,QAAQ,CAAC,UAAU,EAAE,gBAAgB;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,yBAAyB,GAAG,SAAS;IAC1D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,sBAAsB,GAAG,SAAS;gBAFrD,UAAU,EAAE,gBAAgB,EAC5B,SAAS,CAAC,EAAE,yBAAyB,GAAG,SAAS,EACjD,gBAAgB,CAAC,EAAE,sBAAsB,GAAG,SAAS;CAEjE;AAED;;;;;;GAMG;AACH,8BAAsB,UAAU;IAC9B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB;IAEpE;;;;;;OAMG;IACH,eAAe,IAAI,MAAM,EAAE;CAG5B"}
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
export class SimCfnResolveContext {
|
|
5
5
|
parameters;
|
|
6
6
|
resources;
|
|
7
|
-
|
|
7
|
+
pseudoParameters;
|
|
8
|
+
constructor(parameters, resources, pseudoParameters) {
|
|
8
9
|
this.parameters = parameters;
|
|
9
10
|
this.resources = resources;
|
|
11
|
+
this.pseudoParameters = pseudoParameters;
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-node.js","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/node/sim-cfn-node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-cfn-node.js","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/node/sim-cfn-node.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAEpB;IACA;IACA;IAHX,YACW,UAA4B,EAC5B,SAAiD,EACjD,gBAAqD;QAFrD,eAAU,GAAV,UAAU,CAAkB;QAC5B,cAAS,GAAT,SAAS,CAAwC;QACjD,qBAAgB,GAAhB,gBAAgB,CAAqC;IAC7D,CAAC;CACL;AAED;;;;;;GAMG;AACH,MAAM,OAAgB,UAAU;IAM9B;;;;;;OAMG;IACH,eAAe;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-ref.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/node/sim-cfn-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E;;GAEG;AACH,qBAAa,SAAU,SAAQ,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,MAAM;IAIzC;;;;;;OAMG;IACH,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB;
|
|
1
|
+
{"version":3,"file":"sim-cfn-ref.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/node/sim-cfn-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E;;GAEG;AACH,qBAAa,SAAU,SAAQ,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,MAAM;IAIzC;;;;;;OAMG;IACH,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB;IAkB3D;;OAEG;IACM,eAAe,IAAI,MAAM,EAAE;CAGrC"}
|
|
@@ -19,6 +19,10 @@ export class SimCfnRef extends SimCfnNode {
|
|
|
19
19
|
if (context.parameters.has(this.name)) {
|
|
20
20
|
return context.parameters.value(this.name);
|
|
21
21
|
}
|
|
22
|
+
const pseudoParameterValue = context.pseudoParameters?.value(this.name);
|
|
23
|
+
if (pseudoParameterValue !== undefined) {
|
|
24
|
+
return pseudoParameterValue;
|
|
25
|
+
}
|
|
22
26
|
if (context.resources?.has(this.name) === true) {
|
|
23
27
|
return context.resources.refValue(this.name);
|
|
24
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-ref.js","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/node/sim-cfn-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA6B,MAAM,mBAAmB,CAAC;AAG1E;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,UAAU;IACV;IAA7B,YAA6B,IAAY;QACvC,KAAK,EAAE,CAAC;QADmB,SAAI,GAAJ,IAAI,CAAQ;IAEzC,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,OAA6B;QACnC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,OAAO,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,C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IAAI,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACM,eAAe;QACtB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -2,6 +2,8 @@ import { SimCfnParameters } from "../parameters/sim-cfn-parameters.js";
|
|
|
2
2
|
import type { SimCfnTemplateValue, SimCfnTemplateValueRecord } from "./value/sim-cfn-template-value.js";
|
|
3
3
|
import type { SimCfnParameterDefinition } from "../parameters/sim-cfn-parameters.type.js";
|
|
4
4
|
import { type JSONString } from "../../../util/type-guard/json.js";
|
|
5
|
+
import type { SimAwsAccountRegionScope } from "../../aws/sim-aws-account-region-scope.js";
|
|
6
|
+
import { SimCfnPseudoParameters } from "../parameters/pseudo/sim-cfn-pseudo-parameters.js";
|
|
5
7
|
/**
|
|
6
8
|
* Parsed CloudFormation template body accepted by the simulator.
|
|
7
9
|
*
|
|
@@ -10,20 +12,27 @@ import { type JSONString } from "../../../util/type-guard/json.js";
|
|
|
10
12
|
export interface CfnTemplateBodyRecord {
|
|
11
13
|
readonly Parameters?: Record<string, SimCfnParameterDefinition> | undefined;
|
|
12
14
|
readonly Resources: Record<string, SimCfnTemplateValue>;
|
|
15
|
+
readonly Outputs?: Record<string, SimCfnTemplateValue> | undefined;
|
|
13
16
|
readonly [sectionName: string]: Record<string, SimCfnParameterDefinition> | Record<string, SimCfnTemplateValue> | SimCfnTemplateValue | undefined;
|
|
14
17
|
}
|
|
15
18
|
export interface SimCfnResourceTemplateRecord {
|
|
16
19
|
readonly logicalId: string;
|
|
17
20
|
readonly template: SimCfnTemplateValueRecord;
|
|
18
21
|
}
|
|
22
|
+
export interface SimCfnOutputTemplateRecord {
|
|
23
|
+
readonly outputKey: string;
|
|
24
|
+
readonly template: SimCfnTemplateValueRecord;
|
|
25
|
+
}
|
|
19
26
|
interface SimCfnTemplateProps {
|
|
20
27
|
readonly template: CfnTemplateBodyRecord;
|
|
21
28
|
readonly parameters?: SimCfnParameters | undefined;
|
|
22
29
|
readonly stackName?: string | undefined;
|
|
30
|
+
readonly accountRegionScope?: SimAwsAccountRegionScope | undefined;
|
|
23
31
|
}
|
|
24
32
|
interface SimCfnTemplateFromJsonProps {
|
|
25
33
|
readonly stackName?: string | undefined;
|
|
26
34
|
readonly parameters?: SimCfnParameters | undefined;
|
|
35
|
+
readonly accountRegionScope?: SimAwsAccountRegionScope | undefined;
|
|
27
36
|
}
|
|
28
37
|
/**
|
|
29
38
|
* Convenience wrapper over a plain parsed CloudFormation template object.
|
|
@@ -34,6 +43,7 @@ export declare class SimCfnTemplate {
|
|
|
34
43
|
readonly template: CfnTemplateBodyRecord;
|
|
35
44
|
readonly stackName: string | undefined;
|
|
36
45
|
readonly parameters: SimCfnParameters;
|
|
46
|
+
private readonly accountRegionScope;
|
|
37
47
|
constructor(props: SimCfnTemplateProps);
|
|
38
48
|
/**
|
|
39
49
|
* Parse a JSON CloudFormation template body.
|
|
@@ -46,6 +56,19 @@ export declare class SimCfnTemplate {
|
|
|
46
56
|
* Refs to other Resources are left unresolved because the referenced Resources do not exist yet; they are resolved at Resource creation time.
|
|
47
57
|
*/
|
|
48
58
|
resourceTemplates(): SimCfnResourceTemplateRecord[];
|
|
59
|
+
/**
|
|
60
|
+
* Get Output template entries with parameter-only expressions resolved.
|
|
61
|
+
*
|
|
62
|
+
* Resource-backed intrinsic functions are intentionally left unresolved here
|
|
63
|
+
* because Outputs are resolved after Resource creation.
|
|
64
|
+
*/
|
|
65
|
+
outputTemplates(): SimCfnOutputTemplateRecord[];
|
|
66
|
+
/**
|
|
67
|
+
* Get the sim CFN pseudo parameters for this template.
|
|
68
|
+
*
|
|
69
|
+
* https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html
|
|
70
|
+
*/
|
|
71
|
+
pseudoParameters(): SimCfnPseudoParameters;
|
|
49
72
|
}
|
|
50
73
|
export {};
|
|
51
74
|
//# sourceMappingURL=sim-cfn-template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-template.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudformation/template/sim-cfn-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-template.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudformation/template/sim-cfn-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAE3F;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAAG,SAAS,CAAC;IAC5E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,SAAS,CAAC;IACnE,QAAQ,EAAE,WAAW,EAAE,MA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;OAKG;IACH,iBAAiB,IAAI,4BAA4B,EAAE;IAgBnD;;;;;OAKG;IACH,eAAe,IAAI,0BAA0B,EAAE;IAgB/C;;;;OAIG;IACH,gBAAgB,IAAI,sBAAsB;CAM3C"}
|
|
@@ -3,6 +3,7 @@ import { SimCfnTemplateValueResolver } from "./value/sim-cfn-template-value-reso
|
|
|
3
3
|
import { isRecord } from "../../../util/type-guard/record.js";
|
|
4
4
|
import { SimCfnTemplateBodyValidator } from "./sim-cfn-template-body-validator.js";
|
|
5
5
|
import { jsonParse } from "../../../util/type-guard/json.js";
|
|
6
|
+
import { SimCfnPseudoParameters } from "../parameters/pseudo/sim-cfn-pseudo-parameters.js";
|
|
6
7
|
/**
|
|
7
8
|
* Convenience wrapper over a plain parsed CloudFormation template object.
|
|
8
9
|
*
|
|
@@ -12,10 +13,12 @@ export class SimCfnTemplate {
|
|
|
12
13
|
template;
|
|
13
14
|
stackName;
|
|
14
15
|
parameters;
|
|
16
|
+
accountRegionScope;
|
|
15
17
|
constructor(props) {
|
|
16
|
-
const { template, parameters, stackName } = props;
|
|
18
|
+
const { template, parameters, stackName, accountRegionScope } = props;
|
|
17
19
|
this.template = template;
|
|
18
20
|
this.stackName = stackName;
|
|
21
|
+
this.accountRegionScope = accountRegionScope;
|
|
19
22
|
new SimCfnTemplateBodyValidator({ template, stackName }).validate();
|
|
20
23
|
this.parameters = (parameters ?? new SimCfnParameters({ stackName })).withDefinitions(this.template.Parameters);
|
|
21
24
|
}
|
|
@@ -36,6 +39,7 @@ export class SimCfnTemplate {
|
|
|
36
39
|
template,
|
|
37
40
|
parameters: props.parameters,
|
|
38
41
|
stackName: props.stackName,
|
|
42
|
+
accountRegionScope: props.accountRegionScope,
|
|
39
43
|
});
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
@@ -47,6 +51,7 @@ export class SimCfnTemplate {
|
|
|
47
51
|
resourceTemplates() {
|
|
48
52
|
const valueResolver = new SimCfnTemplateValueResolver({
|
|
49
53
|
parameters: this.parameters,
|
|
54
|
+
pseudoParameters: this.pseudoParameters(),
|
|
50
55
|
});
|
|
51
56
|
return Object.entries(this.template.Resources)
|
|
52
57
|
.filter((entry) => {
|
|
@@ -57,5 +62,36 @@ export class SimCfnTemplate {
|
|
|
57
62
|
template: valueResolver.resolveRecord(resourceTemplate),
|
|
58
63
|
}));
|
|
59
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Get Output template entries with parameter-only expressions resolved.
|
|
67
|
+
*
|
|
68
|
+
* Resource-backed intrinsic functions are intentionally left unresolved here
|
|
69
|
+
* because Outputs are resolved after Resource creation.
|
|
70
|
+
*/
|
|
71
|
+
outputTemplates() {
|
|
72
|
+
const valueResolver = new SimCfnTemplateValueResolver({
|
|
73
|
+
parameters: this.parameters,
|
|
74
|
+
pseudoParameters: this.pseudoParameters(),
|
|
75
|
+
});
|
|
76
|
+
return Object.entries(this.template.Outputs ?? {})
|
|
77
|
+
.filter((entry) => {
|
|
78
|
+
return isRecord(entry[1]);
|
|
79
|
+
})
|
|
80
|
+
.map(([outputKey, outputTemplate]) => ({
|
|
81
|
+
outputKey,
|
|
82
|
+
template: valueResolver.resolveRecord(outputTemplate),
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the sim CFN pseudo parameters for this template.
|
|
87
|
+
*
|
|
88
|
+
* https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html
|
|
89
|
+
*/
|
|
90
|
+
pseudoParameters() {
|
|
91
|
+
return new SimCfnPseudoParameters({
|
|
92
|
+
accountRegionScope: this.accountRegionScope,
|
|
93
|
+
stackName: this.stackName,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
60
96
|
}
|
|
61
97
|
//# sourceMappingURL=sim-cfn-template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-template.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/template/sim-cfn-template.ts"],"names":[],"mappings":"A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,CAAC;YACpD,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE;SAC1C,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;aAC/C,MAAM,CAAC,CAAC,KAAK,EAAgD,EAAE;YAC9D,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC;YACrC,SAAS;YACT,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,cAAc,CAAC;SACtD,CAAC,CAAC,CAAC;IACR,CAAC;IAED;;;;OAIG;IACH,gBAAgB;QACd,OAAO,IAAI,sBAAsB,CAAC;YAChC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { SimCfnParameters } from "../../parameters/sim-cfn-parameters.js";
|
|
2
2
|
import type { SimCfnTemplateValue, SimCfnTemplateValueRecord } from "./sim-cfn-template-value.js";
|
|
3
3
|
import type { SimCfnResourceRefResolver } from "../resolve/sim-cfn-resource-ref-resolver.js";
|
|
4
|
+
import type { SimCfnPseudoParameters } from "../../parameters/pseudo/sim-cfn-pseudo-parameters.js";
|
|
4
5
|
interface SimCfnTemplateValueResolverProps {
|
|
5
6
|
readonly parameters: SimCfnParameters;
|
|
6
7
|
readonly resources?: SimCfnResourceRefResolver | undefined;
|
|
8
|
+
readonly pseudoParameters?: SimCfnPseudoParameters | undefined;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* Resolve supported CloudFormation value expressions inside template values.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-template-value-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/value/sim-cfn-template-value-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAG/E,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-value-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/value/sim-cfn-template-value-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAG/E,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAEnG,UAAU,gCAAgC;IACxC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;CAChE;AAED;;GAEG;AACH,qBAAa,2BAA2B;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;gBAEnC,KAAK,EAAE,gCAAgC;IAQnD;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,mBAAmB,GAAG,mBAAmB;IAIxD;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,yBAAyB,GAAG,yBAAyB;CAQ3E"}
|
|
@@ -6,7 +6,7 @@ import { parseSimCfnNode } from "../parse/node/sim-cfn-node-parser.js";
|
|
|
6
6
|
export class SimCfnTemplateValueResolver {
|
|
7
7
|
context;
|
|
8
8
|
constructor(props) {
|
|
9
|
-
this.context = new SimCfnResolveContext(props.parameters, props.resources);
|
|
9
|
+
this.context = new SimCfnResolveContext(props.parameters, props.resources, props.pseudoParameters);
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Resolve Parameters and supported intrinsic functions recursively.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-template-value-resolver.js","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/value/sim-cfn-template-value-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-value-resolver.js","sourceRoot":"","sources":["../../../../../src/service/cloudformation/template/value/sim-cfn-template-value-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAcvE;;GAEG;AACH,MAAM,OAAO,2BAA2B;IACrB,OAAO,CAAuB;IAE/C,YAAY,KAAuC;QACjD,IAAI,CAAC,OAAO,GAAG,IAAI,oBAAoB,CACrC,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,gBAAgB,CACvB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,KAA0B;QAChC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,KAAgC;QAC5C,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;YAC/C,GAAG;YACH,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;SACzB,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
|
package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommandHandler } from "../../../../command/command-handler.js";
|
|
2
2
|
import type { SimCreateDistributionCommand, SimCreateDistributionCommandOutput } from "./create-distribution.cmd.js";
|
|
3
|
-
import type { SimCloudFrontRegistry } from "../../sim-cloud-front-registry.js";
|
|
3
|
+
import type { SimCloudFrontRegistry } from "../../registry/sim-cloud-front-registry.js";
|
|
4
4
|
import { SimCloudFrontDistribution, type SimCloudFrontDistributionId } from "../../distribution/sim-cloudfront-distribution.js";
|
|
5
5
|
import type { SimAwsAccountId } from "../../../aws/sim-aws-account.js";
|
|
6
6
|
import type { SimCloudFrontS3OriginResolver } from "../../origin/s3/sim-cloudfront-s3-origin.js";
|
package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-distribution.handler.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/command/create-distribution/create-distribution.handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,KAAK,EACV,4BAA4B,EAC5B,kCAAkC,EACnC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-distribution.handler.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/command/create-distribution/create-distribution.handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,KAAK,EACV,4BAA4B,EAC5B,kCAAkC,EACnC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EACL,yBAAyB,EACzB,KAAK,2BAA2B,EACjC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAMrF,UAAU,qCAAqC;IAC7C,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,GAAG,CACzB,2BAA2B,EAC3B,yBAAyB,CAC1B,CAAC;IACF,QAAQ,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;IACnD,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;IACzD,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;CAC1C;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,YAAW,cAAc,CACrE,4BAA4B,EAC5B,kCAAkC,CACnC;IACC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAC5C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAG5B;IACF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAwB;IAC3D,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAwC;IACjF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;gBAErC,KAAK,EAAE,qCAAqC;IAWxD;;OAEG;IACG,MAAM,CACV,GAAG,EAAE,4BAA4B,GAChC,OAAO,CAAC,kCAAkC,CAAC;CAsD/C"}
|
|
@@ -41,6 +41,9 @@ export class CreateDistributionCommandHandler {
|
|
|
41
41
|
this.distributionConfigurator.configure(distribution, distributionConfig);
|
|
42
42
|
this.distributions.set(distribution.distributionId, distribution);
|
|
43
43
|
this.cloudFrontRegistry.registerDistribution(distribution.distributionId, this.accountId);
|
|
44
|
+
for (const alternateDomainName of distribution.getAlternateDomainNames()) {
|
|
45
|
+
this.cloudFrontRegistry.registerAlternateDomainName(alternateDomainName, distribution.distributionId);
|
|
46
|
+
}
|
|
44
47
|
// Schedule background task to complete deployment of the sim Distribution.
|
|
45
48
|
this.background.schedule(() => distribution.completeDeployment());
|
|
46
49
|
return {
|
package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-distribution.handler.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/command/create-distribution/create-distribution.handler.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,yBAAyB,GAE1B,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAGvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wEAAwE,CAAC;AACzH,OAAO,EAAE,iCAAiC,EAAE,MAAM,0EAA0E,CAAC;AAC7H,OAAO,EAAE,qCAAqC,EAAE,MAAM,8EAA8E,CAAC;AACrI,OAAO,EAAE,yCAAyC,EAAE,MAAM,sCAAsC,CAAC;AAajG;;;;GAIG;AACH,MAAM,OAAO,gCAAgC;IAI1B,SAAS,CAAkB;IAC3B,aAAa,CAG5B;IACe,kBAAkB,CAAwB;IAC1C,wBAAwB,CAAwC;IAChE,UAAU,CAAsB;IAEjD,YAAY,KAA4C;QACtD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC;QACnD,IAAI,CAAC,wBAAwB,GAAG,IAAI,qCAAqC,CACvE,IAAI,+BAA+B,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAC3D,IAAI,iCAAiC,EAAE,CACxC,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,GAAiC;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AC,kBAAkB;aACpD;YACD,QAAQ,EAAE,4DAA4D,YAAY,CAAC,cAAc,EAAE;YACnG,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"create-distribution.handler.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/command/create-distribution/create-distribution.handler.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,yBAAyB,GAE1B,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAGvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wEAAwE,CAAC;AACzH,OAAO,EAAE,iCAAiC,EAAE,MAAM,0EAA0E,CAAC;AAC7H,OAAO,EAAE,qCAAqC,EAAE,MAAM,8EAA8E,CAAC;AACrI,OAAO,EAAE,yCAAyC,EAAE,MAAM,sCAAsC,CAAC;AAajG;;;;GAIG;AACH,MAAM,OAAO,gCAAgC;IAI1B,SAAS,CAAkB;IAC3B,aAAa,CAG5B;IACe,kBAAkB,CAAwB;IAC1C,wBAAwB,CAAwC;IAChE,UAAU,CAAsB;IAEjD,YAAY,KAA4C;QACtD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC;QACnD,IAAI,CAAC,wBAAwB,GAAG,IAAI,qCAAqC,CACvE,IAAI,+BAA+B,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAC3D,IAAI,iCAAiC,EAAE,CACxC,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,GAAiC;QAEjC,MAAM,uBAAuB,GAAG,GAAG,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAC7D,aAAa,CACX,uBAAuB,EACvB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G,YAAY,CAAC,cAAc,CAAC,WAAW,EAAE,iBAAiB;gBACzE,kBAAkB,EAAE,YAAY,CAAC,kBAAkB;aACpD;YACD,QAAQ,EAAE,4DAA4D,YAAY,CAAC,cAAc,EAAE;YACnG,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SimAws } from "../../../aws/sim-aws.js";
|
|
2
|
-
import type { SimCloudFrontRegistry } from "../../sim-cloud-front-registry.js";
|
|
2
|
+
import type { SimCloudFrontRegistry } from "../../registry/sim-cloud-front-registry.js";
|
|
3
3
|
import type { SimCloudFrontDistroRouter } from "../../router/sim-cloud-front-distro-router.js";
|
|
4
4
|
import type { SimCloudFrontBehaviorResolver } from "../../resolver/sim-cloud-front-behavior-resolver.js";
|
|
5
5
|
import { SimCffApplicator } from "../cff/sim-cff-applicator.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cf-controller-dependency.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/controller/dependency/sim-cf-controller-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sim-cf-controller-dependency.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/controller/dependency/sim-cf-controller-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEzG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAExF,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;IACpD,QAAQ,CAAC,YAAY,CAAC,EAAE,yBAAyB,CAAC;IAClD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAC3D,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,CAAC;IAC1C,QAAQ,CAAC,aAAa,CAAC,EAAE,0BAA0B,CAAC;CACrD;AAED,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAC;IACjD,QAAQ,CAAC,iBAAiB,EAAE,6BAA6B,CAAC;IAC1D,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzC,QAAQ,CAAC,aAAa,EAAE,0BAA0B,CAAC;CACpD;AAED;;GAEG;AACH,qBAAa,0CAA0C;IACrD;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,mCAAwC,GAC9C,mCAAmC;CAkBvC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type SimCloudFrontDistributionId } from "../distribution/sim-cloudfront-distribution.js";
|
|
2
|
+
import type { SimAwsAccountId } from "../../aws/sim-aws-account.js";
|
|
3
|
+
/**
|
|
4
|
+
* Simulated CloudFront cross-Account registry of Distribution IDs.
|
|
5
|
+
*
|
|
6
|
+
* CloudFront is not region-scoped, so all region-scoped CloudFront service
|
|
7
|
+
* instances for the same Account should delegate to the same Account-global
|
|
8
|
+
* state.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SimCloudFrontRegistry {
|
|
11
|
+
private readonly distributionAccountIds;
|
|
12
|
+
private readonly accountDistributionIds;
|
|
13
|
+
private readonly alternateDomainDistributionIds;
|
|
14
|
+
/**
|
|
15
|
+
* Allocate a globally unique simulated CloudFront Distribution ID.
|
|
16
|
+
*/
|
|
17
|
+
allocateDistributionId(): SimCloudFrontDistributionId;
|
|
18
|
+
/**
|
|
19
|
+
* Register a simulated CloudFront Distribution ID to an Account ID.
|
|
20
|
+
*/
|
|
21
|
+
registerDistribution(distributionId: SimCloudFrontDistributionId, accountId: SimAwsAccountId): void;
|
|
22
|
+
/**
|
|
23
|
+
* Register an alternate domain name to a simulated CloudFront Distribution ID.
|
|
24
|
+
*/
|
|
25
|
+
registerAlternateDomainName(alternateDomainName: string, distributionId: SimCloudFrontDistributionId): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get the Distribution ID registered for an alternate domain name.
|
|
28
|
+
*/
|
|
29
|
+
distributionIdForAlternateDomainName(alternateDomainName: string): SimCloudFrontDistributionId | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Get the Account ID which owns a simulated CloudFront Distribution ID.
|
|
32
|
+
*/
|
|
33
|
+
accountIdForDistribution(distributionId: SimCloudFrontDistributionId): SimAwsAccountId | undefined;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=sim-cloud-front-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cloud-front-registry.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudfront/registry/sim-cloud-front-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;;GAMG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAGnC;IAEJ,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAGnC;IAEJ,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAG3C;IAEJ;;OAEG;IACH,sBAAsB,IAAI,2BAA2B;IAWrD;;OAEG;IACH,oBAAoB,CAClB,cAAc,EAAE,2BAA2B,EAC3C,SAAS,EAAE,eAAe,GACzB,IAAI;IAaP;;OAEG;IACH,2BAA2B,CACzB,mBAAmB,EAAE,MAAM,EAC3B,cAAc,EAAE,2BAA2B,GAC1C,IAAI;IAmBP;;OAEG;IACH,oCAAoC,CAClC,mBAAmB,EAAE,MAAM,GAC1B,2BAA2B,GAAG,SAAS;IAI1C;;OAEG;IACH,wBAAwB,CACtB,cAAc,EAAE,2BAA2B,GAC1C,eAAe,GAAG,SAAS;CAG/B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { makeDistributionId, } from "../distribution/sim-cloudfront-distribution.js";
|
|
2
|
+
/**
|
|
3
|
+
* Simulated CloudFront cross-Account registry of Distribution IDs.
|
|
4
|
+
*
|
|
5
|
+
* CloudFront is not region-scoped, so all region-scoped CloudFront service
|
|
6
|
+
* instances for the same Account should delegate to the same Account-global
|
|
7
|
+
* state.
|
|
8
|
+
*/
|
|
9
|
+
export class SimCloudFrontRegistry {
|
|
10
|
+
distributionAccountIds = new Map();
|
|
11
|
+
accountDistributionIds = new Map();
|
|
12
|
+
alternateDomainDistributionIds = new Map();
|
|
13
|
+
/**
|
|
14
|
+
* Allocate a globally unique simulated CloudFront Distribution ID.
|
|
15
|
+
*/
|
|
16
|
+
allocateDistributionId() {
|
|
17
|
+
let distributionId = makeDistributionId();
|
|
18
|
+
while (this.distributionAccountIds.has(distributionId)) {
|
|
19
|
+
/* v8 ignore next -- does not happen in practice */
|
|
20
|
+
distributionId = makeDistributionId();
|
|
21
|
+
}
|
|
22
|
+
return distributionId;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Register a simulated CloudFront Distribution ID to an Account ID.
|
|
26
|
+
*/
|
|
27
|
+
registerDistribution(distributionId, accountId) {
|
|
28
|
+
this.distributionAccountIds.set(distributionId, accountId);
|
|
29
|
+
let accountDistributions = this.accountDistributionIds.get(accountId);
|
|
30
|
+
if (accountDistributions === undefined) {
|
|
31
|
+
accountDistributions = new Set();
|
|
32
|
+
this.accountDistributionIds.set(accountId, accountDistributions);
|
|
33
|
+
}
|
|
34
|
+
accountDistributions.add(distributionId);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Register an alternate domain name to a simulated CloudFront Distribution ID.
|
|
38
|
+
*/
|
|
39
|
+
registerAlternateDomainName(alternateDomainName, distributionId) {
|
|
40
|
+
const existingDistributionId = this.alternateDomainDistributionIds.get(alternateDomainName);
|
|
41
|
+
if (existingDistributionId !== undefined &&
|
|
42
|
+
existingDistributionId !== distributionId) {
|
|
43
|
+
throw new Error(`Sim CloudFront alternate domain name ${alternateDomainName} is already registered to Distribution ${existingDistributionId}`);
|
|
44
|
+
}
|
|
45
|
+
this.alternateDomainDistributionIds.set(alternateDomainName, distributionId);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get the Distribution ID registered for an alternate domain name.
|
|
49
|
+
*/
|
|
50
|
+
distributionIdForAlternateDomainName(alternateDomainName) {
|
|
51
|
+
return this.alternateDomainDistributionIds.get(alternateDomainName);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get the Account ID which owns a simulated CloudFront Distribution ID.
|
|
55
|
+
*/
|
|
56
|
+
accountIdForDistribution(distributionId) {
|
|
57
|
+
return this.distributionAccountIds.get(distributionId);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=sim-cloud-front-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cloud-front-registry.js","sourceRoot":"","sources":["../../../../src/service/cloudfront/registry/sim-cloud-front-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAEnB,MAAM,gDAAgD,CAAC;AAGxD;;;;;;GAMG;AACH,MAAM,OAAO,qBAAqB;IACf,sBAAsB,GAAG,IAAI,GAAG,EAG9C,CAAC;IAEa,sBAAsB,GAAG,IAAI,GAAG,EAG9C,CAAC;IAEa,8BAA8B,GAAG,IAAI,GAAG,EAGtD,CAAC;IAEJ;;OAEG;IACH,sBAAsB;QACpB,IAAI,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,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SimCloudFrontDistribution, SimCloudFrontDistributionId } from "../../distribution/sim-cloudfront-distribution.js";
|
|
2
|
+
import type { SimCloudFrontRegistry } from "../../registry/sim-cloud-front-registry.js";
|
|
3
|
+
import type { SimAws } from "../../../aws/sim-aws.js";
|
|
4
|
+
import type { SimCloudFrontDistroRoute } from "../sim-cloud-front-distro-router.js";
|
|
5
|
+
/**
|
|
6
|
+
* Routes CloudFront alternate domain names to matching simulated Distributions.
|
|
7
|
+
*
|
|
8
|
+
* Lookup is attempted in two tiers:
|
|
9
|
+
* 1. The inline `distributions` map — fast path for directly supplied distributions.
|
|
10
|
+
* 2. The SimCloudFrontRegistry alternate-domain index — lookup for
|
|
11
|
+
* distributions created through the sim CloudFront API.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SimCloudFrontAlternateDomainRouter {
|
|
14
|
+
private readonly simAws;
|
|
15
|
+
private readonly cloudFrontRegistry;
|
|
16
|
+
private readonly distributions?;
|
|
17
|
+
constructor(props: {
|
|
18
|
+
readonly simAws: SimAws;
|
|
19
|
+
readonly cloudFrontRegistry: SimCloudFrontRegistry;
|
|
20
|
+
readonly distributions?: ReadonlyMap<SimCloudFrontDistributionId, SimCloudFrontDistribution>;
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Select the appropriate CloudFront route for an alternate domain name.
|
|
24
|
+
*/
|
|
25
|
+
routeForAlternateDomainName(alternateDomainName: string): SimCloudFrontDistroRoute | undefined;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=sim-cf-alternate-domain-router.d.ts.map
|
package/dist/service/cloudfront/router/alternate-domain/sim-cf-alternate-domain-router.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cf-alternate-domain-router.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/router/alternate-domain/sim-cf-alternate-domain-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAEpF;;;;;;;GAOG;AACH,qBAAa,kCAAkC;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAwB;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAEjB;gBAEF,KAAK,EAAE;QACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;QACnD,QAAQ,CAAC,aAAa,CAAC,EAAE,WAAW,CAClC,2BAA2B,EAC3B,yBAAyB,CAC1B,CAAC;KACH;IAMD;;OAEG;IACH,2BAA2B,CACzB,mBAAmB,EAAE,MAAM,GAC1B,wBAAwB,GAAG,SAAS;CA0CxC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Routes CloudFront alternate domain names to matching simulated Distributions.
|
|
3
|
+
*
|
|
4
|
+
* Lookup is attempted in two tiers:
|
|
5
|
+
* 1. The inline `distributions` map — fast path for directly supplied distributions.
|
|
6
|
+
* 2. The SimCloudFrontRegistry alternate-domain index — lookup for
|
|
7
|
+
* distributions created through the sim CloudFront API.
|
|
8
|
+
*/
|
|
9
|
+
export class SimCloudFrontAlternateDomainRouter {
|
|
10
|
+
simAws;
|
|
11
|
+
cloudFrontRegistry;
|
|
12
|
+
distributions;
|
|
13
|
+
constructor(props) {
|
|
14
|
+
this.simAws = props.simAws;
|
|
15
|
+
this.cloudFrontRegistry = props.cloudFrontRegistry;
|
|
16
|
+
this.distributions = props.distributions;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Select the appropriate CloudFront route for an alternate domain name.
|
|
20
|
+
*/
|
|
21
|
+
routeForAlternateDomainName(alternateDomainName) {
|
|
22
|
+
// Tier 1: search the inline distributions map first.
|
|
23
|
+
if (this.distributions !== undefined) {
|
|
24
|
+
const distribution = [...this.distributions.values()].find((distro) => distro.hasAlternateDomainName(alternateDomainName));
|
|
25
|
+
if (distribution !== undefined) {
|
|
26
|
+
return {
|
|
27
|
+
cloudFront: this.simAws
|
|
28
|
+
.accountRegionScope(distribution.accountId)
|
|
29
|
+
.cloudFront(),
|
|
30
|
+
distribution,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const distributionId = this.cloudFrontRegistry.distributionIdForAlternateDomainName(alternateDomainName);
|
|
35
|
+
if (distributionId === undefined) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const accountId = this.cloudFrontRegistry.accountIdForDistribution(distributionId);
|
|
39
|
+
if (accountId === undefined) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const cloudFront = this.simAws.accountRegionScope(accountId).cloudFront();
|
|
43
|
+
const distribution = cloudFront.getSimDistributionById(distributionId);
|
|
44
|
+
if (distribution === undefined) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
return { cloudFront, distribution };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=sim-cf-alternate-domain-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cf-alternate-domain-router.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/router/alternate-domain/sim-cf-alternate-domain-router.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,MAAM,OAAO,kCAAkC;IAC5B,MAAM,CAAS;IACf,kBAAkB,CAAwB;IAC1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,EAAE,CAAC;YAC/B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SimCloudFrontDistributionId } from "../../distribution/sim-cloudfront-distribution.js";
|
|
2
|
+
/**
|
|
3
|
+
* Try to extract a CloudFront Distribution ID from a hostname which could
|
|
4
|
+
* start with
|
|
5
|
+
* distro123.cloudfront.net
|
|
6
|
+
* Such as
|
|
7
|
+
* distro123.cloudfront.net.sim-aws.localhost
|
|
8
|
+
*/
|
|
9
|
+
export declare function extractCloudFrontHostDistroId(hostname: string): SimCloudFrontDistributionId | undefined;
|
|
10
|
+
//# sourceMappingURL=extract-cf-host-distro-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-cf-host-distro-id.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/router/distro-id/extract-cf-host-distro-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAErG;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,GACf,2BAA2B,GAAG,SAAS,CAkBzC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Try to extract a CloudFront Distribution ID from a hostname which could
|
|
3
|
+
* start with
|
|
4
|
+
* distro123.cloudfront.net
|
|
5
|
+
* Such as
|
|
6
|
+
* distro123.cloudfront.net.sim-aws.localhost
|
|
7
|
+
*/
|
|
8
|
+
export function extractCloudFrontHostDistroId(hostname) {
|
|
9
|
+
const subdomains = hostname.split(".");
|
|
10
|
+
// E.g. "distro123" "cloudfront" "net" ["sim-aws", "localhost"]
|
|
11
|
+
if (subdomains.length !== 5 && subdomains.length !== 3) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
if (subdomains[1]?.toLowerCase() !== "cloudfront" ||
|
|
15
|
+
subdomains[2]?.toLowerCase() !== "net") {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
/* v8 ignore if -- redundant safety catch */
|
|
19
|
+
if (subdomains[0] === undefined || subdomains[0] === "") {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
return subdomains[0].toUpperCase();
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=extract-cf-host-distro-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-cf-host-distro-id.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/router/distro-id/extract-cf-host-distro-id.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAgB;IAEhB,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,+DAA+D;IAC/D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IACE,UAAU,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,YAAY;QAC7C,UAAU,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,KAAK,EACtC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,4CAA4C;IAC5C,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QACxD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW,EAAiC,CAAC;AACpE,CAAC"}
|