Skip to main content

vpc_flow_logs_configs

Creates, updates, deletes, gets or lists a vpc_flow_logs_configs resource.

Overview

Namevpc_flow_logs_configs
TypeResource
Idgoogle.networkmanagement.vpc_flow_logs_configs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Unique name of the configuration. The name can have one of the following forms: - For project-level configurations: projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id} - For organization-level configurations: organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}
aggregationIntervalstringOptional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
createTimestring (google-datetime)Output only. The time the config was created.
descriptionstringOptional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.
filterExprstringOptional. Export filter used to define which VPC Flow Logs should be logged.
flowSamplingnumber (float)Optional. The value of the field must be in (0, 1]. The sampling rate of VPC Flow Logs where 1.0 means all collected logs are reported. Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs, use the state field instead. Default value is 1.0.
interconnectAttachmentstringTraffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}
labelsobjectOptional. Resource labels to represent user-provided metadata.
metadatastringOptional. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA.
metadataFieldsarrayOptional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA.
statestringOptional. The state of the VPC Flow Log configuration. Default value is ENABLED. When creating a new configuration, it must be enabled. Setting state=DISABLED will pause the log generation for this config.
targetResourceStatestringOutput only. Describes the state of the configured target resource for diagnostic purposes.
updateTimestring (google-datetime)Output only. The time the config was updated.
vpnTunnelstringTraffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, vpcFlowLogsConfigsIdGets the details of a specific VpcFlowLogsConfig.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists all VpcFlowLogsConfigs in a given project.
createinsertprojectsId, locationsIdvpcFlowLogsConfigIdCreates a new VpcFlowLogsConfig. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes: 1. Creating a configuration with state=DISABLED will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description
patchupdateprojectsId, locationsId, vpcFlowLogsConfigsIdupdateMaskUpdates an existing VpcFlowLogsConfig. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes: 1. Updating a configuration with state=DISABLED will fail. 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - updating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description
deletedeleteprojectsId, locationsId, vpcFlowLogsConfigsIdDeletes a specific VpcFlowLogsConfig.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
vpcFlowLogsConfigsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)
vpcFlowLogsConfigIdstring

SELECT examples

Gets the details of a specific VpcFlowLogsConfig.

SELECT
name,
aggregationInterval,
createTime,
description,
filterExpr,
flowSampling,
interconnectAttachment,
labels,
metadata,
metadataFields,
state,
targetResourceState,
updateTime,
vpnTunnel
FROM google.networkmanagement.vpc_flow_logs_configs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND vpcFlowLogsConfigsId = '{{ vpcFlowLogsConfigsId }}' -- required;

INSERT examples

Creates a new VpcFlowLogsConfig. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes: 1. Creating a configuration with state=DISABLED will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

INSERT INTO google.networkmanagement.vpc_flow_logs_configs (
data__name,
data__description,
data__state,
data__aggregationInterval,
data__flowSampling,
data__metadata,
data__metadataFields,
data__filterExpr,
data__interconnectAttachment,
data__vpnTunnel,
data__labels,
projectsId,
locationsId,
vpcFlowLogsConfigId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ state }}',
'{{ aggregationInterval }}',
{{ flowSampling }},
'{{ metadata }}',
'{{ metadataFields }}',
'{{ filterExpr }}',
'{{ interconnectAttachment }}',
'{{ vpnTunnel }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ vpcFlowLogsConfigId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an existing VpcFlowLogsConfig. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes: 1. Updating a configuration with state=DISABLED will fail. 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - updating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

UPDATE google.networkmanagement.vpc_flow_logs_configs
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__state = '{{ state }}',
data__aggregationInterval = '{{ aggregationInterval }}',
data__flowSampling = {{ flowSampling }},
data__metadata = '{{ metadata }}',
data__metadataFields = '{{ metadataFields }}',
data__filterExpr = '{{ filterExpr }}',
data__interconnectAttachment = '{{ interconnectAttachment }}',
data__vpnTunnel = '{{ vpnTunnel }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND vpcFlowLogsConfigsId = '{{ vpcFlowLogsConfigsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a specific VpcFlowLogsConfig.

DELETE FROM google.networkmanagement.vpc_flow_logs_configs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND vpcFlowLogsConfigsId = '{{ vpcFlowLogsConfigsId }}' --required;