Skip to content

Instantly share code, notes, and snippets.

@Gunisalvo
Created June 19, 2018 10:27
Show Gist options
  • Save Gunisalvo/a0523111a76da2047cfe232a772d3f5f to your computer and use it in GitHub Desktop.
Save Gunisalvo/a0523111a76da2047cfe232a772d3f5f to your computer and use it in GitHub Desktop.
UoL: Cloud Computing week 3 (snapshot)
variable "student_name" {
default = "STUDENT_NAME" #fix me
}
variable "region" {
default = "us-east-2"
}
provider "aws" {
region = "${var.region}"
}
data "aws_ebs_volume" "uol_storage" {
filter{
name = "tag:Name"
values = ["ebs_wk3_${var.student_name}"]
}
}
resource "aws_ebs_snapshot" "uol_storage_snapshot" {
volume_id = "${data.aws_ebs_volume.uol_storage.id}"
tags {
Name = "ebs_wk3_${var.student_name}_${timestamp()}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment