Skip to content

Commit

Permalink
chore: adding command to set Network Service Tier for a project (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark1000 authored Apr 22, 2021
1 parent 94967b8 commit 383f369
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/network_service_tiers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Network Service Tier

This example configures the Network Service Tier for a project.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| project\_id | The project ID to set the Network Service Tier in | `any` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| project\_id | Google Cloud project ID |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

31 changes: 31 additions & 0 deletions examples/network_service_tiers/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* 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.
*/

provider "null" {
version = "~> 2.1"
}

provider "google" {
version = "~> 3.45.0"
}

# [START networkservicetiers_project_tier_set]
resource "google_compute_project_default_network_tier" "project-tier" {
project = var.project_id # Replace this with your project ID in quotes
network_tier = "STANDARD"
}
# [END networkservicetiers_project_tier_set]

21 changes: 21 additions & 0 deletions examples/network_service_tiers/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* 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.
*/

output "project_id" {
value = google_compute_project_default_network_tier.project-tier.project
description = "Google Cloud project ID"
}

20 changes: 20 additions & 0 deletions examples/network_service_tiers/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* 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.
*/

variable "project_id" {
description = "The project ID to set the Network Service Tier in"
}

20 changes: 20 additions & 0 deletions examples/network_service_tiers/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* 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_version = ">=0.12.6"
}

0 comments on commit 383f369

Please sign in to comment.