Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{
"Type" : "AWS::OpsWorks::Volume",
"Properties" : {
"Ec2VolumeId" : String
,
"MountPoint" : String
,
"Name" : String
,
"StackId" : String
}
}
YAML
Type: AWS::OpsWorks::Volume
Properties:
Ec2VolumeId: String
MountPoint: String
Name: String
StackId: String
Properties
Ec2VolumeId
-
The Amazon EC2 volume ID.
Required: Yes
Type: String
Update requires: Replacement
MountPoint
-
The volume mount point. For example, "/mnt/disk1".
Required: No
Type: String
Update requires: No interruption
Name
-
The volume name. Volume names are a maximum of 128 characters.
Required: No
Type: String
Update requires: No interruption
StackId
-
The stack ID.
Required: Yes
Type: String
Update requires: Replacement
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the AWS OpsWorks volume ID, such as 1ab23cd4-92ff-4501-b37c-example
.
For more information about using the Ref
function, see Ref
.
Fn::GetAtt
Examples
Template Snippet
The following example registers the ec2volume
volume with the
opsworksstack
stack, both of which are declared elsewhere in the same
template.
JSON
"opsworksVolume": {
"Type": "AWS::OpsWorks::Volume",
"Properties": {
"Ec2VolumeId": { "Ref": "ec2volume" },
"MountPoint": "/dev/sdb",
"Name": "testOpsWorksVolume",
"StackId": { "Ref": "opsworksstack" }
}
}
YAML
opsworksVolume:
Type: AWS::OpsWorks::Volume
Properties:
Ec2VolumeId: !Ref 'ec2volume'
MountPoint: /dev/sdb
Name: testOpsWorksVolume
StackId: !Ref 'opsworksstack'
See also
-
RegisterVolume in the AWS OpsWorks API Reference.
-
Resource Management in the AWS OpsWorks User Guide.