Created
June 19, 2018 10:27
-
-
Save Gunisalvo/a0523111a76da2047cfe232a772d3f5f to your computer and use it in GitHub Desktop.
UoL: Cloud Computing week 3 (snapshot)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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