From 46cebb319406c0c42d6e17540d47bcc24accca33 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 15 Sep 2020 15:34:18 +0200 Subject: [PATCH] Prefer external.name over x-aws-securitygroup Signed-off-by: Nicolas De Loof --- ecs/cloudformation.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ecs/cloudformation.go b/ecs/cloudformation.go index cc2139259..6301a84b0 100644 --- a/ecs/cloudformation.go +++ b/ecs/cloudformation.go @@ -524,7 +524,11 @@ func createCloudMap(project *types.Project, template *cloudformation.Template) { } func convertNetwork(project *types.Project, net types.NetworkConfig, vpc string, template *cloudformation.Template) string { + if net.External.External { + return net.Name + } if sg, ok := net.Extensions[extensionSecurityGroup]; ok { + logrus.Warn("to use an existing security-group, set `network.external` and `network.name` in your compose file") logrus.Debugf("Security Group for network %q set by user to %q", net.Name, sg) return sg.(string) }