@xcelsior/support-api 0.1.3 → 0.1.5

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": "@xcelsior/support-api",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "packages/**",
@@ -25,10 +25,10 @@
25
25
  "typescript": "^5.3.3",
26
26
  "@tsconfig/node18": "^18.2.2",
27
27
  "@types/node": "^20.11.16",
28
- "@xcelsior/aws": "1.0.3",
29
- "@xcelsior/support-client": "1.0.1",
30
- "@xcelsior/lambda-http": "1.0.5",
28
+ "@xcelsior/aws": "1.0.4",
29
+ "@xcelsior/support-client": "1.0.2",
31
30
  "@xcelsior/monitoring": "1.0.4",
31
+ "@xcelsior/lambda-http": "1.0.5",
32
32
  "@xcelsior/email": "1.0.2"
33
33
  },
34
34
  "scripts": {
@@ -46,3 +46,4 @@ const listTicketEvents = async (event: APIGatewayProxyEventV2) => {
46
46
  };
47
47
 
48
48
  export const handler = middyfy(listTicketEvents, middlewareConfig);
49
+
@@ -11,8 +11,34 @@ import {
11
11
  import { Duration } from 'aws-cdk-lib';
12
12
  import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
13
13
  import * as origins from 'aws-cdk-lib/aws-cloudfront-origins';
14
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
14
15
 
15
16
  export function SupportStack({ stack }: StackContext) {
17
+ // VPC Configuration - optional, lookup existing VPC by ID if provided
18
+ const vpcId = process.env.VPC_ID;
19
+
20
+ const vpc = vpcId
21
+ ? ec2.Vpc.fromLookup(stack, 'support-vpc', { vpcId })
22
+ : undefined;
23
+
24
+ // Create security group for Lambda functions (only if VPC is configured)
25
+ const lambdaSecurityGroup = vpc
26
+ ? new ec2.SecurityGroup(stack, 'support-lambda-sg', {
27
+ vpc,
28
+ description: 'Security group for Support API Lambda functions',
29
+ allowAllOutbound: true,
30
+ })
31
+ : undefined;
32
+
33
+ // VPC configuration for Lambda functions (only applied if VPC is configured)
34
+ const vpcConfig = vpc
35
+ ? {
36
+ vpc,
37
+ vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED },
38
+ securityGroups: [lambdaSecurityGroup!],
39
+ }
40
+ : {};
41
+
16
42
  const domainName = process.env.API_DOMAIN_NAME! || 'xcelsior.co';
17
43
  const apiSubdomain =
18
44
  stack.stage === 'production'
@@ -159,6 +185,7 @@ export function SupportStack({ stack }: StackContext) {
159
185
  },
160
186
  runtime: 'nodejs18.x',
161
187
  tracing: 'active',
188
+ ...vpcConfig,
162
189
  });
163
190
 
164
191
  reminderQueue.addConsumer(stack, {
@@ -186,6 +213,7 @@ export function SupportStack({ stack }: StackContext) {
186
213
  },
187
214
  runtime: 'nodejs18.x',
188
215
  tracing: 'active',
216
+ ...vpcConfig,
189
217
  },
190
218
  },
191
219
  });
@@ -209,6 +237,7 @@ export function SupportStack({ stack }: StackContext) {
209
237
  },
210
238
  runtime: 'nodejs18.x',
211
239
  tracing: 'active',
240
+ ...vpcConfig,
212
241
  },
213
242
  },
214
243
  });
@@ -237,6 +266,7 @@ export function SupportStack({ stack }: StackContext) {
237
266
  },
238
267
  runtime: 'nodejs18.x',
239
268
  tracing: 'active',
269
+ ...vpcConfig,
240
270
  },
241
271
  },
242
272
  cors: true,