Skip to content

Commit

Permalink
test: adding test for example_google_compute_network_endpoint_group r… (
Browse files Browse the repository at this point in the history
  • Loading branch information
delimaneto authored and BBBmau committed May 8, 2024
1 parent a198e02 commit c0f4778
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[
{
"name": "//compute.googleapis.com/projects/{{.Provider.project}}/global/networks/neg-network",
"asset_type": "compute.googleapis.com/Network",
"resource": {
"version": "beta",
"discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/compute/beta/rest",
"discovery_name": "Network",
"parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
"data": {
"autoCreateSubnetworks": false,
"name": "neg-network"
}
},
"ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}"
},
{
"name": "//compute.googleapis.com/projects/{{.Provider.project}}/regions/us-central1/subnetworks/neg-subnetwork",
"asset_type": "compute.googleapis.com/Subnetwork",
"resource": {
"version": "beta",
"discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/compute/beta/rest",
"discovery_name": "Subnetwork",
"parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
"data": {
"ipCidrRange": "10.0.0.0/16",
"logConfig": {
"enable": false
},
"name": "neg-subnetwork",
"region": "projects/{{.Provider.project}}/global/regions/us-central1"
}
},
"ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.84"
}
}
}

provider "google" {
{{if .Provider.credentials }}credentials = "{{.Provider.credentials}}"{{end}}
}

resource "google_compute_network_endpoint_group" "neg" {
name = "my-lb-neg"
network = google_compute_network.default.id
subnetwork = google_compute_subnetwork.default.id
default_port = "90"
zone = "us-central1-a"
}

resource "google_compute_network" "default" {
name = "neg-network"
auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "default" {
name = "neg-subnetwork"
ip_cidr_range = "10.0.0.0/16"
region = "us-central1"
network = google_compute_network.default.id
}

0 comments on commit c0f4778

Please sign in to comment.