Try AWS Native preview for resources not in the classic version.
aws.ec2.getInstance
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Use this data source to get the ID of an Amazon EC2 Instance for use in other resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const foo = aws.ec2.getInstance({
instanceId: "i-instanceid",
filters: [
{
name: "image-id",
values: ["ami-xxxxxxxx"],
},
{
name: "tag:Name",
values: ["instance-name-tag"],
},
],
});
import pulumi
import pulumi_aws as aws
foo = aws.ec2.get_instance(instance_id="i-instanceid",
filters=[
{
"name": "image-id",
"values": ["ami-xxxxxxxx"],
},
{
"name": "tag:Name",
"values": ["instance-name-tag"],
},
])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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{
InstanceId: pulumi.StringRef("i-instanceid"),
Filters: []ec2.GetInstanceFilter{
{
Name: "image-id",
Values: []string{
"ami-xxxxxxxx",
},
},
{
Name: "tag:Name",
Values: []string{
"instance-name-tag",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var foo = Aws.Ec2.GetInstance.Invoke(new()
{
InstanceId = "i-instanceid",
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",
},
},
},
});
});
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.ec2.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()
.instanceId("i-instanceid")
.filters(
GetInstanceFilterArgs.builder()
.name("image-id")
.values("ami-xxxxxxxx")
.build(),
GetInstanceFilterArgs.builder()
.name("tag:Name")
.values("instance-name-tag")
.build())
.build());
}
}
variables:
foo:
fn::invoke:
Function: aws:ec2:getInstance
Arguments:
instanceId: i-instanceid
filters:
- name: image-id
values:
- ami-xxxxxxxx
- name: tag:Name
values:
- instance-name-tag
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<Get
Instance Filter> - 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 boolData - 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 boolData 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 theuser_data
attribute. Defaults tofalse
.NOTE: At least one of
filter
,instance_tags
, orinstance_id
must be specified.NOTE: If anything other than a single match is returned by the search, this call will fail. Ensure that your search is specific enough to return a single Instance ID only.
- Instance
Id string - Specify the exact Instance ID with which to populate the data source.
- Dictionary<string, string>
- Map of tags, each pair of which must exactly match a pair on the desired Instance.
- Dictionary<string, string>
- Map of tags assigned to the Instance.
- Filters
[]Get
Instance Filter - 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 boolData - 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 boolData 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 theuser_data
attribute. Defaults tofalse
.NOTE: At least one of
filter
,instance_tags
, orinstance_id
must be specified.NOTE: If anything other than a single match is returned by the search, this call will fail. Ensure that your search is specific enough to return a single Instance ID only.
- Instance
Id string - Specify the exact Instance ID with which to populate the data source.
- map[string]string
- Map of tags, each pair of which must exactly match a pair on the desired Instance.
- map[string]string
- Map of tags assigned to the Instance.
- filters
List<Get
Instance Filter> - 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 BooleanData - 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 BooleanData 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 theuser_data
attribute. Defaults tofalse
.NOTE: At least one of
filter
,instance_tags
, orinstance_id
must be specified.NOTE: If anything other than a single match is returned by the search, this call will fail. Ensure that your search is specific enough to return a single Instance ID only.
- instance
Id String - Specify the exact Instance ID with which to populate the data source.
- Map<String,String>
- Map of tags, each pair of which must exactly match a pair on the desired Instance.
- Map<String,String>
- Map of tags assigned to the Instance.
- filters
Get
Instance Filter[] - 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 booleanData - 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 booleanData 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 theuser_data
attribute. Defaults tofalse
.NOTE: At least one of
filter
,instance_tags
, orinstance_id
must be specified.NOTE: If anything other than a single match is returned by the search, this call will fail. Ensure that your search is specific enough to return a single Instance ID only.
- instance
Id string - Specify the exact Instance ID with which to populate the data source.
- {[key: string]: string}
- Map of tags, each pair of which must exactly match a pair on the desired Instance.
- {[key: string]: string}
- Map of tags assigned to the Instance.
- filters
Sequence[Get
Instance Filter] - 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_ booldata - 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_ booldata 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 theuser_data
attribute. Defaults tofalse
.NOTE: At least one of
filter
,instance_tags
, orinstance_id
must be specified.NOTE: If anything other than a single match is returned by the search, this call will fail. Ensure that your search is specific enough to return a single Instance ID only.
- instance_
id str - Specify the exact Instance ID with which to populate the data source.
- Mapping[str, str]
- Map of tags, each pair of which must exactly match a pair on the desired Instance.
- 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].
- get
Password BooleanData - 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 BooleanData 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 theuser_data
attribute. Defaults tofalse
.NOTE: At least one of
filter
,instance_tags
, orinstance_id
must be specified.NOTE: If anything other than a single match is returned by the search, this call will fail. Ensure that your search is specific enough to return a single Instance ID only.
- instance
Id String - Specify the exact Instance ID with which to populate the data source.
- Map<String>
- Map of tags, each pair of which must exactly match a pair on the desired Instance.
- 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.
- Associate
Public boolIp Address - Whether or not the Instance is associated with a public IP address or not (Boolean).
- Availability
Zone string - Availability zone of the Instance.
- Credit
Specifications List<GetInstance Credit Specification> - Credit specification of the Instance.
- Disable
Api boolStop - 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 boolTermination - Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- Ebs
Block List<GetDevices Instance Ebs Block Device> - EBS block device mappings of the Instance.
- Ebs
Optimized bool - Whether the Instance is EBS optimized or not (Boolean).
- Enclave
Options List<GetInstance Enclave Option> - Enclave options of the instance.
- Ephemeral
Block List<GetDevices Instance Ephemeral Block Device> - Ephemeral block device mappings of the Instance.
- Host
Id string - ID of the dedicated host the instance will be assigned to.
- Host
Resource stringGroup Arn - ARN of the host resource group the instance is associated with.
- Iam
Instance stringProfile - Name of the instance profile associated with the Instance.
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
State string - State of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information. - Dictionary<string, string>
- Instance
Type 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.
- Key
Name string - Key name of the Instance.
- Launch
Time string - Time the instance was launched.
- Maintenance
Options List<GetInstance Maintenance Option> - Maintenance and recovery options for the instance.
- Metadata
Options List<GetInstance Metadata Option> - Metadata options of the Instance.
- Monitoring bool
- Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- Network
Interface stringId - ID of the network interface that was created with the Instance.
- Outpost
Arn string - ARN of the Outpost.
- Password
Data 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. - Placement
Group string - Placement group of the Instance.
- Placement
Partition intNumber - Number of the partition the instance is in.
- Private
Dns 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.
- Private
Dns List<GetName Options Instance Private Dns Name Option> - Options for the instance hostname.
- Private
Ip string - Private IP address assigned to the Instance.
- Public
Dns string - 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 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 usepublic_ip
, as this field will change after the EIP is attached. - Root
Block List<GetDevices Instance Root Block Device> - Root block device mappings of the Instance
- Secondary
Private List<string>Ips - Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- Security
Groups List<string> - Associated security groups.
- Source
Dest boolCheck - Whether the network interface performs source/destination checking (Boolean).
- Subnet
Id string - VPC subnet ID.
- Dictionary<string, string>
- Map of tags assigned to the Instance.
- Tenancy string
- Tenancy of the instance:
dedicated
,default
,host
. - User
Data string - SHA-1 hash of User Data supplied to the Instance.
- User
Data stringBase64 - Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true. - Vpc
Security List<string>Group Ids - Associated security groups in a non-default VPC.
- Filters
List<Get
Instance Filter> - Get
Password boolData - Get
User boolData - Instance
Id string
- Ami string
- ID of the AMI used to launch the instance.
- Arn string
- ARN of the instance.
- Associate
Public boolIp Address - Whether or not the Instance is associated with a public IP address or not (Boolean).
- Availability
Zone string - Availability zone of the Instance.
- Credit
Specifications []GetInstance Credit Specification - Credit specification of the Instance.
- Disable
Api boolStop - 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 boolTermination - Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- Ebs
Block []GetDevices Instance Ebs Block Device - EBS block device mappings of the Instance.
- Ebs
Optimized bool - Whether the Instance is EBS optimized or not (Boolean).
- Enclave
Options []GetInstance Enclave Option - Enclave options of the instance.
- Ephemeral
Block []GetDevices Instance Ephemeral Block Device - Ephemeral block device mappings of the Instance.
- Host
Id string - ID of the dedicated host the instance will be assigned to.
- Host
Resource stringGroup Arn - ARN of the host resource group the instance is associated with.
- Iam
Instance stringProfile - Name of the instance profile associated with the Instance.
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
State string - State of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information. - map[string]string
- Instance
Type 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.
- Key
Name string - Key name of the Instance.
- Launch
Time string - Time the instance was launched.
- Maintenance
Options []GetInstance Maintenance Option - Maintenance and recovery options for the instance.
- Metadata
Options []GetInstance Metadata Option - Metadata options of the Instance.
- Monitoring bool
- Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- Network
Interface stringId - ID of the network interface that was created with the Instance.
- Outpost
Arn string - ARN of the Outpost.
- Password
Data 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. - Placement
Group string - Placement group of the Instance.
- Placement
Partition intNumber - Number of the partition the instance is in.
- Private
Dns 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.
- Private
Dns []GetName Options Instance Private Dns Name Option - Options for the instance hostname.
- Private
Ip string - Private IP address assigned to the Instance.
- Public
Dns string - 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 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 usepublic_ip
, as this field will change after the EIP is attached. - Root
Block []GetDevices Instance Root Block Device - Root block device mappings of the Instance
- Secondary
Private []stringIps - Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- Security
Groups []string - Associated security groups.
- Source
Dest boolCheck - Whether the network interface performs source/destination checking (Boolean).
- Subnet
Id string - VPC subnet ID.
- map[string]string
- Map of tags assigned to the Instance.
- Tenancy string
- Tenancy of the instance:
dedicated
,default
,host
. - User
Data string - SHA-1 hash of User Data supplied to the Instance.
- User
Data stringBase64 - Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true. - Vpc
Security []stringGroup Ids - Associated security groups in a non-default VPC.
- Filters
[]Get
Instance Filter - Get
Password boolData - Get
User boolData - Instance
Id string
- ami String
- ID of the AMI used to launch the instance.
- arn String
- ARN of the instance.
- associate
Public BooleanIp Address - Whether or not the Instance is associated with a public IP address or not (Boolean).
- availability
Zone String - Availability zone of the Instance.
- credit
Specifications List<GetInstance Credit Specification> - Credit specification of the Instance.
- disable
Api BooleanStop - 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 BooleanTermination - Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- ebs
Block List<GetDevices Instance Ebs Block Device> - EBS block device mappings of the Instance.
- ebs
Optimized Boolean - Whether the Instance is EBS optimized or not (Boolean).
- enclave
Options List<GetInstance Enclave Option> - Enclave options of the instance.
- ephemeral
Block List<GetDevices Instance Ephemeral Block Device> - Ephemeral block device mappings of the Instance.
- host
Id String - ID of the dedicated host the instance will be assigned to.
- host
Resource StringGroup Arn - ARN of the host resource group the instance is associated with.
- iam
Instance StringProfile - Name of the instance profile associated with the Instance.
- id String
- The provider-assigned unique ID for this managed resource.
- instance
State String - State of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information. - Map<String,String>
- instance
Type 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.
- key
Name String - Key name of the Instance.
- launch
Time String - Time the instance was launched.
- maintenance
Options List<GetInstance Maintenance Option> - Maintenance and recovery options for the instance.
- metadata
Options List<GetInstance Metadata Option> - Metadata options of the Instance.
- monitoring Boolean
- Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- network
Interface StringId - ID of the network interface that was created with the Instance.
- outpost
Arn String - ARN of the Outpost.
- password
Data 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. - placement
Group String - Placement group of the Instance.
- placement
Partition IntegerNumber - Number of the partition the instance is in.
- private
Dns 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.
- private
Dns List<GetName Options Instance Private Dns Name Option> - Options for the instance hostname.
- private
Ip String - Private IP address assigned to the Instance.
- public
Dns String - 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 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 usepublic_ip
, as this field will change after the EIP is attached. - root
Block List<GetDevices Instance Root Block Device> - Root block device mappings of the Instance
- secondary
Private List<String>Ips - Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- security
Groups List<String> - Associated security groups.
- source
Dest BooleanCheck - Whether the network interface performs source/destination checking (Boolean).
- subnet
Id String - VPC subnet ID.
- Map<String,String>
- Map of tags assigned to the Instance.
- tenancy String
- Tenancy of the instance:
dedicated
,default
,host
. - user
Data String - SHA-1 hash of User Data supplied to the Instance.
- user
Data StringBase64 - Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true. - vpc
Security List<String>Group Ids - Associated security groups in a non-default VPC.
- filters
List<Get
Instance Filter> - get
Password BooleanData - get
User BooleanData - instance
Id String
- ami string
- ID of the AMI used to launch the instance.
- arn string
- ARN of the instance.
- associate
Public booleanIp Address - Whether or not the Instance is associated with a public IP address or not (Boolean).
- availability
Zone string - Availability zone of the Instance.
- credit
Specifications GetInstance Credit Specification[] - Credit specification of the Instance.
- disable
Api booleanStop - 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 booleanTermination - Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- ebs
Block GetDevices Instance Ebs Block Device[] - EBS block device mappings of the Instance.
- ebs
Optimized boolean - Whether the Instance is EBS optimized or not (Boolean).
- enclave
Options GetInstance Enclave Option[] - Enclave options of the instance.
- ephemeral
Block GetDevices Instance Ephemeral Block Device[] - Ephemeral block device mappings of the Instance.
- host
Id string - ID of the dedicated host the instance will be assigned to.
- host
Resource stringGroup Arn - ARN of the host resource group the instance is associated with.
- iam
Instance stringProfile - Name of the instance profile associated with the Instance.
- id string
- The provider-assigned unique ID for this managed resource.
- instance
State string - State of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information. - {[key: string]: string}
- instance
Type 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.
- key
Name string - Key name of the Instance.
- launch
Time string - Time the instance was launched.
- maintenance
Options GetInstance Maintenance Option[] - Maintenance and recovery options for the instance.
- metadata
Options GetInstance Metadata Option[] - Metadata options of the Instance.
- monitoring boolean
- Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- network
Interface stringId - ID of the network interface that was created with the Instance.
- outpost
Arn string - ARN of the Outpost.
- password
Data 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. - placement
Group string - Placement group of the Instance.
- placement
Partition numberNumber - Number of the partition the instance is in.
- private
Dns 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.
- private
Dns GetName Options Instance Private Dns Name Option[] - Options for the instance hostname.
- private
Ip string - Private IP address assigned to the Instance.
- public
Dns string - 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 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 usepublic_ip
, as this field will change after the EIP is attached. - root
Block GetDevices Instance Root Block Device[] - Root block device mappings of the Instance
- secondary
Private string[]Ips - Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- security
Groups string[] - Associated security groups.
- source
Dest booleanCheck - Whether the network interface performs source/destination checking (Boolean).
- subnet
Id string - VPC subnet ID.
- {[key: string]: string}
- Map of tags assigned to the Instance.
- tenancy string
- Tenancy of the instance:
dedicated
,default
,host
. - user
Data string - SHA-1 hash of User Data supplied to the Instance.
- user
Data stringBase64 - Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true. - vpc
Security string[]Group Ids - Associated security groups in a non-default VPC.
- filters
Get
Instance Filter[] - get
Password booleanData - get
User booleanData - instance
Id string
- ami str
- ID of the AMI used to launch the instance.
- arn str
- ARN of the instance.
- associate_
public_ boolip_ address - 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[GetInstance Credit Specification] - Credit specification of the Instance.
- disable_
api_ boolstop - 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_ booltermination - Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- ebs_
block_ Sequence[Getdevices Instance Ebs Block Device] - EBS block device mappings of the Instance.
- ebs_
optimized bool - Whether the Instance is EBS optimized or not (Boolean).
- enclave_
options Sequence[GetInstance Enclave Option] - Enclave options of the instance.
- ephemeral_
block_ Sequence[Getdevices Instance Ephemeral Block Device] - Ephemeral block device mappings of the Instance.
- host_
id str - ID of the dedicated host the instance will be assigned to.
- host_
resource_ strgroup_ arn - ARN of the host resource group the instance is associated with.
- iam_
instance_ strprofile - 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. - 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.
- launch_
time str - Time the instance was launched.
- maintenance_
options Sequence[GetInstance Maintenance Option] - Maintenance and recovery options for the instance.
- metadata_
options Sequence[GetInstance Metadata Option] - Metadata options of the Instance.
- monitoring bool
- Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- network_
interface_ strid - 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_ intnumber - 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_ Sequence[Getname_ options Instance Private Dns Name Option] - 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 usepublic_ip
, as this field will change after the EIP is attached. - root_
block_ Sequence[Getdevices Instance Root Block Device] - Root block device mappings of the Instance
- secondary_
private_ Sequence[str]ips - 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_ boolcheck - Whether the network interface performs source/destination checking (Boolean).
- subnet_
id str - VPC subnet ID.
- 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_ strbase64 - Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true. - vpc_
security_ Sequence[str]group_ ids - Associated security groups in a non-default VPC.
- filters
Sequence[Get
Instance Filter] - get_
password_ booldata - get_
user_ booldata - instance_
id str
- ami String
- ID of the AMI used to launch the instance.
- arn String
- ARN of the instance.
- associate
Public BooleanIp Address - Whether or not the Instance is associated with a public IP address or not (Boolean).
- availability
Zone String - Availability zone of the Instance.
- credit
Specifications List<Property Map> - Credit specification of the Instance.
- disable
Api BooleanStop - 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 BooleanTermination - Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- ebs
Block List<Property Map>Devices - EBS block device mappings of the Instance.
- ebs
Optimized Boolean - Whether the Instance is EBS optimized or not (Boolean).
- enclave
Options List<Property Map> - Enclave options of the instance.
- ephemeral
Block List<Property Map>Devices - Ephemeral block device mappings of the Instance.
- host
Id String - ID of the dedicated host the instance will be assigned to.
- host
Resource StringGroup Arn - ARN of the host resource group the instance is associated with.
- iam
Instance StringProfile - Name of the instance profile associated with the Instance.
- id String
- The provider-assigned unique ID for this managed resource.
- instance
State String - State of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information. - Map<String>
- instance
Type 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.
- key
Name String - Key name of the Instance.
- launch
Time String - Time the instance was launched.
- maintenance
Options List<Property Map> - Maintenance and recovery options for the instance.
- metadata
Options List<Property Map> - Metadata options of the Instance.
- monitoring Boolean
- Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- network
Interface StringId - ID of the network interface that was created with the Instance.
- outpost
Arn String - ARN of the Outpost.
- password
Data 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. - placement
Group String - Placement group of the Instance.
- placement
Partition NumberNumber - Number of the partition the instance is in.
- private
Dns 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.
- private
Dns List<Property Map>Name Options - Options for the instance hostname.
- private
Ip String - Private IP address assigned to the Instance.
- public
Dns String - 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 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 usepublic_ip
, as this field will change after the EIP is attached. - root
Block List<Property Map>Devices - Root block device mappings of the Instance
- secondary
Private List<String>Ips - Secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- security
Groups List<String> - Associated security groups.
- source
Dest BooleanCheck - Whether the network interface performs source/destination checking (Boolean).
- subnet
Id String - VPC subnet ID.
- Map<String>
- Map of tags assigned to the Instance.
- tenancy String
- Tenancy of the instance:
dedicated
,default
,host
. - user
Data String - SHA-1 hash of User Data supplied to the Instance.
- user
Data StringBase64 - Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true. - vpc
Security List<String>Group Ids - Associated security groups in a non-default VPC.
- filters List<Property Map>
- get
Password BooleanData - get
User BooleanData - instance
Id String
Supporting Types
GetInstanceCreditSpecification
- Cpu
Credits string
- Cpu
Credits string
- cpu
Credits String
- cpu
Credits string
- cpu_
credits str
- cpu
Credits String
GetInstanceEbsBlockDevice
- Delete
On boolTermination - If the root block device will be deleted on termination.
- Device
Name 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.- Kms
Key stringId - Snapshot
Id string - ID of the snapshot.
- Dictionary<string, string>
- Map of tags assigned to the Instance.
- Throughput int
- Throughput of the volume, in MiB/s.
- Volume
Id string - Volume
Size int - Size of the volume, in GiB.
- Volume
Type string - Type of the volume.
- Delete
On boolTermination - If the root block device will be deleted on termination.
- Device
Name 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.- Kms
Key stringId - Snapshot
Id string - ID of the snapshot.
- map[string]string
- Map of tags assigned to the Instance.
- Throughput int
- Throughput of the volume, in MiB/s.
- Volume
Id string - Volume
Size int - Size of the volume, in GiB.
- Volume
Type string - Type of the volume.
- delete
On BooleanTermination - If the root block device will be deleted on termination.
- device
Name 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.- kms
Key StringId - snapshot
Id String - ID of the snapshot.
- Map<String,String>
- Map of tags assigned to the Instance.
- throughput Integer
- Throughput of the volume, in MiB/s.
- volume
Id String - volume
Size Integer - Size of the volume, in GiB.
- volume
Type String - Type of the volume.
- delete
On booleanTermination - If the root block device will be deleted on termination.
- device
Name 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.- kms
Key stringId - snapshot
Id string - ID of the snapshot.
- {[key: string]: string}
- Map of tags assigned to the Instance.
- throughput number
- Throughput of the volume, in MiB/s.
- volume
Id string - volume
Size number - Size of the volume, in GiB.
- volume
Type string - Type of the volume.
- delete_
on_ booltermination - 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_ strid - snapshot_
id str - ID of the snapshot.
- 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.
- delete
On BooleanTermination - If the root block device will be deleted on termination.
- device
Name 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.- kms
Key StringId - snapshot
Id String - ID of the snapshot.
- Map<String>
- Map of tags assigned to the Instance.
- throughput Number
- Throughput of the volume, in MiB/s.
- volume
Id String - volume
Size Number - Size of the volume, in GiB.
- volume
Type 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
- Device
Name string - Physical name of the device.
- No
Device bool - Whether the specified device included in the device mapping was suppressed or not (Boolean).
- Virtual
Name string - Virtual device name.
- Device
Name string - Physical name of the device.
- No
Device bool - Whether the specified device included in the device mapping was suppressed or not (Boolean).
- Virtual
Name string - Virtual device name.
- device
Name String - Physical name of the device.
- no
Device Boolean - Whether the specified device included in the device mapping was suppressed or not (Boolean).
- virtual
Name String - Virtual device name.
- device
Name string - Physical name of the device.
- no
Device boolean - Whether the specified device included in the device mapping was suppressed or not (Boolean).
- virtual
Name 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.
- device
Name String - Physical name of the device.
- no
Device Boolean - Whether the specified device included in the device mapping was suppressed or not (Boolean).
- virtual
Name String - Virtual device name.
GetInstanceFilter
GetInstanceMaintenanceOption
- Auto
Recovery string - Automatic recovery behavior of the instance.
- Auto
Recovery string - Automatic recovery behavior of the instance.
- auto
Recovery String - Automatic recovery behavior of the instance.
- auto
Recovery string - Automatic recovery behavior of the instance.
- auto_
recovery str - Automatic recovery behavior of the instance.
- auto
Recovery String - Automatic recovery behavior of the instance.
GetInstanceMetadataOption
- Http
Endpoint string - State of the metadata service:
enabled
,disabled
. - Http
Protocol stringIpv6 - Whether the IPv6 endpoint for the instance metadata service is
enabled
ordisabled
- Http
Put intResponse Hop Limit - Desired HTTP PUT response hop limit for instance metadata requests.
- Http
Tokens string - If session tokens are required:
optional
,required
. - string
- If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- Http
Endpoint string - State of the metadata service:
enabled
,disabled
. - Http
Protocol stringIpv6 - Whether the IPv6 endpoint for the instance metadata service is
enabled
ordisabled
- Http
Put intResponse Hop Limit - Desired HTTP PUT response hop limit for instance metadata requests.
- Http
Tokens string - If session tokens are required:
optional
,required
. - string
- If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- http
Endpoint String - State of the metadata service:
enabled
,disabled
. - http
Protocol StringIpv6 - Whether the IPv6 endpoint for the instance metadata service is
enabled
ordisabled
- http
Put IntegerResponse Hop Limit - Desired HTTP PUT response hop limit for instance metadata requests.
- http
Tokens String - If session tokens are required:
optional
,required
. - String
- If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- http
Endpoint string - State of the metadata service:
enabled
,disabled
. - http
Protocol stringIpv6 - Whether the IPv6 endpoint for the instance metadata service is
enabled
ordisabled
- http
Put numberResponse Hop Limit - Desired HTTP PUT response hop limit for instance metadata requests.
- http
Tokens string - If session tokens are required:
optional
,required
. - 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_
protocol_ stripv6 - Whether the IPv6 endpoint for the instance metadata service is
enabled
ordisabled
- http_
put_ intresponse_ hop_ limit - Desired HTTP PUT response hop limit for instance metadata requests.
- http_
tokens str - If session tokens are required:
optional
,required
. - str
- If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- http
Endpoint String - State of the metadata service:
enabled
,disabled
. - http
Protocol StringIpv6 - Whether the IPv6 endpoint for the instance metadata service is
enabled
ordisabled
- http
Put NumberResponse Hop Limit - Desired HTTP PUT response hop limit for instance metadata requests.
- http
Tokens String - If session tokens are required:
optional
,required
. - String
- If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
GetInstancePrivateDnsNameOption
- Enable
Resource boolName Dns ARecord - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- Enable
Resource boolName Dns Aaaa Record - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- Hostname
Type string - Type of hostname for EC2 instances.
- Enable
Resource boolName Dns ARecord - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- Enable
Resource boolName Dns Aaaa Record - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- Hostname
Type string - Type of hostname for EC2 instances.
- enable
Resource BooleanName Dns ARecord - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable
Resource BooleanName Dns Aaaa Record - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- hostname
Type String - Type of hostname for EC2 instances.
- enable
Resource booleanName Dns ARecord - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable
Resource booleanName Dns Aaaa Record - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- hostname
Type string - Type of hostname for EC2 instances.
- enable_
resource_ boolname_ dns_ a_ record - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable_
resource_ boolname_ dns_ aaaa_ record - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- hostname_
type str - Type of hostname for EC2 instances.
- enable
Resource BooleanName Dns ARecord - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable
Resource BooleanName Dns Aaaa Record - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- hostname
Type String - Type of hostname for EC2 instances.
GetInstanceRootBlockDevice
- Delete
On boolTermination - If the root block device will be deleted on termination.
- Device
Name 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.- Kms
Key stringId - Dictionary<string, string>
- Map of tags assigned to the Instance.
- Throughput int
- Throughput of the volume, in MiB/s.
- Volume
Id string - Volume
Size int - Size of the volume, in GiB.
- Volume
Type string - Type of the volume.
- Delete
On boolTermination - If the root block device will be deleted on termination.
- Device
Name 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.- Kms
Key stringId - map[string]string
- Map of tags assigned to the Instance.
- Throughput int
- Throughput of the volume, in MiB/s.
- Volume
Id string - Volume
Size int - Size of the volume, in GiB.
- Volume
Type string - Type of the volume.
- delete
On BooleanTermination - If the root block device will be deleted on termination.
- device
Name 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.- kms
Key StringId - Map<String,String>
- Map of tags assigned to the Instance.
- throughput Integer
- Throughput of the volume, in MiB/s.
- volume
Id String - volume
Size Integer - Size of the volume, in GiB.
- volume
Type String - Type of the volume.
- delete
On booleanTermination - If the root block device will be deleted on termination.
- device
Name 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.- kms
Key stringId - {[key: string]: string}
- Map of tags assigned to the Instance.
- throughput number
- Throughput of the volume, in MiB/s.
- volume
Id string - volume
Size number - Size of the volume, in GiB.
- volume
Type string - Type of the volume.
- delete_
on_ booltermination - 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_ strid - 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.
- delete
On BooleanTermination - If the root block device will be deleted on termination.
- device
Name 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.- kms
Key StringId - Map<String>
- Map of tags assigned to the Instance.
- throughput Number
- Throughput of the volume, in MiB/s.
- volume
Id String - volume
Size Number - Size of the volume, in GiB.
- volume
Type String - Type of the volume.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.