Skip to content

Commit

Permalink
test: cdk highlevel
Browse files Browse the repository at this point in the history
  • Loading branch information
kwiss committed May 26, 2024
1 parent 2e57c02 commit 4a756d9
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 362 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ ENV STARKNET_SOLIS_ACCOUNT_ADDRESS=""
ENV STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY=""
ENV RUST_LOG=info

# Create a user with the correct UID and GID
RUN groupadd -g 1000 appgroup &&
useradd -u 1000 -g appgroup -m appuser &&
chown -R appuser:appgroup /app

# Switch to the new user
USER appuser

WORKDIR /app

# Copy the entire workspace context into the container
Expand Down
62 changes: 35 additions & 27 deletions aws/cdk-solis-ecs/bin/cdk-solis.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
import * as cdk from "aws-cdk-lib";
import * as ecs from "aws-cdk-lib/aws-ecs";
import { Construct } from "constructs";

import { ArkSolisLambdaStack } from "../lib/cdk-solis-db";
import { ArkSolisEcsStack } from "../lib/cdk-solis-stack";
import { ArkSolisEfsStack } from "../lib/cdk-stack-efs";
import { EcsWithEfsConstruct } from "../lib/ecs-with-efs-construct";
import { EfsConstruct } from "../lib/efs-construct";

const app = new cdk.App();
interface ArkSolisEcsStackProps extends cdk.StackProps {
vpcId: string;
}

new ArkSolisEfsStack(app, "ark-solis-efs-stack", {
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION
}
});
class ArkSolisEcsStack extends cdk.Stack {
constructor(scope: Construct, id: string, props: ArkSolisEcsStackProps) {
super(scope, id, props);

new ArkSolisLambdaStack(app, "ark-solis-db-stack", {
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION
}
});
const efsConstruct = new EfsConstruct(this, "EfsConstruct", {
vpcId: props.vpcId
});

new ArkSolisEcsStack(app, "ark-solis-production-stack", {
vpcId: "vpc-0d11f7ec183208e08",
efsFileSystemId: cdk.Fn.importValue("RecordingEFSFileStorageId"),
efsAccessPointId: cdk.Fn.importValue("RecordingEFSFileStorageAccessPointId"),
efsSecurityGroupId: cdk.Fn.importValue(
"RecordingEFSFileStorageSecurityGroupId"
),
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION
new EcsWithEfsConstruct(this, "EcsWithEfsConstruct", {
vpcId: props.vpcId,
efsFileSystemId: efsConstruct.fileSystemId,
efsAccessPointId: efsConstruct.accessPointId,
efsSecurityGroupId: efsConstruct.securityGroupId,
containerImage: ecs.ContainerImage.fromEcrRepository(
cdk.aws_ecr.Repository.fromRepositoryName(
this,
"ArkProjectRepository",
"ark-project-repo"
),
"solis-latest"
),
containerPort: 7777,
domainName: "arkproject.dev",
subdomain: "staging.solis"
});
}
});
}

const app = new cdk.App();
new ArkSolisEcsStack(app, "ArkSolisEcsStack", {
vpcId: "vpc-0d11f7ec183208e08"
});
app.synth();
236 changes: 0 additions & 236 deletions aws/cdk-solis-ecs/lib/cdk-solis-stack.ts

This file was deleted.

Loading

0 comments on commit 4a756d9

Please sign in to comment.