From 5ace3642eb0782dc6daf5791a0db4a0735d6e2f0 Mon Sep 17 00:00:00 2001 From: Roni Frantchi Date: Tue, 20 Aug 2019 17:07:31 +0300 Subject: [PATCH] override cluster --- README.md | 4 ++++ lib/index.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index f9f0126..95e6e95 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,10 @@ You can override the generated CF resource properties per task with the `overrid ``` custom: fargate: + override: + cluster: + Foo: bar + tasks: my-task: image: 123456789369.dkr.ecr.eu-west-1.amazonaws.com/my-image diff --git a/lib/index.js b/lib/index.js index 09a7d38..3985250 100644 --- a/lib/index.js +++ b/lib/index.js @@ -22,9 +22,12 @@ class ServerlessFargateTasks { if (debug) consoleLog(yellow('Fargate Tasks Plugin')); + const clusterOverride = options.override && options.override.cluster || {}; + // add the cluster template['Resources']['FargateTasksCluster'] = { "Type" : "AWS::ECS::Cluster", + ...clusterOverride } // Create a loggroup for the logs