# FlowLogResourceType

The type of resource to create the flow log for.

- Source: [`aws-ec2/lib/vpc-flow-logs.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ec2/lib/vpc-flow-logs.ts#L89)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

```ts
declare const tgw: ec2.CfnTransitGateway;

new ec2.FlowLog(this, 'TransitGatewayFlowLog', {
  resourceType: ec2.FlowLogResourceType.fromTransitGatewayId(tgw.ref)
})
```

## Initializer

```ts
new FlowLogResourceType()
```

## Properties

- `resourceId`: string — The Id of the resource that the flow log should be attached to.

- `resourceType`: string — The type of resource to attach a flow log to.

## Methods

- `fromNetworkInterfaceId(id: string): FlowLogResourceType // chainable` (static) — The Network Interface to attach the Flow Log to.

- `fromSubnet(subnet: ISubnetRef): FlowLogResourceType // chainable` (static) — The subnet to attach the Flow Log to.

- `fromTransitGatewayAttachmentId(id: string): FlowLogResourceType // chainable` (static) — The Transit Gateway Attachment to attach the Flow Log to.

- `fromTransitGatewayId(id: string): FlowLogResourceType // chainable` (static) — The Transit Gateway to attach the Flow Log to.

- `fromVpc(vpc: IVpc): FlowLogResourceType // chainable` (static) — The VPC to attach the Flow Log to.
