Membuat pemesanan lokal
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Membuat pemesanan project tunggal untuk jenis mesin N2
Jelajahi lebih lanjut
Untuk dokumentasi mendetail yang menyertakan contoh kode ini, lihat artikel berikut:
Contoh kode
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis content demonstrates how to create a single-project reservation for Google Compute Engine using Terraform.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eshare_type\u003c/code\u003e is set to \u003ccode\u003eLOCAL\u003c/code\u003e within the \u003ccode\u003eshare_settings\u003c/code\u003e block to configure the reservation for a single project.\u003c/p\u003e\n"],["\u003cp\u003eThe reservation is configured to accommodate one instance with the \u003ccode\u003en2-standard-2\u003c/code\u003e machine type.\u003c/p\u003e\n"],["\u003cp\u003eThe configuration does not require affinity to use the reservation via \u003ccode\u003especific_reservation_required\u003c/code\u003e, which defaults to false.\u003c/p\u003e\n"]]],[],null,["# Create a local reservation\n\nCreate a single-project reservation for N2 machine types\n\nExplore further\n---------------\n\n\nFor detailed documentation that includes this code sample, see the following:\n\n- [Create a reservation for a single project](/compute/docs/instances/reservations-single-project)\n\nCode sample\n-----------\n\n### Terraform\n\n\nTo learn how to apply or remove a Terraform configuration, see\n[Basic Terraform commands](/docs/terraform/basic-commands).\n\n\nFor more information, see the\n[Terraform provider reference documentation](https://registry.terraform.io/providers/hashicorp/google/latest/docs).\n\n\n resource \"google_compute_reservation\" \"default\" {\n name = \"gce-reservation-local\"\n zone = \"us-central1-a\"\n\n /**\n * To specify a single-project reservation, omit the share_settings block\n * (default) or set the share_type field to LOCAL.\n */\n share_settings {\n share_type = \"LOCAL\"\n }\n\n specific_reservation {\n count = 1\n instance_properties {\n machine_type = \"n2-standard-2\"\n }\n }\n\n /**\n * To let VMs with affinity for any reservation consume this reservation, omit\n * the specific_reservation_required field (default) or set it to false.\n */\n specific_reservation_required = false\n }\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=compute)."]]