File tree Expand file tree Collapse file tree 9 files changed +18
-23
lines changed
infra/gcp/terraform/k8s-infra-gcp-gcve Expand file tree Collapse file tree 9 files changed +18
-23
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ limitations under the License.
1515*/
1616
1717variable "project_id" {
18- description = " The project ID to use for the maintenance jumphost ."
18+ description = " The project ID to use for the gcve cluster ."
1919 default = " broadcom-451918"
20+ type = string
2021}
2122
2223# Read the secret from Secret Manager which contains the wireguard server configuration.
@@ -25,7 +26,7 @@ data "google_secret_manager_secret_version_access" "wireguard-config" {
2526 secret = " maintenance-vm-wireguard-config"
2627}
2728
28- # Creates the maintenance jumphost which runs SSH and a wireguard server.
29+ # Create the maintenance jumphost which runs SSH and a wireguard server.
2930resource "google_compute_instance" "jumphost" {
3031 project = var. project_id
3132 name = " maintenance-jumphost"
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ This file defines:
2121*/
2222
2323terraform {
24+ required_version = " 1.10.5"
2425
2526 backend "gcs" {
2627 bucket = " k8s-infra-tf-gcp-gcve"
Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ This file defines:
2222
2323terraform {
2424 required_version = " 1.10.5"
25+
2526 backend "gcs" {
2627 bucket = " k8s-infra-tf-gcp-gcve"
2728 prefix = " k8s-infra-gcp-gcve"
2829 }
2930
30-
3131 required_providers {
3232 google = {
3333 source = " hashicorp/google"
Original file line number Diff line number Diff line change @@ -17,4 +17,5 @@ limitations under the License.
1717variable "project_id" {
1818 description = " The project ID to use for the gcve cluster."
1919 default = " broadcom-451918"
20+ type = string
2021}
Original file line number Diff line number Diff line change @@ -32,23 +32,11 @@ data "vsphere_datastore" "datastore" {
3232 datacenter_id = data. vsphere_datacenter . datacenter . id
3333}
3434
35- data "vsphere_role" "read-only" {
36- label = " Read-only"
37- }
38-
39- data "vsphere_role" "no-access" {
40- label = " No access"
41- }
42-
4335data "vsphere_network" "network" {
4436 name = var. vsphere_network_name
4537 datacenter_id = data. vsphere_datacenter . datacenter . id
4638}
4739
48- data "vsphere_folder" "global" {
49- path = " /"
50- }
51-
5240# Resources from NSX-T.
5341
5442data "nsxt_policy_tier1_gateway" "tier1_gw" {
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ limitations under the License.
1515*/
1616
1717terraform {
18+ required_version = " 1.10.5"
19+
1820 required_providers {
1921 vsphere = {
2022 source = " vmware/vsphere"
Original file line number Diff line number Diff line change @@ -14,14 +14,20 @@ See the License for the specific language governing permissions and
1414limitations under the License.
1515*/
1616
17+ /*
18+ This file defines:
19+ - Required provider versions
20+ - Storage backend details
21+ */
22+
1723terraform {
24+ required_version = " 1.10.5"
1825
1926 backend "gcs" {
2027 bucket = " k8s-infra-tf-gcp-gcve"
2128 prefix = " k8s-infra-gcp-gcve-vcenter"
2229 }
2330
24-
2531 required_providers {
2632 google = {
2733 source = " hashicorp/google"
Original file line number Diff line number Diff line change @@ -47,13 +47,9 @@ function initBoskosResourceUserData() {
4747 boskos_data=' {"ipPool":"' " ${ipPool} " ' ","resourcePool":"' " ${resourcePool} " ' ","folder":"' " ${folder} " ' "}'
4848
4949 # acquire from "dirty" or "free" state
50- ACQUIRED=1
5150 curl -s -X POST " ${BOSKOS_HOST} /acquirebystate?names=${resourceName} &state=dirty&dest=busy&owner=$( whoami) " | grep -q " ${resourceName} " \
5251 || curl -s -X POST " ${BOSKOS_HOST} /acquirebystate?names=${resourceName} &state=free&dest=busy&owner=$( whoami) " | grep -q " ${resourceName} " \
53- || ( echo " Failed to acquire ${resourceName} " ; ACQUIRED=0)
54- if [[ " ${ACQUIRED} " -eq 0 ]]; then
55- echo " Failed to acquire project ${resourceName} "
56- fi
52+ || echo " Failed to acquire ${resourceName} "
5753
5854 # update resource
5955 echo " Updating resource ${resourceName} with following data: ${boskos_data} "
Original file line number Diff line number Diff line change @@ -39,13 +39,13 @@ resource "vsphere_tag_category" "category_k8s_zone" {
3939# Creates the Datacenter tag for the k8s-region tag category for failure domain testing.
4040resource "vsphere_tag" "tag_k8s_region" {
4141 name = var. vsphere_datacenter
42- category_id = " ${ vsphere_tag_category . category_k8s_region . id } "
42+ category_id = vsphere_tag_category. category_k8s_region . id
4343 description = " Managed by Terraform"
4444}
4545
4646# Creates the Compute Cluster tag for the k8s-zone tag category for failure domain testing.
4747resource "vsphere_tag" "tag_k8s_zone" {
4848 name = var. vsphere_cluster
49- category_id = " ${ vsphere_tag_category . category_k8s_zone . id } "
49+ category_id = vsphere_tag_category. category_k8s_zone . id
5050 description = " Managed by Terraform"
5151}
You can’t perform that action at this time.
0 commit comments