@@ -110,24 +110,26 @@ class ServerlessFargateTasks {
110110 let desired = options . tasks [ identifier ] [ 'desired' ]
111111
112112 // create the service definition
113- var service = {
114- 'Type' : 'AWS::ECS::Service' ,
115- 'Properties' : Object . assign ( {
116- 'Cluster' : { "Fn::Sub" : '${FargateTasksCluster}' } ,
117- 'LaunchType' : 'FARGATE' ,
118- 'ServiceName' : name ,
119- 'DesiredCount' : desired == undefined ? 1 : desired ,
120- 'TaskDefinition' : { "Fn::Sub" : '${' + normalizedIdentifier + 'Task}' } ,
121- 'NetworkConfiguration' : {
122- 'AwsvpcConfiguration' : Object . assign ( {
123- 'AssignPublicIp' : options . vpc [ 'public-ip' ] || "DISABLED" ,
124- 'SecurityGroups' : options . vpc [ 'security-groups' ] || [ ] ,
125- 'Subnets' : options . vpc [ 'subnets' ] || [ ] ,
126- } , network_override ) ,
127- }
128- } , service_override )
113+ if ( ! options . tasks [ identifier ] . noService ) {
114+ const service = {
115+ 'Type' : 'AWS::ECS::Service' ,
116+ 'Properties' : Object . assign ( {
117+ 'Cluster' : { "Fn::Sub" : '${FargateTasksCluster}' } ,
118+ 'LaunchType' : 'FARGATE' ,
119+ 'ServiceName' : name ,
120+ 'DesiredCount' : desired == undefined ? 1 : desired ,
121+ 'TaskDefinition' : { "Fn::Sub" : '${' + normalizedIdentifier + 'Task}' } ,
122+ 'NetworkConfiguration' : {
123+ 'AwsvpcConfiguration' : Object . assign ( {
124+ 'AssignPublicIp' : options . vpc [ 'public-ip' ] || "DISABLED" ,
125+ 'SecurityGroups' : options . vpc [ 'security-groups' ] || [ ] ,
126+ 'Subnets' : options . vpc [ 'subnets' ] || [ ] ,
127+ } , network_override ) ,
128+ }
129+ } , service_override )
130+ }
131+ template [ 'Resources' ] [ normalizedIdentifier + 'Service' ] = service
129132 }
130- template [ 'Resources' ] [ normalizedIdentifier + 'Service' ] = service
131133 } ) ;
132134
133135 function yellow ( str ) {
0 commit comments