Viewing docs for juju 2.1.1
published on Thursday, Jul 2, 2026 by juju
published on Thursday, Jul 2, 2026 by juju
Viewing docs for juju 2.1.1
published on Thursday, Jul 2, 2026 by juju
published on Thursday, Jul 2, 2026 by juju
A data source representing a list of Juju subnets.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as juju from "@pulumi/juju";
const myModel = juju.getModel({
name: "default",
});
const _this = myModel.then(myModel => juju.getSubnets({
modelUuid: myModel.uuid,
spaceName: "alpha",
}));
import pulumi
import pulumi_juju as juju
my_model = juju.get_model(name="default")
this = juju.get_subnets(model_uuid=my_model.uuid,
space_name="alpha")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/juju/v2/juju"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
myModel, err := juju.LookupModel(ctx, &juju.LookupModelArgs{
Name: pulumi.StringRef("default"),
}, nil)
if err != nil {
return err
}
_, err = juju.GetSubnets(ctx, &juju.GetSubnetsArgs{
ModelUuid: myModel.Uuid,
SpaceName: pulumi.StringRef("alpha"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Juju = Pulumi.Juju;
return await Deployment.RunAsync(() =>
{
var myModel = Juju.GetModel.Invoke(new()
{
Name = "default",
});
var @this = Juju.GetSubnets.Invoke(new()
{
ModelUuid = myModel.Apply(getModelResult => getModelResult.Uuid),
SpaceName = "alpha",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.juju.JujuFunctions;
import com.pulumi.juju.inputs.GetModelArgs;
import com.pulumi.juju.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 myModel = JujuFunctions.getModel(GetModelArgs.builder()
.name("default")
.build());
final var this = JujuFunctions.getSubnets(GetSubnetsArgs.builder()
.modelUuid(myModel.uuid())
.spaceName("alpha")
.build());
}
}
variables:
myModel:
fn::invoke:
function: juju:getModel
arguments:
name: default
this:
fn::invoke:
function: juju:getSubnets
arguments:
modelUuid: ${myModel.uuid}
spaceName: alpha
Example coming soon!
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>def get_subnets(model_uuid: Optional[str] = None,
space_name: Optional[str] = None,
zone_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSubnetsResult
def get_subnets_output(model_uuid: pulumi.Input[Optional[str]] = None,
space_name: pulumi.Input[Optional[str]] = None,
zone_name: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSubnetsResult]func GetSubnets(ctx *Context, args *GetSubnetsArgs, opts ...InvokeOption) (*GetSubnetsResult, error)
func GetSubnetsOutput(ctx *Context, args *GetSubnetsOutputArgs, opts ...InvokeOption) GetSubnetsResultOutput> 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)
}public static CompletableFuture<GetSubnetsResult> getSubnets(GetSubnetsArgs args, InvokeOptions options)
public static Output<GetSubnetsResult> getSubnets(GetSubnetsArgs args, InvokeOptions options)
fn::invoke:
function: juju:index/getSubnets:getSubnets
arguments:
# arguments dictionarydata "juju_getsubnets" "name" {
# arguments
}The following arguments are supported:
- model_
uuid string - The UUID of the model where subnets exist.
- space_
name string - Optional space name filter.
- zone_
name string - Optional availability zone filter.
- model_
uuid str - The UUID of the model where subnets exist.
- space_
name str - Optional space name filter.
- zone_
name str - Optional availability zone filter.
getSubnets Result
The following output properties are available:
- id string
- Identifier of the subnets data source.
- model_
uuid string - The UUID of the model where subnets exist.
- subnets map(object)
- Map of subnets keyed by CIDR.
- space_
name string - Optional space name filter.
- zone_
name string - Optional availability zone filter.
- id str
- Identifier of the subnets data source.
- model_
uuid str - The UUID of the model where subnets exist.
- subnets
Mapping[str, Get
Subnets Subnets] - Map of subnets keyed by CIDR.
- space_
name str - Optional space name filter.
- zone_
name str - Optional availability zone filter.
Supporting Types
GetSubnetsSubnets
- Cidr string
- Life string
- Provider
Id string - Provider
Network stringId - Provider
Space stringId - Space
Name string - Vlan
Tag double - Zones List<string>
- Cidr string
- Life string
- Provider
Id string - Provider
Network stringId - Provider
Space stringId - Space
Name string - Vlan
Tag float64 - Zones []string
- cidr string
- life string
- provider_
id string - provider_
network_ stringid - provider_
space_ stringid - space_
name string - vlan_
tag number - zones list(string)
- cidr String
- life String
- provider
Id String - provider
Network StringId - provider
Space StringId - space
Name String - vlan
Tag Double - zones List<String>
- cidr string
- life string
- provider
Id string - provider
Network stringId - provider
Space stringId - space
Name string - vlan
Tag number - zones string[]
- cidr str
- life str
- provider_
id str - provider_
network_ strid - provider_
space_ strid - space_
name str - vlan_
tag float - zones Sequence[str]
- cidr String
- life String
- provider
Id String - provider
Network StringId - provider
Space StringId - space
Name String - vlan
Tag Number - zones List<String>
Package Details
- Repository
- juju juju/terraform-provider-juju
- License
- Notes
- This Pulumi package is based on the
jujuTerraform Provider.
Viewing docs for juju 2.1.1
published on Thursday, Jul 2, 2026 by juju
published on Thursday, Jul 2, 2026 by juju