Ec2Functions

Functions

Link copied to clipboard
suspend fun getAmi(argument: GetAmiPlainArgs): GetAmiResult

Use this data source to get the ID of a registered AMI for use in other resources.

suspend fun getAmi(argument: suspend GetAmiPlainArgsBuilder.() -> Unit): GetAmiResult
suspend fun getAmi(executableUsers: List<String>? = null, filters: List<GetAmiFilter>? = null, includeDeprecated: Boolean? = null, mostRecent: Boolean? = null, nameRegex: String? = null, owners: List<String>? = null, tags: Map<String, String>? = null): GetAmiResult
Link copied to clipboard

Use this data source to get a list of AMI IDs matching the specified criteria.

suspend fun getAmiIds(argument: suspend GetAmiIdsPlainArgsBuilder.() -> Unit): GetAmiIdsResult
suspend fun getAmiIds(executableUsers: List<String>? = null, filters: List<GetAmiIdsFilter>? = null, includeDeprecated: Boolean? = null, nameRegex: String? = null, owners: List<String>, sortAscending: Boolean? = null): GetAmiIdsResult
Link copied to clipboard

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.

suspend fun getCoipPool(argument: suspend GetCoipPoolPlainArgsBuilder.() -> Unit): GetCoipPoolResult
suspend fun getCoipPool(filters: List<GetCoipPoolFilter>? = null, localGatewayRouteTableId: String? = null, poolId: String? = null, tags: Map<String, String>? = null): GetCoipPoolResult
Link copied to clipboard

Provides information for multiple EC2 Customer-Owned IP Pools, such as their identifiers.

suspend fun getCoipPools(filters: List<GetCoipPoolsFilter>? = null, tags: Map<String, String>? = null): GetCoipPoolsResult
Link copied to clipboard

Get an existing AWS Customer Gateway.

suspend fun getCustomerGateway(filters: List<GetCustomerGatewayFilter>? = null, id: String? = null, tags: Map<String, String>? = null): GetCustomerGatewayResult
Link copied to clipboard

Use this data source to get information about an EC2 Dedicated Host.

suspend fun getDedicatedHost(filters: List<GetDedicatedHostFilter>? = null, hostId: String? = null, tags: Map<String, String>? = null): GetDedicatedHostResult
Link copied to clipboard
suspend fun getEips(argument: GetEipsPlainArgs): GetEipsResult

Provides a list of Elastic IPs in a region.

suspend fun getEips(argument: suspend GetEipsPlainArgsBuilder.() -> Unit): GetEipsResult
suspend fun getEips(filters: List<GetEipsFilter>? = null, tags: Map<String, String>? = null): GetEipsResult
Link copied to clipboard

aws.ec2.Eip provides details about a specific Elastic IP.

suspend fun getElasticIp(filters: List<GetElasticIpFilter>? = null, id: String? = null, publicIp: String? = null, tags: Map<String, String>? = null): GetElasticIpResult
Link copied to clipboard

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

suspend fun getInstance(argument: suspend GetInstancePlainArgsBuilder.() -> Unit): GetInstanceResult
suspend fun getInstance(filters: List<GetInstanceFilter>? = null, getPasswordData: Boolean? = null, getUserData: Boolean? = null, instanceId: String? = null, instanceTags: Map<String, String>? = null, tags: Map<String, String>? = null): GetInstanceResult
Link copied to clipboard

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).

suspend fun getInstances(filters: List<GetInstancesFilter>? = null, instanceStateNames: List<String>? = null, instanceTags: Map<String, String>? = null): GetInstancesResult
Link copied to clipboard

Get characteristics for a single EC2 Instance Type.

suspend fun getInstanceType(instanceType: String): GetInstanceTypeResult
Link copied to clipboard

Information about single EC2 Instance Type Offering.

suspend fun getInstanceTypeOffering(filters: List<GetInstanceTypeOfferingFilter>? = null, locationType: String? = null, preferredInstanceTypes: List<String>? = null): GetInstanceTypeOfferingResult
Link copied to clipboard

Information about EC2 Instance Types.

Link copied to clipboard

aws.ec2.InternetGateway provides details about a specific Internet Gateway.

suspend fun getInternetGateway(filters: List<GetInternetGatewayFilter>? = null, internetGatewayId: String? = null, tags: Map<String, String>? = null): GetInternetGatewayResult
Link copied to clipboard

Previews a CIDR from an IPAM address pool. Only works for private IPv4.

suspend fun getIpamPreviewNextCidr(disallowedCidrs: List<String>? = null, ipamPoolId: String, netmaskLength: Int? = null): GetIpamPreviewNextCidrResult
Link copied to clipboard

Use this data source to get information about a specific EC2 Key Pair.

suspend fun getKeyPair(argument: suspend GetKeyPairPlainArgsBuilder.() -> Unit): GetKeyPairResult
suspend fun getKeyPair(filters: List<GetKeyPairFilter>? = null, includePublicKey: Boolean? = null, keyName: String? = null, keyPairId: String? = null, tags: Map<String, String>? = null): GetKeyPairResult
Link copied to clipboard

Provides information about a Launch Template.

suspend fun getLaunchTemplate(filters: List<GetLaunchTemplateFilter>? = null, id: String? = null, name: String? = null, tags: Map<String, String>? = null): GetLaunchTemplateResult
Link copied to clipboard

Provides details about an EC2 Local Gateway.

suspend fun getLocalGateway(filters: List<GetLocalGatewayFilter>? = null, id: String? = null, state: String? = null, tags: Map<String, String>? = null): GetLocalGatewayResult
Link copied to clipboard

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.

suspend fun getLocalGatewayRouteTable(filters: List<GetLocalGatewayRouteTableFilter>? = null, localGatewayId: String? = null, localGatewayRouteTableId: String? = null, outpostArn: String? = null, state: String? = null, tags: Map<String, String>? = null): GetLocalGatewayRouteTableResult
Link copied to clipboard

Provides information for multiple EC2 Local Gateway Route Tables, such as their identifiers.

Link copied to clipboard

Provides information for multiple EC2 Local Gateways, such as their identifiers.

suspend fun getLocalGateways(filters: List<GetLocalGatewaysFilter>? = null, tags: Map<String, String>? = null): GetLocalGatewaysResult
Link copied to clipboard

aws.ec2.ManagedPrefixList provides details about a specific AWS prefix list or customer-managed prefix list in the current region.

suspend fun getManagedPrefixList(filters: List<GetManagedPrefixListFilter>? = null, id: String? = null, name: String? = null, tags: Map<String, String>? = null): GetManagedPrefixListResult
Link copied to clipboard

This resource can be useful for getting back a list of managed prefix list ids to be referenced elsewhere.

Link copied to clipboard

Provides details about a specific Nat Gateway.

suspend fun getNatGateway(filters: List<GetNatGatewayFilter>? = null, id: String? = null, state: String? = null, subnetId: String? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetNatGatewayResult
Link copied to clipboard

This resource can be useful for getting back a list of NAT gateway ids to be referenced elsewhere.

suspend fun getNatGateways(filters: List<GetNatGatewaysFilter>? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetNatGatewaysResult
Link copied to clipboard

The following shows outputting all network ACL ids in a vpc.

suspend fun getNetworkAcls(filters: List<GetNetworkAclsFilter>? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetNetworkAclsResult
Link copied to clipboard

aws.ec2.NetworkInsightsAnalysis provides details about a specific Network Insights Analysis.

suspend fun getNetworkInsightsAnalysis(filters: List<GetNetworkInsightsAnalysisFilter>? = null, networkInsightsAnalysisId: String? = null, tags: Map<String, String>? = null): GetNetworkInsightsAnalysisResult
Link copied to clipboard

aws.ec2.NetworkInsightsPath provides details about a specific Network Insights Path.

suspend fun getNetworkInsightsPath(filters: List<GetNetworkInsightsPathFilter>? = null, networkInsightsPathId: String? = null, tags: Map<String, String>? = null): GetNetworkInsightsPathResult
Link copied to clipboard

Use this data source to get information about a Network Interface.

suspend fun getNetworkInterface(filters: List<GetNetworkInterfaceFilter>? = null, id: String? = null, tags: Map<String, String>? = null): GetNetworkInterfaceResult
Link copied to clipboard

The following shows outputting all network interface ids in a region.

Link copied to clipboard

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.

suspend fun getPrefixList(filters: List<GetPrefixListFilter>? = null, name: String? = null, prefixListId: String? = null): GetPrefixListResult
Link copied to clipboard

Provides details about a specific AWS EC2 Public IPv4 Pool.

suspend fun getPublicIpv4Pool(poolId: String, tags: Map<String, String>? = null): GetPublicIpv4PoolResult
Link copied to clipboard

Data source for getting information about AWS EC2 Public IPv4 Pools.

Link copied to clipboard
suspend fun getRoute(argument: GetRoutePlainArgs): GetRouteResult

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.

suspend fun getRoute(argument: suspend GetRoutePlainArgsBuilder.() -> Unit): GetRouteResult
suspend fun getRoute(carrierGatewayId: String? = null, coreNetworkArn: String? = null, destinationCidrBlock: String? = null, destinationIpv6CidrBlock: String? = null, destinationPrefixListId: String? = null, egressOnlyGatewayId: String? = null, gatewayId: String? = null, instanceId: String? = null, localGatewayId: String? = null, natGatewayId: String? = null, networkInterfaceId: String? = null, routeTableId: String, transitGatewayId: String? = null, vpcPeeringConnectionId: String? = null): GetRouteResult
Link copied to clipboard

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.

suspend fun getRouteTable(filters: List<GetRouteTableFilter>? = null, gatewayId: String? = null, routeTableId: String? = null, subnetId: String? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetRouteTableResult
Link copied to clipboard

This resource can be useful for getting back a list of route table ids to be referenced elsewhere.

suspend fun getRouteTables(filters: List<GetRouteTablesFilter>? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetRouteTablesResult
Link copied to clipboard

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.

suspend fun getSecurityGroup(filters: List<GetSecurityGroupFilter>? = null, id: String? = null, name: String? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetSecurityGroupResult
Link copied to clipboard

Use this data source to get IDs and VPC membership of Security Groups that are created outside this provider.

suspend fun getSecurityGroups(filters: List<GetSecurityGroupsFilter>? = null, tags: Map<String, String>? = null): GetSecurityGroupsResult
Link copied to clipboard

Provides a way to check whether serial console access is enabled for your AWS account in the current AWS region.

Link copied to clipboard

Information about most recent Spot Price for a given EC2 instance.

suspend fun getSpotPrice(availabilityZone: String? = null, filters: List<GetSpotPriceFilter>? = null, instanceType: String? = null): GetSpotPriceResult
Link copied to clipboard

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.

suspend fun getSubnet(argument: suspend GetSubnetPlainArgsBuilder.() -> Unit): GetSubnetResult
suspend fun getSubnet(availabilityZone: String? = null, availabilityZoneId: String? = null, cidrBlock: String? = null, defaultForAz: Boolean? = null, filters: List<GetSubnetFilter>? = null, id: String? = null, ipv6CidrBlock: String? = null, state: String? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetSubnetResult
Link copied to clipboard

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.

suspend fun getSubnetIds(filters: List<GetSubnetIdsFilter>? = null, tags: Map<String, String>? = null, vpcId: String): GetSubnetIdsResult
Link copied to clipboard

This resource can be useful for getting back a set of subnet IDs.

suspend fun getSubnets(argument: suspend GetSubnetsPlainArgsBuilder.() -> Unit): GetSubnetsResult
suspend fun getSubnets(filters: List<GetSubnetsFilter>? = null, tags: Map<String, String>? = null): GetSubnetsResult
Link copied to clipboard

Provides information for multiple EC2 Transit Gateway Route Tables, such as their identifiers.

Link copied to clipboard
suspend fun getVpc(argument: GetVpcPlainArgs): GetVpcResult

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.

suspend fun getVpc(argument: suspend GetVpcPlainArgsBuilder.() -> Unit): GetVpcResult
suspend fun getVpc(cidrBlock: String? = null, default: Boolean? = null, dhcpOptionsId: String? = null, filters: List<GetVpcFilter>? = null, id: String? = null, state: String? = null, tags: Map<String, String>? = null): GetVpcResult
Link copied to clipboard

Retrieve information about an EC2 DHCP Options configuration.

suspend fun getVpcDhcpOptions(dhcpOptionsId: String? = null, filters: List<GetVpcDhcpOptionsFilter>? = null, tags: Map<String, String>? = null): GetVpcDhcpOptionsResult
Link copied to clipboard

The VPC Endpoint data source provides details about a specific VPC endpoint.

suspend fun getVpcEndpoint(filters: List<GetVpcEndpointFilter>? = null, id: String? = null, serviceName: String? = null, state: String? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetVpcEndpointResult
Link copied to clipboard

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.

suspend fun getVpcEndpointService(filters: List<GetVpcEndpointServiceFilter>? = null, service: String? = null, serviceName: String? = null, serviceType: String? = null, tags: Map<String, String>? = null): GetVpcEndpointServiceResult
Link copied to clipboard

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.

suspend fun getVpcIamPool(allocationResourceTags: Map<String, String>? = null, filters: List<GetVpcIamPoolFilter>? = null, id: String? = null, ipamPoolId: String? = null, tags: Map<String, String>? = null): GetVpcIamPoolResult
Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

The VPC Peering Connection data source provides details about a specific VPC peering connection.

suspend fun getVpcPeeringConnection(cidrBlock: String? = null, filters: List<GetVpcPeeringConnectionFilter>? = null, id: String? = null, ownerId: String? = null, peerCidrBlock: String? = null, peerOwnerId: String? = null, peerRegion: String? = null, peerVpcId: String? = null, region: String? = null, status: String? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetVpcPeeringConnectionResult
Link copied to clipboard

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.

Link copied to clipboard
suspend fun getVpcs(argument: GetVpcsPlainArgs): GetVpcsResult

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".

suspend fun getVpcs(argument: suspend GetVpcsPlainArgsBuilder.() -> Unit): GetVpcsResult
suspend fun getVpcs(filters: List<GetVpcsFilter>? = null, tags: Map<String, String>? = null): GetVpcsResult
Link copied to clipboard

The VPN Gateway data source provides details about a specific VPN gateway.

suspend fun getVpnGateway(amazonSideAsn: String? = null, attachedVpcId: String? = null, availabilityZone: String? = null, filters: List<GetVpnGatewayFilter>? = null, id: String? = null, state: String? = null, tags: Map<String, String>? = null): GetVpnGatewayResult