Ejemplo n.º 1
0
 public MyStack()
 {
     var foo = new Aws.Ec2.VpcPeeringConnection("foo", new Aws.Ec2.VpcPeeringConnectionArgs
     {
         PeerOwnerId = @var.Peer_owner_id,
         PeerVpcId   = aws_vpc.Bar.Id,
         VpcId       = aws_vpc.Foo.Id,
     });
 }
Ejemplo n.º 2
0
 public MyStack()
 {
     var peer = new Aws.Provider("peer", new Aws.ProviderArgs
     {
         Region = "us-west-2",
     });
     var main = new Aws.Ec2.Vpc("main", new Aws.Ec2.VpcArgs
     {
         CidrBlock = "10.0.0.0/16",
     });
     var peerVpc = new Aws.Ec2.Vpc("peerVpc", new Aws.Ec2.VpcArgs
     {
         CidrBlock = "10.1.0.0/16",
     }, new CustomResourceOptions
     {
         Provider = "aws.peer",
     });
     var peerCallerIdentity = Output.Create(Aws.GetCallerIdentity.InvokeAsync());
     // Requester's side of the connection.
     var peerVpcPeeringConnection = new Aws.Ec2.VpcPeeringConnection("peerVpcPeeringConnection", new Aws.Ec2.VpcPeeringConnectionArgs
     {
         AutoAccept  = false,
         PeerOwnerId = peerCallerIdentity.Apply(peerCallerIdentity => peerCallerIdentity.AccountId),
         PeerRegion  = "us-west-2",
         PeerVpcId   = peerVpc.Id,
         Tags        =
         {
             { "Side", "Requester" },
         },
         VpcId = main.Id,
     });
     // Accepter's side of the connection.
     var peerVpcPeeringConnectionAccepter = new Aws.Ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", new Aws.Ec2.VpcPeeringConnectionAccepterArgs
     {
         AutoAccept = true,
         Tags       =
         {
             { "Side", "Accepter" },
         },
         VpcPeeringConnectionId = peerVpcPeeringConnection.Id,
     }, new CustomResourceOptions
     {
         Provider = "aws.peer",
     });
 }