vpc_flow_logs_configs
Creates, updates, deletes, gets or lists a vpc_flow_logs_configs
resource.
Overview
Name | vpc_flow_logs_configs |
Type | Resource |
Id | google.networkmanagement.vpc_flow_logs_configs |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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} |
aggregationInterval | string | Optional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC. |
createTime | string (google-datetime) | Output only. The time the config was created. |
description | string | Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters. |
filterExpr | string | Optional. Export filter used to define which VPC Flow Logs should be logged. |
flowSampling | number (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. |
interconnectAttachment | string | Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name} |
labels | object | Optional. Resource labels to represent user-provided metadata. |
metadata | string | Optional. 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. |
metadataFields | array | Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA. |
state | string | Optional. 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. |
targetResourceState | string | Output only. Describes the state of the configured target resource for diagnostic purposes. |
updateTime | string (google-datetime) | Output only. The time the config was updated. |
vpnTunnel | string | Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name} |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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} |
aggregationInterval | string | Optional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC. |
createTime | string (google-datetime) | Output only. The time the config was created. |
description | string | Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters. |
filterExpr | string | Optional. Export filter used to define which VPC Flow Logs should be logged. |
flowSampling | number (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. |
interconnectAttachment | string | Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name} |
labels | object | Optional. Resource labels to represent user-provided metadata. |
metadata | string | Optional. 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. |
metadataFields | array | Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA. |
state | string | Optional. 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. |
targetResourceState | string | Output only. Describes the state of the configured target resource for diagnostic purposes. |
updateTime | string (google-datetime) | Output only. The time the config was updated. |
vpnTunnel | string | Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name} |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , vpcFlowLogsConfigsId | Gets the details of a specific VpcFlowLogsConfig . | |
list | select | projectsId , locationsId | pageSize , pageToken , filter , orderBy | Lists all VpcFlowLogsConfigs in a given project. |
create | insert | projectsId , locationsId | vpcFlowLogsConfigId | 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 |
patch | update | projectsId , locationsId , vpcFlowLogsConfigsId | updateMask | 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 |
delete | delete | projectsId , locationsId , vpcFlowLogsConfigsId | Deletes 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.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
projectsId | string | |
vpcFlowLogsConfigsId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) | |
vpcFlowLogsConfigId | string |
SELECT
examples
- get
- list
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;
Lists all VpcFlowLogsConfigs
in a given project.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: vpc_flow_logs_configs
props:
- name: projectsId
value: string
description: Required parameter for the vpc_flow_logs_configs resource.
- name: locationsId
value: string
description: Required parameter for the vpc_flow_logs_configs resource.
- name: name
value: string
description: >
Identifier. 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}`
- name: description
value: string
description: >
Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.
- name: state
value: string
description: >
Optional. 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.
valid_values: ['STATE_UNSPECIFIED', 'ENABLED', 'DISABLED']
- name: aggregationInterval
value: string
description: >
Optional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
valid_values: ['AGGREGATION_INTERVAL_UNSPECIFIED', 'INTERVAL_5_SEC', 'INTERVAL_30_SEC', 'INTERVAL_1_MIN', 'INTERVAL_5_MIN', 'INTERVAL_10_MIN', 'INTERVAL_15_MIN']
- name: flowSampling
value: number
description: >
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.
- name: metadata
value: string
description: >
Optional. 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.
valid_values: ['METADATA_UNSPECIFIED', 'INCLUDE_ALL_METADATA', 'EXCLUDE_ALL_METADATA', 'CUSTOM_METADATA']
- name: metadataFields
value: array
description: >
Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA.
- name: filterExpr
value: string
description: >
Optional. Export filter used to define which VPC Flow Logs should be logged.
- name: interconnectAttachment
value: string
description: >
Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}
- name: vpnTunnel
value: string
description: >
Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
- name: labels
value: object
description: >
Optional. Resource labels to represent user-provided metadata.
- name: vpcFlowLogsConfigId
value: string
UPDATE
examples
- patch
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
- delete
Deletes a specific VpcFlowLogsConfig
.
DELETE FROM google.networkmanagement.vpc_flow_logs_configs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND vpcFlowLogsConfigsId = '{{ vpcFlowLogsConfigsId }}' --required;