+ Creating new volume for the photo/video gallery service

Service ware still needs to be defined but this is the only resource we need
to build out in order to have things be kosher
This commit is contained in:
shockrah 2022-06-12 21:34:39 -07:00
parent b9759b38f6
commit acfd39be9b
2 changed files with 29 additions and 2 deletions

View File

@ -6,6 +6,25 @@ resource "aws_key_pair" "alpha_ssh" {
public_key = file(var.alpha_public_key_path) public_key = file(var.alpha_public_key_path)
} }
resource "aws_ebs_volume" "photo_gallery_volume" {
availability_zone = var.athens_availability_zone
size = 35
tags = {
Name = "Photo gallery volume"
Description = "Volume is to be used entirely for Photos/Video"
}
}
resource "aws_ebs_volume" "id" {
availability_zone = "us-west-1b"
size = 35
tags = {
Name = "Clips"
Description = "Used for the clippable instance"
}
}
resource "aws_instance" "alpha" { resource "aws_instance" "alpha" {
ami = var.alpha_ami_id ami = var.alpha_ami_id
instance_type = var.alpha_instance_type instance_type = var.alpha_instance_type
@ -13,7 +32,7 @@ resource "aws_instance" "alpha" {
key_name = var.alpha_ssh_key_name key_name = var.alpha_ssh_key_name
private_ip = "10.0.1.10" private_ip = "10.0.1.10"
security_groups = [ vpc_security_group_ids = [
aws_security_group.general_web_req.id, aws_security_group.general_web_req.id,
aws_security_group.remote_ssh_rec.id aws_security_group.remote_ssh_rec.id
] ]
@ -22,4 +41,12 @@ resource "aws_instance" "alpha" {
Name = "Alpha Host" Name = "Alpha Host"
Description = "Docker host with chatbots mostly" Description = "Docker host with chatbots mostly"
} }
}
resource "aws_volume_attachment" "photo_gallery_attach" {
# hdp is for hard drive photos in this case
device_name = "/dev/sdp"
volume_id = aws_ebs_volume.photo_gallery_volume.id
instance_id = aws_instance.alpha.id
} }

View File

@ -12,7 +12,7 @@ resource "aws_instance" "beta" {
key_name = var.beta_public_key_path key_name = var.beta_public_key_path
private_ip = "10.0.1.11" private_ip = "10.0.1.11"
security_groups = [ vpc_security_group_ids = [
aws_security_group.general_web_req.id, aws_security_group.general_web_req.id,
aws_security_group.remote_ssh_rec.id aws_security_group.remote_ssh_rec.id
] ]