class FlowLogResourceType
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.FlowLogResourceType |
Java | software.amazon.awscdk.services.ec2.FlowLogResourceType |
Python | aws_cdk.aws_ec2.FlowLogResourceType |
TypeScript (source) | @aws-cdk/aws-ec2 » FlowLogResourceType |
The type of resource to create the flow log for.
Example
declare const vpc: ec2.Vpc;
const logGroup = new logs.LogGroup(this, 'MyCustomLogGroup');
const role = new iam.Role(this, 'MyCustomRole', {
assumedBy: new iam.ServicePrincipal('vpc-flow-logs.amazonaws.com')
});
new ec2.FlowLog(this, 'FlowLog', {
resourceType: ec2.FlowLogResourceType.fromVpc(vpc),
destination: ec2.FlowLogDestination.toCloudWatchLogs(logGroup, role)
});
Initializer
new FlowLogResourceType()
Properties
Name | Type | Description |
---|---|---|
resource | string | The Id of the resource that the flow log should be attached to. |
resource | string | The type of resource to attach a flow log to. |
resourceId
Type:
string
The Id of the resource that the flow log should be attached to.
resourceType
Type:
string
The type of resource to attach a flow log to.
Methods
Name | Description |
---|---|
static from | The Network Interface to attach the Flow Log to. |
static from | The subnet to attach the Flow Log to. |
static from | The VPC to attach the Flow Log to. |
NetworkInterfaceId(id)
static frompublic static fromNetworkInterfaceId(id: string): FlowLogResourceType
Parameters
- id
string
Returns
The Network Interface to attach the Flow Log to.
Subnet(subnet)
static frompublic static fromSubnet(subnet: ISubnet): FlowLogResourceType
Parameters
- subnet
ISubnet
Returns
The subnet to attach the Flow Log to.
Vpc(vpc)
static frompublic static fromVpc(vpc: IVpc): FlowLogResourceType
Parameters
- vpc
IVpc
Returns
The VPC to attach the Flow Log to.