-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
15-ebs.tf
49 lines (42 loc) · 1.34 KB
/
15-ebs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# EBS volume creation
resource "aws_ebs_volume" "ebs_volume_1" {
availability_zone = var.ec2_availability_zone
size = var.ebs_volume_1_size_gb
type = var.ebs_volume_1_type
encrypted = var.ebs_volume_1_encryption
kms_key_id = aws_kms_key.kms_key_4.arn
tags = {
Name = "ebs-volume-nextcloud-1"
}
}
# EBS volume attachment
resource "aws_volume_attachment" "ebs_volume_1_attachment" {
device_name = var.ebs_volume_1_name
volume_id = aws_ebs_volume.ebs_volume_1.id
instance_id = aws_instance.instance_1.id
depends_on = [
aws_ebs_volume.ebs_volume_1,
aws_instance.instance_1
]
}
# EBS volume creation
resource "aws_ebs_volume" "backup_ebs_volume_1" {
availability_zone = var.ec2_availability_zone
size = var.backup_ebs_volume_1_size_gb
type = var.backup_ebs_volume_1_type
encrypted = var.backup_ebs_volume_1_encryption
kms_key_id = aws_kms_key.kms_key_5.arn
tags = {
Name = "backup-ebs-volume-nextcloud-1"
}
}
# EBS volume attachment
resource "aws_volume_attachment" "backup_ebs_volume_1_attachment" {
device_name = var.backup_ebs_volume_1_name
volume_id = aws_ebs_volume.backup_ebs_volume_1.id
instance_id = aws_instance.instance_1.id
depends_on = [
aws_ebs_volume.backup_ebs_volume_1,
aws_instance.instance_1
]
}