1. Packages
  2. Packages
  3. Juju Provider
  4. API Docs
  5. Space
Viewing docs for juju 2.2.0-rc1
published on Tuesday, Jul 21, 2026 by juju
Viewing docs for juju 2.2.0-rc1
published on Tuesday, Jul 21, 2026 by juju

    A resource that represents a Juju space.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as juju from "@pulumi/juju";
    
    const development = new juju.Model("development", {name: "development"});
    const developmentSpace = new juju.Space("development", {
        modelUuid: development.uuid,
        name: "development",
    });
    
    import pulumi
    import pulumi_juju as juju
    
    development = juju.Model("development", name="development")
    development_space = juju.Space("development",
        model_uuid=development.uuid,
        name="development")
    
    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 {
    		development, err := juju.NewModel(ctx, "development", &juju.ModelArgs{
    			Name: pulumi.String("development"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = juju.NewSpace(ctx, "development", &juju.SpaceArgs{
    			ModelUuid: development.Uuid,
    			Name:      pulumi.String("development"),
    		})
    		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 development = new Juju.Model("development", new()
        {
            Name = "development",
        });
    
        var developmentSpace = new Juju.Space("development", new()
        {
            ModelUuid = development.Uuid,
            Name = "development",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.juju.Model;
    import com.pulumi.juju.ModelArgs;
    import com.pulumi.juju.Space;
    import com.pulumi.juju.SpaceArgs;
    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) {
            var development = new Model("development", ModelArgs.builder()
                .name("development")
                .build());
    
            var developmentSpace = new Space("developmentSpace", SpaceArgs.builder()
                .modelUuid(development.uuid())
                .name("development")
                .build());
    
        }
    }
    
    resources:
      development:
        type: juju:Model
        properties:
          name: development
      developmentSpace:
        type: juju:Space
        name: development
        properties:
          modelUuid: ${development.uuid}
          name: development
    
    Example coming soon!
    

    Create Space Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Space(name: string, args: SpaceArgs, opts?: CustomResourceOptions);
    @overload
    def Space(resource_name: str,
              args: SpaceArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Space(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              model_uuid: Optional[str] = None,
              name: Optional[str] = None)
    func NewSpace(ctx *Context, name string, args SpaceArgs, opts ...ResourceOption) (*Space, error)
    public Space(string name, SpaceArgs args, CustomResourceOptions? opts = null)
    public Space(String name, SpaceArgs args)
    public Space(String name, SpaceArgs args, CustomResourceOptions options)
    
    type: juju:Space
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "juju_space" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args SpaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SpaceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SpaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SpaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SpaceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var spaceResource = new Juju.Space("spaceResource", new()
    {
        ModelUuid = "string",
        Name = "string",
    });
    
    example, err := juju.NewSpace(ctx, "spaceResource", &juju.SpaceArgs{
    	ModelUuid: pulumi.String("string"),
    	Name:      pulumi.String("string"),
    })
    
    resource "juju_space" "spaceResource" {
      lifecycle {
        create_before_destroy = true
      }
      model_uuid = "string"
      name       = "string"
    }
    
    var spaceResource = new Space("spaceResource", SpaceArgs.builder()
        .modelUuid("string")
        .name("string")
        .build());
    
    space_resource = juju.Space("spaceResource",
        model_uuid="string",
        name="string")
    
    const spaceResource = new juju.Space("spaceResource", {
        modelUuid: "string",
        name: "string",
    });
    
    type: juju:Space
    properties:
        modelUuid: string
        name: string
    

    Space Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Space resource accepts the following input properties:

    ModelUuid string
    The UUID of the model where the space belongs.
    Name string
    The name of the space. Changing this value forces replacement.
    ModelUuid string
    The UUID of the model where the space belongs.
    Name string
    The name of the space. Changing this value forces replacement.
    model_uuid string
    The UUID of the model where the space belongs.
    name string
    The name of the space. Changing this value forces replacement.
    modelUuid String
    The UUID of the model where the space belongs.
    name String
    The name of the space. Changing this value forces replacement.
    modelUuid string
    The UUID of the model where the space belongs.
    name string
    The name of the space. Changing this value forces replacement.
    model_uuid str
    The UUID of the model where the space belongs.
    name str
    The name of the space. Changing this value forces replacement.
    modelUuid String
    The UUID of the model where the space belongs.
    name String
    The name of the space. Changing this value forces replacement.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Space resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Space Resource

    Get an existing Space resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SpaceState, opts?: CustomResourceOptions): Space
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            model_uuid: Optional[str] = None,
            name: Optional[str] = None) -> Space
    func GetSpace(ctx *Context, name string, id IDInput, state *SpaceState, opts ...ResourceOption) (*Space, error)
    public static Space Get(string name, Input<string> id, SpaceState? state, CustomResourceOptions? opts = null)
    public static Space get(String name, Output<String> id, SpaceState state, CustomResourceOptions options)
    resources:  _:    type: juju:Space    get:      id: ${id}
    import {
      to = juju_space.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ModelUuid string
    The UUID of the model where the space belongs.
    Name string
    The name of the space. Changing this value forces replacement.
    ModelUuid string
    The UUID of the model where the space belongs.
    Name string
    The name of the space. Changing this value forces replacement.
    model_uuid string
    The UUID of the model where the space belongs.
    name string
    The name of the space. Changing this value forces replacement.
    modelUuid String
    The UUID of the model where the space belongs.
    name String
    The name of the space. Changing this value forces replacement.
    modelUuid string
    The UUID of the model where the space belongs.
    name string
    The name of the space. Changing this value forces replacement.
    model_uuid str
    The UUID of the model where the space belongs.
    name str
    The name of the space. Changing this value forces replacement.
    modelUuid String
    The UUID of the model where the space belongs.
    name String
    The name of the space. Changing this value forces replacement.

    Import

    The pulumi import command can be used, for example:

    Spaces can be imported using the format: model_uuid:space_name

    $ pulumi import juju:index/space:Space development a3c2c72a-75f6-43b9-9b2d-d85d5449cb2f:development
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    juju juju/terraform-provider-juju
    License
    Notes
    This Pulumi package is based on the juju Terraform Provider.
    Viewing docs for juju 2.2.0-rc1
    published on Tuesday, Jul 21, 2026 by juju

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial