GetInstance
Get information about a VM instance resource within GCE. For more information see the official documentation and API.
Using GetInstance
function getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>function get_instance(name=None, project=None, self_link=None, zone=None, opts=None)func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)Note: This function is named
LookupInstancein the Go SDK.
public static class GetInstance {
public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Name string
The name of the instance. One of
nameorself_linkmust be provided.- Project string
The ID of the project in which the resource belongs. If
self_linkis provided, this value is ignored. If neitherself_linknorprojectare provided, the provider project is used.- Self
Link string The self link of the instance. One of
nameorself_linkmust be provided.- Zone string
The zone of the instance. If
self_linkis provided, this value is ignored. If neitherself_linknorzoneare provided, the provider zone is used.
- Name string
The name of the instance. One of
nameorself_linkmust be provided.- Project string
The ID of the project in which the resource belongs. If
self_linkis provided, this value is ignored. If neitherself_linknorprojectare provided, the provider project is used.- Self
Link string The self link of the instance. One of
nameorself_linkmust be provided.- Zone string
The zone of the instance. If
self_linkis provided, this value is ignored. If neitherself_linknorzoneare provided, the provider zone is used.
- name string
The name of the instance. One of
nameorself_linkmust be provided.- project string
The ID of the project in which the resource belongs. If
self_linkis provided, this value is ignored. If neitherself_linknorprojectare provided, the provider project is used.- self
Link string The self link of the instance. One of
nameorself_linkmust be provided.- zone string
The zone of the instance. If
self_linkis provided, this value is ignored. If neitherself_linknorzoneare provided, the provider zone is used.
- name str
The name of the instance. One of
nameorself_linkmust be provided.- project str
The ID of the project in which the resource belongs. If
self_linkis provided, this value is ignored. If neitherself_linknorprojectare provided, the provider project is used.- self_
link str The self link of the instance. One of
nameorself_linkmust be provided.- zone str
The zone of the instance. If
self_linkis provided, this value is ignored. If neitherself_linknorzoneare provided, the provider zone is used.
GetInstance Result
The following output properties are available:
- Allow
Stopping boolFor Update - Attached
Disks List<GetInstance Attached Disk> List of disks attached to the instance. Structure is documented below.
- Boot
Disks List<GetInstance Boot Disk> The boot disk for the instance. Structure is documented below.
- Can
Ip boolForward Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
- Cpu
Platform string The CPU platform used by this instance.
- Current
Status string - Deletion
Protection bool Whether deletion protection is enabled on this instance.
- Description string
A brief description of the resource.
- Desired
Status string - Enable
Display bool - Guest
Accelerators List<GetInstance Guest Accelerator> List of the type and count of accelerator cards attached to the instance. Structure is documented below.
- Hostname string
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Id string The server-assigned unique identifier of this instance.
- Label
Fingerprint string The unique fingerprint of the labels.
- Labels Dictionary<string, string>
A set of key/value label pairs assigned to the instance.
- Machine
Type string The machine type to create.
- Metadata Dictionary<string, string>
Metadata key/value pairs made available within the instance.
- Metadata
Fingerprint string The unique fingerprint of the metadata.
- Metadata
Startup stringScript - Min
Cpu stringPlatform The minimum CPU platform specified for the VM instance.
- Network
Interfaces List<GetInstance Network Interface> The networks attached to the instance. Structure is documented below.
- Resource
Policies List<string> - Schedulings
List<Get
Instance Scheduling> The scheduling strategy being used by the instance.
- Scratch
Disks List<GetInstance Scratch Disk> The scratch disks attached to the instance. Structure is documented below.
- Service
Accounts List<GetInstance Service Account> The service account to attach to the instance. Structure is documented below.
- Shielded
Instance List<GetConfigs Instance Shielded Instance Config> The shielded vm config being used by the instance. Structure is documented below.
- List<string>
The list of tags attached to the instance.
- string
The unique fingerprint of the tags.
- Name string
- Project string
- Self
Link string The URI of the created resource.
- Zone string
- Allow
Stopping boolFor Update - Attached
Disks []GetInstance Attached Disk List of disks attached to the instance. Structure is documented below.
- Boot
Disks []GetInstance Boot Disk The boot disk for the instance. Structure is documented below.
- Can
Ip boolForward Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
- Cpu
Platform string The CPU platform used by this instance.
- Current
Status string - Deletion
Protection bool Whether deletion protection is enabled on this instance.
- Description string
A brief description of the resource.
- Desired
Status string - Enable
Display bool - Guest
Accelerators []GetInstance Guest Accelerator List of the type and count of accelerator cards attached to the instance. Structure is documented below.
- Hostname string
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Id string The server-assigned unique identifier of this instance.
- Label
Fingerprint string The unique fingerprint of the labels.
- Labels map[string]string
A set of key/value label pairs assigned to the instance.
- Machine
Type string The machine type to create.
- Metadata map[string]string
Metadata key/value pairs made available within the instance.
- Metadata
Fingerprint string The unique fingerprint of the metadata.
- Metadata
Startup stringScript - Min
Cpu stringPlatform The minimum CPU platform specified for the VM instance.
- Network
Interfaces []GetInstance Network Interface The networks attached to the instance. Structure is documented below.
- Resource
Policies []string - Schedulings
[]Get
Instance Scheduling The scheduling strategy being used by the instance.
- Scratch
Disks []GetInstance Scratch Disk The scratch disks attached to the instance. Structure is documented below.
- Service
Accounts []GetInstance Service Account The service account to attach to the instance. Structure is documented below.
- Shielded
Instance []GetConfigs Instance Shielded Instance Config The shielded vm config being used by the instance. Structure is documented below.
- []string
The list of tags attached to the instance.
- string
The unique fingerprint of the tags.
- Name string
- Project string
- Self
Link string The URI of the created resource.
- Zone string
- allow
Stopping booleanFor Update - attached
Disks GetInstance Attached Disk[] List of disks attached to the instance. Structure is documented below.
- boot
Disks GetInstance Boot Disk[] The boot disk for the instance. Structure is documented below.
- can
Ip booleanForward Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
- cpu
Platform string The CPU platform used by this instance.
- current
Status string - deletion
Protection boolean Whether deletion protection is enabled on this instance.
- description string
A brief description of the resource.
- desired
Status string - enable
Display boolean - guest
Accelerators GetInstance Guest Accelerator[] List of the type and count of accelerator cards attached to the instance. Structure is documented below.
- hostname string
- id string
The provider-assigned unique ID for this managed resource.
- instance
Id string The server-assigned unique identifier of this instance.
- label
Fingerprint string The unique fingerprint of the labels.
- labels {[key: string]: string}
A set of key/value label pairs assigned to the instance.
- machine
Type string The machine type to create.
- metadata {[key: string]: string}
Metadata key/value pairs made available within the instance.
- metadata
Fingerprint string The unique fingerprint of the metadata.
- metadata
Startup stringScript - min
Cpu stringPlatform The minimum CPU platform specified for the VM instance.
- network
Interfaces GetInstance Network Interface[] The networks attached to the instance. Structure is documented below.
- resource
Policies string[] - schedulings
Get
Instance Scheduling[] The scheduling strategy being used by the instance.
- scratch
Disks GetInstance Scratch Disk[] The scratch disks attached to the instance. Structure is documented below.
- service
Accounts GetInstance Service Account[] The service account to attach to the instance. Structure is documented below.
- shielded
Instance GetConfigs Instance Shielded Instance Config[] The shielded vm config being used by the instance. Structure is documented below.
- string[]
The list of tags attached to the instance.
- string
The unique fingerprint of the tags.
- name string
- project string
- self
Link string The URI of the created resource.
- zone string
- allow_
stopping_ boolfor_ update - attached_
disks List[GetInstance Attached Disk] List of disks attached to the instance. Structure is documented below.
- boot_
disks List[GetInstance Boot Disk] The boot disk for the instance. Structure is documented below.
- can_
ip_ boolforward Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
- cpu_
platform str The CPU platform used by this instance.
- current_
status str - deletion_
protection bool Whether deletion protection is enabled on this instance.
- description str
A brief description of the resource.
- desired_
status str - enable_
display bool - guest_
accelerators List[GetInstance Guest Accelerator] List of the type and count of accelerator cards attached to the instance. Structure is documented below.
- hostname str
- id str
The provider-assigned unique ID for this managed resource.
- instance_
id str The server-assigned unique identifier of this instance.
- label_
fingerprint str The unique fingerprint of the labels.
- labels Dict[str, str]
A set of key/value label pairs assigned to the instance.
- machine_
type str The machine type to create.
- metadata Dict[str, str]
Metadata key/value pairs made available within the instance.
- metadata_
fingerprint str The unique fingerprint of the metadata.
- metadata_
startup_ strscript - min_
cpu_ strplatform The minimum CPU platform specified for the VM instance.
- network_
interfaces List[GetInstance Network Interface] The networks attached to the instance. Structure is documented below.
- resource_
policies List[str] - schedulings
List[Get
Instance Scheduling] The scheduling strategy being used by the instance.
- scratch_
disks List[GetInstance Scratch Disk] The scratch disks attached to the instance. Structure is documented below.
- service_
accounts List[GetInstance Service Account] The service account to attach to the instance. Structure is documented below.
- shielded_
instance_ List[Getconfigs Instance Shielded Instance Config] The shielded vm config being used by the instance. Structure is documented below.
- List[str]
The list of tags attached to the instance.
- str
The unique fingerprint of the tags.
- name str
- project str
- self_
link str The URI of the created resource.
- zone str
Supporting Types
GetInstanceAttachedDisk
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Device
Name string Name with which the attached disk is accessible under
/dev/disk/by-id/- Disk
Encryption stringKey Raw - Disk
Encryption stringKey Sha256 - Kms
Key stringSelf Link - Mode string
Read/write mode for the disk. One of
"READ_ONLY"or"READ_WRITE".- Source string
The name or self_link of the disk attached to this instance.
- Device
Name string Name with which the attached disk is accessible under
/dev/disk/by-id/- Disk
Encryption stringKey Raw - Disk
Encryption stringKey Sha256 - Kms
Key stringSelf Link - Mode string
Read/write mode for the disk. One of
"READ_ONLY"or"READ_WRITE".- Source string
The name or self_link of the disk attached to this instance.
- device
Name string Name with which the attached disk is accessible under
/dev/disk/by-id/- disk
Encryption stringKey Raw - disk
Encryption stringKey Sha256 - kms
Key stringSelf Link - mode string
Read/write mode for the disk. One of
"READ_ONLY"or"READ_WRITE".- source string
The name or self_link of the disk attached to this instance.
- device_
name str Name with which the attached disk is accessible under
/dev/disk/by-id/- disk
Encryption strKey Raw - disk
Encryption strKey Sha256 - kms
Key strSelf Link - mode str
Read/write mode for the disk. One of
"READ_ONLY"or"READ_WRITE".- source str
The name or self_link of the disk attached to this instance.
GetInstanceBootDisk
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Auto
Delete bool Whether the disk will be auto-deleted when the instance is deleted.
- Device
Name string Name with which the attached disk is accessible under
/dev/disk/by-id/- Disk
Encryption stringKey Raw - Disk
Encryption stringKey Sha256 - Initialize
Params List<GetInstance Boot Disk Initialize Param Args> Parameters with which a disk was created alongside the instance. Structure is documented below.
- Kms
Key stringSelf Link - Mode string
Read/write mode for the disk. One of
"READ_ONLY"or"READ_WRITE".- Source string
The name or self_link of the disk attached to this instance.
- Auto
Delete bool Whether the disk will be auto-deleted when the instance is deleted.
- Device
Name string Name with which the attached disk is accessible under
/dev/disk/by-id/- Disk
Encryption stringKey Raw - Disk
Encryption stringKey Sha256 - Initialize
Params []GetInstance Boot Disk Initialize Param Parameters with which a disk was created alongside the instance. Structure is documented below.
- Kms
Key stringSelf Link - Mode string
Read/write mode for the disk. One of
"READ_ONLY"or"READ_WRITE".- Source string
The name or self_link of the disk attached to this instance.
- auto
Delete boolean Whether the disk will be auto-deleted when the instance is deleted.
- device
Name string Name with which the attached disk is accessible under
/dev/disk/by-id/- disk
Encryption stringKey Raw - disk
Encryption stringKey Sha256 - initialize
Params GetInstance Boot Disk Initialize Param[] Parameters with which a disk was created alongside the instance. Structure is documented below.
- kms
Key stringSelf Link - mode string
Read/write mode for the disk. One of
"READ_ONLY"or"READ_WRITE".- source string
The name or self_link of the disk attached to this instance.
- auto
Delete bool Whether the disk will be auto-deleted when the instance is deleted.
- device_
name str Name with which the attached disk is accessible under
/dev/disk/by-id/- disk
Encryption strKey Raw - disk
Encryption strKey Sha256 - initialize
Params List[GetInstance Boot Disk Initialize Param] Parameters with which a disk was created alongside the instance. Structure is documented below.
- kms
Key strSelf Link - mode str
Read/write mode for the disk. One of
"READ_ONLY"or"READ_WRITE".- source str
The name or self_link of the disk attached to this instance.
GetInstanceBootDiskInitializeParam
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetInstanceGuestAccelerator
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetInstanceNetworkInterface
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Access
Configs List<GetInstance Network Interface Access Config Args> Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Structure documented below.
- Alias
Ip List<GetRanges Instance Network Interface Alias Ip Range Args> An array of alias IP ranges for this network interface. Structure documented below.
- Name string
The name of the instance. One of
nameorself_linkmust be provided.- Network string
The name or self_link of the network attached to this interface.
- Network
Ip string The private IP address assigned to the instance.
- Subnetwork string
The name or self_link of the subnetwork attached to this interface.
- Subnetwork
Project string The project in which the subnetwork belongs.
- Access
Configs []GetInstance Network Interface Access Config Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Structure documented below.
- Alias
Ip []GetRanges Instance Network Interface Alias Ip Range An array of alias IP ranges for this network interface. Structure documented below.
- Name string
The name of the instance. One of
nameorself_linkmust be provided.- Network string
The name or self_link of the network attached to this interface.
- Network
Ip string The private IP address assigned to the instance.
- Subnetwork string
The name or self_link of the subnetwork attached to this interface.
- Subnetwork
Project string The project in which the subnetwork belongs.
- access
Configs GetInstance Network Interface Access Config[] Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Structure documented below.
- alias
Ip GetRanges Instance Network Interface Alias Ip Range[] An array of alias IP ranges for this network interface. Structure documented below.
- name string
The name of the instance. One of
nameorself_linkmust be provided.- network string
The name or self_link of the network attached to this interface.
- network
Ip string The private IP address assigned to the instance.
- subnetwork string
The name or self_link of the subnetwork attached to this interface.
- subnetwork
Project string The project in which the subnetwork belongs.
- access
Configs List[GetInstance Network Interface Access Config] Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Structure documented below.
- alias
Ip List[GetRanges Instance Network Interface Alias Ip Range] An array of alias IP ranges for this network interface. Structure documented below.
- name str
The name of the instance. One of
nameorself_linkmust be provided.- network str
The name or self_link of the network attached to this interface.
- network
Ip str The private IP address assigned to the instance.
- subnetwork str
The name or self_link of the subnetwork attached to this interface.
- subnetwork
Project str The project in which the subnetwork belongs.
GetInstanceNetworkInterfaceAccessConfig
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Nat
Ip string The IP address that is be 1:1 mapped to the instance’s network ip.
- Network
Tier string The [networking tier][network-tier] used for configuring this instance. One of
PREMIUMorSTANDARD.- Public
Ptr stringDomain Name The DNS domain name for the public PTR record.
- Nat
Ip string The IP address that is be 1:1 mapped to the instance’s network ip.
- Network
Tier string The [networking tier][network-tier] used for configuring this instance. One of
PREMIUMorSTANDARD.- Public
Ptr stringDomain Name The DNS domain name for the public PTR record.
- nat
Ip string The IP address that is be 1:1 mapped to the instance’s network ip.
- network
Tier string The [networking tier][network-tier] used for configuring this instance. One of
PREMIUMorSTANDARD.- public
Ptr stringDomain Name The DNS domain name for the public PTR record.
- nat
Ip str The IP address that is be 1:1 mapped to the instance’s network ip.
- network_
tier str The [networking tier][network-tier] used for configuring this instance. One of
PREMIUMorSTANDARD.- public
Ptr strDomain Name The DNS domain name for the public PTR record.
GetInstanceNetworkInterfaceAliasIpRange
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Ip
Cidr stringRange The IP CIDR range represented by this alias IP range.
- Subnetwork
Range stringName The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range.
- Ip
Cidr stringRange The IP CIDR range represented by this alias IP range.
- Subnetwork
Range stringName The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range.
- ip
Cidr stringRange The IP CIDR range represented by this alias IP range.
- subnetwork
Range stringName The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range.
- ip_
cidr_ strrange The IP CIDR range represented by this alias IP range.
- subnetwork
Range strName The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range.
GetInstanceScheduling
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Automatic
Restart bool Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user).
- Min
Node intCpus - Node
Affinities List<GetInstance Scheduling Node Affinity Args> - On
Host stringMaintenance Describes maintenance behavior for the instance. One of
MIGRATEorTERMINATE, for more info, read here- Preemptible bool
Whether the instance is preemptible.
- Automatic
Restart bool Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user).
- Min
Node intCpus - Node
Affinities []GetInstance Scheduling Node Affinity - On
Host stringMaintenance Describes maintenance behavior for the instance. One of
MIGRATEorTERMINATE, for more info, read here- Preemptible bool
Whether the instance is preemptible.
- automatic
Restart boolean Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user).
- min
Node numberCpus - node
Affinities GetInstance Scheduling Node Affinity[] - on
Host stringMaintenance Describes maintenance behavior for the instance. One of
MIGRATEorTERMINATE, for more info, read here- preemptible boolean
Whether the instance is preemptible.
- automatic
Restart bool Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user).
- min
Node floatCpus - node
Affinities List[GetInstance Scheduling Node Affinity] - on
Host strMaintenance Describes maintenance behavior for the instance. One of
MIGRATEorTERMINATE, for more info, read here- preemptible bool
Whether the instance is preemptible.
GetInstanceSchedulingNodeAffinity
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetInstanceScratchDisk
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetInstanceServiceAccount
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Email string
The service account e-mail address.
- Scopes List<string>
A list of service scopes.
GetInstanceShieldedInstanceConfig
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.