@pattform/api-kit 3.1.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.
@@ -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 = (_a = args.readinessPath) !== null && _a !== void 0 ? _a : "/actuator/health/readiness";
51
- const defaultLivenessPath = (_b = args.livenessPath) !== null && _b !== void 0 ? _b : "/actuator/health/liveness";
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: (_c = args.concurrency) !== null && _c !== void 0 ? _c : 30,
62
+ maxInstanceRequestConcurrency: (_f = args.concurrency) !== null && _f !== void 0 ? _f : 30,
60
63
  scaling: {
61
64
  maxInstanceCount: 2
62
65
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pattform/api-kit",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Pulumi infra library for building and deploying an API",
5
5
  "author": "Pattform <contact@pattform.io>",
6
6
  "license": "SEE LICENSE IN LICENSE",