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
{
});
}
}
Coming soon!
import pulumi
import pulumi_docker as docker
# Creates a docker volume "shared_volume".
shared_volume = docker.Volume("sharedVolume")import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";
// Creates a docker volume "shared_volume".
const sharedVolume = new docker.Volume("shared_volume", {});Create a Volume Resource
new Volume(name: string, args?: VolumeArgs, opts?: CustomResourceOptions);def Volume(resource_name, opts=None, driver=None, driver_opts=None, labels=None, name=None, __props__=None);func NewVolume(ctx *Context, name string, args *VolumeArgs, opts ...ResourceOption) (*Volume, error)public Volume(string name, VolumeArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args VolumeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VolumeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VolumeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Volume Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Volume resource accepts the following input properties:
- Driver string
Driver type for the volume (defaults to local).
- Driver
Opts Dictionary<string, object> Options specific to the driver.
- Labels
List<Volume
Label Args> User-defined key/value metadata.
- Name string
The name of the Docker volume (generated if not provided).
- Driver string
Driver type for the volume (defaults to local).
- Driver
Opts map[string]interface{} Options specific to the driver.
- Labels
[]Volume
Label User-defined key/value metadata.
- Name string
The name of the Docker volume (generated if not provided).
- driver string
Driver type for the volume (defaults to local).
- driver
Opts {[key: string]: any} Options specific to the driver.
- labels
Volume
Label[] User-defined key/value metadata.
- name string
The name of the Docker volume (generated if not provided).
- driver str
Driver type for the volume (defaults to local).
- driver_
opts Dict[str, Any] Options specific to the driver.
- labels
List[Volume
Label] User-defined key/value metadata.
- name str
The name of the Docker volume (generated if not provided).
Outputs
All input properties are implicitly available as output properties. Additionally, the Volume resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Mountpoint string
- Id string
- The provider-assigned unique ID for this managed resource.
- Mountpoint string
- id string
- The provider-assigned unique ID for this managed resource.
- mountpoint string
- id str
- The provider-assigned unique ID for this managed resource.
- mountpoint str
Look up an Existing Volume Resource
Get an existing Volume 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?: VolumeState, opts?: CustomResourceOptions): Volumestatic get(resource_name, id, opts=None, driver=None, driver_opts=None, labels=None, mountpoint=None, name=None, __props__=None);func GetVolume(ctx *Context, name string, id IDInput, state *VolumeState, opts ...ResourceOption) (*Volume, error)public static Volume Get(string name, Input<string> id, VolumeState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Driver string
Driver type for the volume (defaults to local).
- Driver
Opts Dictionary<string, object> Options specific to the driver.
- Labels
List<Volume
Label Args> User-defined key/value metadata.
- Mountpoint string
- Name string
The name of the Docker volume (generated if not provided).
- Driver string
Driver type for the volume (defaults to local).
- Driver
Opts map[string]interface{} Options specific to the driver.
- Labels
[]Volume
Label User-defined key/value metadata.
- Mountpoint string
- Name string
The name of the Docker volume (generated if not provided).
- driver string
Driver type for the volume (defaults to local).
- driver
Opts {[key: string]: any} Options specific to the driver.
- labels
Volume
Label[] User-defined key/value metadata.
- mountpoint string
- name string
The name of the Docker volume (generated if not provided).
- driver str
Driver type for the volume (defaults to local).
- driver_
opts Dict[str, Any] Options specific to the driver.
- labels
List[Volume
Label] User-defined key/value metadata.
- mountpoint str
- name str
The name of the Docker volume (generated if not provided).
Supporting Types
VolumeLabel
Package Details
- Repository
- https://github.com/pulumi/pulumi-docker
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
dockerTerraform Provider.