@intentius/chant-lexicon-gcp 0.124.37 → 0.124.39
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/api/read-client.d.ts +14 -1
- package/dist/api/read-client.d.ts.map +1 -1
- package/dist/api/read-client.js +25 -10
- package/dist/composites/catalog.d.ts.map +1 -1
- package/dist/composites/catalog.js +187 -0
- package/dist/composites/index.d.ts +4 -0
- package/dist/composites/index.d.ts.map +1 -1
- package/dist/composites/index.js +2 -0
- package/dist/composites/private-egress-network.d.ts +42 -0
- package/dist/composites/private-egress-network.d.ts.map +1 -0
- package/dist/composites/private-egress-network.js +48 -0
- package/dist/composites/public-cloud-run.d.ts +85 -0
- package/dist/composites/public-cloud-run.d.ts.map +1 -0
- package/dist/composites/public-cloud-run.js +144 -0
- package/dist/deep-observe.d.ts +5 -0
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/deep-observe.js +37 -3
- package/dist/describe-resources.d.ts +13 -0
- package/dist/describe-resources.d.ts.map +1 -1
- package/dist/describe-resources.js +19 -0
- package/dist/health.d.ts +26 -2
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +85 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/integrity.json +3 -3
- package/dist/manifest.json +1 -1
- package/dist/op/activities/gcp-apply.d.ts +19 -0
- package/dist/op/activities/gcp-apply.d.ts.map +1 -1
- package/dist/op/activities/gcp-apply.js +16 -0
- package/dist/op/activities/gcp-compute.d.ts +9 -0
- package/dist/op/activities/gcp-compute.d.ts.map +1 -1
- package/dist/op/activities/gcp-compute.js +107 -11
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +6 -2
- package/dist/skills/chant-gcp.md +2 -0
- package/package.json +2 -2
- package/src/api/read-client.ts +30 -9
- package/src/composites/catalog.ts +187 -0
- package/src/composites/cloud-run-lb.test.ts +93 -0
- package/src/composites/index.ts +4 -0
- package/src/composites/private-egress-network.ts +82 -0
- package/src/composites/public-cloud-run.ts +245 -0
- package/src/deep-observe.test.ts +46 -0
- package/src/deep-observe.ts +41 -3
- package/src/describe-resources.ts +23 -1
- package/src/health.test.ts +65 -1
- package/src/health.ts +88 -11
- package/src/index.ts +2 -1
- package/src/op/activities/gcp-apply.ts +31 -1
- package/src/op/activities/gcp-compute-reconcile.test.ts +150 -0
- package/src/op/activities/gcp-compute.test.ts +4 -2
- package/src/op/activities/gcp-compute.ts +129 -11
- package/src/plugin.ts +6 -2
- package/src/project-config.test.ts +50 -3
- package/src/read-refs.test.ts +60 -0
- package/src/skills/chant-gcp.md +2 -0
package/src/read-refs.test.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, test, expect, vi, beforeEach, afterEach } from "vitest";
|
|
2
2
|
import { describeResources } from "./describe-resources";
|
|
3
|
+
import { CloudRunServiceComposite } from "./composites/cloud-run-service";
|
|
3
4
|
import {
|
|
4
5
|
BackendService,
|
|
5
6
|
CloudRunService,
|
|
@@ -133,3 +134,62 @@ describe("gcp live read resolves .name references as the build does (#4251)", ()
|
|
|
133
134
|
expect(out.unobserved?.publicIam).toBeUndefined();
|
|
134
135
|
});
|
|
135
136
|
});
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* #4251, the IAM binding behold saw as pending: the public IAMPolicyMember of a
|
|
140
|
+
* CloudRunServiceComposite whose service runs outside us-central1. The binding
|
|
141
|
+
* names its service by `name`, so the read has to take the service's region from
|
|
142
|
+
* the declared service, as apply does, or it asks a region where the service
|
|
143
|
+
* isn't, gets a 404 and reports the binding absent.
|
|
144
|
+
*/
|
|
145
|
+
describe("the public binding of a service outside us-central1 reads as observed (#4251)", () => {
|
|
146
|
+
const policyUrl = "/v2/projects/three-cloud/locations/asia-northeast1/services/three-cloud-site:getIamPolicy";
|
|
147
|
+
|
|
148
|
+
function composite() {
|
|
149
|
+
const { service, publicIam } = CloudRunServiceComposite({
|
|
150
|
+
name: "three-cloud-site",
|
|
151
|
+
image: "gcr.io/p/site:1",
|
|
152
|
+
projectId: "three-cloud",
|
|
153
|
+
location: "asia-northeast1",
|
|
154
|
+
publicAccess: true,
|
|
155
|
+
}) as unknown as Record<string, { entityType: string; props: Record<string, unknown> }>;
|
|
156
|
+
return [
|
|
157
|
+
["webService", { entityType: service.entityType, props: service.props }],
|
|
158
|
+
["webPublicIam", { entityType: publicIam.entityType, props: publicIam.props }],
|
|
159
|
+
] as Array<[string, { entityType: string; props: Record<string, unknown> }]>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
beforeEach(() => {
|
|
163
|
+
fetchMock.mockReset();
|
|
164
|
+
vi.stubGlobal("fetch", fetchMock);
|
|
165
|
+
process.env.GCP_ENDPOINT_URL = "http://localhost:4588";
|
|
166
|
+
process.env.GCP_PROJECT_ID = "three-cloud";
|
|
167
|
+
delete process.env.GCP_REGION;
|
|
168
|
+
fetchMock.mockImplementation(async (url: string) => {
|
|
169
|
+
if (url.includes(":getIamPolicy")) {
|
|
170
|
+
return url.includes(policyUrl)
|
|
171
|
+
? reply(200, { bindings: [{ role: "roles/run.invoker", members: ["allUsers"] }] })
|
|
172
|
+
: reply(404, { error: { code: 404 } });
|
|
173
|
+
}
|
|
174
|
+
return reply(200, { name: url.split("?")[0].split("/").slice(-6).join("/") });
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
afterEach(() => {
|
|
179
|
+
vi.unstubAllGlobals();
|
|
180
|
+
delete process.env.GCP_ENDPOINT_URL;
|
|
181
|
+
delete process.env.GCP_PROJECT_ID;
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
for (const order of ["service first", "binding first"]) {
|
|
185
|
+
test(`webPublicIam is observed with a physical id, ${order}`, async () => {
|
|
186
|
+
const pairs = composite();
|
|
187
|
+
const entities = new Map(order === "service first" ? pairs : [...pairs].reverse());
|
|
188
|
+
const out = await describeResources({ environment: "local", buildOutput: "", entityNames: [...entities.keys()], entities });
|
|
189
|
+
expect(out.unobserved?.webPublicIam).toBeUndefined();
|
|
190
|
+
expect(out.resources.webPublicIam?.physicalId).toBe(
|
|
191
|
+
"projects/three-cloud/locations/asia-northeast1/services/three-cloud-site#roles/run.invoker#allUsers",
|
|
192
|
+
);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
package/src/skills/chant-gcp.md
CHANGED
|
@@ -202,6 +202,8 @@ Composites group related Config Connector resources with secure defaults. Each r
|
|
|
202
202
|
| `ManagedCertificate` | ComputeManagedSslCertificate | Auto-renewal via Google-managed cert |
|
|
203
203
|
| `SecureProject` | Project + IAMAuditConfig + essential Service resources | Audit logging, required APIs enabled, org policy constraints |
|
|
204
204
|
| `GpuNodePool` | ContainerNodePool with GPU accelerators | Scale-to-zero, nvidia.com/gpu taint, GKE metadata workload identity |
|
|
205
|
+
| `PrivateEgressNetwork` | ComputeNetwork + ComputeSubnetwork | Custom mode, regional routing, Private Google Access |
|
|
206
|
+
| `PublicCloudRun` | IAMServiceAccount + RunService + serverless NEG + global external Application Load Balancer | Own service account, Direct VPC egress for private ranges, optional managed certificate with HTTP to HTTPS redirect, optional Cloud Armor policy |
|
|
205
207
|
|
|
206
208
|
### Example: GKE cluster with secure defaults
|
|
207
209
|
|