@pattform/api-kit 3.0.0 → 3.2.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/AppComponent.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface AppComponentArgs {
|
|
|
22
22
|
[key: string]: pulumi.Input<string>;
|
|
23
23
|
};
|
|
24
24
|
manageValidationRecord?: boolean;
|
|
25
|
+
githubToken?: pulumi.Input<string>;
|
|
26
|
+
cloudflareApiToken?: pulumi.Input<string>;
|
|
25
27
|
}
|
|
26
28
|
export interface DnsRecordInstruction {
|
|
27
29
|
name: string;
|
package/dist/AppComponent.js
CHANGED
|
@@ -14,9 +14,13 @@ class AppComponent extends pulumi.ComponentResource {
|
|
|
14
14
|
const awsAccessKey = awsConfig.getSecret("accessKey");
|
|
15
15
|
const awsSecretKey = awsConfig.getSecret("secretKey");
|
|
16
16
|
const githubConfig = new pulumi.Config("github");
|
|
17
|
-
const githubToken =
|
|
17
|
+
const githubToken = args.githubToken
|
|
18
|
+
? pulumi.secret(args.githubToken)
|
|
19
|
+
: githubConfig.requireSecret("apiToken");
|
|
18
20
|
const cloudFlareConfig = new pulumi.Config("cloudflare");
|
|
19
|
-
const cloudFrontToken =
|
|
21
|
+
const cloudFrontToken = args.cloudflareApiToken
|
|
22
|
+
? pulumi.secret(args.cloudflareApiToken)
|
|
23
|
+
: cloudFlareConfig.getSecret("apiToken");
|
|
20
24
|
const appName = pulumi.getProject();
|
|
21
25
|
const env = pulumi.getStack();
|
|
22
26
|
// DNS is managed in Cloudflare unless the client owns their domain
|
|
@@ -22,4 +22,7 @@ export interface ContainerComponentArgs {
|
|
|
22
22
|
concurrency?: number;
|
|
23
23
|
readinessPath?: pulumi.Input<string>;
|
|
24
24
|
livenessPath?: pulumi.Input<string>;
|
|
25
|
+
gcpProject?: pulumi.Input<string>;
|
|
26
|
+
gcpRegion?: pulumi.Input<string>;
|
|
27
|
+
imageDigest?: pulumi.Input<string>;
|
|
25
28
|
}
|
|
@@ -9,13 +9,16 @@ const gcp = require("@pulumi/gcp");
|
|
|
9
9
|
*/
|
|
10
10
|
class ContainerComponent extends pulumi.ComponentResource {
|
|
11
11
|
constructor(name, args, opts) {
|
|
12
|
-
var _a, _b, _c;
|
|
12
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13
13
|
super("custom:pattform:ContainerComponent", name, args, opts);
|
|
14
|
+
// Project, region and image digest come from args when given (a
|
|
15
|
+
// capability has no stack config of its own), else from config as
|
|
16
|
+
// before: gcp:project, gcp:region and <project>:imageRef.
|
|
14
17
|
const gcpConfig = new pulumi.Config("gcp");
|
|
15
|
-
const gcpProject = gcpConfig.require("project");
|
|
16
|
-
const gcpRegion = gcpConfig.require("region");
|
|
18
|
+
const gcpProject = (_a = args.gcpProject) !== null && _a !== void 0 ? _a : gcpConfig.require("project");
|
|
19
|
+
const gcpRegion = (_b = args.gcpRegion) !== null && _b !== void 0 ? _b : gcpConfig.require("region");
|
|
17
20
|
const componentConfig = new pulumi.Config();
|
|
18
|
-
const imageRefFromConfig = componentConfig.get("imageRef");
|
|
21
|
+
const imageRefFromConfig = (_c = args.imageDigest) !== null && _c !== void 0 ? _c : componentConfig.get("imageRef");
|
|
19
22
|
// Create an Artifact Registry repository
|
|
20
23
|
this.repository = new gcp.artifactregistry.Repository("container-component-" + args.imageName + "-repo-" + args.environment, {
|
|
21
24
|
description: args.environment + " repository for " + args.imageName + " Docker images",
|
|
@@ -47,8 +50,8 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
47
50
|
? pulumi.interpolate `${repoUrl}/${args.imageName}@${imageRefFromConfig}`
|
|
48
51
|
: pulumi.interpolate `${repoUrl}/${args.imageName}:latest`;
|
|
49
52
|
// Default Spring Boot probe paths (can be overridden via args)
|
|
50
|
-
const defaultReadinessPath = (
|
|
51
|
-
const defaultLivenessPath = (
|
|
53
|
+
const defaultReadinessPath = (_d = args.readinessPath) !== null && _d !== void 0 ? _d : "/actuator/health/readiness";
|
|
54
|
+
const defaultLivenessPath = (_e = args.livenessPath) !== null && _e !== void 0 ? _e : "/actuator/health/liveness";
|
|
52
55
|
// Create a Cloud Run service for the container image.
|
|
53
56
|
this.service = new gcp.cloudrunv2.Service("container-component-" + args.imageName + "-service-" + args.environment, {
|
|
54
57
|
location: gcpRegion,
|
|
@@ -56,7 +59,7 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
56
59
|
name: args.imageName + "-" + args.environment,
|
|
57
60
|
invokerIamDisabled: true,
|
|
58
61
|
template: {
|
|
59
|
-
maxInstanceRequestConcurrency: (
|
|
62
|
+
maxInstanceRequestConcurrency: (_f = args.concurrency) !== null && _f !== void 0 ? _f : 30,
|
|
60
63
|
scaling: {
|
|
61
64
|
maxInstanceCount: 2
|
|
62
65
|
},
|