Skip to content

Commit 054e5ae

Browse files
compute_vm_packet_mirror sample (#4930) (#3401)
Signed-off-by: Modular Magician <[email protected]>
1 parent 6009d25 commit 054e5ae

File tree

4 files changed

+49
-43
lines changed

4 files changed

+49
-43
lines changed

.changelog/4930.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_compute_packet_mirroring_generated_test.go

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,6 @@ resource "google_compute_instance" "mirror" {
6666
}
6767
}
6868
69-
resource "google_compute_packet_mirroring" "foobar" {
70-
name = "tf-test-my-mirroring%{random_suffix}"
71-
description = "bar"
72-
network {
73-
url = google_compute_network.default.id
74-
}
75-
collector_ilb {
76-
url = google_compute_forwarding_rule.default.id
77-
}
78-
mirrored_resources {
79-
tags = ["foo"]
80-
instances {
81-
url = google_compute_instance.mirror.id
82-
}
83-
}
84-
filter {
85-
ip_protocols = ["tcp"]
86-
cidr_ranges = ["0.0.0.0/0"]
87-
direction = "BOTH"
88-
}
89-
}
9069
resource "google_compute_network" "default" {
9170
name = "tf-test-my-network%{random_suffix}"
9271
}
@@ -125,6 +104,28 @@ resource "google_compute_forwarding_rule" "default" {
125104
subnetwork = google_compute_subnetwork.default.id
126105
network_tier = "PREMIUM"
127106
}
107+
108+
resource "google_compute_packet_mirroring" "foobar" {
109+
name = "tf-test-my-mirroring%{random_suffix}"
110+
description = "bar"
111+
network {
112+
url = google_compute_network.default.id
113+
}
114+
collector_ilb {
115+
url = google_compute_forwarding_rule.default.id
116+
}
117+
mirrored_resources {
118+
tags = ["foo"]
119+
instances {
120+
url = google_compute_instance.mirror.id
121+
}
122+
}
123+
filter {
124+
ip_protocols = ["tcp"]
125+
cidr_ranges = ["0.0.0.0/0"]
126+
direction = "BOTH"
127+
}
128+
}
128129
`, context)
129130
}
130131

google-beta/resource_dataproc_cluster_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import (
1313
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1414
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
1515

16-
dataproc "google.golang.org/api/dataproc/v1beta2"
1716
"google.golang.org/api/googleapi"
17+
18+
dataproc "google.golang.org/api/dataproc/v1beta2"
1819
)
1920

2021
func TestDataprocExtractInitTimeout(t *testing.T) {

website/docs/r/compute_packet_mirroring.html.markdown

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,6 @@ resource "google_compute_instance" "mirror" {
5959
}
6060
}
6161
62-
resource "google_compute_packet_mirroring" "foobar" {
63-
name = "my-mirroring"
64-
description = "bar"
65-
network {
66-
url = google_compute_network.default.id
67-
}
68-
collector_ilb {
69-
url = google_compute_forwarding_rule.default.id
70-
}
71-
mirrored_resources {
72-
tags = ["foo"]
73-
instances {
74-
url = google_compute_instance.mirror.id
75-
}
76-
}
77-
filter {
78-
ip_protocols = ["tcp"]
79-
cidr_ranges = ["0.0.0.0/0"]
80-
direction = "BOTH"
81-
}
82-
}
8362
resource "google_compute_network" "default" {
8463
name = "my-network"
8564
}
@@ -118,6 +97,28 @@ resource "google_compute_forwarding_rule" "default" {
11897
subnetwork = google_compute_subnetwork.default.id
11998
network_tier = "PREMIUM"
12099
}
100+
101+
resource "google_compute_packet_mirroring" "foobar" {
102+
name = "my-mirroring"
103+
description = "bar"
104+
network {
105+
url = google_compute_network.default.id
106+
}
107+
collector_ilb {
108+
url = google_compute_forwarding_rule.default.id
109+
}
110+
mirrored_resources {
111+
tags = ["foo"]
112+
instances {
113+
url = google_compute_instance.mirror.id
114+
}
115+
}
116+
filter {
117+
ip_protocols = ["tcp"]
118+
cidr_ranges = ["0.0.0.0/0"]
119+
direction = "BOTH"
120+
}
121+
}
121122
```
122123

123124
## Argument Reference

0 commit comments

Comments
 (0)