Ejemplo n.º 1
0
 public MyStack()
 {
     var foo = Output.Create(Aws.Ec2.GetCustomerGateway.InvokeAsync(new Aws.Ec2.GetCustomerGatewayArgs
     {
         Filters =
         {
             new Aws.Ec2.Inputs.GetCustomerGatewayFilterArgs
             {
                 Name   = "tag:Name",
                 Values =
                 {
                     "foo-prod",
                 },
             },
         },
     }));
     var main = new Aws.Ec2.VpnGateway("main", new Aws.Ec2.VpnGatewayArgs
     {
         AmazonSideAsn = "7224",
         VpcId         = aws_vpc.Main.Id,
     });
     var transit = new Aws.Ec2.VpnConnection("transit", new Aws.Ec2.VpnConnectionArgs
     {
         CustomerGatewayId = foo.Apply(foo => foo.Id),
         StaticRoutesOnly  = false,
         Type         = foo.Apply(foo => foo.Type),
         VpnGatewayId = main.Id,
     });
 }
Ejemplo n.º 2
0
 public MyStack()
 {
     var exampleGateway = new Aws.DirectConnect.Gateway("exampleGateway", new Aws.DirectConnect.GatewayArgs
     {
         AmazonSideAsn = "64512",
     });
     var exampleVpc = new Aws.Ec2.Vpc("exampleVpc", new Aws.Ec2.VpcArgs
     {
         CidrBlock = "10.255.255.0/28",
     });
     var exampleVpnGateway = new Aws.Ec2.VpnGateway("exampleVpnGateway", new Aws.Ec2.VpnGatewayArgs
     {
         VpcId = exampleVpc.Id,
     });
     var exampleGatewayAssociation = new Aws.DirectConnect.GatewayAssociation("exampleGatewayAssociation", new Aws.DirectConnect.GatewayAssociationArgs
     {
         AllowedPrefixes =
         {
             "210.52.109.0/24",
             "175.45.176.0/22",
         },
         AssociatedGatewayId = exampleVpnGateway.Id,
         DxGatewayId         = exampleGateway.Id,
     });
 }
Ejemplo n.º 3
0
 public MyStack()
 {
     var vpc = new Aws.Ec2.Vpc("vpc", new Aws.Ec2.VpcArgs
     {
         CidrBlock = "10.0.0.0/16",
     });
     var vpnGateway = new Aws.Ec2.VpnGateway("vpnGateway", new Aws.Ec2.VpnGatewayArgs
     {
         VpcId = vpc.Id,
     });
     var customerGateway = new Aws.Ec2.CustomerGateway("customerGateway", new Aws.Ec2.CustomerGatewayArgs
     {
         BgpAsn    = 65000,
         IpAddress = "172.0.0.1",
         Type      = "ipsec.1",
     });
     var main = new Aws.Ec2.VpnConnection("main", new Aws.Ec2.VpnConnectionArgs
     {
         CustomerGatewayId = customerGateway.Id,
         StaticRoutesOnly  = true,
         Type         = "ipsec.1",
         VpnGatewayId = vpnGateway.Id,
     });
     var office = new Aws.Ec2.VpnConnectionRoute("office", new Aws.Ec2.VpnConnectionRouteArgs
     {
         DestinationCidrBlock = "192.168.10.0/24",
         VpnConnectionId      = main.Id,
     });
 }
Ejemplo n.º 4
0
 public MyStack()
 {
     var vpnGw = new Aws.Ec2.VpnGateway("vpnGw", new Aws.Ec2.VpnGatewayArgs
     {
         Tags =
         {
             { "Name", "main" },
         },
         VpcId = aws_vpc.Main.Id,
     });
 }
Ejemplo n.º 5
0
 public MyStack()
 {
     var network = new Aws.Ec2.Vpc("network", new Aws.Ec2.VpcArgs
     {
         CidrBlock = "10.0.0.0/16",
     });
     var vpn = new Aws.Ec2.VpnGateway("vpn", new Aws.Ec2.VpnGatewayArgs
     {
         Tags =
         {
             { "Name", "example-vpn-gateway" },
         },
     });
     var vpnAttachment = new Aws.Ec2.VpnGatewayAttachment("vpnAttachment", new Aws.Ec2.VpnGatewayAttachmentArgs
     {
         VpcId        = network.Id,
         VpnGatewayId = vpn.Id,
     });
 }
Ejemplo n.º 6
0
 public MyStack()
 {
     var exampleGateway = new Aws.DirectConnect.Gateway("exampleGateway", new Aws.DirectConnect.GatewayArgs
     {
         AmazonSideAsn = "64512",
     });
     var exampleVpc = new Aws.Ec2.Vpc("exampleVpc", new Aws.Ec2.VpcArgs
     {
         CidrBlock = "10.255.255.0/28",
     });
     var exampleVpnGateway = new Aws.Ec2.VpnGateway("exampleVpnGateway", new Aws.Ec2.VpnGatewayArgs
     {
         VpcId = exampleVpc.Id,
     });
     var exampleGatewayAssociation = new Aws.DirectConnect.GatewayAssociation("exampleGatewayAssociation", new Aws.DirectConnect.GatewayAssociationArgs
     {
         AssociatedGatewayId = exampleVpnGateway.Id,
         DxGatewayId         = exampleGateway.Id,
     });
 }
Ejemplo n.º 7
0
 public MyStack()
 {
     var accepter = new Aws.Provider("accepter", new Aws.ProviderArgs
     {
     });
     var accepterCallerIdentity = Output.Create(Aws.GetCallerIdentity.InvokeAsync());
     // Creator's side of the VIF
     var creator = new Aws.DirectConnect.HostedPrivateVirtualInterface("creator", new Aws.DirectConnect.HostedPrivateVirtualInterfaceArgs
     {
         AddressFamily  = "ipv4",
         BgpAsn         = 65352,
         ConnectionId   = "dxcon-zzzzzzzz",
         OwnerAccountId = accepterCallerIdentity.Apply(accepterCallerIdentity => accepterCallerIdentity.AccountId),
         Vlan           = 4094,
     }, new CustomResourceOptions
     {
         DependsOn =
         {
             "aws_vpn_gateway.vpn_gw",
         },
     });
     // Accepter's side of the VIF.
     var vpnGw = new Aws.Ec2.VpnGateway("vpnGw", new Aws.Ec2.VpnGatewayArgs
     {
     }, new CustomResourceOptions
     {
         Provider = "aws.accepter",
     });
     var accepterHostedPrivateVirtualInterfaceAccepter = new Aws.DirectConnect.HostedPrivateVirtualInterfaceAccepter("accepterHostedPrivateVirtualInterfaceAccepter", new Aws.DirectConnect.HostedPrivateVirtualInterfaceAccepterArgs
     {
         Tags =
         {
             { "Side", "Accepter" },
         },
         VirtualInterfaceId = creator.Id,
         VpnGatewayId       = vpnGw.Id,
     }, new CustomResourceOptions
     {
         Provider = "aws.accepter",
     });
 }