diff --git a/ecs/awsResources.go b/ecs/awsResources.go index 02021d8de..e97d8a134 100644 --- a/ecs/awsResources.go +++ b/ecs/awsResources.go @@ -39,7 +39,7 @@ import ( // vpcSubNets classification type vpcSubNets struct { - public []awsResource + public []awsResource private []awsResource } @@ -325,7 +325,10 @@ func (b *ecsAPIService) ensureResources(resources *awsResources, project *types. if err != nil { return err } - b.ensureLoadBalancer(resources, project, template) + err = b.ensureLoadBalancer(resources, project, template) + if err != nil { + return err + } return nil } @@ -461,9 +464,9 @@ func (b *ecsAPIService) ensureLoadBalancer(r *awsResources, project *types.Proje } var publicSubNetIDs []string - for _, subNetID := range r.subnetsIDs() { - publicSubNetIDs = append(publicSubNetIDs, subNetID) - } + for _, subNetID := range r.subnetsIDs() { + publicSubNetIDs = append(publicSubNetIDs, subNetID) + } template.Resources["LoadBalancer"] = &elasticloadbalancingv2.LoadBalancer{ Scheme: elbv2.LoadBalancerSchemeEnumInternetFacing, diff --git a/ecs/sdk.go b/ecs/sdk.go index bee6432d7..167cfe25c 100644 --- a/ecs/sdk.go +++ b/ecs/sdk.go @@ -1068,7 +1068,7 @@ func (s sdk) ResolveLoadBalancer(ctx context.Context, nameOrArn string) (awsReso it := lbs.LoadBalancers[0] var subNets vpcSubNets for _, az := range it.AvailabilityZones { - isPublic, err := s.IsPublicSubnet(ctx,aws.StringValue(az.SubnetId)); + isPublic, err := s.IsPublicSubnet(ctx, aws.StringValue(az.SubnetId)) if err != nil { return nil, "", "", subNets, err }