Skip to content

Commit 7f85b37

Browse files
VPCFlowLogs - Add Organization Support (#14885) (#24245)
[upstream:9fd482b38f178f15560eab4c6acc1b99b3bb944b] Signed-off-by: Modular Magician <[email protected]>
1 parent 69e2d0a commit 7f85b37

File tree

3 files changed

+192
-0
lines changed

3 files changed

+192
-0
lines changed

.changelog/14885.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unknown: VPCFlowLogs - Add Organization Support
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
// ----------------------------------------------------------------------------
4+
//
5+
// *** AUTO GENERATED CODE *** Type: Handwritten ***
6+
//
7+
// ----------------------------------------------------------------------------
8+
//
9+
// This code is generated by Magic Modules using the following:
10+
//
11+
// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_org_vpc_flow_logs_config_test.go.tmpl
12+
//
13+
// DO NOT EDIT this file directly. Any changes made to this file will be
14+
// overwritten during the next generation cycle.
15+
//
16+
// ----------------------------------------------------------------------------
17+
package networkmanagement_test
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This code is generated by Magic Modules using the following:
9+
#
10+
# Configuration: https:#github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/products/networkmanagement/OrganizationVpcFlowLogsConfig.yaml
11+
# Template: https:#github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/templates/terraform/resource.html.markdown.tmpl
12+
#
13+
# DO NOT EDIT this file directly. Any changes made to this file will be
14+
# overwritten during the next generation cycle.
15+
#
16+
# ----------------------------------------------------------------------------
17+
subcategory: "Network Management"
18+
description: |-
19+
VPC Flow Logs Config is a resource that lets you configure Flow Logs for Organization.
20+
---
21+
22+
# google_network_management_organization_vpc_flow_logs_config
23+
24+
VPC Flow Logs Config is a resource that lets you configure Flow Logs for Organization.
25+
26+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
27+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
28+
29+
30+
## Example Usage - Network Management Org Vpc Flow Logs Config Basic
31+
32+
33+
```hcl
34+
resource "google_network_management_organization_vpc_flow_logs_config" "org-test" {
35+
provider = google-beta
36+
vpc_flow_logs_config_id = "basic-org-test-id"
37+
location = "global"
38+
organization = "123456789"
39+
}
40+
```
41+
42+
## Argument Reference
43+
44+
The following arguments are supported:
45+
46+
47+
* `organization` -
48+
(Required)
49+
Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
50+
51+
* `location` -
52+
(Required)
53+
Resource ID segment making up resource `name`. It identifies the resource
54+
within its parent collection as described in https://google.aip.dev/122. See documentation
55+
for resource type `networkmanagement.googleapis.com/VpcFlowLogsConfig`.
56+
57+
* `vpc_flow_logs_config_id` -
58+
(Required)
59+
Required. ID of the `VpcFlowLogsConfig`.
60+
61+
62+
* `description` -
63+
(Optional)
64+
Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum
65+
of 512 characters.
66+
67+
* `state` -
68+
(Optional)
69+
Optional. The state of the VPC Flow Log configuration. Default value
70+
is ENABLED. When creating a new configuration, it must be enabled.
71+
Possible values: ENABLED DISABLED
72+
73+
* `aggregation_interval` -
74+
(Optional)
75+
Optional. The aggregation interval for the logs. Default value is
76+
INTERVAL_5_SEC. Possible values: INTERVAL_5_SEC INTERVAL_30_SEC INTERVAL_1_MIN INTERVAL_5_MIN INTERVAL_10_MIN INTERVAL_15_MIN
77+
78+
* `flow_sampling` -
79+
(Optional)
80+
Optional. The value of the field must be in (0, 1]. The sampling rate
81+
of VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
82+
sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs, use
83+
the state field instead. Default value is 1.0.
84+
85+
* `metadata` -
86+
(Optional)
87+
Optional. Configures whether all, none or a subset of metadata fields
88+
should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA.
89+
Possible values: METADATA_UNSPECIFIED INCLUDE_ALL_METADATA EXCLUDE_ALL_METADATA CUSTOM_METADATA
90+
91+
* `metadata_fields` -
92+
(Optional)
93+
Optional. Custom metadata fields to include in the reported VPC flow
94+
logs. Can only be specified if \"metadata\" was set to CUSTOM_METADATA.
95+
96+
* `filter_expr` -
97+
(Optional)
98+
Optional. Export filter used to define which VPC Flow Logs should be logged.
99+
100+
* `labels` -
101+
(Optional)
102+
Optional. Resource labels to represent the user-provided metadata.
103+
104+
**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
105+
Please refer to the field `effective_labels` for all of the labels present on the resource.
106+
107+
* `cross_project_metadata` -
108+
(Optional)
109+
Determines whether to include cross project annotations in the logs.
110+
This field is available only for organization configurations. If not
111+
specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
112+
Possible values:
113+
CROSS_PROJECT_METADATA_ENABLED
114+
CROSS_PROJECT_METADATA_DISABLED
115+
Possible values are: `CROSS_PROJECT_METADATA_ENABLED`, `CROSS_PROJECT_METADATA_DISABLED`.
116+
117+
118+
119+
## Attributes Reference
120+
121+
In addition to the arguments listed above, the following computed attributes are exported:
122+
123+
* `id` - an identifier for the resource with format `organizations/{{organization}}/locations/{{location}}/vpcFlowLogsConfigs/{{vpc_flow_logs_config_id}}`
124+
125+
* `name` -
126+
Identifier. Unique name of the configuration using the form: `organizations/{org_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
127+
128+
* `create_time` -
129+
Output only. The time the config was created.
130+
131+
* `update_time` -
132+
Output only. The time the config was updated.
133+
134+
* `terraform_labels` -
135+
The combination of labels configured directly on the resource
136+
and default labels configured on the provider.
137+
138+
* `effective_labels` -
139+
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
140+
141+
142+
## Timeouts
143+
144+
This resource provides the following
145+
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
146+
147+
- `create` - Default is 20 minutes.
148+
- `update` - Default is 20 minutes.
149+
- `delete` - Default is 20 minutes.
150+
151+
## Import
152+
153+
154+
OrganizationVpcFlowLogsConfig can be imported using any of these accepted formats:
155+
156+
* `organizations/{{organization}}/locations/{{location}}/vpcFlowLogsConfigs/{{vpc_flow_logs_config_id}}`
157+
* `{{organization}}/{{location}}/{{vpc_flow_logs_config_id}}`
158+
159+
160+
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OrganizationVpcFlowLogsConfig using one of the formats above. For example:
161+
162+
```tf
163+
import {
164+
id = "organizations/{{organization}}/locations/{{location}}/vpcFlowLogsConfigs/{{vpc_flow_logs_config_id}}"
165+
to = google_network_management_organization_vpc_flow_logs_config.default
166+
}
167+
```
168+
169+
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), OrganizationVpcFlowLogsConfig can be imported using one of the formats above. For example:
170+
171+
```
172+
$ terraform import google_network_management_organization_vpc_flow_logs_config.default organizations/{{organization}}/locations/{{location}}/vpcFlowLogsConfigs/{{vpc_flow_logs_config_id}}
173+
$ terraform import google_network_management_organization_vpc_flow_logs_config.default {{organization}}/{{location}}/{{vpc_flow_logs_config_id}}
174+
```

0 commit comments

Comments
 (0)