Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.compute.getInstanceGuestAttributes
Explore with Pulumi AI
Get information about a VM instance resource within GCE. For more information see the official documentation and API.
Get information about VM’s guest attrubutes. For more information see the official documentation and API.
Example Usage
Get All Attributes From A Single Namespace
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const appserverGa = gcp.compute.getInstanceGuestAttributes({
name: "primary-application-server",
zone: "us-central1-a",
queryPath: "variables/",
});
import pulumi
import pulumi_gcp as gcp
appserver_ga = gcp.compute.get_instance_guest_attributes(name="primary-application-server",
zone="us-central1-a",
query_path="variables/")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.GetInstanceGuestAttributes(ctx, &compute.GetInstanceGuestAttributesArgs{
Name: "primary-application-server",
Zone: pulumi.StringRef("us-central1-a"),
QueryPath: pulumi.StringRef("variables/"),
}, nil)
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 appserverGa = Gcp.Compute.GetInstanceGuestAttributes.Invoke(new()
{
Name = "primary-application-server",
Zone = "us-central1-a",
QueryPath = "variables/",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetInstanceGuestAttributesArgs;
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) {
final var appserverGa = ComputeFunctions.getInstanceGuestAttributes(GetInstanceGuestAttributesArgs.builder()
.name("primary-application-server")
.zone("us-central1-a")
.queryPath("variables/")
.build());
}
}
variables:
appserverGa:
fn::invoke:
Function: gcp:compute:getInstanceGuestAttributes
Arguments:
name: primary-application-server
zone: us-central1-a
queryPath: variables/
Get A Specific Variable
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const appserverGa = gcp.compute.getInstanceGuestAttributes({
name: "primary-application-server",
zone: "us-central1-a",
variableKey: "variables/key1",
});
import pulumi
import pulumi_gcp as gcp
appserver_ga = gcp.compute.get_instance_guest_attributes(name="primary-application-server",
zone="us-central1-a",
variable_key="variables/key1")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.GetInstanceGuestAttributes(ctx, &compute.GetInstanceGuestAttributesArgs{
Name: "primary-application-server",
Zone: pulumi.StringRef("us-central1-a"),
VariableKey: pulumi.StringRef("variables/key1"),
}, nil)
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 appserverGa = Gcp.Compute.GetInstanceGuestAttributes.Invoke(new()
{
Name = "primary-application-server",
Zone = "us-central1-a",
VariableKey = "variables/key1",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetInstanceGuestAttributesArgs;
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) {
final var appserverGa = ComputeFunctions.getInstanceGuestAttributes(GetInstanceGuestAttributesArgs.builder()
.name("primary-application-server")
.zone("us-central1-a")
.variableKey("variables/key1")
.build());
}
}
variables:
appserverGa:
fn::invoke:
Function: gcp:compute:getInstanceGuestAttributes
Arguments:
name: primary-application-server
zone: us-central1-a
variableKey: variables/key1
Using getInstanceGuestAttributes
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getInstanceGuestAttributes(args: GetInstanceGuestAttributesArgs, opts?: InvokeOptions): Promise<GetInstanceGuestAttributesResult>
function getInstanceGuestAttributesOutput(args: GetInstanceGuestAttributesOutputArgs, opts?: InvokeOptions): Output<GetInstanceGuestAttributesResult>
def get_instance_guest_attributes(name: Optional[str] = None,
project: Optional[str] = None,
query_path: Optional[str] = None,
region: Optional[str] = None,
variable_key: Optional[str] = None,
zone: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetInstanceGuestAttributesResult
def get_instance_guest_attributes_output(name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
query_path: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
variable_key: Optional[pulumi.Input[str]] = None,
zone: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInstanceGuestAttributesResult]
func GetInstanceGuestAttributes(ctx *Context, args *GetInstanceGuestAttributesArgs, opts ...InvokeOption) (*GetInstanceGuestAttributesResult, error)
func GetInstanceGuestAttributesOutput(ctx *Context, args *GetInstanceGuestAttributesOutputArgs, opts ...InvokeOption) GetInstanceGuestAttributesResultOutput
> Note: This function is named GetInstanceGuestAttributes
in the Go SDK.
public static class GetInstanceGuestAttributes
{
public static Task<GetInstanceGuestAttributesResult> InvokeAsync(GetInstanceGuestAttributesArgs args, InvokeOptions? opts = null)
public static Output<GetInstanceGuestAttributesResult> Invoke(GetInstanceGuestAttributesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceGuestAttributesResult> getInstanceGuestAttributes(GetInstanceGuestAttributesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:compute/getInstanceGuestAttributes:getInstanceGuestAttributes
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- The name or self_link of the instance.
- Project string
- The ID of the project in which the resource belongs.
If
self_link
is provided, this value is ignored. If neitherself_link
norproject
are provided, the provider project is used. - Query
Path string - Path to query for the guest attributes. Consists of
namespace
name for the attributes followed with a/
. - Region string
- Variable
Key string - Key of a variable to get the value of. Consists of
namespace
name andkey
name for the variable separated by a/
. - Zone string
- The zone of the instance. If
self_link
is provided, this value is ignored. If neitherself_link
norzone
are provided, the provider zone is used.
- Name string
- The name or self_link of the instance.
- Project string
- The ID of the project in which the resource belongs.
If
self_link
is provided, this value is ignored. If neitherself_link
norproject
are provided, the provider project is used. - Query
Path string - Path to query for the guest attributes. Consists of
namespace
name for the attributes followed with a/
. - Region string
- Variable
Key string - Key of a variable to get the value of. Consists of
namespace
name andkey
name for the variable separated by a/
. - Zone string
- The zone of the instance. If
self_link
is provided, this value is ignored. If neitherself_link
norzone
are provided, the provider zone is used.
- name String
- The name or self_link of the instance.
- project String
- The ID of the project in which the resource belongs.
If
self_link
is provided, this value is ignored. If neitherself_link
norproject
are provided, the provider project is used. - query
Path String - Path to query for the guest attributes. Consists of
namespace
name for the attributes followed with a/
. - region String
- variable
Key String - Key of a variable to get the value of. Consists of
namespace
name andkey
name for the variable separated by a/
. - zone String
- The zone of the instance. If
self_link
is provided, this value is ignored. If neitherself_link
norzone
are provided, the provider zone is used.
- name string
- The name or self_link of the instance.
- project string
- The ID of the project in which the resource belongs.
If
self_link
is provided, this value is ignored. If neitherself_link
norproject
are provided, the provider project is used. - query
Path string - Path to query for the guest attributes. Consists of
namespace
name for the attributes followed with a/
. - region string
- variable
Key string - Key of a variable to get the value of. Consists of
namespace
name andkey
name for the variable separated by a/
. - zone string
- The zone of the instance. If
self_link
is provided, this value is ignored. If neitherself_link
norzone
are provided, the provider zone is used.
- name str
- The name or self_link of the instance.
- project str
- The ID of the project in which the resource belongs.
If
self_link
is provided, this value is ignored. If neitherself_link
norproject
are provided, the provider project is used. - query_
path str - Path to query for the guest attributes. Consists of
namespace
name for the attributes followed with a/
. - region str
- variable_
key str - Key of a variable to get the value of. Consists of
namespace
name andkey
name for the variable separated by a/
. - zone str
- The zone of the instance. If
self_link
is provided, this value is ignored. If neitherself_link
norzone
are provided, the provider zone is used.
- name String
- The name or self_link of the instance.
- project String
- The ID of the project in which the resource belongs.
If
self_link
is provided, this value is ignored. If neitherself_link
norproject
are provided, the provider project is used. - query
Path String - Path to query for the guest attributes. Consists of
namespace
name for the attributes followed with a/
. - region String
- variable
Key String - Key of a variable to get the value of. Consists of
namespace
name andkey
name for the variable separated by a/
. - zone String
- The zone of the instance. If
self_link
is provided, this value is ignored. If neitherself_link
norzone
are provided, the provider zone is used.
getInstanceGuestAttributes Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Project string
- Query
Values List<GetInstance Guest Attributes Query Value> - Structure is documented below.
- Region string
- Variable
Value string - Value of the queried guest_attribute.
- Zone string
- Query
Path string - Variable
Key string
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Project string
- Query
Values []GetInstance Guest Attributes Query Value - Structure is documented below.
- Region string
- Variable
Value string - Value of the queried guest_attribute.
- Zone string
- Query
Path string - Variable
Key string
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- project String
- query
Values List<GetInstance Guest Attributes Query Value> - Structure is documented below.
- region String
- variable
Value String - Value of the queried guest_attribute.
- zone String
- query
Path String - variable
Key String
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- project string
- query
Values GetInstance Guest Attributes Query Value[] - Structure is documented below.
- region string
- variable
Value string - Value of the queried guest_attribute.
- zone string
- query
Path string - variable
Key string
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- project str
- query_
values Sequence[GetInstance Guest Attributes Query Value] - Structure is documented below.
- region str
- variable_
value str - Value of the queried guest_attribute.
- zone str
- query_
path str - variable_
key str
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- project String
- query
Values List<Property Map> - Structure is documented below.
- region String
- variable
Value String - Value of the queried guest_attribute.
- zone String
- query
Path String - variable
Key String
Supporting Types
GetInstanceGuestAttributesQueryValue
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.