Skip to content

Commit 35b8d6f

Browse files
committed
public subnets support for Runfargate
1 parent 3db714d commit 35b8d6f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/runFargate.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@ func RunFargate(profile, cluster, service, taskDefinitionName, imageTag string,
2424
// Fetch subnets and security groups
2525
subnets, err := fetchSubnetsByTag(svcEC2, "Tier", "private")
2626
if err != nil {
27-
log.WithError(err).Error("Failed to fetch subnets by tag")
27+
log.WithError(err).Error("Failed to fetch subnets by private tag")
2828
return 1, err
2929
}
30+
if len(subnets) == 0 {
31+
subnets, err = fetchSubnetsByTag(svcEC2, "Tier", "public")
32+
33+
if err != nil {
34+
log.WithError(err).Error("Failed to fetch subnets by public tag")
35+
return 1, err
36+
}
37+
}
3038
securityGroups, err := fetchSecurityGroupsByName(svcEC2, securityGroupFilter)
3139
if err != nil {
3240
log.WithError(err).Error("Failed to fetch security groups by name")

0 commit comments

Comments
 (0)