@relkit/deploy 0.0.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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/diff-utils.d.ts +15 -0
- package/dist/diff-utils.d.ts.map +1 -0
- package/dist/diff-utils.js +71 -0
- package/dist/diff-utils.js.map +1 -0
- package/dist/diff.d.ts +46 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +103 -0
- package/dist/diff.js.map +1 -0
- package/dist/from-graph-aws.d.ts +8 -0
- package/dist/from-graph-aws.d.ts.map +1 -0
- package/dist/from-graph-aws.js +52 -0
- package/dist/from-graph-aws.js.map +1 -0
- package/dist/from-graph-boundary.d.ts +2 -0
- package/dist/from-graph-boundary.d.ts.map +1 -0
- package/dist/from-graph-boundary.js +23 -0
- package/dist/from-graph-boundary.js.map +1 -0
- package/dist/from-graph-context.d.ts +11 -0
- package/dist/from-graph-context.d.ts.map +1 -0
- package/dist/from-graph-context.js +14 -0
- package/dist/from-graph-context.js.map +1 -0
- package/dist/from-graph-plan.d.ts +5 -0
- package/dist/from-graph-plan.d.ts.map +1 -0
- package/dist/from-graph-plan.js +118 -0
- package/dist/from-graph-plan.js.map +1 -0
- package/dist/from-graph-resources.d.ts +63 -0
- package/dist/from-graph-resources.d.ts.map +1 -0
- package/dist/from-graph-resources.js +77 -0
- package/dist/from-graph-resources.js.map +1 -0
- package/dist/from-graph-validation.d.ts +39 -0
- package/dist/from-graph-validation.d.ts.map +1 -0
- package/dist/from-graph-validation.js +104 -0
- package/dist/from-graph-validation.js.map +1 -0
- package/dist/from-graph.d.ts +6 -0
- package/dist/from-graph.d.ts.map +1 -0
- package/dist/from-graph.js +28 -0
- package/dist/from-graph.js.map +1 -0
- package/dist/iam.d.ts +5 -0
- package/dist/iam.d.ts.map +1 -0
- package/dist/iam.js +96 -0
- package/dist/iam.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/plan.d.ts +143 -0
- package/dist/plan.d.ts.map +1 -0
- package/dist/plan.js +5 -0
- package/dist/plan.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { GraphNode } from "@relkit/graph";
|
|
2
|
+
import { type PlanContext } from "./from-graph-context.js";
|
|
3
|
+
export declare function events(context: PlanContext): {
|
|
4
|
+
version: number;
|
|
5
|
+
payload: import("@relkit/contracts").JsonValue;
|
|
6
|
+
id: string;
|
|
7
|
+
logicalName: string;
|
|
8
|
+
bindingId: string;
|
|
9
|
+
profile?: string;
|
|
10
|
+
configurationNames: readonly string[];
|
|
11
|
+
capabilities?: readonly string[];
|
|
12
|
+
tags?: Readonly<Record<string, string>>;
|
|
13
|
+
metadata?: import("@relkit/contracts").JsonValue;
|
|
14
|
+
}[];
|
|
15
|
+
export declare function eventTriggers(context: PlanContext): {
|
|
16
|
+
concurrency?: number;
|
|
17
|
+
retry?: string | number | boolean | readonly import("@relkit/contracts").JsonValue[] | {
|
|
18
|
+
readonly [key: string]: import("@relkit/contracts").JsonValue;
|
|
19
|
+
};
|
|
20
|
+
targetFunctionId: string;
|
|
21
|
+
expansion: `${string}@${number}`[];
|
|
22
|
+
delivery: "ephemeral" | "durable";
|
|
23
|
+
id: string;
|
|
24
|
+
logicalName: string;
|
|
25
|
+
bindingId: string;
|
|
26
|
+
profile?: string;
|
|
27
|
+
configurationNames: readonly string[];
|
|
28
|
+
capabilities?: readonly string[];
|
|
29
|
+
tags?: Readonly<Record<string, string>>;
|
|
30
|
+
metadata?: import("@relkit/contracts").JsonValue;
|
|
31
|
+
}[];
|
|
32
|
+
export declare function buckets(context: PlanContext): {
|
|
33
|
+
allowedContentTypes?: string[];
|
|
34
|
+
maxObjectBytes?: number;
|
|
35
|
+
profile: string;
|
|
36
|
+
visibility: "private" | "public";
|
|
37
|
+
id: string;
|
|
38
|
+
logicalName: string;
|
|
39
|
+
bindingId: string;
|
|
40
|
+
configurationNames: readonly string[];
|
|
41
|
+
capabilities?: readonly string[];
|
|
42
|
+
tags?: Readonly<Record<string, string>>;
|
|
43
|
+
metadata?: import("@relkit/contracts").JsonValue;
|
|
44
|
+
}[];
|
|
45
|
+
export declare function caches(context: PlanContext): {
|
|
46
|
+
maxTtlMs?: number;
|
|
47
|
+
defaultTtlMs?: number;
|
|
48
|
+
profile: string;
|
|
49
|
+
id: string;
|
|
50
|
+
logicalName: string;
|
|
51
|
+
bindingId: string;
|
|
52
|
+
configurationNames: readonly string[];
|
|
53
|
+
capabilities?: readonly string[];
|
|
54
|
+
tags?: Readonly<Record<string, string>>;
|
|
55
|
+
metadata?: import("@relkit/contracts").JsonValue;
|
|
56
|
+
}[];
|
|
57
|
+
export declare function routes(graphNodes: readonly GraphNode[]): {
|
|
58
|
+
id: string;
|
|
59
|
+
method: string;
|
|
60
|
+
path: string;
|
|
61
|
+
targetFunctionId: string;
|
|
62
|
+
}[];
|
|
63
|
+
//# sourceMappingURL=from-graph-resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-graph-resources.d.ts","sourceRoot":"","sources":["../src/from-graph-resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,SAAS,EAAE,MAAM,eAAe,CAAC;AAInE,OAAO,EAAQ,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEjE,wBAAgB,MAAM,CAAC,OAAO,EAAE,WAAW;;;;;;;;;;;IAgB1C;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW;;;;;;;;;;;;;;;;IA8BjD;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,WAAW;;;;;;;;;;;;IAoB3C;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,WAAW;;;;;;;;;;;IAiB1C;AAED,wBAAgB,MAAM,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE;;;;;IAgBtD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { byLogical, isManaged, nodes } from "./from-graph-validation.js";
|
|
2
|
+
import { iam } from "./from-graph-aws.js";
|
|
3
|
+
import { base } from "./from-graph-context.js";
|
|
4
|
+
export function events(context) {
|
|
5
|
+
return nodes(context.graph.nodes, "event")
|
|
6
|
+
.filter(() => isManaged(context.providers, "events", "default"))
|
|
7
|
+
.map((event) => ({
|
|
8
|
+
...base(context, event.id, "event", "events", "default", iam("events", event.id, context.graph.edges)),
|
|
9
|
+
version: event.version,
|
|
10
|
+
payload: event.payload,
|
|
11
|
+
}))
|
|
12
|
+
.sort(byLogical);
|
|
13
|
+
}
|
|
14
|
+
export function eventTriggers(context) {
|
|
15
|
+
return context.graph.nodes
|
|
16
|
+
.filter((node) => node.kind === "trigger" && node.triggerType === "event")
|
|
17
|
+
.filter((node) => {
|
|
18
|
+
const config = node.config;
|
|
19
|
+
return isManaged(context.providers, "events", config.profile ?? "default");
|
|
20
|
+
})
|
|
21
|
+
.map((node) => {
|
|
22
|
+
const config = node.config;
|
|
23
|
+
const profile = config.profile ?? "default";
|
|
24
|
+
return {
|
|
25
|
+
...base(context, node.id, "event-trigger", "events", profile, config.delivery === "durable" ? iam("jobs", node.id, context.graph.edges) : []),
|
|
26
|
+
targetFunctionId: node.targetFunctionId,
|
|
27
|
+
expansion: [...config.expansion].sort(),
|
|
28
|
+
delivery: config.delivery,
|
|
29
|
+
...(defined(config.retry) ? { retry: config.retry } : {}),
|
|
30
|
+
...(defined(config.concurrency) ? { concurrency: config.concurrency } : {}),
|
|
31
|
+
};
|
|
32
|
+
})
|
|
33
|
+
.sort(byLogical);
|
|
34
|
+
}
|
|
35
|
+
export function buckets(context) {
|
|
36
|
+
return nodes(context.graph.nodes, "bucket")
|
|
37
|
+
.filter((bucket) => isManaged(context.providers, "buckets", bucket.profile))
|
|
38
|
+
.map((bucket) => ({
|
|
39
|
+
...base(context, bucket.id, "bucket", "buckets", bucket.profile, iam("buckets", bucket.id, context.graph.edges)),
|
|
40
|
+
profile: bucket.profile,
|
|
41
|
+
visibility: bucket.visibility,
|
|
42
|
+
...(defined(bucket.maxObjectBytes) ? { maxObjectBytes: bucket.maxObjectBytes } : {}),
|
|
43
|
+
...(defined(bucket.allowedContentTypes)
|
|
44
|
+
? { allowedContentTypes: [...bucket.allowedContentTypes].sort() }
|
|
45
|
+
: {}),
|
|
46
|
+
}))
|
|
47
|
+
.sort(byLogical);
|
|
48
|
+
}
|
|
49
|
+
export function caches(context) {
|
|
50
|
+
return nodes(context.graph.nodes, "cache")
|
|
51
|
+
.filter((cache) => isManaged(context.providers, "cache", cache.profile))
|
|
52
|
+
.map((cache) => ({
|
|
53
|
+
...base(context, cache.id, "cache", "cache", cache.profile, iam("cache", cache.id, context.graph.edges)),
|
|
54
|
+
profile: cache.profile,
|
|
55
|
+
...(defined(cache.defaultTtlMs) ? { defaultTtlMs: cache.defaultTtlMs } : {}),
|
|
56
|
+
...(defined(cache.maxTtlMs) ? { maxTtlMs: cache.maxTtlMs } : {}),
|
|
57
|
+
}))
|
|
58
|
+
.sort(byLogical);
|
|
59
|
+
}
|
|
60
|
+
export function routes(graphNodes) {
|
|
61
|
+
return graphNodes
|
|
62
|
+
.filter((node) => node.kind === "trigger" && node.triggerType === "http")
|
|
63
|
+
.map((node) => {
|
|
64
|
+
const config = node.config;
|
|
65
|
+
return {
|
|
66
|
+
id: node.id,
|
|
67
|
+
method: config.method,
|
|
68
|
+
path: config.path,
|
|
69
|
+
targetFunctionId: node.targetFunctionId,
|
|
70
|
+
};
|
|
71
|
+
})
|
|
72
|
+
.sort((left, right) => left.id.localeCompare(right.id));
|
|
73
|
+
}
|
|
74
|
+
function defined(value) {
|
|
75
|
+
return value !== null && value !== undefined;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=from-graph-resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-graph-resources.js","sourceRoot":"","sources":["../src/from-graph-resources.ts"],"names":[],"mappings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AE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5E,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjE,CAAC,CAAC;SACF,IAAI,CAAC,SAAS,CAAC,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,UAAgC;IACrD,OAAO,UAAU;SACd,MAAM,CACL,CAAC,IAAI,EAAmD,EAAE,CACxD,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,MAAM,CACzD;SACA,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,MAAM,GAAG,IAAI,CAAC,MAA4D,CAAC;QACjF,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;SACxC,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,OAAO,CAAI,KAA2B;IAC7C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AppNode, ApplicationGraph, GraphNode, ProviderProfileNode } from "@relkit/graph";
|
|
2
|
+
export declare const AWS_DEPLOYMENT_CAPABILITIES: readonly ["buckets", "cache", "events", "jobs", "models", "observability"];
|
|
3
|
+
export type Capability = (typeof AWS_DEPLOYMENT_CAPABILITIES)[number];
|
|
4
|
+
type EnvNode = Extract<GraphNode, {
|
|
5
|
+
kind: "env";
|
|
6
|
+
}>;
|
|
7
|
+
export interface FromGraphOptions {
|
|
8
|
+
readonly image?: import("./plan.js").ContainerImagePlan;
|
|
9
|
+
readonly httpPort?: number;
|
|
10
|
+
}
|
|
11
|
+
export type DeploymentPlanErrorCode = "RELKIT_DEPLOY_GRAPH_INVALID" | "RELKIT_DEPLOY_SECRET_UNSUPPORTED" | "RELKIT_DEPLOY_LIVE_OBJECT_UNSUPPORTED" | "RELKIT_DEPLOY_AWS_CAPABILITY_UNSUPPORTED" | "RELKIT_DEPLOY_AWS_PROFILE_UNSUPPORTED" | "RELKIT_DEPLOY_CONFIGURATION_MISSING";
|
|
12
|
+
export declare class DeploymentPlanError extends Error {
|
|
13
|
+
readonly code: DeploymentPlanErrorCode;
|
|
14
|
+
constructor(code: DeploymentPlanErrorCode, message: string);
|
|
15
|
+
}
|
|
16
|
+
export declare function providerMap(nodes: readonly GraphNode[]): Map<string, ProviderProfileNode>;
|
|
17
|
+
export declare function validateProviders(app: AppNode, providers: Map<string, ProviderProfileNode>, nodes: readonly GraphNode[], edges: ApplicationGraph["edges"]): void;
|
|
18
|
+
export declare function requireProvider(providers: Map<string, ProviderProfileNode>, capability: Capability, profile: string): ProviderProfileNode;
|
|
19
|
+
export declare function configNames(providers: Map<string, ProviderProfileNode>, name: Capability, profile: string): string[];
|
|
20
|
+
export declare function isManaged(providers: Map<string, ProviderProfileNode>, capability: Capability, profile: string): boolean;
|
|
21
|
+
export declare function providerId(capability: string, profile: string): string;
|
|
22
|
+
export declare function onlyApp(nodes: readonly GraphNode[]): Extract<GraphNode, {
|
|
23
|
+
kind: "app";
|
|
24
|
+
}>;
|
|
25
|
+
export declare function nodes<K extends GraphNode["kind"]>(values: readonly GraphNode[], kind: K): Extract<GraphNode, {
|
|
26
|
+
kind: K;
|
|
27
|
+
}>[];
|
|
28
|
+
export declare function envNodes(nodes: readonly GraphNode[]): Map<string, EnvNode>;
|
|
29
|
+
export declare function envNames(nodes: readonly GraphNode[]): string[];
|
|
30
|
+
export declare function logicalName(appId: string, kind: string, id: string): string;
|
|
31
|
+
export declare function byLogical(left: {
|
|
32
|
+
readonly logicalName: string;
|
|
33
|
+
}, right: {
|
|
34
|
+
readonly logicalName: string;
|
|
35
|
+
}): number;
|
|
36
|
+
export declare function secretName(value: string): boolean;
|
|
37
|
+
export declare function fail(code: DeploymentPlanErrorCode, message: string): never;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=from-graph-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-graph-validation.d.ts","sourceRoot":"","sources":["../src/from-graph-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAG/F,eAAO,MAAM,2BAA2B,4EAO9B,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AACtE,KAAK,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAWnD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,WAAW,EAAE,kBAAkB,CAAC;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,uBAAuB,GAC/B,6BAA6B,GAC7B,kCAAkC,GAClC,uCAAuC,GACvC,0CAA0C,GAC1C,uCAAuC,GACvC,qCAAqC,CAAC;AAE1C,qBAAa,mBAAoB,SAAQ,KAAK;IAE1C,QAAQ,CAAC,IAAI,EAAE,uBAAuB;gBAA7B,IAAI,EAAE,uBAAuB,EACtC,OAAO,EAAE,MAAM;CAKlB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC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AAS,EAAE,GAAG,MAAM,EAAE,CAK9D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAU3E;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EACtC,KAAK,EAAE;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACtC,MAAM,CAER;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIjD;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAE1E"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { usedCapabilities } from "./from-graph-aws.js";
|
|
2
|
+
export const AWS_DEPLOYMENT_CAPABILITIES = [
|
|
3
|
+
"buckets",
|
|
4
|
+
"cache",
|
|
5
|
+
"events",
|
|
6
|
+
"jobs",
|
|
7
|
+
"models",
|
|
8
|
+
"observability",
|
|
9
|
+
];
|
|
10
|
+
const AWS_ADAPTERS = {
|
|
11
|
+
buckets: ["s3"],
|
|
12
|
+
cache: ["redis"],
|
|
13
|
+
events: ["eventbridge"],
|
|
14
|
+
jobs: ["sqs"],
|
|
15
|
+
models: [],
|
|
16
|
+
observability: ["cloudwatch"],
|
|
17
|
+
};
|
|
18
|
+
export class DeploymentPlanError extends Error {
|
|
19
|
+
code;
|
|
20
|
+
constructor(code, message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.code = code;
|
|
23
|
+
this.name = "DeploymentPlanError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function providerMap(nodes) {
|
|
27
|
+
return new Map(nodes
|
|
28
|
+
.filter((node) => node.kind === "provider")
|
|
29
|
+
.map((node) => [node.id, node]));
|
|
30
|
+
}
|
|
31
|
+
export function validateProviders(app, providers, nodes, edges) {
|
|
32
|
+
for (const provider of providers.values()) {
|
|
33
|
+
if (!AWS_DEPLOYMENT_CAPABILITIES.includes(provider.capability)) {
|
|
34
|
+
fail("RELKIT_DEPLOY_AWS_CAPABILITY_UNSUPPORTED", `AWS does not support capability ${provider.capability}.`);
|
|
35
|
+
}
|
|
36
|
+
if (provider.ownership === "managed" &&
|
|
37
|
+
!AWS_ADAPTERS[provider.capability].includes(provider.adapter)) {
|
|
38
|
+
fail("RELKIT_DEPLOY_AWS_CAPABILITY_UNSUPPORTED", `AWS does not support managed ${provider.capability}:${provider.adapter}.`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
for (const id of app.providerBindings ?? []) {
|
|
42
|
+
if (!providers.has(id)) {
|
|
43
|
+
fail("RELKIT_DEPLOY_AWS_PROFILE_UNSUPPORTED", `Provider binding ${id} is missing.`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for (const { capability, profile } of usedCapabilities(nodes, edges)) {
|
|
47
|
+
requireProvider(providers, capability, profile);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function requireProvider(providers, capability, profile) {
|
|
51
|
+
const provider = providers.get(providerId(capability, profile));
|
|
52
|
+
if (provider !== undefined)
|
|
53
|
+
return provider;
|
|
54
|
+
fail("RELKIT_DEPLOY_AWS_PROFILE_UNSUPPORTED", `Provider profile ${profile} does not implement ${capability}.`);
|
|
55
|
+
}
|
|
56
|
+
export function configNames(providers, name, profile) {
|
|
57
|
+
const provider = requireProvider(providers, name, profile);
|
|
58
|
+
return provider.environment
|
|
59
|
+
.filter((entry) => !entry.sensitive && !secretName(entry.name))
|
|
60
|
+
.map((entry) => entry.name)
|
|
61
|
+
.sort();
|
|
62
|
+
}
|
|
63
|
+
export function isManaged(providers, capability, profile) {
|
|
64
|
+
return requireProvider(providers, capability, profile).ownership === "managed";
|
|
65
|
+
}
|
|
66
|
+
export function providerId(capability, profile) {
|
|
67
|
+
return `provider.${capability}.${profile}`;
|
|
68
|
+
}
|
|
69
|
+
export function onlyApp(nodes) {
|
|
70
|
+
const apps = nodes.filter((node) => node.kind === "app");
|
|
71
|
+
if (apps.length !== 1)
|
|
72
|
+
fail("RELKIT_DEPLOY_GRAPH_INVALID", "Graph must contain exactly one app node.");
|
|
73
|
+
return apps[0];
|
|
74
|
+
}
|
|
75
|
+
export function nodes(values, kind) {
|
|
76
|
+
return values.filter((node) => node.kind === kind);
|
|
77
|
+
}
|
|
78
|
+
export function envNodes(nodes) {
|
|
79
|
+
return new Map(nodes.filter((node) => node.kind === "env").map((node) => [node.name, node]));
|
|
80
|
+
}
|
|
81
|
+
export function envNames(nodes) {
|
|
82
|
+
return [...envNodes(nodes).values()]
|
|
83
|
+
.filter((node) => !node.sensitive && !secretName(node.name))
|
|
84
|
+
.map((node) => node.name)
|
|
85
|
+
.sort();
|
|
86
|
+
}
|
|
87
|
+
export function logicalName(appId, kind, id) {
|
|
88
|
+
return [appId, kind, id]
|
|
89
|
+
.map((value) => value
|
|
90
|
+
.toLowerCase()
|
|
91
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
92
|
+
.replace(/^-|-$/g, "") || "resource")
|
|
93
|
+
.join("-");
|
|
94
|
+
}
|
|
95
|
+
export function byLogical(left, right) {
|
|
96
|
+
return left.logicalName.localeCompare(right.logicalName);
|
|
97
|
+
}
|
|
98
|
+
export function secretName(value) {
|
|
99
|
+
return /api[-_]?key|password|secret(value)?|private[-_]?key|access[-_]?key|credential/i.test(value);
|
|
100
|
+
}
|
|
101
|
+
export function fail(code, message) {
|
|
102
|
+
throw new DeploymentPlanError(code, message);
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=from-graph-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-graph-validation.js","sourceRoot":"","sources":["../src/from-graph-validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,MAAM,2BAA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C,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC3D,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,IAAI,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,IAAY,EAAE,EAAU;IACjE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;SACrB,GAAG,CACF,CAAC,KAAK,EAAE,EAAE,CACR,KAAK;SACF,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,UAAU,CACzC;SACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,IAAsC,EACtC,KAAuC;IAEvC,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,gFAAgF,CAAC,IAAI,CAC1F,KAAK,CACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,IAA6B,EAAE,OAAe;IACjE,MAAM,IAAI,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ApplicationGraph } from "@relkit/graph";
|
|
2
|
+
import { AWS_DEPLOYMENT_CAPABILITIES, DeploymentPlanError, type DeploymentPlanErrorCode, type FromGraphOptions } from "./from-graph-validation.js";
|
|
3
|
+
export { AWS_DEPLOYMENT_CAPABILITIES, DeploymentPlanError, type DeploymentPlanErrorCode, type FromGraphOptions, };
|
|
4
|
+
export declare function fromGraph(graph: ApplicationGraph, options?: FromGraphOptions): import("./plan.js").DeploymentPlan;
|
|
5
|
+
export declare const createDeploymentPlan: typeof fromGraph;
|
|
6
|
+
//# sourceMappingURL=from-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-graph.d.ts","sourceRoot":"","sources":["../src/from-graph.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EAInB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,GACtB,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,GAAE,gBAAqB,sCA2BhF;AAED,eAAO,MAAM,oBAAoB,kBAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { GRAPH_VERSION } from "@relkit/contracts";
|
|
2
|
+
import { canonicalizeGraph, hashGraph, validateGraphShape, } from "@relkit/graph";
|
|
3
|
+
import { validateBoundary } from "./from-graph-boundary.js";
|
|
4
|
+
import { buildPlan } from "./from-graph-plan.js";
|
|
5
|
+
import { AWS_DEPLOYMENT_CAPABILITIES, DeploymentPlanError, onlyApp, providerMap, validateProviders, } from "./from-graph-validation.js";
|
|
6
|
+
export { AWS_DEPLOYMENT_CAPABILITIES, DeploymentPlanError, };
|
|
7
|
+
export function fromGraph(graph, options = {}) {
|
|
8
|
+
validateBoundary(graph);
|
|
9
|
+
validateBoundary(options);
|
|
10
|
+
try {
|
|
11
|
+
validateGraphShape(graph);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
throw new DeploymentPlanError("RELKIT_DEPLOY_GRAPH_INVALID", error instanceof Error ? error.message : "Graph shape is invalid.");
|
|
15
|
+
}
|
|
16
|
+
const normalized = canonicalizeGraph(graph);
|
|
17
|
+
if (normalized.contractVersion !== GRAPH_VERSION)
|
|
18
|
+
throw new DeploymentPlanError("RELKIT_DEPLOY_GRAPH_INVALID", "Unsupported graph contract version.");
|
|
19
|
+
const app = onlyApp(normalized.nodes);
|
|
20
|
+
const appId = normalized.appId ?? app.id;
|
|
21
|
+
if (normalized.appId !== undefined && normalized.appId !== app.id)
|
|
22
|
+
throw new DeploymentPlanError("RELKIT_DEPLOY_GRAPH_INVALID", "Graph appId does not match its app node.");
|
|
23
|
+
const providers = providerMap(normalized.nodes);
|
|
24
|
+
validateProviders(app, providers, normalized.nodes, normalized.edges);
|
|
25
|
+
return buildPlan(normalized, appId, hashGraph(normalized), options, providers);
|
|
26
|
+
}
|
|
27
|
+
export const createDeploymentPlan = fromGraph;
|
|
28
|
+
//# sourceMappingURL=from-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-graph.js","sourceRoot":"","sources":["../src/from-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,GAEnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,OAAO,EACP,WAAW,EACX,iBAAiB,GAGlB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,GAGpB,CAAC;AAEF,MAAM,UAAU,SAAS,CAAC,KAAuB,EAAE,UAA4B,EAAE;IAC/E,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxB,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1B,IAAI,CAAC;QACH,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,mBAAmB,CAC3B,6BAA6B,EAC7B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,CACnE,CAAC;IACJ,CAAC;IACD,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC5C,IAAI,UAAU,CAAC,eAAe,KAAK,aAAa;QAC9C,MAAM,IAAI,mBAAmB,CAC3B,6BAA6B,EAC7B,qCAAqC,CACtC,CAAC;IACJ,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,GAAG,CAAC,EAAE,CAAC;IACzC,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,IAAI,UAAU,CAAC,KAAK,KAAK,GAAG,CAAC,EAAE;QAC/D,MAAM,IAAI,mBAAmB,CAC3B,6BAA6B,EAC7B,0CAA0C,CAC3C,CAAC;IACJ,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAChD,iBAAiB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACtE,OAAO,SAAS,CAAC,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC"}
|
package/dist/iam.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ApplicationGraph, ProviderProfileNode } from "@relkit/graph";
|
|
2
|
+
import type { DeploymentIamPlan } from "./plan.js";
|
|
3
|
+
/** Builds edge-derived shared-role policy data and future per-function grants. */
|
|
4
|
+
export declare function createIamPlan(appId: string, graph: ApplicationGraph, providers: ReadonlyMap<string, ProviderProfileNode>): DeploymentIamPlan;
|
|
5
|
+
//# sourceMappingURL=iam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iam.d.ts","sourceRoot":"","sources":["../src/iam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAa,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEtF,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,WAAW,CAAC;AAwBnB,kFAAkF;AAClF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,gBAAgB,EACvB,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAClD,iBAAiB,CAwDnB"}
|
package/dist/iam.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { logicalName } from "./from-graph-validation.js";
|
|
2
|
+
const ACTIONS = {
|
|
3
|
+
bucket: ["s3:GetObject", "s3:PutObject", "s3:DeleteObject", "s3:ListBucket"],
|
|
4
|
+
cache: ["elasticache:Connect"],
|
|
5
|
+
eventPublish: ["events:PutEvents"],
|
|
6
|
+
jobConsume: ["sqs:ReceiveMessage", "sqs:DeleteMessage", "sqs:ChangeMessageVisibility"],
|
|
7
|
+
eventConsume: [
|
|
8
|
+
"sqs:ReceiveMessage",
|
|
9
|
+
"sqs:DeleteMessage",
|
|
10
|
+
"sqs:ChangeMessageVisibility",
|
|
11
|
+
"sqs:GetQueueAttributes",
|
|
12
|
+
],
|
|
13
|
+
jobPublish: ["sqs:SendMessage"],
|
|
14
|
+
};
|
|
15
|
+
/** Builds edge-derived shared-role policy data and future per-function grants. */
|
|
16
|
+
export function createIamPlan(appId, graph, providers) {
|
|
17
|
+
const grants = new Map();
|
|
18
|
+
const managedResources = new Set(graph.edges.flatMap((edge) => {
|
|
19
|
+
if (edge.kind !== "uses-provider-profile")
|
|
20
|
+
return [];
|
|
21
|
+
return providers.get(edge.to)?.ownership === "managed" ? [edge.from] : [];
|
|
22
|
+
}));
|
|
23
|
+
const functionIds = new Set(graph.nodes.filter((node) => node.kind === "function").map((node) => node.id));
|
|
24
|
+
const add = (functionId, capability, resourceId, kind, actions) => {
|
|
25
|
+
if (actions.length === 0 || !managedResources.has(resourceId))
|
|
26
|
+
return;
|
|
27
|
+
const resource = logicalName(appId, kind, resourceId);
|
|
28
|
+
const key = [functionId, capability, resourceId, actions.join(",")].join("\0");
|
|
29
|
+
grants.set(key, { functionId, capability, resourceId, resource, actions });
|
|
30
|
+
};
|
|
31
|
+
for (const edge of graph.edges) {
|
|
32
|
+
if (!functionIds.has(edge.from))
|
|
33
|
+
continue;
|
|
34
|
+
if (edge.kind === "uses-bucket")
|
|
35
|
+
add(edge.from, "buckets", edge.to, "bucket", ACTIONS.bucket);
|
|
36
|
+
if (edge.kind === "uses-cache")
|
|
37
|
+
add(edge.from, "cache", edge.to, "cache", ACTIONS.cache);
|
|
38
|
+
if (edge.kind === "enqueues-job")
|
|
39
|
+
add(edge.from, "jobs", edge.to, "job", ACTIONS.jobPublish);
|
|
40
|
+
if (edge.kind === "publishes-event")
|
|
41
|
+
add(edge.from, "events", edge.to, "event", ACTIONS.eventPublish);
|
|
42
|
+
}
|
|
43
|
+
for (const node of graph.nodes) {
|
|
44
|
+
if (node.kind === "job")
|
|
45
|
+
add(node.targetFunctionId, "jobs", node.id, "job", ACTIONS.jobConsume);
|
|
46
|
+
if (node.kind === "trigger" &&
|
|
47
|
+
node.triggerType === "event" &&
|
|
48
|
+
isRecord(node.config) &&
|
|
49
|
+
node.config.delivery === "durable")
|
|
50
|
+
add(node.targetFunctionId, "jobs", node.id, "event-trigger", ACTIONS.eventConsume);
|
|
51
|
+
}
|
|
52
|
+
const perFunction = [...grants.values()]
|
|
53
|
+
.sort(compareGrants)
|
|
54
|
+
.map(({ functionId, capability, resourceId, actions }) => ({
|
|
55
|
+
functionId,
|
|
56
|
+
capability,
|
|
57
|
+
resourceId,
|
|
58
|
+
actions: [...actions],
|
|
59
|
+
}));
|
|
60
|
+
return {
|
|
61
|
+
serviceRole: { statements: statements([...grants.values()]) },
|
|
62
|
+
perFunction,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function statements(grants) {
|
|
66
|
+
const grouped = new Map();
|
|
67
|
+
for (const grant of grants) {
|
|
68
|
+
const key = `${grant.capability}\0${grant.actions.join(",")}`;
|
|
69
|
+
const current = grouped.get(key) ?? {
|
|
70
|
+
capability: grant.capability,
|
|
71
|
+
actions: grant.actions,
|
|
72
|
+
resources: new Set(),
|
|
73
|
+
};
|
|
74
|
+
current.resources.add(grant.resource);
|
|
75
|
+
grouped.set(key, current);
|
|
76
|
+
}
|
|
77
|
+
return [...grouped.values()]
|
|
78
|
+
.map(({ capability, actions, resources }) => ({
|
|
79
|
+
capability,
|
|
80
|
+
actions: [...actions],
|
|
81
|
+
resources: [...resources].sort(),
|
|
82
|
+
}))
|
|
83
|
+
.sort((left, right) => left.capability.localeCompare(right.capability) ||
|
|
84
|
+
left.actions.join(",").localeCompare(right.actions.join(",")) ||
|
|
85
|
+
left.resources.join(",").localeCompare(right.resources.join(",")));
|
|
86
|
+
}
|
|
87
|
+
function isRecord(value) {
|
|
88
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
89
|
+
}
|
|
90
|
+
function compareGrants(left, right) {
|
|
91
|
+
return (left.functionId.localeCompare(right.functionId) ||
|
|
92
|
+
left.capability.localeCompare(right.capability) ||
|
|
93
|
+
left.resourceId.localeCompare(right.resourceId) ||
|
|
94
|
+
left.actions.join(",").localeCompare(right.actions.join(",")));
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=iam.js.map
|
package/dist/iam.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iam.js","sourceRoot":"","sources":["../src/iam.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAOzD,MAAM,OAAO,GAAG;IACd,MAAM,E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K,CAAC,UAAU,CAAC;QAC/C,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC;QAC/C,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
|
package/dist/plan.d.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { JsonValue } from "@relkit/contracts";
|
|
2
|
+
/** Versioned, JSON-safe protocol name for deployment plans. */
|
|
3
|
+
export declare const DEPLOYMENT_PLAN_PROTOCOL: "relkit.deployment-plan";
|
|
4
|
+
/** Current provider-neutral deployment-plan contract version. */
|
|
5
|
+
export declare const DEPLOYMENT_PLAN_VERSION: 2;
|
|
6
|
+
export type DeploymentPlanVersion = typeof DEPLOYMENT_PLAN_VERSION;
|
|
7
|
+
export interface DeploymentHealthPlan {
|
|
8
|
+
readonly livenessPath: string;
|
|
9
|
+
readonly readinessPath: string;
|
|
10
|
+
readonly port: number;
|
|
11
|
+
readonly intervalMs?: number;
|
|
12
|
+
readonly timeoutMs?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ContainerImagePlan {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly tag?: string;
|
|
17
|
+
readonly digest?: string;
|
|
18
|
+
readonly health: DeploymentHealthPlan;
|
|
19
|
+
}
|
|
20
|
+
export interface ApplicationDeploymentPlan {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly image: ContainerImagePlan;
|
|
23
|
+
/** Names only; values, including secrets, never cross the plan boundary. */
|
|
24
|
+
readonly environmentNames: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
export interface DeploymentCapabilityPlan {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly logicalName: string;
|
|
29
|
+
readonly bindingId: string;
|
|
30
|
+
readonly profile?: string;
|
|
31
|
+
readonly configurationNames: readonly string[];
|
|
32
|
+
readonly capabilities?: readonly string[];
|
|
33
|
+
readonly tags?: Readonly<Record<string, string>>;
|
|
34
|
+
readonly metadata?: JsonValue;
|
|
35
|
+
}
|
|
36
|
+
export interface ProviderDeploymentPlan {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly capability: string;
|
|
39
|
+
readonly profile: string;
|
|
40
|
+
readonly adapter: string;
|
|
41
|
+
readonly ownership: "managed";
|
|
42
|
+
readonly configuration: JsonValue;
|
|
43
|
+
readonly environment: readonly {
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly type: string;
|
|
46
|
+
readonly sensitive: boolean;
|
|
47
|
+
}[];
|
|
48
|
+
}
|
|
49
|
+
export interface HttpRouteDeploymentPlan {
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly method: string;
|
|
52
|
+
readonly path: string;
|
|
53
|
+
readonly targetFunctionId: string;
|
|
54
|
+
}
|
|
55
|
+
export interface HttpDeploymentPlan {
|
|
56
|
+
readonly logicalName: string;
|
|
57
|
+
readonly port: number;
|
|
58
|
+
readonly health: DeploymentHealthPlan;
|
|
59
|
+
readonly routes: readonly HttpRouteDeploymentPlan[];
|
|
60
|
+
readonly configurationNames: readonly string[];
|
|
61
|
+
}
|
|
62
|
+
export interface JobDeploymentPlan extends DeploymentCapabilityPlan {
|
|
63
|
+
readonly targetFunctionId: string;
|
|
64
|
+
readonly profile: string;
|
|
65
|
+
readonly retry?: JsonValue;
|
|
66
|
+
readonly timeoutMs?: number;
|
|
67
|
+
readonly concurrency?: number;
|
|
68
|
+
readonly idempotency?: JsonValue;
|
|
69
|
+
}
|
|
70
|
+
export interface ScheduleDeploymentPlan extends DeploymentCapabilityPlan {
|
|
71
|
+
readonly jobId: string;
|
|
72
|
+
readonly schedule: JsonValue;
|
|
73
|
+
}
|
|
74
|
+
export interface EventDeploymentPlan extends DeploymentCapabilityPlan {
|
|
75
|
+
readonly version: number;
|
|
76
|
+
readonly payload: JsonValue;
|
|
77
|
+
}
|
|
78
|
+
export interface EventTriggerDeploymentPlan extends DeploymentCapabilityPlan {
|
|
79
|
+
readonly targetFunctionId: string;
|
|
80
|
+
readonly expansion: readonly string[];
|
|
81
|
+
readonly delivery: "ephemeral" | "durable";
|
|
82
|
+
readonly retry?: JsonValue;
|
|
83
|
+
readonly concurrency?: number;
|
|
84
|
+
}
|
|
85
|
+
export interface BucketDeploymentPlan extends DeploymentCapabilityPlan {
|
|
86
|
+
readonly profile: string;
|
|
87
|
+
readonly visibility: "private" | "public";
|
|
88
|
+
readonly maxObjectBytes?: number;
|
|
89
|
+
readonly allowedContentTypes?: readonly string[];
|
|
90
|
+
}
|
|
91
|
+
export interface CacheDeploymentPlan extends DeploymentCapabilityPlan {
|
|
92
|
+
readonly profile: string;
|
|
93
|
+
readonly defaultTtlMs?: number;
|
|
94
|
+
readonly maxTtlMs?: number;
|
|
95
|
+
}
|
|
96
|
+
export interface ObservabilityDeploymentPlan {
|
|
97
|
+
readonly logicalName: string;
|
|
98
|
+
readonly configurationNames: readonly string[];
|
|
99
|
+
readonly logs: boolean;
|
|
100
|
+
readonly traces: boolean;
|
|
101
|
+
readonly retentionDays?: number;
|
|
102
|
+
readonly export?: {
|
|
103
|
+
readonly enabled: boolean;
|
|
104
|
+
readonly configurationNames: readonly string[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** One safe, logical-resource IAM statement for the shared application role. */
|
|
108
|
+
export interface DeploymentIamStatement {
|
|
109
|
+
readonly capability: string;
|
|
110
|
+
readonly actions: readonly string[];
|
|
111
|
+
/** Stable deployment logical names, never resolved ARNs or secret values. */
|
|
112
|
+
readonly resources: readonly string[];
|
|
113
|
+
}
|
|
114
|
+
/** Desired isolation metadata retained while the POC uses one shared task role. */
|
|
115
|
+
export interface DeploymentFunctionCapability {
|
|
116
|
+
readonly functionId: string;
|
|
117
|
+
readonly capability: string;
|
|
118
|
+
readonly resourceId: string;
|
|
119
|
+
readonly actions: readonly string[];
|
|
120
|
+
}
|
|
121
|
+
export interface DeploymentIamPlan {
|
|
122
|
+
readonly serviceRole: {
|
|
123
|
+
readonly statements: readonly DeploymentIamStatement[];
|
|
124
|
+
};
|
|
125
|
+
readonly perFunction: readonly DeploymentFunctionCapability[];
|
|
126
|
+
}
|
|
127
|
+
/** Complete provider-neutral deployment input for the Pulumi adapter. */
|
|
128
|
+
export interface DeploymentPlan {
|
|
129
|
+
readonly contractVersion: number;
|
|
130
|
+
readonly graphHash: string;
|
|
131
|
+
readonly application: ApplicationDeploymentPlan;
|
|
132
|
+
readonly providerBindings: readonly ProviderDeploymentPlan[];
|
|
133
|
+
readonly http: HttpDeploymentPlan;
|
|
134
|
+
readonly jobs: readonly JobDeploymentPlan[];
|
|
135
|
+
readonly schedules: readonly ScheduleDeploymentPlan[];
|
|
136
|
+
readonly events: readonly EventDeploymentPlan[];
|
|
137
|
+
readonly eventTriggers: readonly EventTriggerDeploymentPlan[];
|
|
138
|
+
readonly buckets: readonly BucketDeploymentPlan[];
|
|
139
|
+
readonly caches: readonly CacheDeploymentPlan[];
|
|
140
|
+
readonly iam: DeploymentIamPlan;
|
|
141
|
+
readonly observability?: ObservabilityDeploymentPlan;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=plan.d.ts.map
|