Unit class

A Unit is the fundamental structural building block of a SaaS offering. Each Unit is an instance of a UnitKind. It is a versioned, manageable component of a service that has its own lifecycle, representing elements like infrastructure, workloads, or an entire application stack that a service producer intends to manage as a single entity.

Example Usage

Saas Runtime Unit Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const exampleSaasRegional = new gcp.saasruntime.SaaS("example_saas_regional", {
    saasId: "example-saas",
    location: "us-central1",
    locations: [{
        name: "us-central1",
    }],
});
const exampleUnitKind = new gcp.saasruntime.UnitKind("example_unit_kind", {
    location: "us-central1",
    unitKindId: "example-unitkind",
    saas: exampleSaasRegional.id,
});
const example = new gcp.saasruntime.Unit("example", {
    location: "us-central1",
    unitId: "example-unit",
    unitKind: exampleUnitKind.id,
    managementMode: "MANAGEMENT_MODE_USER",
});
import pulumi
import pulumi_gcp as gcp

example_saas_regional = gcp.saasruntime.SaaS("example_saas_regional",
    saas_id="example-saas",
    location="us-central1",
    locations=[{
        "name": "us-central1",
    }])
example_unit_kind = gcp.saasruntime.UnitKind("example_unit_kind",
    location="us-central1",
    unit_kind_id="example-unitkind",
    saas=example_saas_regional.id)
example = gcp.saasruntime.Unit("example",
    location="us-central1",
    unit_id="example-unit",
    unit_kind=example_unit_kind.id,
    management_mode="MANAGEMENT_MODE_USER")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var exampleSaasRegional = new Gcp.SaaSRuntime.SaaS("example_saas_regional", new()
    {
        SaasId = "example-saas",
        Location = "us-central1",
        Locations = new[]
        {
            new Gcp.SaaSRuntime.Inputs.SaaSLocationArgs
            {
                Name = "us-central1",
            },
        },
    });

    var exampleUnitKind = new Gcp.SaaSRuntime.UnitKind("example_unit_kind", new()
    {
        Location = "us-central1",
        UnitKindId = "example-unitkind",
        Saas = exampleSaasRegional.Id,
    });

    var example = new Gcp.SaaSRuntime.Unit("example", new()
    {
        Location = "us-central1",
        UnitId = "example-unit",
        UnitKind = exampleUnitKind.Id,
        ManagementMode = "MANAGEMENT_MODE_USER",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/saasruntime"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleSaasRegional, err := saasruntime.NewSaaS(ctx, "example_saas_regional", &saasruntime.SaaSArgs{
			SaasId:   pulumi.String("example-saas"),
			Location: pulumi.String("us-central1"),
			Locations: saasruntime.SaaSLocationArray{
				&saasruntime.SaaSLocationArgs{
					Name: pulumi.String("us-central1"),
				},
			},
		})
		if err != nil {
			return err
		}
		exampleUnitKind, err := saasruntime.NewUnitKind(ctx, "example_unit_kind", &saasruntime.UnitKindArgs{
			Location:   pulumi.String("us-central1"),
			UnitKindId: pulumi.String("example-unitkind"),
			Saas:       exampleSaasRegional.ID().ToIDOutput().ToStringOutput(),
		})
		if err != nil {
			return err
		}
		_, err = saasruntime.NewUnit(ctx, "example", &saasruntime.UnitArgs{
			Location:       pulumi.String("us-central1"),
			UnitId:         pulumi.String("example-unit"),
			UnitKind:       exampleUnitKind.ID().ToIDOutput().ToStringOutput(),
			ManagementMode: pulumi.String("MANAGEMENT_MODE_USER"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_saasruntime_saas" "example_saas_regional" {
  saas_id  = "example-saas"
  location = "us-central1"
  locations {
    name = "us-central1"
  }
}
resource "gcp_saasruntime_unitkind" "example_unit_kind" {
  location     = "us-central1"
  unit_kind_id = "example-unitkind"
  saas         = gcp_saasruntime_saas.example_saas_regional.id
}
resource "gcp_saasruntime_unit" "example" {
  location        = "us-central1"
  unit_id         = "example-unit"
  unit_kind       = gcp_saasruntime_unitkind.example_unit_kind.id
  management_mode = "MANAGEMENT_MODE_USER"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.saasruntime.SaaS;
import com.pulumi.gcp.saasruntime.SaaSArgs;
import com.pulumi.gcp.saasruntime.inputs.SaaSLocationArgs;
import com.pulumi.gcp.saasruntime.UnitKind;
import com.pulumi.gcp.saasruntime.UnitKindArgs;
import com.pulumi.gcp.saasruntime.Unit;
import com.pulumi.gcp.saasruntime.UnitArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleSaasRegional = new SaaS("exampleSaasRegional", SaaSArgs.builder()
            .saasId("example-saas")
            .location("us-central1")
            .locations(SaaSLocationArgs.builder()
                .name("us-central1")
                .build())
            .build());

        var exampleUnitKind = new UnitKind("exampleUnitKind", UnitKindArgs.builder()
            .location("us-central1")
            .unitKindId("example-unitkind")
            .saas(exampleSaasRegional.id())
            .build());

        var example = new Unit("example", UnitArgs.builder()
            .location("us-central1")
            .unitId("example-unit")
            .unitKind(exampleUnitKind.id())
            .managementMode("MANAGEMENT_MODE_USER")
            .build());

    }
}
resources:
  exampleSaasRegional:
    type: gcp:saasruntime:SaaS
    name: example_saas_regional
    properties:
      saasId: example-saas
      location: us-central1
      locations:
        - name: us-central1
  exampleUnitKind:
    type: gcp:saasruntime:UnitKind
    name: example_unit_kind
    properties:
      location: us-central1
      unitKindId: example-unitkind
      saas: ${exampleSaasRegional.id}
  example:
    type: gcp:saasruntime:Unit
    properties:
      location: us-central1
      unitId: example-unit
      unitKind: ${exampleUnitKind.id}
      managementMode: MANAGEMENT_MODE_USER

Import

Unit can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/units/{{unit_id}}
  • {{project}}/{{location}}/{{unit_id}}
  • {{location}}/{{unit_id}}

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

$ pulumi import gcp:saasruntime/unit:Unit default projects/{{project}}/locations/{{location}}/units/{{unit_id}}
$ pulumi import gcp:saasruntime/unit:Unit default {{project}}/{{location}}/{{unit_id}}
$ pulumi import gcp:saasruntime/unit:Unit default {{location}}/{{unit_id}}

Constructors

Unit(String name, {UnitArgs? args, CustomResourceOptions? options})
Creates a new Unit. name The Pulumi resource name. args Arguments used to configure this Unit. The set of arguments for Unit. options Resource options controlling this resource's behavior.
Unit.reference(String urn)
Creates a typed reference to an existing Unit resource.

Properties

annotations ↔ Output<Map<String, String>?>
Annotations is an unstructured key-value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/user-guide/annotations Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effectiveAnnotations for all of the annotations present on the resource.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
conditions ↔ Output<List<UnitCondition>>
A set of conditions which indicate the various conditions this resource can have. Structure is documented below.
latefinal
createTime ↔ Output<String>
The timestamp when the resource was created.
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
dependencies ↔ Output<List<UnitDependency>>
Set of dependencies for this unit. Maximum 10. Structure is documented below.
latefinal
dependents ↔ Output<List<UnitDependent>>
List of Units that depend on this unit. Unit can only be deprovisioned if this list is empty. Maximum 1000. Structure is documented below.
latefinal
effectiveAnnotations ↔ Output<Map<String, String>>
All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
latefinal
effectiveLabels ↔ Output<Map<String, String>>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
inputVariables ↔ Output<List<UnitInputVariable>>
Indicates the current input variables deployed by the unit Structure is documented below.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
labels ↔ Output<Map<String, String>?>
The labels on the resource, which can be used for categorization. similar to Kubernetes resource labels. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.
latefinal
location ↔ Output<String>
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
latefinal
maintenance ↔ Output<UnitMaintenance?>
Captures requested directives for performing future maintenance on the unit. This includes a request for the unit to skip maintenance for a period of time and remain pinned to its current release as well as controls for postponing maintenance scheduled in future. Structure is documented below.
latefinal
managementMode ↔ Output<String?>
Indicates whether the Unit life cycle is controlled by the user or by the system. Immutable once created. Possible values: MANAGEMENT_MODE_USER MANAGEMENT_MODE_SYSTEM
latefinal
name ↔ Output<String>
Identifier. The resource name (full URI of the resource) following the standard naming scheme: "projects/{project}/locations/{location}/units/{unit}"
latefinal
ongoingOperations ↔ Output<List<String>>
List of concurrent UnitOperations that are operating on this Unit.
latefinal
outputVariables ↔ Output<List<UnitOutputVariable>>
Set of key/value pairs corresponding to output variables from execution of actuation templates. The variables are declared in actuation configs (e.g in helm chart or terraform) and the values are fetched and returned by the actuation engine upon completion of execution. Structure is documented below.
latefinal
pendingOperations ↔ Output<List<String>>
List of pending (wait to be executed) UnitOperations for this unit.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
pulumiLabels ↔ Output<Map<String, String>>
The combination of labels configured directly on the resource and default labels configured on the provider.
latefinal
release ↔ Output<String>
The current Release object for this Unit.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scheduledOperations ↔ Output<List<String>>
List of scheduled UnitOperations for this unit.
latefinal
state ↔ Output<String>
Current lifecycle state of the resource (e.g. if it's being created or ready to use). Possible values: UNIT_STATE_NOT_PROVISIONED UNIT_STATE_PROVISIONING UNIT_STATE_UPDATING UNIT_STATE_DEPROVISIONING UNIT_STATE_READY UNIT_STATE_ERROR
latefinal
systemCleanupAt ↔ Output<String>
If set, indicates the time when the system will start removing the unit.
latefinal
systemManagedState ↔ Output<String>
Indicates the system managed state of the unit. Possible values: SYSTEM_MANAGED_STATE_ACTIVE SYSTEM_MANAGED_STATE_INACTIVE SYSTEM_MANAGED_STATE_DECOMMISSIONED
latefinal
tenant ↔ Output<String?>
Reference to the Saas Tenant resource this unit belongs to. This for example informs the maintenance policies to use for scheduling future updates on a unit. (optional and immutable once created)
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
uid ↔ Output<String>
The unique identifier of the resource. UID is unique in the time and space for this resource within the scope of the service. It is typically generated by the server on successful creation of a resource and must not be changed. UID is used to uniquely identify resources with resource name reuses. This should be a UUID4.
latefinal
unitId ↔ Output<String>
The ID value for the new unit.
latefinal
unitKind ↔ Output<String?>
Reference to the UnitKind this Unit belongs to. Immutable once set.
latefinal
updateTime ↔ Output<String>
The timestamp when the resource was last updated. Any change to the resource made by users must refresh this value. Changes to a resource made by the service should refresh this value.
latefinal
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {UnitState? state, CustomResourceOptions? options}) → Unit
Gets an existing Unit resource's state with the given name and id.