published on Friday, Feb 20, 2026 by stackitcloud
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:
- 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.
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) -> ServerVolumeAttachfunc 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.
- 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.
Package Details
- Repository
- stackit stackitcloud/pulumi-stackit
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
stackitTerraform Provider.
published on Friday, Feb 20, 2026 by stackitcloud
