Create a single-project reservation for N2 machine types

## Explore further


For detailed documentation that includes this code sample, see the following:

- [Create a reservation for a single project](https://docs.cloud.google.com/compute/docs/instances/reservations-single-project)

## Code sample

### Terraform


To learn how to apply or remove a Terraform configuration, see
[Basic Terraform commands](https://docs.cloud.google.com/docs/terraform/basic-commands).


For more information, see the
[Terraform provider reference documentation](https://registry.terraform.io/providers/hashicorp/google/latest/docs).


    resource "google_compute_reservation" "default" {
      name = "gce-reservation-local"
      zone = "us-central1-b"

      /**
       * To specify a single-project reservation, omit the share_settings block
       * (default) or set the share_type field to LOCAL.
       */
      share_settings {
        share_type = "LOCAL"
      }

      specific_reservation {
        count = 1
        instance_properties {
          machine_type = "e2-micro"
        }
      }

      /**
       * To let VMs with affinity for any reservation consume this reservation, omit
       * the specific_reservation_required field (default) or set it to false.
       */
      specific_reservation_required = false
    }

## What's next


To search and filter code samples for other Google Cloud products, see the
[Google Cloud sample browser](https://docs.cloud.google.com/docs/samples?product=computeengine).