Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

 πŸ€– Plandex  πŸ“ Update ECS and EFS configurations to fix mounting issue ✏️ Edits: β€’ infra/src/main.ts βœ… Update Fargate service security group to allow outbound NFS traffic and create EFS security group to allow inbound NFS traffic

Dane Schneider9acd873eccf4
diff --git a/infra/src/main.ts b/infra/src/main.ts
index 890e36f2..813a27fa 100644
--- a/infra/src/main.ts
+++ b/infra/src/main.ts
@@ -168,26 +168,6 @@ export class PlandexStack extends cdk.Stack {
protocol: ecs.Protocol.TCP,
},
],
- healthCheck: {
- command: [
- "CMD-SHELL",
- "curl -f http://localhost:8080/health || exit 1"
- ],
- interval: cdk.Duration.seconds(30),
- timeout: cdk.Duration.seconds(5),
- retries: 3,
- startPeriod: cdk.Duration.seconds(60),
- },
- healthCheck: {
- command: [
- "CMD-SHELL",
- "curl -f http://localhost:8080/health || exit 1"
- ],
- interval: cdk.Duration.seconds(30),
- timeout: cdk.Duration.seconds(5),
- retries: 3,
- startPeriod: cdk.Duration.seconds(60),
- },
});
// Mount the EFS file system to the container
@@ -207,7 +187,33 @@ export class PlandexStack extends cdk.Stack {
// Create a Fargate service with a security group that allows outbound internet access and access to the RDS database
const fargateServiceSecurityGroup = new ec2.SecurityGroup(
this,
- `plandex-fargate-service-sg-${tag}`,
+ `plandex-fargate-service-sg-${tag}`, {
+ vpc,
+ allowAllOutbound: true,
+ }
+ );
+
+ fargateServiceSecurityGroup.addEgressRule(
+ ec2.Peer.ipv4(vpc.vpcCidrBlock),
+ ec2.Port.tcp(2049),
+ "Allow outbound NFS traffic to EFS"
+ );
+
+ const efsSecurityGroup = new ec2.SecurityGroup(this, `plandex-efs-sg-${tag}`, {
+ vpc,
+ });
+
+ efsSecurityGroup.addIngressRule(
+ fargateServiceSecurityGroup,
+ ec2.Port.tcp(2049),
+ "Allow inbound NFS traffic from Fargate service"
+ );
+
+ const fileSystem = new efs.FileSystem(
+ this,
+ `plandex-efs-file-system-${tag}`, {
+ vpc,
+ securityGroup: efsSecurityGroup,
{
vpc,
allowAllOutbound: true, // Allows the containers to access the internet