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
- query_org_vpc_flow_logs_configs
| 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. (AGGREGATION_INTERVAL_UNSPECIFIED, INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN) |
createTime | string (google-datetime) | Output only. The time the config was created. |
crossProjectMetadata | string | Optional. Determines whether to include cross project annotations in the logs. This field is available only for organization configurations. If not specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED. (CROSS_PROJECT_METADATA_UNSPECIFIED, CROSS_PROJECT_METADATA_ENABLED, CROSS_PROJECT_METADATA_DISABLED) |
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. (METADATA_UNSPECIFIED, INCLUDE_ALL_METADATA, EXCLUDE_ALL_METADATA, CUSTOM_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. |
network | string | Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name} |
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. (STATE_UNSPECIFIED, ENABLED, DISABLED) |
subnet | string | Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name} |
targetResourceState | string | Output only. Describes the state of the configured target resource for diagnostic purposes. (TARGET_RESOURCE_STATE_UNSPECIFIED, TARGET_RESOURCE_EXISTS, TARGET_RESOURCE_DOES_NOT_EXIST) |
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} |
| 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. (AGGREGATION_INTERVAL_UNSPECIFIED, INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN) |
createTime | string (google-datetime) | Output only. The time the config was created. |
crossProjectMetadata | string | Optional. Determines whether to include cross project annotations in the logs. This field is available only for organization configurations. If not specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED. (CROSS_PROJECT_METADATA_UNSPECIFIED, CROSS_PROJECT_METADATA_ENABLED, CROSS_PROJECT_METADATA_DISABLED) |
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. (METADATA_UNSPECIFIED, INCLUDE_ALL_METADATA, EXCLUDE_ALL_METADATA, CUSTOM_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. |
network | string | Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name} |
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. (STATE_UNSPECIFIED, ENABLED, DISABLED) |
subnet | string | Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name} |
targetResourceState | string | Output only. Describes the state of the configured target resource for diagnostic purposes. (TARGET_RESOURCE_STATE_UNSPECIFIED, TARGET_RESOURCE_EXISTS, TARGET_RESOURCE_DOES_NOT_EXIST) |
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} |
| Name | Datatype | Description |
|---|---|---|
nextPageToken | string | Page token to fetch the next set of configurations. |
unreachable | array | Locations that could not be reached (when querying all locations with -). |
vpcFlowLogsConfigs | array | List of VPC Flow Log configurations. |
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 | filter, pageSize, pageToken, orderBy | Lists all VpcFlowLogsConfigs in a given project. |
query_org_vpc_flow_logs_configs | select | projectsId, locationsId | filter, pageSize, pageToken | QueryOrgVpcFlowLogsConfigs returns a list of all organization-level VPC Flow Logs configurations applicable to the specified 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. | |
show_effective_flow_logs_configs | exec | projectsId, locationsId | filter, resource, pageSize, pageToken | ShowEffectiveFlowLogsConfigs returns a list of all VPC Flow Logs configurations applicable to a specified resource. |
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 | |
resource | string | |
updateMask | string (google-fieldmask) | |
vpcFlowLogsConfigId | string |
SELECT examples
- get
- list
- query_org_vpc_flow_logs_configs
Gets the details of a specific VpcFlowLogsConfig.
SELECT
name,
aggregationInterval,
createTime,
crossProjectMetadata,
description,
filterExpr,
flowSampling,
interconnectAttachment,
labels,
metadata,
metadataFields,
network,
state,
subnet,
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,
crossProjectMetadata,
description,
filterExpr,
flowSampling,
interconnectAttachment,
labels,
metadata,
metadataFields,
network,
state,
subnet,
targetResourceState,
updateTime,
vpnTunnel
FROM google.networkmanagement.vpc_flow_logs_configs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
;
QueryOrgVpcFlowLogsConfigs returns a list of all organization-level VPC Flow Logs configurations applicable to the specified project.
SELECT
nextPageToken,
unreachable,
vpcFlowLogsConfigs
FROM google.networkmanagement.vpc_flow_logs_configs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
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__metadata,
data__labels,
data__description,
data__aggregationInterval,
data__name,
data__filterExpr,
data__crossProjectMetadata,
data__vpnTunnel,
data__state,
data__metadataFields,
data__network,
data__interconnectAttachment,
data__flowSampling,
data__subnet,
projectsId,
locationsId,
vpcFlowLogsConfigId
)
SELECT
'{{ metadata }}',
'{{ labels }}',
'{{ description }}',
'{{ aggregationInterval }}',
'{{ name }}',
'{{ filterExpr }}',
'{{ crossProjectMetadata }}',
'{{ vpnTunnel }}',
'{{ state }}',
'{{ metadataFields }}',
'{{ network }}',
'{{ interconnectAttachment }}',
{{ flowSampling }},
'{{ subnet }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ vpcFlowLogsConfigId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: vpc_flow_logs_configs
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the vpc_flow_logs_configs resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the vpc_flow_logs_configs resource.
- name: metadata
value: "{{ metadata }}"
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: labels
value: "{{ labels }}"
description: |
Optional. Resource labels to represent user-provided metadata.
- name: description
value: "{{ description }}"
description: |
Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.
- name: aggregationInterval
value: "{{ aggregationInterval }}"
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: name
value: "{{ name }}"
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: filterExpr
value: "{{ filterExpr }}"
description: |
Optional. Export filter used to define which VPC Flow Logs should be logged.
- name: crossProjectMetadata
value: "{{ crossProjectMetadata }}"
description: |
Optional. Determines whether to include cross project annotations in the logs. This field is available only for organization configurations. If not specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
valid_values: ['CROSS_PROJECT_METADATA_UNSPECIFIED', 'CROSS_PROJECT_METADATA_ENABLED', 'CROSS_PROJECT_METADATA_DISABLED']
- name: vpnTunnel
value: "{{ vpnTunnel }}"
description: |
Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
- name: state
value: "{{ state }}"
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: metadataFields
value:
- "{{ metadataFields }}"
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: network
value: "{{ network }}"
description: |
Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name}
- name: interconnectAttachment
value: "{{ interconnectAttachment }}"
description: |
Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}
- name: flowSampling
value: {{ flowSampling }}
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: subnet
value: "{{ subnet }}"
description: |
Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}
- name: vpcFlowLogsConfigId
value: "{{ vpcFlowLogsConfigId }}"
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__metadata = '{{ metadata }}',
data__labels = '{{ labels }}',
data__description = '{{ description }}',
data__aggregationInterval = '{{ aggregationInterval }}',
data__name = '{{ name }}',
data__filterExpr = '{{ filterExpr }}',
data__crossProjectMetadata = '{{ crossProjectMetadata }}',
data__vpnTunnel = '{{ vpnTunnel }}',
data__state = '{{ state }}',
data__metadataFields = '{{ metadataFields }}',
data__network = '{{ network }}',
data__interconnectAttachment = '{{ interconnectAttachment }}',
data__flowSampling = {{ flowSampling }},
data__subnet = '{{ subnet }}'
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
;
Lifecycle Methods
- show_effective_flow_logs_configs
ShowEffectiveFlowLogsConfigs returns a list of all VPC Flow Logs configurations applicable to a specified resource.
EXEC google.networkmanagement.vpc_flow_logs_configs.show_effective_flow_logs_configs
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@filter='{{ filter }}',
@resource='{{ resource }}',
@pageSize='{{ pageSize }}',
@pageToken='{{ pageToken }}'
;