We recommend new projects start with resources from the AWS provider.
aws-native.ec2.VolumeAttachment
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
Attaches an Amazon EBS volume to a running instance and exposes it to the instance with the specified device name. Before this resource can be deleted (and therefore the volume detached), you must first unmount the volume in the instance. Failure to do so results in the volume being stuck in the busy state while it is trying to detach, which could possibly damage the file system or the data it contains. If an Amazon EBS volume is the root device of an instance, it cannot be detached while the instance is in the “running” state. To detach the root volume, stop the instance first. If the root volume is detached from an instance with an MKT product code, then the product codes from that volume are no longer associated with the instance.
Create VolumeAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VolumeAttachment(name: string, args: VolumeAttachmentArgs, opts?: CustomResourceOptions);
@overload
def VolumeAttachment(resource_name: str,
args: VolumeAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VolumeAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
volume_id: Optional[str] = None,
device: Optional[str] = None)
func NewVolumeAttachment(ctx *Context, name string, args VolumeAttachmentArgs, opts ...ResourceOption) (*VolumeAttachment, error)
public VolumeAttachment(string name, VolumeAttachmentArgs args, CustomResourceOptions? opts = null)
public VolumeAttachment(String name, VolumeAttachmentArgs args)
public VolumeAttachment(String name, VolumeAttachmentArgs args, CustomResourceOptions options)
type: aws-native:ec2:VolumeAttachment
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 VolumeAttachmentArgs
- 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 VolumeAttachmentArgs
- 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 VolumeAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VolumeAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VolumeAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VolumeAttachment 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 VolumeAttachment resource accepts the following input properties:
- Instance
Id string - The ID of the instance to which the volume attaches. This value can be a reference to an AWS::EC2::Instance resource, or it can be the physical ID of an existing EC2 instance.
- Volume
Id string - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an AWS::EC2::Volume resource, or it can be the volume ID of an existing Amazon EBS volume.
- Device string
- The device name (for example,
/dev/sdh
orxvdh
).
- Instance
Id string - The ID of the instance to which the volume attaches. This value can be a reference to an AWS::EC2::Instance resource, or it can be the physical ID of an existing EC2 instance.
- Volume
Id string - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an AWS::EC2::Volume resource, or it can be the volume ID of an existing Amazon EBS volume.
- Device string
- The device name (for example,
/dev/sdh
orxvdh
).
- instance
Id String - The ID of the instance to which the volume attaches. This value can be a reference to an AWS::EC2::Instance resource, or it can be the physical ID of an existing EC2 instance.
- volume
Id String - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an AWS::EC2::Volume resource, or it can be the volume ID of an existing Amazon EBS volume.
- device String
- The device name (for example,
/dev/sdh
orxvdh
).
- instance
Id string - The ID of the instance to which the volume attaches. This value can be a reference to an AWS::EC2::Instance resource, or it can be the physical ID of an existing EC2 instance.
- volume
Id string - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an AWS::EC2::Volume resource, or it can be the volume ID of an existing Amazon EBS volume.
- device string
- The device name (for example,
/dev/sdh
orxvdh
).
- instance_
id str - The ID of the instance to which the volume attaches. This value can be a reference to an AWS::EC2::Instance resource, or it can be the physical ID of an existing EC2 instance.
- volume_
id str - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an AWS::EC2::Volume resource, or it can be the volume ID of an existing Amazon EBS volume.
- device str
- The device name (for example,
/dev/sdh
orxvdh
).
- instance
Id String - The ID of the instance to which the volume attaches. This value can be a reference to an AWS::EC2::Instance resource, or it can be the physical ID of an existing EC2 instance.
- volume
Id String - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an AWS::EC2::Volume resource, or it can be the volume ID of an existing Amazon EBS volume.
- device String
- The device name (for example,
/dev/sdh
orxvdh
).
Outputs
All input properties are implicitly available as output properties. Additionally, the VolumeAttachment 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.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.