1. Packages
  2. stackit
  3. API Docs
  4. ServerVolumeAttach
Viewing docs for stackit v0.0.4
published on Friday, Feb 20, 2026 by stackitcloud
stackit logo
Viewing docs for stackit v0.0.4
published on Friday, Feb 20, 2026 by stackitcloud

    Volume attachment resource schema. Attaches a volume to a server. Must have a region specified in the provider configuration.

    Example Usage

    resource "stackit_server_volume_attach" "attached_volume" {
      project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      server_id  = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      volume_id  = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
    
    # Only use the import statement, if you want to import an existing server volume attachment
    import {
      to = stackit_server_volume_attach.import-example
      id = "${var.project_id},${var.region},${var.server_id},${var.volume_id}"
    }
    

    Create ServerVolumeAttach Resource

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

    Constructor syntax

    new ServerVolumeAttach(name: string, args: ServerVolumeAttachArgs, opts?: CustomResourceOptions);
    @overload
    def ServerVolumeAttach(resource_name: str,
                           args: ServerVolumeAttachArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServerVolumeAttach(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           project_id: Optional[str] = None,
                           server_id: Optional[str] = None,
                           volume_id: Optional[str] = None,
                           region: Optional[str] = None)
    func NewServerVolumeAttach(ctx *Context, name string, args ServerVolumeAttachArgs, opts ...ResourceOption) (*ServerVolumeAttach, error)
    public ServerVolumeAttach(string name, ServerVolumeAttachArgs args, CustomResourceOptions? opts = null)
    public ServerVolumeAttach(String name, ServerVolumeAttachArgs args)
    public ServerVolumeAttach(String name, ServerVolumeAttachArgs args, CustomResourceOptions options)
    
    type: stackit:ServerVolumeAttach
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ServerVolumeAttachArgs
    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 ServerVolumeAttachArgs
    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 ServerVolumeAttachArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServerVolumeAttachArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServerVolumeAttachArgs
    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 serverVolumeAttachResource = new Stackit.ServerVolumeAttach("serverVolumeAttachResource", new()
    {
        ProjectId = "string",
        ServerId = "string",
        VolumeId = "string",
        Region = "string",
    });
    
    example, err := stackit.NewServerVolumeAttach(ctx, "serverVolumeAttachResource", &stackit.ServerVolumeAttachArgs{
    	ProjectId: pulumi.String("string"),
    	ServerId:  pulumi.String("string"),
    	VolumeId:  pulumi.String("string"),
    	Region:    pulumi.String("string"),
    })
    
    var serverVolumeAttachResource = new ServerVolumeAttach("serverVolumeAttachResource", ServerVolumeAttachArgs.builder()
        .projectId("string")
        .serverId("string")
        .volumeId("string")
        .region("string")
        .build());
    
    server_volume_attach_resource = stackit.ServerVolumeAttach("serverVolumeAttachResource",
        project_id="string",
        server_id="string",
        volume_id="string",
        region="string")
    
    const serverVolumeAttachResource = new stackit.ServerVolumeAttach("serverVolumeAttachResource", {
        projectId: "string",
        serverId: "string",
        volumeId: "string",
        region: "string",
    });
    
    type: stackit:ServerVolumeAttach
    properties:
        projectId: string
        region: string
        serverId: string
        volumeId: string
    

    ServerVolumeAttach 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 ServerVolumeAttach resource accepts the following input properties:

    ProjectId string
    STACKIT project ID to which the volume attachment is associated.
    ServerId string
    The server ID.
    VolumeId string
    The volume ID.
    Region string
    The resource region. If not defined, the provider region is used.
    ProjectId string
    STACKIT project ID to which the volume attachment is associated.
    ServerId string
    The server ID.
    VolumeId string
    The volume ID.
    Region string
    The resource region. If not defined, the provider region is used.
    projectId String
    STACKIT project ID to which the volume attachment is associated.
    serverId String
    The server ID.
    volumeId String
    The volume ID.
    region String
    The resource region. If not defined, the provider region is used.
    projectId string
    STACKIT project ID to which the volume attachment is associated.
    serverId string
    The server ID.
    volumeId string
    The volume ID.
    region string
    The resource region. If not defined, the provider region is used.
    project_id str
    STACKIT project ID to which the volume attachment is associated.
    server_id str
    The server ID.
    volume_id str
    The volume ID.
    region str
    The resource region. If not defined, the provider region is used.
    projectId String
    STACKIT project ID to which the volume attachment is associated.
    serverId String
    The server ID.
    volumeId String
    The volume ID.
    region String
    The resource region. If not defined, the provider region is used.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ServerVolumeAttach 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 str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ServerVolumeAttach Resource

    Get an existing ServerVolumeAttach 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?: ServerVolumeAttachState, opts?: CustomResourceOptions): ServerVolumeAttach
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            server_id: Optional[str] = None,
            volume_id: Optional[str] = None) -> ServerVolumeAttach
    func GetServerVolumeAttach(ctx *Context, name string, id IDInput, state *ServerVolumeAttachState, opts ...ResourceOption) (*ServerVolumeAttach, error)
    public static ServerVolumeAttach Get(string name, Input<string> id, ServerVolumeAttachState? state, CustomResourceOptions? opts = null)
    public static ServerVolumeAttach get(String name, Output<String> id, ServerVolumeAttachState state, CustomResourceOptions options)
    resources:  _:    type: stackit:ServerVolumeAttach    get:      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:
    ProjectId string
    STACKIT project ID to which the volume attachment is associated.
    Region string
    The resource region. If not defined, the provider region is used.
    ServerId string
    The server ID.
    VolumeId string
    The volume ID.
    ProjectId string
    STACKIT project ID to which the volume attachment is associated.
    Region string
    The resource region. If not defined, the provider region is used.
    ServerId string
    The server ID.
    VolumeId string
    The volume ID.
    projectId String
    STACKIT project ID to which the volume attachment is associated.
    region String
    The resource region. If not defined, the provider region is used.
    serverId String
    The server ID.
    volumeId String
    The volume ID.
    projectId string
    STACKIT project ID to which the volume attachment is associated.
    region string
    The resource region. If not defined, the provider region is used.
    serverId string
    The server ID.
    volumeId string
    The volume ID.
    project_id str
    STACKIT project ID to which the volume attachment is associated.
    region str
    The resource region. If not defined, the provider region is used.
    server_id str
    The server ID.
    volume_id str
    The volume ID.
    projectId String
    STACKIT project ID to which the volume attachment is associated.
    region String
    The resource region. If not defined, the provider region is used.
    serverId String
    The server ID.
    volumeId String
    The volume ID.

    Package Details

    Repository
    stackit stackitcloud/pulumi-stackit
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the stackit Terraform Provider.
    stackit logo
    Viewing docs for stackit v0.0.4
    published on Friday, Feb 20, 2026 by stackitcloud
      Try Pulumi Cloud free. Your team will thank you.