Skip to content

Commit

Permalink
feat(networksecurity): add tags for all resources in Mirroring docs (#…
Browse files Browse the repository at this point in the history
…807)

* feat(networksecurity): add tags for all resources in Mirroring docs

* Change tags from _new_ to _create_

Also dropping the _cons_ and _prod_ prefixes.
  • Loading branch information
duvni authored Jan 21, 2025
1 parent 48fd8a0 commit 7ecba61
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions network_security/mirroring/basic/consumer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,47 @@
*/

# [START networksecurity_mirroring_basic_consumer]
# [START networksecurity_mirroring_create_producer_network_tf]
resource "google_compute_network" "producer_network" {
provider = google-beta
name = "producer-network"
auto_create_subnetworks = false
}
# [END networksecurity_mirroring_create_producer_network_tf]

# [START networksecurity_mirroring_create_consumer_network_tf]
resource "google_compute_network" "consumer_network" {
provider = google-beta
name = "consumer-network"
auto_create_subnetworks = false
}
# [END networksecurity_mirroring_create_consumer_network_tf]

# [START networksecurity_mirroring_create_producer_deployment_group_tf]
resource "google_network_security_mirroring_deployment_group" "default" {
provider = google-beta
mirroring_deployment_group_id = "mirroring-deployment-group"
location = "global"
network = google_compute_network.producer_network.id
}
# [END networksecurity_mirroring_create_producer_deployment_group_tf]

# [START networksecurity_mirroring_create_endpoint_group_tf]
resource "google_network_security_mirroring_endpoint_group" "default" {
provider = google-beta
mirroring_endpoint_group_id = "mirroring-endpoint-group"
location = "global"
mirroring_deployment_group = google_network_security_mirroring_deployment_group.default.id
}
# [END networksecurity_mirroring_create_endpoint_group_tf]

# [START networksecurity_mirroring_create_endpoint_group_association_tf]
resource "google_network_security_mirroring_endpoint_group_association" "default" {
provider = google-beta
mirroring_endpoint_group_association_id = "mirroring-endpoint-group-association"
location = "global"
network = google_compute_network.consumer_network.id
mirroring_endpoint_group = google_network_security_mirroring_endpoint_group.default.id
}
# [END networksecurity_mirroring_create_endpoint_group_association_tf]
# [END networksecurity_mirroring_basic_consumer]
14 changes: 14 additions & 0 deletions network_security/mirroring/basic/producer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,25 @@
*/

# [START networksecurity_mirroring_basic_producer]
# [START networksecurity_mirroring_create_network_tf]
resource "google_compute_network" "default" {
provider = google-beta
name = "producer-network"
auto_create_subnetworks = false
}
# [END networksecurity_mirroring_create_network_tf]

# [START networksecurity_mirroring_create_subnetwork_tf]
resource "google_compute_subnetwork" "default" {
provider = google-beta
name = "producer-subnet"
region = "us-central1"
ip_cidr_range = "10.1.0.0/16"
network = google_compute_network.default.name
}
# [END networksecurity_mirroring_create_subnetwork_tf]

# [START networksecurity_mirroring_create_health_check_tf]
resource "google_compute_region_health_check" "default" {
provider = google-beta
name = "deploymnet-hc"
Expand All @@ -37,7 +42,9 @@ resource "google_compute_region_health_check" "default" {
port = 80
}
}
# [END networksecurity_mirroring_create_health_check_tf]

# [START networksecurity_mirroring_create_backend_service_tf]
resource "google_compute_region_backend_service" "default" {
provider = google-beta
name = "deployment-svc"
Expand All @@ -46,7 +53,9 @@ resource "google_compute_region_backend_service" "default" {
protocol = "UDP"
load_balancing_scheme = "INTERNAL"
}
# [END networksecurity_mirroring_create_backend_service_tf]

# [START networksecurity_mirroring_create_forwarding_rule_tf]
resource "google_compute_forwarding_rule" "default" {
provider = google-beta
name = "deployment-fr"
Expand All @@ -59,19 +68,24 @@ resource "google_compute_forwarding_rule" "default" {
ip_protocol = "UDP"
is_mirroring_collector = true
}
# [END networksecurity_mirroring_create_forwarding_rule_tf]

# [START networksecurity_mirroring_create_deployment_group_tf]
resource "google_network_security_mirroring_deployment_group" "default" {
provider = google-beta
mirroring_deployment_group_id = "mirroring-deployment-group"
location = "global"
network = google_compute_network.default.id
}
# [END networksecurity_mirroring_create_deployment_group_tf]

# [START networksecurity_mirroring_create_deployment_tf]
resource "google_network_security_mirroring_deployment" "default" {
provider = google-beta
mirroring_deployment_id = "mirroring-deployment"
location = "us-central1-a"
forwarding_rule = google_compute_forwarding_rule.default.id
mirroring_deployment_group = google_network_security_mirroring_deployment_group.default.id
}
# [END networksecurity_mirroring_create_deployment_tf]
# [END networksecurity_mirroring_basic_producer]

0 comments on commit 7ecba61

Please sign in to comment.