# PrivateSubnetAttributes

Extends: [SubnetAttributes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SubnetAttributes.html)
Used as argument in: [PrivateSubnet.fromPrivateSubnetAttributes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.PrivateSubnet.html#fromprivatesubnetattributes)

- Source: [`aws-ec2/lib/vpc.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts#L2662)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const privateSubnetAttributes: ec2.PrivateSubnetAttributes = {
  subnetId: 'subnetId',

  // the properties below are optional
  availabilityZone: 'availabilityZone',
  ipv4CidrBlock: 'ipv4CidrBlock',
  routeTableId: 'routeTableId',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

private_subnet_attributes = ec2.PrivateSubnetAttributes(
    subnet_id="subnetId",

    # the properties below are optional
    availability_zone="availabilityZone",
    ipv4_cidr_block="ipv4CidrBlock",
    route_table_id="routeTableId"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

PrivateSubnetAttributes privateSubnetAttributes = PrivateSubnetAttributes.builder()
        .subnetId("subnetId")

        // the properties below are optional
        .availabilityZone("availabilityZone")
        .ipv4CidrBlock("ipv4CidrBlock")
        .routeTableId("routeTableId")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var privateSubnetAttributes = new PrivateSubnetAttributes {
    SubnetId = "subnetId",

    // the properties below are optional
    AvailabilityZone = "availabilityZone",
    Ipv4CidrBlock = "ipv4CidrBlock",
    RouteTableId = "routeTableId"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

privateSubnetAttributes := &PrivateSubnetAttributes{
	SubnetId: jsii.String("subnetId"),

	// the properties below are optional
	AvailabilityZone: jsii.String("availabilityZone"),
	Ipv4CidrBlock: jsii.String("ipv4CidrBlock"),
	RouteTableId: jsii.String("routeTableId"),
}
```

## Properties

- `availabilityZone`: string — The Availability Zone the subnet is located in.

  **Default:** No AZ information, cannot use AZ selection features

- `ipv4CidrBlock`: string — The IPv4 CIDR block associated with the subnet.

  **Default:** No CIDR information, cannot use CIDR filter features

- `routeTableId`: string — The ID of the route table for this particular subnet.

  **Default:** No route table information, cannot create VPC endpoints

- `subnetId`: string (required) — The subnetId for this particular subnet.
