This message was deleted.
# general
s
This message was deleted.
l
What is a shared account? Have you peered the VPCs? You shouldn't need the ownerId. You will need to use the correct provider though, since the AWS SDK doesn't treat peered VPCs the same as VPCs. You can load the peering connection using the default provider, or use the peered VPCs' provider to load it.
To load the peered VPC, first create a provider for its account:
Copy code
const peeredAccount = new aws.Provider(name, {
  region: 'us-east-1',
  profile: profilePointingToPeeredAccount
});
Then use that provider with `Vpc.get`:
Copy code
const peeredVpc = aws.ec2.Vpc.get(peeredVpcName, peeredVpcId, {}, { provider: peeredAccount});
f
@narrow-author-62348 1. hey what should i used for name here 2. how use used peered vpc to create ec2 instance I am currently using
Copy code
const server = new aws.ec2.Instance("server", {
        instanceType: size,
        ami: amiId,
        keyName: 'MyKeyPair',
    });
l
Name can be anything, it's the label within the Pulumi stack that is put into the Pulumi URN. To create a peer VPC, create a VPC in the normal way in the "other" account (or in the same account, if you're peering two VPCs within the same account). Then use VpcPeeringConnection and VpcPeeringConnectionAccepter to peer the two VPCs.