From 82704aeab7ea1db2f7bcefce62d3aff0d6c9e41f Mon Sep 17 00:00:00 2001 From: Joyson Lewis <49881437+joysl@users.noreply.github.com> Date: Sun, 19 Mar 2023 22:17:10 -0400 Subject: [PATCH] Fix: FrontendServiceMesh code bugs for Appmesh workshop --- cdk/app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cdk/app.py b/cdk/app.py index 933bb00..e74a211 100644 --- a/cdk/app.py +++ b/cdk/app.py @@ -127,14 +127,14 @@ def __init__(self, scope: Stack, id: str, **kwargs): self, "mesh-crystal-vs", mesh=self.mesh, - virtual_service_name=cdk.Fn.import_value("MeshCrystalVSName") + virtual_service_name="ecsdemo-crystal.service.local"#cdk.Fn.import_value("MeshCrystalVSName") ) self.mesh_nodejs_vs = appmesh.VirtualService.from_virtual_service_attributes( self, "mesh-nodejs-vs", mesh=self.mesh, - virtual_service_name=cdk.Fn.import_value("MeshNodeJsVSName") + virtual_service_name="ecsdemo-nodejs.service.local"#cdk.Fn.import_value("MeshNodeJsVSName") ) self.fargate_task_def = ecs.TaskDefinition( @@ -205,7 +205,7 @@ def __init__(self, scope: Stack, id: str, **kwargs): mesh=self.mesh, virtual_node_name="frontend", listeners=[appmesh.VirtualNodeListener.http(port=3000)], - service_discovery=self.appmesh.ServiceDiscovery.cloud_map(self.fargate_service.cloud_map_service), + service_discovery=appmesh.ServiceDiscovery.cloud_map(self.fargate_service.cloud_map_service), backends=[ appmesh.Backend.virtual_service(self.mesh_crystal_vs), appmesh.Backend.virtual_service(self.mesh_nodejs_vs) @@ -312,7 +312,7 @@ def __init__(self, scope: Stack, id: str, **kwargs): # Asdding mesh virtual service mesh_frontend_vs = appmesh.VirtualService(self,"mesh-frontend-vs", - virtual_service_provider=self.appmesh.VirtualServiceProvider.virtual_router(meshVR), + virtual_service_provider=appmesh.VirtualServiceProvider.virtual_router(meshVR), virtual_service_name="{}.{}".format(self.fargate_service.cloud_map_service.service_name,self.fargate_service.cloud_map_service.namespace.namespace_name) ) @@ -350,4 +350,4 @@ def __init__(self, scope: Stack, id: str, **kwargs): # App Mesh workshop # FrontendServiceMesh(app, stack_name, env=_env) -app.synth() \ No newline at end of file +app.synth()