1. Packages
  2. Outscale Provider
  3. API Docs
  4. getSubnets
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

outscale.getSubnets

Explore with Pulumi AI

outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

Provides information about Subnets.

For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const subnets01 = outscale.getSubnets({
    filters: [
        {
            name: "states",
            values: ["available"],
        },
        {
            name: "subregion_names",
            values: [
                "eu-west-2a",
                "eu-west-2b",
            ],
        },
    ],
});
Copy
import pulumi
import pulumi_outscale as outscale

subnets01 = outscale.get_subnets(filters=[
    {
        "name": "states",
        "values": ["available"],
    },
    {
        "name": "subregion_names",
        "values": [
            "eu-west-2a",
            "eu-west-2b",
        ],
    },
])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.GetSubnets(ctx, &outscale.GetSubnetsArgs{
			Filters: []outscale.GetSubnetsFilter{
				{
					Name: "states",
					Values: []string{
						"available",
					},
				},
				{
					Name: "subregion_names",
					Values: []string{
						"eu-west-2a",
						"eu-west-2b",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var subnets01 = Outscale.GetSubnets.Invoke(new()
    {
        Filters = new[]
        {
            new Outscale.Inputs.GetSubnetsFilterInputArgs
            {
                Name = "states",
                Values = new[]
                {
                    "available",
                },
            },
            new Outscale.Inputs.GetSubnetsFilterInputArgs
            {
                Name = "subregion_names",
                Values = new[]
                {
                    "eu-west-2a",
                    "eu-west-2b",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.OutscaleFunctions;
import com.pulumi.outscale.inputs.GetSubnetsArgs;
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 subnets01 = OutscaleFunctions.getSubnets(GetSubnetsArgs.builder()
            .filters(            
                GetSubnetsFilterArgs.builder()
                    .name("states")
                    .values("available")
                    .build(),
                GetSubnetsFilterArgs.builder()
                    .name("subregion_names")
                    .values(                    
                        "eu-west-2a",
                        "eu-west-2b")
                    .build())
            .build());

    }
}
Copy
variables:
  subnets01:
    fn::invoke:
      function: outscale:getSubnets
      arguments:
        filters:
          - name: states
            values:
              - available
          - name: subregion_names
            values:
              - eu-west-2a
              - eu-west-2b
Copy

Using getSubnets

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 getSubnets(args: GetSubnetsArgs, opts?: InvokeOptions): Promise<GetSubnetsResult>
function getSubnetsOutput(args: GetSubnetsOutputArgs, opts?: InvokeOptions): Output<GetSubnetsResult>
Copy
def get_subnets(filters: Optional[Sequence[GetSubnetsFilter]] = None,
                id: Optional[str] = None,
                subnet_ids: Optional[Sequence[str]] = None,
                opts: Optional[InvokeOptions] = None) -> GetSubnetsResult
def get_subnets_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSubnetsFilterArgs]]]] = None,
                id: Optional[pulumi.Input[str]] = None,
                subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetSubnetsResult]
Copy
func GetSubnets(ctx *Context, args *GetSubnetsArgs, opts ...InvokeOption) (*GetSubnetsResult, error)
func GetSubnetsOutput(ctx *Context, args *GetSubnetsOutputArgs, opts ...InvokeOption) GetSubnetsResultOutput
Copy

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

public static class GetSubnets 
{
    public static Task<GetSubnetsResult> InvokeAsync(GetSubnetsArgs args, InvokeOptions? opts = null)
    public static Output<GetSubnetsResult> Invoke(GetSubnetsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSubnetsResult> getSubnets(GetSubnetsArgs args, InvokeOptions options)
public static Output<GetSubnetsResult> getSubnets(GetSubnetsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: outscale:index/getSubnets:getSubnets
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters List<GetSubnetsFilter>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
Id string
SubnetIds List<string>
Filters []GetSubnetsFilter
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
Id string
SubnetIds []string
filters List<GetSubnetsFilter>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id String
subnetIds List<String>
filters GetSubnetsFilter[]
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id string
subnetIds string[]
filters Sequence[GetSubnetsFilter]
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id str
subnet_ids Sequence[str]
filters List<Property Map>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id String
subnetIds List<String>

getSubnets Result

The following output properties are available:

Id string
RequestId string
Subnets List<GetSubnetsSubnet>
Information about one or more Subnets.
Filters List<GetSubnetsFilter>
SubnetIds List<string>
Id string
RequestId string
Subnets []GetSubnetsSubnet
Information about one or more Subnets.
Filters []GetSubnetsFilter
SubnetIds []string
id String
requestId String
subnets List<GetSubnetsSubnet>
Information about one or more Subnets.
filters List<GetSubnetsFilter>
subnetIds List<String>
id string
requestId string
subnets GetSubnetsSubnet[]
Information about one or more Subnets.
filters GetSubnetsFilter[]
subnetIds string[]
id str
request_id str
subnets Sequence[GetSubnetsSubnet]
Information about one or more Subnets.
filters Sequence[GetSubnetsFilter]
subnet_ids Sequence[str]
id String
requestId String
subnets List<Property Map>
Information about one or more Subnets.
filters List<Property Map>
subnetIds List<String>

Supporting Types

GetSubnetsFilter

Name This property is required. string
Values This property is required. List<string>
Name This property is required. string
Values This property is required. []string
name This property is required. String
values This property is required. List<String>
name This property is required. string
values This property is required. string[]
name This property is required. str
values This property is required. Sequence[str]
name This property is required. String
values This property is required. List<String>

GetSubnetsSubnet

AvailableIpsCount This property is required. double
The number of available IPs in the Subnets.
IpRange This property is required. string
The IP range in the Subnet, in CIDR notation (for example, 10.0.0.0/16).
MapPublicIpOnLaunch This property is required. bool
If true, a public IP is assigned to the network interface cards (NICs) created in the specified Subnet.
NetId This property is required. string
The ID of the Net in which the Subnet is.
State This property is required. string
The state of the Subnet (pending | available | deleted).
SubnetId This property is required. string
The ID of the Subnet.
SubregionName This property is required. string
The name of the Subregion in which the Subnet is located.
Tags This property is required. List<GetSubnetsSubnetTag>
One or more tags associated with the Subnet.
AvailableIpsCount This property is required. float64
The number of available IPs in the Subnets.
IpRange This property is required. string
The IP range in the Subnet, in CIDR notation (for example, 10.0.0.0/16).
MapPublicIpOnLaunch This property is required. bool
If true, a public IP is assigned to the network interface cards (NICs) created in the specified Subnet.
NetId This property is required. string
The ID of the Net in which the Subnet is.
State This property is required. string
The state of the Subnet (pending | available | deleted).
SubnetId This property is required. string
The ID of the Subnet.
SubregionName This property is required. string
The name of the Subregion in which the Subnet is located.
Tags This property is required. []GetSubnetsSubnetTag
One or more tags associated with the Subnet.
availableIpsCount This property is required. Double
The number of available IPs in the Subnets.
ipRange This property is required. String
The IP range in the Subnet, in CIDR notation (for example, 10.0.0.0/16).
mapPublicIpOnLaunch This property is required. Boolean
If true, a public IP is assigned to the network interface cards (NICs) created in the specified Subnet.
netId This property is required. String
The ID of the Net in which the Subnet is.
state This property is required. String
The state of the Subnet (pending | available | deleted).
subnetId This property is required. String
The ID of the Subnet.
subregionName This property is required. String
The name of the Subregion in which the Subnet is located.
tags This property is required. List<GetSubnetsSubnetTag>
One or more tags associated with the Subnet.
availableIpsCount This property is required. number
The number of available IPs in the Subnets.
ipRange This property is required. string
The IP range in the Subnet, in CIDR notation (for example, 10.0.0.0/16).
mapPublicIpOnLaunch This property is required. boolean
If true, a public IP is assigned to the network interface cards (NICs) created in the specified Subnet.
netId This property is required. string
The ID of the Net in which the Subnet is.
state This property is required. string
The state of the Subnet (pending | available | deleted).
subnetId This property is required. string
The ID of the Subnet.
subregionName This property is required. string
The name of the Subregion in which the Subnet is located.
tags This property is required. GetSubnetsSubnetTag[]
One or more tags associated with the Subnet.
available_ips_count This property is required. float
The number of available IPs in the Subnets.
ip_range This property is required. str
The IP range in the Subnet, in CIDR notation (for example, 10.0.0.0/16).
map_public_ip_on_launch This property is required. bool
If true, a public IP is assigned to the network interface cards (NICs) created in the specified Subnet.
net_id This property is required. str
The ID of the Net in which the Subnet is.
state This property is required. str
The state of the Subnet (pending | available | deleted).
subnet_id This property is required. str
The ID of the Subnet.
subregion_name This property is required. str
The name of the Subregion in which the Subnet is located.
tags This property is required. Sequence[GetSubnetsSubnetTag]
One or more tags associated with the Subnet.
availableIpsCount This property is required. Number
The number of available IPs in the Subnets.
ipRange This property is required. String
The IP range in the Subnet, in CIDR notation (for example, 10.0.0.0/16).
mapPublicIpOnLaunch This property is required. Boolean
If true, a public IP is assigned to the network interface cards (NICs) created in the specified Subnet.
netId This property is required. String
The ID of the Net in which the Subnet is.
state This property is required. String
The state of the Subnet (pending | available | deleted).
subnetId This property is required. String
The ID of the Subnet.
subregionName This property is required. String
The name of the Subregion in which the Subnet is located.
tags This property is required. List<Property Map>
One or more tags associated with the Subnet.

GetSubnetsSubnetTag

Key This property is required. string
The key of the tag, with a minimum of 1 character.
Value This property is required. string
The value of the tag, between 0 and 255 characters.
Key This property is required. string
The key of the tag, with a minimum of 1 character.
Value This property is required. string
The value of the tag, between 0 and 255 characters.
key This property is required. String
The key of the tag, with a minimum of 1 character.
value This property is required. String
The value of the tag, between 0 and 255 characters.
key This property is required. string
The key of the tag, with a minimum of 1 character.
value This property is required. string
The value of the tag, between 0 and 255 characters.
key This property is required. str
The key of the tag, with a minimum of 1 character.
value This property is required. str
The value of the tag, between 0 and 255 characters.
key This property is required. String
The key of the tag, with a minimum of 1 character.
value This property is required. String
The value of the tag, between 0 and 255 characters.

Package Details

Repository
outscale outscale/terraform-provider-outscale
License
Notes
This Pulumi package is based on the outscale Terraform Provider.
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale