gcp.compute.InstanceSettings
Explore with Pulumi AI
Represents an Instance Settings resource. Instance settings are centralized configuration parameters that allow users to configure the default values for specific VM parameters that are normally set using GCE instance API methods.
To get more information about InstanceSettings, see:
- API documentation
- How-to Guides
Example Usage
Instance Settings Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const gceInstanceSettings = new gcp.compute.InstanceSettings("gce_instance_settings", {
zone: "us-east7-b",
metadata: {
items: {
foo: "baz",
},
},
});
import pulumi
import pulumi_gcp as gcp
gce_instance_settings = gcp.compute.InstanceSettings("gce_instance_settings",
zone="us-east7-b",
metadata=gcp.compute.InstanceSettingsMetadataArgs(
items={
"foo": "baz",
},
))
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewInstanceSettings(ctx, "gce_instance_settings", &compute.InstanceSettingsArgs{
Zone: pulumi.String("us-east7-b"),
Metadata: &compute.InstanceSettingsMetadataArgs{
Items: pulumi.StringMap{
"foo": pulumi.String("baz"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var gceInstanceSettings = new Gcp.Compute.InstanceSettings("gce_instance_settings", new()
{
Zone = "us-east7-b",
Metadata = new Gcp.Compute.Inputs.InstanceSettingsMetadataArgs
{
Items =
{
{ "foo", "baz" },
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.InstanceSettings;
import com.pulumi.gcp.compute.InstanceSettingsArgs;
import com.pulumi.gcp.compute.inputs.InstanceSettingsMetadataArgs;
import java.util.List;
import java.util.ArrayList;
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 gceInstanceSettings = new InstanceSettings("gceInstanceSettings", InstanceSettingsArgs.builder()
.zone("us-east7-b")
.metadata(InstanceSettingsMetadataArgs.builder()
.items(Map.of("foo", "baz"))
.build())
.build());
}
}
resources:
gceInstanceSettings:
type: gcp:compute:InstanceSettings
name: gce_instance_settings
properties:
zone: us-east7-b
metadata:
items:
foo: baz
Create InstanceSettings Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new InstanceSettings(name: string, args: InstanceSettingsArgs, opts?: CustomResourceOptions);
@overload
def InstanceSettings(resource_name: str,
args: InstanceSettingsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def InstanceSettings(resource_name: str,
opts: Optional[ResourceOptions] = None,
zone: Optional[str] = None,
metadata: Optional[InstanceSettingsMetadataArgs] = None,
project: Optional[str] = None)
func NewInstanceSettings(ctx *Context, name string, args InstanceSettingsArgs, opts ...ResourceOption) (*InstanceSettings, error)
public InstanceSettings(string name, InstanceSettingsArgs args, CustomResourceOptions? opts = null)
public InstanceSettings(String name, InstanceSettingsArgs args)
public InstanceSettings(String name, InstanceSettingsArgs args, CustomResourceOptions options)
type: gcp:compute:InstanceSettings
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args InstanceSettingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args InstanceSettingsArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args InstanceSettingsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceSettingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InstanceSettingsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var instanceSettingsResource = new Gcp.Compute.InstanceSettings("instanceSettingsResource", new()
{
Zone = "string",
Metadata = new Gcp.Compute.Inputs.InstanceSettingsMetadataArgs
{
Items =
{
{ "string", "string" },
},
},
Project = "string",
});
example, err := compute.NewInstanceSettings(ctx, "instanceSettingsResource", &compute.InstanceSettingsArgs{
Zone: pulumi.String("string"),
Metadata: &compute.InstanceSettingsMetadataArgs{
Items: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
Project: pulumi.String("string"),
})
var instanceSettingsResource = new InstanceSettings("instanceSettingsResource", InstanceSettingsArgs.builder()
.zone("string")
.metadata(InstanceSettingsMetadataArgs.builder()
.items(Map.of("string", "string"))
.build())
.project("string")
.build());
instance_settings_resource = gcp.compute.InstanceSettings("instanceSettingsResource",
zone="string",
metadata=gcp.compute.InstanceSettingsMetadataArgs(
items={
"string": "string",
},
),
project="string")
const instanceSettingsResource = new gcp.compute.InstanceSettings("instanceSettingsResource", {
zone: "string",
metadata: {
items: {
string: "string",
},
},
project: "string",
});
type: gcp:compute:InstanceSettings
properties:
metadata:
items:
string: string
project: string
zone: string
InstanceSettings Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The InstanceSettings resource accepts the following input properties:
- Zone string
- A reference to the zone where the machine resides.
- Metadata
Instance
Settings Metadata - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Zone string
- A reference to the zone where the machine resides.
- Metadata
Instance
Settings Metadata Args - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- zone String
- A reference to the zone where the machine resides.
- metadata
Instance
Settings Metadata - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- zone string
- A reference to the zone where the machine resides.
- metadata
Instance
Settings Metadata - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- zone str
- A reference to the zone where the machine resides.
- metadata
Instance
Settings Metadata Args - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- zone String
- A reference to the zone where the machine resides.
- metadata Property Map
- The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the InstanceSettings resource produces the following output properties:
- Fingerprint string
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Id string
- The provider-assigned unique ID for this managed resource.
- Fingerprint string
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Id string
- The provider-assigned unique ID for this managed resource.
- fingerprint String
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- id String
- The provider-assigned unique ID for this managed resource.
- fingerprint string
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- id string
- The provider-assigned unique ID for this managed resource.
- fingerprint str
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- id str
- The provider-assigned unique ID for this managed resource.
- fingerprint String
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing InstanceSettings Resource
Get an existing InstanceSettings resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: InstanceSettingsState, opts?: CustomResourceOptions): InstanceSettings
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
fingerprint: Optional[str] = None,
metadata: Optional[InstanceSettingsMetadataArgs] = None,
project: Optional[str] = None,
zone: Optional[str] = None) -> InstanceSettings
func GetInstanceSettings(ctx *Context, name string, id IDInput, state *InstanceSettingsState, opts ...ResourceOption) (*InstanceSettings, error)
public static InstanceSettings Get(string name, Input<string> id, InstanceSettingsState? state, CustomResourceOptions? opts = null)
public static InstanceSettings get(String name, Output<String> id, InstanceSettingsState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Fingerprint string
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Metadata
Instance
Settings Metadata - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Zone string
- A reference to the zone where the machine resides.
- Fingerprint string
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Metadata
Instance
Settings Metadata Args - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Zone string
- A reference to the zone where the machine resides.
- fingerprint String
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- metadata
Instance
Settings Metadata - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- zone String
- A reference to the zone where the machine resides.
- fingerprint string
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- metadata
Instance
Settings Metadata - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- zone string
- A reference to the zone where the machine resides.
- fingerprint str
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- metadata
Instance
Settings Metadata Args - The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- zone str
- A reference to the zone where the machine resides.
- fingerprint String
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- metadata Property Map
- The metadata key/value pairs assigned to all the instances in the corresponding scope. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- zone String
- A reference to the zone where the machine resides.
Supporting Types
InstanceSettingsMetadata, InstanceSettingsMetadataArgs
- Items Dictionary<string, string>
- A metadata key/value items map. The total size of all keys and values must be less than 512KB
- Items map[string]string
- A metadata key/value items map. The total size of all keys and values must be less than 512KB
- items Map<String,String>
- A metadata key/value items map. The total size of all keys and values must be less than 512KB
- items {[key: string]: string}
- A metadata key/value items map. The total size of all keys and values must be less than 512KB
- items Mapping[str, str]
- A metadata key/value items map. The total size of all keys and values must be less than 512KB
- items Map<String>
- A metadata key/value items map. The total size of all keys and values must be less than 512KB
Import
InstanceSettings can be imported using any of these accepted formats:
projects/{{project}}/zones/{{zone}}/instanceSettings
{{project}}/{{zone}}
{{zone}}
When using the pulumi import
command, InstanceSettings can be imported using one of the formats above. For example:
$ pulumi import gcp:compute/instanceSettings:InstanceSettings default projects/{{project}}/zones/{{zone}}/instanceSettings
$ pulumi import gcp:compute/instanceSettings:InstanceSettings default {{project}}/{{zone}}
$ pulumi import gcp:compute/instanceSettings:InstanceSettings default {{zone}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.