@appliance.sh/infra 1.20.0 → 1.22.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appliance.sh/infra",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "description": "Deploy the Appliance Infrastructure",
5
5
  "repository": "https://github.com/appliance-sh/appliance.sh",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  "dev:setup": "npm link"
24
24
  },
25
25
  "dependencies": {
26
- "@appliance.sh/sdk": "1.20.0",
26
+ "@appliance.sh/sdk": "1.22.0",
27
27
  "@pulumi/aws": "^7.16.0",
28
28
  "@pulumi/aws-native": "^1.48.0",
29
29
  "@pulumi/awsx": "^3.1.0",
@@ -14,6 +14,16 @@ export interface PulumiResult {
14
14
  stackName: string;
15
15
  }
16
16
 
17
+ export interface ResolvedBuildParams {
18
+ imageUri?: string;
19
+ codeS3Key?: string;
20
+ runtime?: string;
21
+ handler?: string;
22
+ layers?: string[];
23
+ architectures?: string[];
24
+ environment?: Record<string, string>;
25
+ }
26
+
17
27
  export interface ApplianceDeploymentServiceOptions {
18
28
  baseConfig?: ApplianceBaseConfig;
19
29
  }
@@ -32,11 +42,7 @@ export class ApplianceDeploymentService {
32
42
  this.region = this.baseConfig?.aws.region || 'us-east-1';
33
43
  }
34
44
 
35
- private inlineProgram(
36
- stackName: string,
37
- metadata?: ApplianceStackMetadata,
38
- build?: { imageUri?: string; codeS3Key?: string }
39
- ) {
45
+ private inlineProgram(stackName: string, metadata?: ApplianceStackMetadata, build?: ResolvedBuildParams) {
40
46
  return async () => {
41
47
  if (!this.baseConfig) {
42
48
  throw new Error('Missing base config');
@@ -64,6 +70,11 @@ export class ApplianceDeploymentService {
64
70
  config: this.baseConfig,
65
71
  imageUri: build?.imageUri,
66
72
  codeS3Key: build?.codeS3Key,
73
+ runtime: build?.runtime,
74
+ handler: build?.handler,
75
+ layers: build?.layers,
76
+ architectures: build?.architectures,
77
+ environment: build?.environment,
67
78
  },
68
79
  {
69
80
  globalProvider,
@@ -82,7 +93,7 @@ export class ApplianceDeploymentService {
82
93
  private async getOrCreateStack(
83
94
  stackName: string,
84
95
  metadata?: ApplianceStackMetadata,
85
- build?: { imageUri?: string; codeS3Key?: string }
96
+ build?: ResolvedBuildParams
86
97
  ): Promise<auto.Stack> {
87
98
  const program = this.inlineProgram(stackName, metadata, build);
88
99
  const envVars: Record<string, string> = {
@@ -125,7 +136,7 @@ export class ApplianceDeploymentService {
125
136
  async deploy(
126
137
  stackName: string,
127
138
  metadata?: ApplianceStackMetadata,
128
- build?: { imageUri?: string; codeS3Key?: string }
139
+ build?: ResolvedBuildParams
129
140
  ): Promise<PulumiResult> {
130
141
  const stack = await this.getOrCreateStack(stackName, metadata, build);
131
142
  const result = await stack.up({ onOutput: (m) => console.log(m) });
@@ -49,6 +49,11 @@ export interface ApplianceStackArgs {
49
49
  config: ApplianceBaseConfig;
50
50
  imageUri?: string;
51
51
  codeS3Key?: string;
52
+ runtime?: string;
53
+ handler?: string;
54
+ layers?: string[];
55
+ architectures?: string[];
56
+ environment?: Record<string, string>;
52
57
  }
53
58
 
54
59
  export interface ApplianceStackOpts extends pulumi.ComponentResourceOptions {
@@ -163,13 +168,16 @@ export class ApplianceStack extends pulumi.ComponentResource {
163
168
  `${rid}-handler`,
164
169
  {
165
170
  packageType: 'Zip',
166
- runtime: 'nodejs22.x',
167
- handler: 'index.handler',
171
+ runtime: args.runtime ?? 'nodejs22.x',
172
+ handler: args.handler ?? 'index.handler',
168
173
  s3Bucket: args.config.aws.dataBucketName,
169
174
  s3Key: args.codeS3Key,
170
175
  role: this.lambdaRole.arn,
171
176
  timeout: 30,
172
177
  memorySize: 512,
178
+ layers: args.layers,
179
+ architectures: args.architectures,
180
+ environment: args.environment ? { variables: args.environment } : undefined,
173
181
  tags: defaultTags,
174
182
  },
175
183
  defaultOpts