@pattform/api-kit 2.6.8 → 2.6.9
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/ApiComponent.d.ts +1 -0
- package/dist/ApiComponent.js +7 -2
- package/package.json +1 -1
package/dist/ApiComponent.d.ts
CHANGED
package/dist/ApiComponent.js
CHANGED
|
@@ -10,7 +10,7 @@ const pattformHelper_1 = require("./pattformHelper");
|
|
|
10
10
|
*/
|
|
11
11
|
class ApiComponent extends pulumi.ComponentResource {
|
|
12
12
|
constructor(name, args, opts) {
|
|
13
|
-
var _a;
|
|
13
|
+
var _a, _b;
|
|
14
14
|
super("custom:pattform:ApiComponent", name, args, opts);
|
|
15
15
|
const awsConfig = new pulumi.Config("aws");
|
|
16
16
|
const awsRegion = awsConfig.require("region");
|
|
@@ -29,6 +29,11 @@ class ApiComponent extends pulumi.ComponentResource {
|
|
|
29
29
|
sessionName: pulumi.interpolate `pattform-api-${args.imageName}-${args.environment}`.apply(s => s.substring(0, 64)),
|
|
30
30
|
},
|
|
31
31
|
} : {})));
|
|
32
|
+
const allowOrigins = [
|
|
33
|
+
args.appDomain,
|
|
34
|
+
args.localAppDomain,
|
|
35
|
+
...((_b = args.additionalAllowedOrigins) !== null && _b !== void 0 ? _b : []),
|
|
36
|
+
];
|
|
32
37
|
// Create an HTTP API for the load balancer to route to
|
|
33
38
|
this.httpApi = new aws.apigatewayv2.Api("api-component-" + args.imageName + "-api-" + args.environment, {
|
|
34
39
|
name: args.imageName,
|
|
@@ -39,7 +44,7 @@ class ApiComponent extends pulumi.ComponentResource {
|
|
|
39
44
|
corsConfiguration: {
|
|
40
45
|
allowMethods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
|
|
41
46
|
allowHeaders: ["*"],
|
|
42
|
-
allowOrigins:
|
|
47
|
+
allowOrigins: allowOrigins,
|
|
43
48
|
allowCredentials: true,
|
|
44
49
|
exposeHeaders: ["*"],
|
|
45
50
|
},
|