@pattform/api-kit 3.2.0 → 3.3.1

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.
@@ -24,6 +24,7 @@ export interface AppComponentArgs {
24
24
  manageValidationRecord?: boolean;
25
25
  githubToken?: pulumi.Input<string>;
26
26
  cloudflareApiToken?: pulumi.Input<string>;
27
+ zoneId?: pulumi.Input<string>;
27
28
  }
28
29
  export interface DnsRecordInstruction {
29
30
  name: string;
@@ -151,11 +151,15 @@ class AppComponent extends pulumi.ComponentResource {
151
151
  const cloudFlareProvider = new cloudflare.Provider(`pattform-app-cloudflare-${appName}-${env}`, {
152
152
  apiToken: cloudFrontToken,
153
153
  });
154
- const cloudflareZone = cloudflare.getZoneOutput({
155
- name: args.domain
156
- }, {
157
- provider: cloudFlareProvider,
158
- });
154
+ // A zone created in the same program (args.zoneId) can't be looked
155
+ // up by name yet, so its id is passed in instead.
156
+ const cloudflareZone = args.zoneId
157
+ ? { id: pulumi.output(args.zoneId) }
158
+ : cloudflare.getZoneOutput({
159
+ name: args.domain
160
+ }, {
161
+ provider: cloudFlareProvider,
162
+ });
159
163
  // ACM validates domain ownership with one deterministic CNAME per
160
164
  // apex, shared across every cert for that domain. When another
161
165
  // stack already manages the apex (e.g. the apex/www site while this
@@ -25,4 +25,5 @@ export interface ContainerComponentArgs {
25
25
  gcpProject?: pulumi.Input<string>;
26
26
  gcpRegion?: pulumi.Input<string>;
27
27
  imageDigest?: pulumi.Input<string>;
28
+ image?: pulumi.Input<string>;
28
29
  }
@@ -21,6 +21,10 @@ class ContainerComponent extends pulumi.ComponentResource {
21
21
  const imageRefFromConfig = (_c = args.imageDigest) !== null && _c !== void 0 ? _c : componentConfig.get("imageRef");
22
22
  // Create an Artifact Registry repository
23
23
  this.repository = new gcp.artifactregistry.Repository("container-component-" + args.imageName + "-repo-" + args.environment, {
24
+ // Explicit (and on the Cloud Run service below): a capability's
25
+ // provider defaults to the platform project (pattform-management),
26
+ // not the client's.
27
+ project: gcpProject,
24
28
  description: args.environment + " repository for " + args.imageName + " Docker images",
25
29
  format: "DOCKER",
26
30
  location: gcpRegion,
@@ -46,14 +50,17 @@ class ContainerComponent extends pulumi.ComponentResource {
46
50
  });
47
51
  // Form the repository URL
48
52
  const repoUrl = pulumi.concat(gcpRegion, "-docker.pkg.dev/", gcpProject, "/", this.repository.repositoryId);
49
- const imageRef = imageRefFromConfig
50
- ? pulumi.interpolate `${repoUrl}/${args.imageName}@${imageRefFromConfig}`
51
- : pulumi.interpolate `${repoUrl}/${args.imageName}:latest`;
53
+ const imageRef = args.image
54
+ ? pulumi.output(args.image)
55
+ : imageRefFromConfig
56
+ ? pulumi.interpolate `${repoUrl}/${args.imageName}@${imageRefFromConfig}`
57
+ : pulumi.interpolate `${repoUrl}/${args.imageName}:latest`;
52
58
  // Default Spring Boot probe paths (can be overridden via args)
53
59
  const defaultReadinessPath = (_d = args.readinessPath) !== null && _d !== void 0 ? _d : "/actuator/health/readiness";
54
60
  const defaultLivenessPath = (_e = args.livenessPath) !== null && _e !== void 0 ? _e : "/actuator/health/liveness";
55
61
  // Create a Cloud Run service for the container image.
56
62
  this.service = new gcp.cloudrunv2.Service("container-component-" + args.imageName + "-service-" + args.environment, {
63
+ project: gcpProject,
57
64
  location: gcpRegion,
58
65
  ingress: "INGRESS_TRAFFIC_ALL",
59
66
  name: args.imageName + "-" + args.environment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pattform/api-kit",
3
- "version": "3.2.0",
3
+ "version": "3.3.1",
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",