@pattform/api-kit 2.5.0 → 2.6.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/ApiComponent.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare class ApiComponent extends pulumi.ComponentResource {
|
|
|
13
13
|
export interface ApiComponentArgs {
|
|
14
14
|
environment: pulumi.Input<string>;
|
|
15
15
|
imageName: pulumi.Input<string>;
|
|
16
|
+
roleArn?: pulumi.Input<string>;
|
|
16
17
|
containerUrl: pulumi.Input<string>;
|
|
17
18
|
appDomain: pulumi.Input<string>;
|
|
18
19
|
localAppDomain: pulumi.Input<string>;
|
package/dist/ApiComponent.js
CHANGED
|
@@ -10,16 +10,25 @@ const pattformHelper_1 = require("./pattformHelper");
|
|
|
10
10
|
*/
|
|
11
11
|
class ApiComponent extends pulumi.ComponentResource {
|
|
12
12
|
constructor(name, args, opts) {
|
|
13
|
+
var _a;
|
|
13
14
|
super("custom:pattform:ApiComponent", name, args, opts);
|
|
14
15
|
const awsConfig = new pulumi.Config("aws");
|
|
15
16
|
const awsRegion = awsConfig.require("region");
|
|
16
|
-
const awsAccessKey = awsConfig.
|
|
17
|
-
const awsSecretKey = awsConfig.
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const awsAccessKey = awsConfig.getSecret("accessKey");
|
|
18
|
+
const awsSecretKey = awsConfig.getSecret("secretKey");
|
|
19
|
+
// Credential precedence matches AppComponent: assume-role into the
|
|
20
|
+
// client account (preferred), then static keys (legacy stacks), then
|
|
21
|
+
// ambient credentials (e.g. an ESC aws-login environment).
|
|
22
|
+
const roleArn = (_a = args.roleArn) !== null && _a !== void 0 ? _a : awsConfig.get("roleArn");
|
|
23
|
+
const awsProvider = new aws.Provider("api-component-aws-" + args.environment, Object.assign(Object.assign({ region: (0, pattformHelper_1.verifyRegion)(awsRegion) }, (awsAccessKey && awsSecretKey ? {
|
|
20
24
|
accessKey: awsAccessKey,
|
|
21
25
|
secretKey: awsSecretKey,
|
|
22
|
-
})
|
|
26
|
+
} : {})), (roleArn ? {
|
|
27
|
+
assumeRole: {
|
|
28
|
+
roleArn: roleArn,
|
|
29
|
+
sessionName: pulumi.interpolate `pattform-api-${args.imageName}-${args.environment}`.apply(s => s.substring(0, 64)),
|
|
30
|
+
},
|
|
31
|
+
} : {})));
|
|
23
32
|
// Create an HTTP API for the load balancer to route to
|
|
24
33
|
this.httpApi = new aws.apigatewayv2.Api("api-component-" + args.imageName + "-api-" + args.environment, {
|
|
25
34
|
name: args.imageName,
|
|
@@ -9,7 +9,7 @@ const gcp = require("@pulumi/gcp");
|
|
|
9
9
|
*/
|
|
10
10
|
class ContainerComponent extends pulumi.ComponentResource {
|
|
11
11
|
constructor(name, args, opts) {
|
|
12
|
-
var _a, _b;
|
|
12
|
+
var _a, _b, _c;
|
|
13
13
|
super("custom:pattform:ContainerComponent", name, args, opts);
|
|
14
14
|
const gcpConfig = new pulumi.Config("gcp");
|
|
15
15
|
const gcpProject = gcpConfig.require("project");
|
|
@@ -56,7 +56,7 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
56
56
|
name: args.imageName + "-" + args.environment,
|
|
57
57
|
invokerIamDisabled: true,
|
|
58
58
|
template: {
|
|
59
|
-
maxInstanceRequestConcurrency: 30,
|
|
59
|
+
maxInstanceRequestConcurrency: (_c = args.concurrency) !== null && _c !== void 0 ? _c : 30,
|
|
60
60
|
scaling: {
|
|
61
61
|
maxInstanceCount: 2
|
|
62
62
|
},
|