Show / Hide Table of Contents

Class GetInstance

Inheritance
System.Object
GetInstance
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public static class GetInstance

Methods

View Source

InvokeAsync(GetInstanceArgs, InvokeOptions)

Use this data source to get the ID of an Amazon EC2 Instance for use in other resources.

{{% examples %}}

Example Usage

{{% example %}}

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var foo = Output.Create(Aws.Ec2.GetInstance.InvokeAsync(new Aws.Ec2.GetInstanceArgs
    {
        Filters = 
        {
            new Aws.Ec2.Inputs.GetInstanceFilterArgs
            {
                Name = "image-id",
                Values = 
                {
                    "ami-xxxxxxxx",
                },
            },
            new Aws.Ec2.Inputs.GetInstanceFilterArgs
            {
                Name = "tag:Name",
                Values = 
                {
                    "instance-name-tag",
                },
            },
        },
        InstanceId = "i-instanceid",
    }));
}

}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args = null, InvokeOptions options = null)
Parameters
Type Name Description
GetInstanceArgs args
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetInstanceResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.