blob: d03d03883d552c3a1289f7d7f9e3d6cc96346af1 [file] [log] [blame]
AWSTemplateFormatVersion: '2010-09-09'
Description: Deploy an EBS Volume for Gerrit service data.
Parameters:
GerritVolumeId:
Description: Existing Gerrit volume id
Type: String
Default: ""
GerritVolumeSnapshotId:
Description: Id of the EBS snapshot for Gerrit volume
Type: String
Default: ""
GerritVolumeSizeInGiB:
Description: Gerrit volume size in GiB
Type: Number
Default: 10
AvailabilityZone:
Description: The Availability Zone in which to create the volume
Type: String
Conditions:
CreateEBSVolume: !Equals [!Ref GerritVolumeId, ""]
CreateEBSVolumeBasedOnSnapshot: !Not
- !Equals [!Ref GerritVolumeSnapshotId, ""]
Resources:
GerritVolume:
Condition: CreateEBSVolume
Type: AWS::EC2::Volume
Properties:
AvailabilityZone: !Ref AvailabilityZone
SnapshotId: !If [CreateEBSVolumeBasedOnSnapshot, !Ref GerritVolumeSnapshotId, !Ref "AWS::NoValue"]
Size: !If [CreateEBSVolumeBasedOnSnapshot, !Ref "AWS::NoValue", !Ref GerritVolumeSizeInGiB]
Outputs:
GerritVolumeRef:
Value: !If [CreateEBSVolume, !Ref "GerritVolume", !Ref "GerritVolumeId"]