# CfnSubnetRouteTableAssociationProps

Properties for defining a `CfnSubnetRouteTableAssociation`.

Used as props by: [CfnSubnetRouteTableAssociation](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## 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 cfnSubnetRouteTableAssociationProps: ec2.CfnSubnetRouteTableAssociationProps = {
  routeTableId: 'routeTableId',
  subnetId: 'subnetId',
};
```

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

cfn_subnet_route_table_association_props = ec2.CfnSubnetRouteTableAssociationProps(
    route_table_id="routeTableId",
    subnet_id="subnetId"
)
```

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.*;

CfnSubnetRouteTableAssociationProps cfnSubnetRouteTableAssociationProps = CfnSubnetRouteTableAssociationProps.builder()
        .routeTableId("routeTableId")
        .subnetId("subnetId")
        .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 cfnSubnetRouteTableAssociationProps = new CfnSubnetRouteTableAssociationProps {
    RouteTableId = "routeTableId",
    SubnetId = "subnetId"
};
```

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"

cfnSubnetRouteTableAssociationProps := &CfnSubnetRouteTableAssociationProps{
	RouteTableId: jsii.String("routeTableId"),
	SubnetId: jsii.String("subnetId"),
}
```

## Properties

- `routeTableId`: string | [IRouteTableRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.IRouteTableRef.html) (required) — The ID of the route table.

  The physical ID changes when the route table ID is changed.

- `subnetId`: string | [ISubnetRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ISubnetRef.html) (required) — The ID of the subnet.
