pulumi_wasm_providers_gcp_mini::compute

Module region_commitment

source
Expand description

Represents a regional Commitment resource.

Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates.

To get more information about RegionCommitment, see:

§Example Usage

§Compute Region Commitment Basic

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let foobar = region_commitment::create(
        "foobar",
        RegionCommitmentArgs::builder()
            .name("my-region-commitment")
            .plan("THIRTY_SIX_MONTH")
            .resources(
                vec![
                    RegionCommitmentResource::builder().amount("4"). type ("VCPU")
                    .build_struct(), RegionCommitmentResource::builder().amount("9").
                    type ("MEMORY").build_struct(),
                ],
            )
            .build_struct(),
    );
}

§Compute Region Commitment Full

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let foobar = region_commitment::create(
        "foobar",
        RegionCommitmentArgs::builder()
            .auto_renew(true)
            .category("MACHINE")
            .description("some description")
            .name("my-full-commitment")
            .plan("THIRTY_SIX_MONTH")
            .resources(
                vec![
                    RegionCommitmentResource::builder().amount("4"). type ("VCPU")
                    .build_struct(), RegionCommitmentResource::builder().amount("9").
                    type ("MEMORY").build_struct(),
                ],
            )
            .type_("MEMORY_OPTIMIZED")
            .build_struct(),
    );
}

§Import

RegionCommitment can be imported using any of these accepted formats:

  • projects/{{project}}/regions/{{region}}/commitments/{{name}}

  • {{project}}/{{region}}/{{name}}

  • {{region}}/{{name}}

  • {{name}}

When using the pulumi import command, RegionCommitment can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/regionCommitment:RegionCommitment default projects/{{project}}/regions/{{region}}/commitments/{{name}}
$ pulumi import gcp:compute/regionCommitment:RegionCommitment default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:compute/regionCommitment:RegionCommitment default {{region}}/{{name}}
$ pulumi import gcp:compute/regionCommitment:RegionCommitment default {{name}}

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments