diff --git a/.changeset/perfect-eels-poke.md b/.changeset/perfect-eels-poke.md new file mode 100644 index 00000000..6f297034 --- /dev/null +++ b/.changeset/perfect-eels-poke.md @@ -0,0 +1,5 @@ +--- +"@codedazur/cdk-docker-cluster": minor +--- + +Buildtime and runtime environment variables are now supported. diff --git a/.changeset/rotten-laws-switch.md b/.changeset/rotten-laws-switch.md new file mode 100644 index 00000000..276d9568 --- /dev/null +++ b/.changeset/rotten-laws-switch.md @@ -0,0 +1,5 @@ +--- +"@codedazur/cdk-next-app": patch +--- + +The version of the DockerCluster dependency is now explicit. diff --git a/packages/cdk-docker-cluster/src/constructs/DockerCluster.ts b/packages/cdk-docker-cluster/src/constructs/DockerCluster.ts index e92b4b80..529421bb 100644 --- a/packages/cdk-docker-cluster/src/constructs/DockerCluster.ts +++ b/packages/cdk-docker-cluster/src/constructs/DockerCluster.ts @@ -22,6 +22,10 @@ export interface DockerClusterProps { }; cpu?: ApplicationLoadBalancedFargateServiceProps["cpu"]; memory?: ApplicationLoadBalancedFargateServiceProps["memoryLimitMiB"]; + environment?: { + buildtime?: Record; + runtime?: Record; + }; } /** @@ -38,6 +42,7 @@ export class DockerCluster extends Construct { exclude: ["**/cdk.out"], buildSecrets: props.secrets, platform: Platform.LINUX_AMD64, + buildArgs: props.environment?.buildtime, }); const desiredTasks = @@ -52,6 +57,7 @@ export class DockerCluster extends Construct { // image: ContainerImage.fromEcrRepository(image.repository, image.imageTag), image: ContainerImage.fromDockerImageAsset(image), containerPort: props.port, + environment: props.environment?.runtime, }, circuitBreaker: { enable: true, diff --git a/packages/cdk-next-app/package.json b/packages/cdk-next-app/package.json index 81c0228b..45d96340 100644 --- a/packages/cdk-next-app/package.json +++ b/packages/cdk-next-app/package.json @@ -23,7 +23,7 @@ "test": "vitest run --passWithNoTests" }, "dependencies": { - "@codedazur/cdk-docker-cluster": "*" + "@codedazur/cdk-docker-cluster": "^0.3.0" }, "peerDependencies": { "aws-cdk-lib": ">=2",