Exemplo n.º 1
0
 public PingPongNetwork(Construct scope, string id, PingPongNetworkProps props = null) : base(scope, id)
 {
     PingPongVpc       = AddVpc(id, props);
     CloudmapNamespace = CreateCloudMapNamespace(id, PingPongVpc);
     AppMesh           = AddMesh(id);
     PingRouter        = AddVirtualRouter(id, "ping", AppMesh);
     PongRouter        = AddVirtualRouter(id, "pong", AppMesh);
     PingService       = AddVirtualService(id, "ping", AppMesh, PingRouter, CloudmapNamespace);
     PongService       = AddVirtualService(id, "pong", AppMesh, PongRouter, CloudmapNamespace);
 }
Exemplo n.º 2
0
 internal IVpc AddVpc(string id, PingPongNetworkProps props)
 {
     if (props.UseExistingVpc)
     {
         System.Console.WriteLine($"Using VPC = {props.ExistingVpcName}");
         return(Vpc.FromLookup(this, $"{id}-vpc", new VpcLookupOptions()
         {
             VpcName = props.ExistingVpcName
         }));
     }
     else
     {
         return(new Vpc(this, $"{id}-vpc", new VpcProps
         {
         }));
     }
 }