AWS Classic

v5.21.1 published on Thursday, Nov 17, 2022 by Pulumi

getInstance

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

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var foo = Aws.Ec2.GetInstance.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2.Inputs.GetInstanceFilterInputArgs
            {
                Name = "image-id",
                Values = new[]
                {
                    "ami-xxxxxxxx",
                },
            },
            new Aws.Ec2.Inputs.GetInstanceFilterInputArgs
            {
                Name = "tag:Name",
                Values = new[]
                {
                    "instance-name-tag",
                },
            },
        },
        InstanceId = "i-instanceid",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.LookupInstance(ctx, &ec2.LookupInstanceArgs{
			Filters: []ec2.GetInstanceFilter{
				ec2.GetInstanceFilter{
					Name: "image-id",
					Values: []string{
						"ami-xxxxxxxx",
					},
				},
				ec2.GetInstanceFilter{
					Name: "tag:Name",
					Values: []string{
						"instance-name-tag",
					},
				},
			},
			InstanceId: pulumi.StringRef("i-instanceid"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.connect.inputs.GetInstanceArgs;
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 foo = Ec2Functions.getInstance(GetInstanceArgs.builder()
            .filters(            
                %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
                %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
            .instanceId("i-instanceid")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

foo = aws.ec2.get_instance(filters=[
        aws.ec2.GetInstanceFilterArgs(
            name="image-id",
            values=["ami-xxxxxxxx"],
        ),
        aws.ec2.GetInstanceFilterArgs(
            name="tag:Name",
            values=["instance-name-tag"],
        ),
    ],
    instance_id="i-instanceid")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const foo = pulumi.output(aws.ec2.getInstance({
    filters: [
        {
            name: "image-id",
            values: ["ami-xxxxxxxx"],
        },
        {
            name: "tag:Name",
            values: ["instance-name-tag"],
        },
    ],
    instanceId: "i-instanceid",
}));
variables:
  foo:
    Fn::Invoke:
      Function: aws:ec2:getInstance
      Arguments:
        filters:
          - name: image-id
            values:
              - ami-xxxxxxxx
          - name: tag:Name
            values:
              - instance-name-tag
        instanceId: i-instanceid

Using getInstance

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 getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>
function getInstanceOutput(args: GetInstanceOutputArgs, opts?: InvokeOptions): Output<GetInstanceResult>
def get_instance(filters: Optional[Sequence[GetInstanceFilter]] = None,
                 get_password_data: Optional[bool] = None,
                 get_user_data: Optional[bool] = None,
                 instance_id: Optional[str] = None,
                 instance_tags: Optional[Mapping[str, str]] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 opts: Optional[InvokeOptions] = None) -> GetInstanceResult
def get_instance_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceFilterArgs]]]] = None,
                 get_password_data: Optional[pulumi.Input[bool]] = None,
                 get_user_data: Optional[pulumi.Input[bool]] = None,
                 instance_id: Optional[pulumi.Input[str]] = None,
                 instance_tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]
func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput

> Note: This function is named LookupInstance in the Go SDK.

public static class GetInstance 
{
    public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: aws:ec2/getInstance:getInstance
  arguments:
    # arguments dictionary

The following arguments are supported:

Filters List<Pulumi.Aws.Ec2.Inputs.GetInstanceFilter>

One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].

GetPasswordData bool

If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the password_data attribute. See GetPasswordData for more information.

GetUserData bool

Retrieve Base64 encoded User Data contents into the user_data_base64 attribute. A SHA-1 hash of the User Data contents will always be present in the user_data attribute. Defaults to false.

InstanceId string

Specify the exact Instance ID with which to populate the data source.

InstanceTags Dictionary<string, string>

Map of tags, each pair of which must exactly match a pair on the desired Instance.

Tags Dictionary<string, string>

Map of tags assigned to the Instance.

Filters []GetInstanceFilter

One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].

GetPasswordData bool

If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the password_data attribute. See GetPasswordData for more information.

GetUserData bool

Retrieve Base64 encoded User Data contents into the user_data_base64 attribute. A SHA-1 hash of the User Data contents will always be present in the user_data attribute. Defaults to false.

InstanceId string

Specify the exact Instance ID with which to populate the data source.

InstanceTags map[string]string

Map of tags, each pair of which must exactly match a pair on the desired Instance.

Tags map[string]string

Map of tags assigned to the Instance.

filters List<GetInstanceFilter>

One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].

getPasswordData Boolean

If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the password_data attribute. See GetPasswordData for more information.

getUserData Boolean

Retrieve Base64 encoded User Data contents into the user_data_base64 attribute. A SHA-1 hash of the User Data contents will always be present in the user_data attribute. Defaults to false.

instanceId String

Specify the exact Instance ID with which to populate the data source.

instanceTags Map<String,String>

Map of tags, each pair of which must exactly match a pair on the desired Instance.

tags Map<String,String>

Map of tags assigned to the Instance.

filters GetInstanceFilter[]

One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].

getPasswordData boolean

If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the password_data attribute. See GetPasswordData for more information.

getUserData boolean

Retrieve Base64 encoded User Data contents into the user_data_base64 attribute. A SHA-1 hash of the User Data contents will always be present in the user_data attribute. Defaults to false.

instanceId string

Specify the exact Instance ID with which to populate the data source.

instanceTags {[key: string]: string}

Map of tags, each pair of which must exactly match a pair on the desired Instance.

tags {[key: string]: string}

Map of tags assigned to the Instance.

filters Sequence[GetInstanceFilter]

One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].

get_password_data bool

If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the password_data attribute. See GetPasswordData for more information.

get_user_data bool

Retrieve Base64 encoded User Data contents into the user_data_base64 attribute. A SHA-1 hash of the User Data contents will always be present in the user_data attribute. Defaults to false.

instance_id str

Specify the exact Instance ID with which to populate the data source.

instance_tags Mapping[str, str]

Map of tags, each pair of which must exactly match a pair on the desired Instance.

tags Mapping[str, str]

Map of tags assigned to the Instance.

filters List<Property Map>

One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].

getPasswordData Boolean

If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the password_data attribute. See GetPasswordData for more information.

getUserData Boolean

Retrieve Base64 encoded User Data contents into the user_data_base64 attribute. A SHA-1 hash of the User Data contents will always be present in the user_data attribute. Defaults to false.

instanceId String

Specify the exact Instance ID with which to populate the data source.

instanceTags Map<String>

Map of tags, each pair of which must exactly match a pair on the desired Instance.

tags Map<String>

Map of tags assigned to the Instance.

getInstance Result

The following output properties are available:

Ami string

ID of the AMI used to launch the instance.

Arn string

ARN of the instance.

AssociatePublicIpAddress bool

Whether or not the Instance is associated with a public IP address or not (Boolean).

AvailabilityZone string

Availability zone of the Instance.

CreditSpecifications List<Pulumi.Aws.Ec2.Outputs.GetInstanceCreditSpecification>

Credit specification of the Instance.

DisableApiStop bool

Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).

DisableApiTermination bool

Whether or not EC2 Instance Termination Protection is enabled (Boolean).

EbsBlockDevices List<Pulumi.Aws.Ec2.Outputs.GetInstanceEbsBlockDevice>

EBS block device mappings of the Instance.

EbsOptimized bool

Whether the Instance is EBS optimized or not (Boolean).

EnclaveOptions List<Pulumi.Aws.Ec2.Outputs.GetInstanceEnclaveOption>

Enclave options of the instance.

EphemeralBlockDevices List<Pulumi.Aws.Ec2.Outputs.GetInstanceEphemeralBlockDevice>

Ephemeral block device mappings of the Instance.

HostId string

ID of the dedicated host the instance will be assigned to.

HostResourceGroupArn string

ARN of the host resource group the instance is associated with.

IamInstanceProfile string

Name of the instance profile associated with the Instance.

Id string

The provider-assigned unique ID for this managed resource.

InstanceState string

State of the instance. One of: pending, running, shutting-down, terminated, stopping, stopped. See Instance Lifecycle for more information.

InstanceTags Dictionary<string, string>
InstanceType string

Type of the Instance.

Ipv6Addresses List<string>

IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.

KeyName string

Key name of the Instance.

MaintenanceOptions List<Pulumi.Aws.Ec2.Outputs.GetInstanceMaintenanceOption>

Maintenance and recovery options for the instance.

MetadataOptions List<Pulumi.Aws.Ec2.Outputs.GetInstanceMetadataOption>

Metadata options of the Instance.

Monitoring bool

Whether detailed monitoring is enabled or disabled for the Instance (Boolean).

NetworkInterfaceId string

ID of the network interface that was created with the Instance.

OutpostArn string

ARN of the Outpost.

PasswordData string

Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if get_password_data is true. See GetPasswordData for more information.

PlacementGroup string

Placement group of the Instance.

PlacementPartitionNumber int

Number of the partition the instance is in.

PrivateDns string

Private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.

PrivateDnsNameOptions List<Pulumi.Aws.Ec2.Outputs.GetInstancePrivateDnsNameOption>

Options for the instance hostname.

PrivateIp string

Private IP address assigned to the Instance.

PublicDns string

Public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.

PublicIp string

Public IP address assigned to the Instance, if applicable. NOTE: If you are using an aws.ec2.Eip with your instance, you should refer to the EIP's address directly and not use public_ip, as this field will change after the EIP is attached.

RootBlockDevices List<Pulumi.Aws.Ec2.Outputs.GetInstanceRootBlockDevice>

Root block device mappings of the Instance

SecondaryPrivateIps List<string>

Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.

SecurityGroups List<string>

Associated security groups.

SourceDestCheck bool

Whether the network interface performs source/destination checking (Boolean).

SubnetId string

VPC subnet ID.

Tags Dictionary<string, string>

Map of tags assigned to the Instance.

Tenancy string

Tenancy of the instance: dedicated, default, host.

UserData string

SHA-1 hash of User Data supplied to the Instance.

UserDataBase64 string

Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if get_user_data is true.

VpcSecurityGroupIds List<string>

Associated security groups in a non-default VPC.

Filters List<Pulumi.Aws.Ec2.Outputs.GetInstanceFilter>
GetPasswordData bool
GetUserData bool
InstanceId string
Ami string

ID of the AMI used to launch the instance.

Arn string

ARN of the instance.

AssociatePublicIpAddress bool

Whether or not the Instance is associated with a public IP address or not (Boolean).

AvailabilityZone string

Availability zone of the Instance.

CreditSpecifications []GetInstanceCreditSpecification

Credit specification of the Instance.

DisableApiStop bool

Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).

DisableApiTermination bool

Whether or not EC2 Instance Termination Protection is enabled (Boolean).

EbsBlockDevices []GetInstanceEbsBlockDevice

EBS block device mappings of the Instance.

EbsOptimized bool

Whether the Instance is EBS optimized or not (Boolean).

EnclaveOptions []GetInstanceEnclaveOption

Enclave options of the instance.

EphemeralBlockDevices []GetInstanceEphemeralBlockDevice

Ephemeral block device mappings of the Instance.

HostId string

ID of the dedicated host the instance will be assigned to.

HostResourceGroupArn string

ARN of the host resource group the instance is associated with.

IamInstanceProfile string

Name of the instance profile associated with the Instance.

Id string

The provider-assigned unique ID for this managed resource.

InstanceState string

State of the instance. One of: pending, running, shutting-down, terminated, stopping, stopped. See Instance Lifecycle for more information.

InstanceTags map[string]string
InstanceType string

Type of the Instance.

Ipv6Addresses []string

IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.

KeyName string

Key name of the Instance.

MaintenanceOptions []GetInstanceMaintenanceOption

Maintenance and recovery options for the instance.

MetadataOptions []GetInstanceMetadataOption

Metadata options of the Instance.

Monitoring bool

Whether detailed monitoring is enabled or disabled for the Instance (Boolean).

NetworkInterfaceId string

ID of the network interface that was created with the Instance.

OutpostArn string

ARN of the Outpost.

PasswordData string

Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if get_password_data is true. See GetPasswordData for more information.

PlacementGroup string

Placement group of the Instance.

PlacementPartitionNumber int

Number of the partition the instance is in.

PrivateDns string

Private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.

PrivateDnsNameOptions []GetInstancePrivateDnsNameOption

Options for the instance hostname.

PrivateIp string

Private IP address assigned to the Instance.

PublicDns string

Public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.

PublicIp string

Public IP address assigned to the Instance, if applicable. NOTE: If you are using an aws.ec2.Eip with your instance, you should refer to the EIP's address directly and not use public_ip, as this field will change after the EIP is attached.

RootBlockDevices []GetInstanceRootBlockDevice

Root block device mappings of the Instance

SecondaryPrivateIps []string

Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.

SecurityGroups []string

Associated security groups.

SourceDestCheck bool

Whether the network interface performs source/destination checking (Boolean).

SubnetId string

VPC subnet ID.

Tags map[string]string

Map of tags assigned to the Instance.

Tenancy string

Tenancy of the instance: dedicated, default, host.

UserData string

SHA-1 hash of User Data supplied to the Instance.

UserDataBase64 string

Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if get_user_data is true.

VpcSecurityGroupIds []string

Associated security groups in a non-default VPC.

Filters []GetInstanceFilter
GetPasswordData bool
GetUserData bool
InstanceId string
ami String

ID of the AMI used to launch the instance.

arn String

ARN of the instance.

associatePublicIpAddress Boolean

Whether or not the Instance is associated with a public IP address or not (Boolean).

availabilityZone String

Availability zone of the Instance.

creditSpecifications List<GetInstanceCreditSpecification>

Credit specification of the Instance.

disableApiStop Boolean

Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).

disableApiTermination Boolean

Whether or not EC2 Instance Termination Protection is enabled (Boolean).

ebsBlockDevices List<GetInstanceEbsBlockDevice>

EBS block device mappings of the Instance.

ebsOptimized Boolean

Whether the Instance is EBS optimized or not (Boolean).

enclaveOptions List<GetInstanceEnclaveOption>

Enclave options of the instance.

ephemeralBlockDevices List<GetInstanceEphemeralBlockDevice>

Ephemeral block device mappings of the Instance.

hostId String

ID of the dedicated host the instance will be assigned to.

hostResourceGroupArn String

ARN of the host resource group the instance is associated with.

iamInstanceProfile String

Name of the instance profile associated with the Instance.

id String

The provider-assigned unique ID for this managed resource.

instanceState String

State of the instance. One of: pending, running, shutting-down, terminated, stopping, stopped. See Instance Lifecycle for more information.

instanceTags Map<String,String>
instanceType String

Type of the Instance.

ipv6Addresses List<String>

IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.

keyName String

Key name of the Instance.

maintenanceOptions List<GetInstanceMaintenanceOption>

Maintenance and recovery options for the instance.

metadataOptions List<GetInstanceMetadataOption>

Metadata options of the Instance.

monitoring Boolean

Whether detailed monitoring is enabled or disabled for the Instance (Boolean).

networkInterfaceId String

ID of the network interface that was created with the Instance.

outpostArn String

ARN of the Outpost.

passwordData String

Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if get_password_data is true. See GetPasswordData for more information.

placementGroup String

Placement group of the Instance.

placementPartitionNumber Integer

Number of the partition the instance is in.

privateDns String

Private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.

privateDnsNameOptions List<GetInstancePrivateDnsNameOption>

Options for the instance hostname.

privateIp String

Private IP address assigned to the Instance.

publicDns String

Public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.

publicIp String

Public IP address assigned to the Instance, if applicable. NOTE: If you are using an aws.ec2.Eip with your instance, you should refer to the EIP's address directly and not use public_ip, as this field will change after the EIP is attached.

rootBlockDevices List<GetInstanceRootBlockDevice>

Root block device mappings of the Instance

secondaryPrivateIps List<String>

Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.

securityGroups List<String>

Associated security groups.

sourceDestCheck Boolean

Whether the network interface performs source/destination checking (Boolean).

subnetId String

VPC subnet ID.

tags Map<String,String>

Map of tags assigned to the Instance.

tenancy String

Tenancy of the instance: dedicated, default, host.

userData String

SHA-1 hash of User Data supplied to the Instance.

userDataBase64 String

Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if get_user_data is true.

vpcSecurityGroupIds List<String>

Associated security groups in a non-default VPC.

filters List<GetInstanceFilter>
getPasswordData Boolean
getUserData Boolean
instanceId String
ami string

ID of the AMI used to launch the instance.

arn string

ARN of the instance.

associatePublicIpAddress boolean

Whether or not the Instance is associated with a public IP address or not (Boolean).

availabilityZone string

Availability zone of the Instance.

creditSpecifications GetInstanceCreditSpecification[]

Credit specification of the Instance.

disableApiStop boolean

Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).

disableApiTermination boolean

Whether or not EC2 Instance Termination Protection is enabled (Boolean).

ebsBlockDevices GetInstanceEbsBlockDevice[]

EBS block device mappings of the Instance.

ebsOptimized boolean

Whether the Instance is EBS optimized or not (Boolean).

enclaveOptions GetInstanceEnclaveOption[]

Enclave options of the instance.

ephemeralBlockDevices GetInstanceEphemeralBlockDevice[]

Ephemeral block device mappings of the Instance.

hostId string

ID of the dedicated host the instance will be assigned to.

hostResourceGroupArn string

ARN of the host resource group the instance is associated with.

iamInstanceProfile string

Name of the instance profile associated with the Instance.

id string

The provider-assigned unique ID for this managed resource.

instanceState string

State of the instance. One of: pending, running, shutting-down, terminated, stopping, stopped. See Instance Lifecycle for more information.

instanceTags {[key: string]: string}
instanceType string

Type of the Instance.

ipv6Addresses string[]

IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.

keyName string

Key name of the Instance.

maintenanceOptions GetInstanceMaintenanceOption[]

Maintenance and recovery options for the instance.

metadataOptions GetInstanceMetadataOption[]

Metadata options of the Instance.

monitoring boolean

Whether detailed monitoring is enabled or disabled for the Instance (Boolean).

networkInterfaceId string

ID of the network interface that was created with the Instance.

outpostArn string

ARN of the Outpost.

passwordData string

Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if get_password_data is true. See GetPasswordData for more information.

placementGroup string

Placement group of the Instance.

placementPartitionNumber number

Number of the partition the instance is in.

privateDns string

Private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.

privateDnsNameOptions GetInstancePrivateDnsNameOption[]

Options for the instance hostname.

privateIp string

Private IP address assigned to the Instance.

publicDns string

Public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.

publicIp string

Public IP address assigned to the Instance, if applicable. NOTE: If you are using an aws.ec2.Eip with your instance, you should refer to the EIP's address directly and not use public_ip, as this field will change after the EIP is attached.

rootBlockDevices GetInstanceRootBlockDevice[]

Root block device mappings of the Instance

secondaryPrivateIps string[]

Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.

securityGroups string[]

Associated security groups.

sourceDestCheck boolean

Whether the network interface performs source/destination checking (Boolean).

subnetId string

VPC subnet ID.

tags {[key: string]: string}

Map of tags assigned to the Instance.

tenancy string

Tenancy of the instance: dedicated, default, host.

userData string

SHA-1 hash of User Data supplied to the Instance.

userDataBase64 string

Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if get_user_data is true.

vpcSecurityGroupIds string[]

Associated security groups in a non-default VPC.

filters GetInstanceFilter[]
getPasswordData boolean
getUserData boolean
instanceId string
ami str

ID of the AMI used to launch the instance.

arn str

ARN of the instance.

associate_public_ip_address bool

Whether or not the Instance is associated with a public IP address or not (Boolean).

availability_zone str

Availability zone of the Instance.

credit_specifications Sequence[GetInstanceCreditSpecification]

Credit specification of the Instance.

disable_api_stop bool

Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).

disable_api_termination bool

Whether or not EC2 Instance Termination Protection is enabled (Boolean).

ebs_block_devices Sequence[GetInstanceEbsBlockDevice]

EBS block device mappings of the Instance.

ebs_optimized bool

Whether the Instance is EBS optimized or not (Boolean).

enclave_options Sequence[GetInstanceEnclaveOption]

Enclave options of the instance.

ephemeral_block_devices Sequence[GetInstanceEphemeralBlockDevice]

Ephemeral block device mappings of the Instance.

host_id str

ID of the dedicated host the instance will be assigned to.

host_resource_group_arn str

ARN of the host resource group the instance is associated with.

iam_instance_profile str

Name of the instance profile associated with the Instance.

id str

The provider-assigned unique ID for this managed resource.

instance_state str

State of the instance. One of: pending, running, shutting-down, terminated, stopping, stopped. See Instance Lifecycle for more information.

instance_tags Mapping[str, str]
instance_type str

Type of the Instance.

ipv6_addresses Sequence[str]

IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.

key_name str

Key name of the Instance.

maintenance_options Sequence[GetInstanceMaintenanceOption]

Maintenance and recovery options for the instance.

metadata_options Sequence[GetInstanceMetadataOption]

Metadata options of the Instance.

monitoring bool

Whether detailed monitoring is enabled or disabled for the Instance (Boolean).

network_interface_id str

ID of the network interface that was created with the Instance.

outpost_arn str

ARN of the Outpost.

password_data str

Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if get_password_data is true. See GetPasswordData for more information.

placement_group str

Placement group of the Instance.

placement_partition_number int

Number of the partition the instance is in.

private_dns str

Private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.

private_dns_name_options Sequence[GetInstancePrivateDnsNameOption]

Options for the instance hostname.

private_ip str

Private IP address assigned to the Instance.

public_dns str

Public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.

public_ip str

Public IP address assigned to the Instance, if applicable. NOTE: If you are using an aws.ec2.Eip with your instance, you should refer to the EIP's address directly and not use public_ip, as this field will change after the EIP is attached.

root_block_devices Sequence[GetInstanceRootBlockDevice]

Root block device mappings of the Instance

secondary_private_ips Sequence[str]

Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.

security_groups Sequence[str]

Associated security groups.

source_dest_check bool

Whether the network interface performs source/destination checking (Boolean).

subnet_id str

VPC subnet ID.

tags Mapping[str, str]

Map of tags assigned to the Instance.

tenancy str

Tenancy of the instance: dedicated, default, host.

user_data str

SHA-1 hash of User Data supplied to the Instance.

user_data_base64 str

Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if get_user_data is true.

vpc_security_group_ids Sequence[str]

Associated security groups in a non-default VPC.

filters Sequence[GetInstanceFilter]
get_password_data bool
get_user_data bool
instance_id str
ami String

ID of the AMI used to launch the instance.

arn String

ARN of the instance.

associatePublicIpAddress Boolean

Whether or not the Instance is associated with a public IP address or not (Boolean).

availabilityZone String

Availability zone of the Instance.

creditSpecifications List<Property Map>

Credit specification of the Instance.

disableApiStop Boolean

Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).

disableApiTermination Boolean

Whether or not EC2 Instance Termination Protection is enabled (Boolean).

ebsBlockDevices List<Property Map>

EBS block device mappings of the Instance.

ebsOptimized Boolean

Whether the Instance is EBS optimized or not (Boolean).

enclaveOptions List<Property Map>

Enclave options of the instance.

ephemeralBlockDevices List<Property Map>

Ephemeral block device mappings of the Instance.

hostId String

ID of the dedicated host the instance will be assigned to.

hostResourceGroupArn String

ARN of the host resource group the instance is associated with.

iamInstanceProfile String

Name of the instance profile associated with the Instance.

id String

The provider-assigned unique ID for this managed resource.

instanceState String

State of the instance. One of: pending, running, shutting-down, terminated, stopping, stopped. See Instance Lifecycle for more information.

instanceTags Map<String>
instanceType String

Type of the Instance.

ipv6Addresses List<String>

IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.

keyName String

Key name of the Instance.

maintenanceOptions List<Property Map>

Maintenance and recovery options for the instance.

metadataOptions List<Property Map>

Metadata options of the Instance.

monitoring Boolean

Whether detailed monitoring is enabled or disabled for the Instance (Boolean).

networkInterfaceId String

ID of the network interface that was created with the Instance.

outpostArn String

ARN of the Outpost.

passwordData String

Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if get_password_data is true. See GetPasswordData for more information.

placementGroup String

Placement group of the Instance.

placementPartitionNumber Number

Number of the partition the instance is in.

privateDns String

Private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.

privateDnsNameOptions List<Property Map>

Options for the instance hostname.

privateIp String

Private IP address assigned to the Instance.

publicDns String

Public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.

publicIp String

Public IP address assigned to the Instance, if applicable. NOTE: If you are using an aws.ec2.Eip with your instance, you should refer to the EIP's address directly and not use public_ip, as this field will change after the EIP is attached.

rootBlockDevices List<Property Map>

Root block device mappings of the Instance

secondaryPrivateIps List<String>

Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.

securityGroups List<String>

Associated security groups.

sourceDestCheck Boolean

Whether the network interface performs source/destination checking (Boolean).

subnetId String

VPC subnet ID.

tags Map<String>

Map of tags assigned to the Instance.

tenancy String

Tenancy of the instance: dedicated, default, host.

userData String

SHA-1 hash of User Data supplied to the Instance.

userDataBase64 String

Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if get_user_data is true.

vpcSecurityGroupIds List<String>

Associated security groups in a non-default VPC.

filters List<Property Map>
getPasswordData Boolean
getUserData Boolean
instanceId String

Supporting Types

GetInstanceCreditSpecification

CpuCredits string
CpuCredits string
cpuCredits String
cpuCredits string
cpuCredits String

GetInstanceEbsBlockDevice

DeleteOnTermination bool

If the root block device will be deleted on termination.

DeviceName string

Physical name of the device.

Encrypted bool

If the EBS volume is encrypted.

Iops int

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

KmsKeyId string
SnapshotId string

ID of the snapshot.

Tags Dictionary<string, string>

Map of tags assigned to the Instance.

Throughput int

Throughput of the volume, in MiB/s.

VolumeId string
VolumeSize int

Size of the volume, in GiB.

VolumeType string

Type of the volume.

DeleteOnTermination bool

If the root block device will be deleted on termination.

DeviceName string

Physical name of the device.

Encrypted bool

If the EBS volume is encrypted.

Iops int

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

KmsKeyId string
SnapshotId string

ID of the snapshot.

Tags map[string]string

Map of tags assigned to the Instance.

Throughput int

Throughput of the volume, in MiB/s.

VolumeId string
VolumeSize int

Size of the volume, in GiB.

VolumeType string

Type of the volume.

deleteOnTermination Boolean

If the root block device will be deleted on termination.

deviceName String

Physical name of the device.

encrypted Boolean

If the EBS volume is encrypted.

iops Integer

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

kmsKeyId String
snapshotId String

ID of the snapshot.

tags Map<String,String>

Map of tags assigned to the Instance.

throughput Integer

Throughput of the volume, in MiB/s.

volumeId String
volumeSize Integer

Size of the volume, in GiB.

volumeType String

Type of the volume.

deleteOnTermination boolean

If the root block device will be deleted on termination.

deviceName string

Physical name of the device.

encrypted boolean

If the EBS volume is encrypted.

iops number

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

kmsKeyId string
snapshotId string

ID of the snapshot.

tags {[key: string]: string}

Map of tags assigned to the Instance.

throughput number

Throughput of the volume, in MiB/s.

volumeId string
volumeSize number

Size of the volume, in GiB.

volumeType string

Type of the volume.

delete_on_termination bool

If the root block device will be deleted on termination.

device_name str

Physical name of the device.

encrypted bool

If the EBS volume is encrypted.

iops int

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

kms_key_id str
snapshot_id str

ID of the snapshot.

tags Mapping[str, str]

Map of tags assigned to the Instance.

throughput int

Throughput of the volume, in MiB/s.

volume_id str
volume_size int

Size of the volume, in GiB.

volume_type str

Type of the volume.

deleteOnTermination Boolean

If the root block device will be deleted on termination.

deviceName String

Physical name of the device.

encrypted Boolean

If the EBS volume is encrypted.

iops Number

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

kmsKeyId String
snapshotId String

ID of the snapshot.

tags Map<String>

Map of tags assigned to the Instance.

throughput Number

Throughput of the volume, in MiB/s.

volumeId String
volumeSize Number

Size of the volume, in GiB.

volumeType String

Type of the volume.

GetInstanceEnclaveOption

Enabled bool

Whether Nitro Enclaves are enabled.

Enabled bool

Whether Nitro Enclaves are enabled.

enabled Boolean

Whether Nitro Enclaves are enabled.

enabled boolean

Whether Nitro Enclaves are enabled.

enabled bool

Whether Nitro Enclaves are enabled.

enabled Boolean

Whether Nitro Enclaves are enabled.

GetInstanceEphemeralBlockDevice

DeviceName string

Physical name of the device.

NoDevice bool

Whether the specified device included in the device mapping was suppressed or not (Boolean).

VirtualName string

Virtual device name.

DeviceName string

Physical name of the device.

NoDevice bool

Whether the specified device included in the device mapping was suppressed or not (Boolean).

VirtualName string

Virtual device name.

deviceName String

Physical name of the device.

noDevice Boolean

Whether the specified device included in the device mapping was suppressed or not (Boolean).

virtualName String

Virtual device name.

deviceName string

Physical name of the device.

noDevice boolean

Whether the specified device included in the device mapping was suppressed or not (Boolean).

virtualName string

Virtual device name.

device_name str

Physical name of the device.

no_device bool

Whether the specified device included in the device mapping was suppressed or not (Boolean).

virtual_name str

Virtual device name.

deviceName String

Physical name of the device.

noDevice Boolean

Whether the specified device included in the device mapping was suppressed or not (Boolean).

virtualName String

Virtual device name.

GetInstanceFilter

Name string
Values List<string>
Name string
Values []string
name String
values List<String>
name string
values string[]
name str
values Sequence[str]
name String
values List<String>

GetInstanceMaintenanceOption

AutoRecovery string

Automatic recovery behavior of the instance.

AutoRecovery string

Automatic recovery behavior of the instance.

autoRecovery String

Automatic recovery behavior of the instance.

autoRecovery string

Automatic recovery behavior of the instance.

auto_recovery str

Automatic recovery behavior of the instance.

autoRecovery String

Automatic recovery behavior of the instance.

GetInstanceMetadataOption

HttpEndpoint string

State of the metadata service: enabled, disabled.

HttpPutResponseHopLimit int

Desired HTTP PUT response hop limit for instance metadata requests.

HttpTokens string

If session tokens are required: optional, required.

InstanceMetadataTags string

If access to instance tags is allowed from the metadata service: enabled, disabled.

HttpEndpoint string

State of the metadata service: enabled, disabled.

HttpPutResponseHopLimit int

Desired HTTP PUT response hop limit for instance metadata requests.

HttpTokens string

If session tokens are required: optional, required.

InstanceMetadataTags string

If access to instance tags is allowed from the metadata service: enabled, disabled.

httpEndpoint String

State of the metadata service: enabled, disabled.

httpPutResponseHopLimit Integer

Desired HTTP PUT response hop limit for instance metadata requests.

httpTokens String

If session tokens are required: optional, required.

instanceMetadataTags String

If access to instance tags is allowed from the metadata service: enabled, disabled.

httpEndpoint string

State of the metadata service: enabled, disabled.

httpPutResponseHopLimit number

Desired HTTP PUT response hop limit for instance metadata requests.

httpTokens string

If session tokens are required: optional, required.

instanceMetadataTags string

If access to instance tags is allowed from the metadata service: enabled, disabled.

http_endpoint str

State of the metadata service: enabled, disabled.

http_put_response_hop_limit int

Desired HTTP PUT response hop limit for instance metadata requests.

http_tokens str

If session tokens are required: optional, required.

instance_metadata_tags str

If access to instance tags is allowed from the metadata service: enabled, disabled.

httpEndpoint String

State of the metadata service: enabled, disabled.

httpPutResponseHopLimit Number

Desired HTTP PUT response hop limit for instance metadata requests.

httpTokens String

If session tokens are required: optional, required.

instanceMetadataTags String

If access to instance tags is allowed from the metadata service: enabled, disabled.

GetInstancePrivateDnsNameOption

EnableResourceNameDnsARecord bool

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

EnableResourceNameDnsAaaaRecord bool

Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

HostnameType string

Type of hostname for EC2 instances.

EnableResourceNameDnsARecord bool

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

EnableResourceNameDnsAaaaRecord bool

Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

HostnameType string

Type of hostname for EC2 instances.

enableResourceNameDnsARecord Boolean

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

enableResourceNameDnsAaaaRecord Boolean

Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

hostnameType String

Type of hostname for EC2 instances.

enableResourceNameDnsARecord boolean

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

enableResourceNameDnsAaaaRecord boolean

Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

hostnameType string

Type of hostname for EC2 instances.

enable_resource_name_dns_a_record bool

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

enable_resource_name_dns_aaaa_record bool

Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

hostname_type str

Type of hostname for EC2 instances.

enableResourceNameDnsARecord Boolean

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

enableResourceNameDnsAaaaRecord Boolean

Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

hostnameType String

Type of hostname for EC2 instances.

GetInstanceRootBlockDevice

DeleteOnTermination bool

If the root block device will be deleted on termination.

DeviceName string

Physical name of the device.

Encrypted bool

If the EBS volume is encrypted.

Iops int

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

KmsKeyId string
Tags Dictionary<string, string>

Map of tags assigned to the Instance.

Throughput int

Throughput of the volume, in MiB/s.

VolumeId string
VolumeSize int

Size of the volume, in GiB.

VolumeType string

Type of the volume.

DeleteOnTermination bool

If the root block device will be deleted on termination.

DeviceName string

Physical name of the device.

Encrypted bool

If the EBS volume is encrypted.

Iops int

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

KmsKeyId string
Tags map[string]string

Map of tags assigned to the Instance.

Throughput int

Throughput of the volume, in MiB/s.

VolumeId string
VolumeSize int

Size of the volume, in GiB.

VolumeType string

Type of the volume.

deleteOnTermination Boolean

If the root block device will be deleted on termination.

deviceName String

Physical name of the device.

encrypted Boolean

If the EBS volume is encrypted.

iops Integer

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

kmsKeyId String
tags Map<String,String>

Map of tags assigned to the Instance.

throughput Integer

Throughput of the volume, in MiB/s.

volumeId String
volumeSize Integer

Size of the volume, in GiB.

volumeType String

Type of the volume.

deleteOnTermination boolean

If the root block device will be deleted on termination.

deviceName string

Physical name of the device.

encrypted boolean

If the EBS volume is encrypted.

iops number

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

kmsKeyId string
tags {[key: string]: string}

Map of tags assigned to the Instance.

throughput number

Throughput of the volume, in MiB/s.

volumeId string
volumeSize number

Size of the volume, in GiB.

volumeType string

Type of the volume.

delete_on_termination bool

If the root block device will be deleted on termination.

device_name str

Physical name of the device.

encrypted bool

If the EBS volume is encrypted.

iops int

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

kms_key_id str
tags Mapping[str, str]

Map of tags assigned to the Instance.

throughput int

Throughput of the volume, in MiB/s.

volume_id str
volume_size int

Size of the volume, in GiB.

volume_type str

Type of the volume.

deleteOnTermination Boolean

If the root block device will be deleted on termination.

deviceName String

Physical name of the device.

encrypted Boolean

If the EBS volume is encrypted.

iops Number

0 If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.

kmsKeyId String
tags Map<String>

Map of tags assigned to the Instance.

throughput Number

Throughput of the volume, in MiB/s.

volumeId String
volumeSize Number

Size of the volume, in GiB.

volumeType String

Type of the volume.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.