> **Experimental**
>
> `@aws-cdk/aws-ec2-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# VpcV2Attributes

Options to import a VPC created outside of CDK stack.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/vpc-v2.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0-alpha.0/packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts#L251)

## Example

```ts
const stack = new Stack();

const acceptorVpc = VpcV2.fromVpcV2Attributes(this, 'acceptorVpc', {
      vpcId: 'vpc-XXXX',
      vpcCidrBlock: '10.0.0.0/16',
      region: 'us-east-2',
      ownerAccountId: '111111111111',
    });

const acceptorRoleArn = 'arn:aws:iam::111111111111:role/VpcPeeringRole';

const requestorVpc = new VpcV2(this, 'VpcB', {
  primaryAddressBlock: IpAddresses.ipv4('10.1.0.0/16'),
});

const peeringConnection = requestorVpc.createPeeringConnection('crossAccountCrossRegionPeering', {
  acceptorVpc: acceptorVpc,
  peerRoleArn: acceptorRoleArn,
});
```

## Properties

- `ownerAccountId`: string — The ID of the AWS account that owns the imported VPC required in case of cross account VPC as given value will be used to set field account for imported VPC, which then later can be used for establishing VPC peering connection.

  **Default:** constructed with stack account value

- `region`: string — Region in which imported VPC is hosted required in case of cross region VPC as given value will be used to set field region for imported VPC, which then later can be used for establishing VPC peering connection.

  **Default:** constructed with stack region value

- `secondaryCidrBlocks`: [VPCCidrBlockattributes](/cdk/api/v2/docs/@aws-cdk_aws-ec2-alpha.VPCCidrBlockattributes.html)[] — Import Secondary CIDR blocks associated with VPC.

  **Default:** No secondary IP address

- `subnets`: [SubnetV2Attributes](/cdk/api/v2/docs/@aws-cdk_aws-ec2-alpha.SubnetV2Attributes.html)[] — Subnets associated with imported VPC.

  **Default:** no subnets provided to be imported

- `vpcCidrBlock`: string (required) — Primary VPC CIDR Block of the imported VPC Can only be IPv4.

- `vpcId`: string (required) — The VPC ID Refers to physical Id of the resource.

- `vpnGatewayId`: string — A VPN Gateway is attached to the VPC.

  **Default:** No VPN Gateway
