Skip to content

Commit

Permalink
Add support for creating EBS volume from a snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
sdickenson committed Nov 4, 2024
1 parent 2d16cb1 commit 75bbcd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ resource "aws_autoscaling_group" "this" {
}
}


resource "aws_ebs_volume" "data" {
count = var.ebs_data_volume ? 1 : 0

availability_zone = var.availability_zone
size = var.ebs_volume_size
size = var.ebs_volume_snapshot_id == "" ? var.ebs_volume_size : null
snapshot_id = var.ebs_volume_snapshot_id == "" ? null : var.ebs_volume_snapshot_id

tags = merge(var.tags,
{
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,17 @@ variable "ebs_data_volume" {
}

variable "ebs_volume_size" {
default = 100
description = "Size of Nexus data volume in GB"
type = number
}

variable "ebs_volume_snapshot_id" {
default = ""
description = "Snapshot ID to use as source for new EBS volume"
type = string
}

########################################
# EFS Vars
########################################
Expand Down

0 comments on commit 75bbcd3

Please sign in to comment.