Class Volume
Creates and destroys a volume in Docker. This can be used alongside docker_container to prepare volumes that can be shared across containers.
Example Usage
using Pulumi;
using Docker = Pulumi.Docker;
class MyStack : Stack
{
public MyStack()
{
// Creates a docker volume "shared_volume".
var sharedVolume = new Docker.Volume("sharedVolume", new Docker.VolumeArgs
{
});
}
}
Inherited Members
Namespace: Pulumi.Docker
Assembly: Pulumi.Docker.dll
Syntax
public class Volume : CustomResource
Constructors
View SourceVolume(String, VolumeArgs, CustomResourceOptions)
Create a Volume resource with the given unique name, arguments, and options.
Declaration
public Volume(string name, VolumeArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| VolumeArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDriver
Driver type for the volume (defaults to local).
Declaration
public Output<string> Driver { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DriverOpts
Options specific to the driver.
Declaration
public Output<ImmutableDictionary<string, object>> DriverOpts { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Labels
User-defined key/value metadata.
Declaration
public Output<ImmutableArray<VolumeLabel>> Labels { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<VolumeLabel>> |
Mountpoint
Declaration
public Output<string> Mountpoint { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name of the Docker volume (generated if not provided).
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, VolumeState, CustomResourceOptions)
Get an existing Volume resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Volume Get(string name, Input<string> id, VolumeState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| VolumeState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Volume |