Ec2Functions
Functions
Use this data source to get the ID of a registered AMI for use in other resources.
Use this data source to get a list of AMI IDs matching the specified criteria.
Provides details about a specific EC2 Customer-Owned IP Pool. This data source can prove useful when a module accepts a coip pool id as an input variable and needs to, for example, determine the CIDR block of that COIP Pool.
Provides information for multiple EC2 Customer-Owned IP Pools, such as their identifiers.
Get an existing AWS Customer Gateway.
Use this data source to get information about an EC2 Dedicated Host.
Provides a list of Elastic IPs in a region.
aws.ec2.Eip
provides details about a specific Elastic IP.
Use this data source to get the ID of an Amazon EC2 Instance for use in other resources.
Use this data source to get IDs or IPs of Amazon EC2 instances to be referenced elsewhere, e.g., to allow easier migration from another management solution or to make it easier for an operator to connect through bastion host(s).
Get characteristics for a single EC2 Instance Type.
Information about single EC2 Instance Type Offering.
Information about EC2 Instance Type Offerings.
Information about EC2 Instance Types.
aws.ec2.InternetGateway
provides details about a specific Internet Gateway.
Previews a CIDR from an IPAM address pool. Only works for private IPv4.
Use this data source to get information about a specific EC2 Key Pair.
Provides information about a Launch Configuration.
Provides information about a Launch Template.
Provides details about an EC2 Local Gateway.
Provides details about an EC2 Local Gateway Route Table. This data source can prove useful when a module accepts a local gateway route table id as an input variable and needs to, for example, find the associated Outpost or Local Gateway.
Provides information for multiple EC2 Local Gateway Route Tables, such as their identifiers.
Provides information for multiple EC2 Local Gateways, such as their identifiers.
Provides details about an EC2 Local Gateway Virtual Interface. More information can be found in the Outposts User Guide.
Provides details about an EC2 Local Gateway Virtual Interface Group. More information can be found in the Outposts User Guide.
Provides details about multiple EC2 Local Gateway Virtual Interface Groups, such as identifiers. More information can be found in the Outposts User Guide.
aws.ec2.ManagedPrefixList
provides details about a specific AWS prefix list or customer-managed prefix list in the current region.
This resource can be useful for getting back a list of managed prefix list ids to be referenced elsewhere.
Provides details about a specific Nat Gateway.
This resource can be useful for getting back a list of NAT gateway ids to be referenced elsewhere.
The following shows outputting all network ACL ids in a vpc.
aws.ec2.NetworkInsightsAnalysis
provides details about a specific Network Insights Analysis.
aws.ec2.NetworkInsightsPath
provides details about a specific Network Insights Path.
Use this data source to get information about a Network Interface.
The following shows outputting all network interface ids in a region.
aws.ec2.getPrefixList
provides details about a specific AWS prefix list (PL) in the current region. This can be used both to validate a prefix list given in a variable and to obtain the CIDR blocks (IP address ranges) for the associated AWS service. The latter may be useful e.g., for adding network ACL rules. The aws.ec2.ManagedPrefixList data source is normally more appropriate to use given it can return customer-managed prefix list info, as well as additional attributes.
Provides details about a specific AWS EC2 Public IPv4 Pool.
Data source for getting information about AWS EC2 Public IPv4 Pools.
aws.ec2.Route
provides details about a specific Route. This resource can prove useful when finding the resource associated with a CIDR. For example, finding the peering connection associated with a CIDR value.
aws.ec2.RouteTable
provides details about a specific Route Table. This resource can prove useful when a module accepts a Subnet ID as an input variable and needs to, for example, add a route in the Route Table.
This resource can be useful for getting back a list of route table ids to be referenced elsewhere.
aws.ec2.SecurityGroup
provides details about a specific Security Group. This resource can prove useful when a module accepts a Security Group id as an input variable and needs to, for example, determine the id of the VPC that the security group belongs to.
Use this data source to get IDs and VPC membership of Security Groups that are created outside this provider.
Provides a way to check whether serial console access is enabled for your AWS account in the current AWS region.
Information about most recent Spot Price for a given EC2 instance.
aws.ec2.Subnet
provides details about a specific VPC subnet. This resource can prove useful when a module accepts a subnet ID as an input variable and needs to, for example, determine the ID of the VPC that the subnet belongs to.
aws.ec2.getSubnetIds
provides a set of ids for a vpc_id This resource can be useful for getting back a set of subnet ids for a vpc.
This resource can be useful for getting back a set of subnet IDs.
Provides information for multiple EC2 Transit Gateway Route Tables, such as their identifiers.
aws.ec2.Vpc
provides details about a specific VPC. This resource can prove useful when a module accepts a vpc id as an input variable and needs to, for example, determine the CIDR block of that VPC.
Retrieve information about an EC2 DHCP Options configuration.
The VPC Endpoint data source provides details about a specific VPC endpoint.
The VPC Endpoint Service data source details about a specific service that can be specified when creating a VPC endpoint within the region configured in the provider.
aws.ec2.VpcIpamPool
provides details about an IPAM pool. This resource can prove useful when an ipam pool was created in another root module and you need the pool's id as an input variable. For example, pools can be shared via RAM and used to create vpcs with CIDRs from that pool.
aws.ec2.getVpcIamPoolCidrs
provides details about an IPAM pool. This resource can prove useful when an ipam pool was shared to your account and you want to know all (or a filtered list) of the CIDRs that are provisioned into the pool.
aws.ec2.getVpcIamPools
provides details about IPAM pools. This resource can prove useful when IPAM pools are created in another root module and you need the pool ids as input variables. For example, pools can be shared via RAM and used to create vpcs with CIDRs from that pool.
The VPC Peering Connection data source provides details about a specific VPC peering connection.
Use this data source to get IDs of Amazon VPC peering connections To get more details on each connection, use the data resource aws.ec2.VpcPeeringConnection Note: To use this data source in a count, the resources should exist before trying to access the data source.
This resource can be useful for getting back a list of VPC Ids for a region. The following example retrieves a list of VPC Ids with a custom tag of service
set to a value of "production".
The VPN Gateway data source provides details about a specific VPN gateway.