This repository was archived by the owner on Sep 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ Resources:
241
241
242
242
response_data = {'DnsName': dns_name}
243
243
cfnresponse.send(event, context, cfnresponse.SUCCESS, response_data)
244
-
244
+
245
245
def force_api_router_deployment(event, context):
246
246
"""
247
247
Forces a new deployment for the APIRouterService.
@@ -250,24 +250,24 @@ Resources:
250
250
ecs_client = boto3.client('ecs')
251
251
cluster_name = os.environ['ECS_CLUSTER_NAME']
252
252
service_name = "EMD-API-Router"
253
-
253
+
254
254
try:
255
255
# Check if the service exists
256
256
response = ecs_client.describe_services(
257
257
cluster=cluster_name,
258
258
services=[service_name]
259
259
)
260
-
260
+
261
261
if not response['services'] or response['services'][0]['status'] != 'ACTIVE':
262
262
raise Exception(f"Service {service_name} not found or not active in cluster {cluster_name}")
263
-
263
+
264
264
# Force a new deployment
265
265
ecs_client.update_service(
266
266
cluster=cluster_name,
267
267
service=service_name,
268
268
forceNewDeployment=True
269
269
)
270
-
270
+
271
271
response_data = {'Message': f"Forced new deployment for {service_name}"}
272
272
cfnresponse.send(event, context, cfnresponse.SUCCESS, response_data)
273
273
except Exception as e:
You can’t perform that action at this time.
0 commit comments