This commit is contained in:
2025-06-16 21:54:40 -07:00
parent d10c38e2a2
commit 6055a94285
6 changed files with 22 additions and 22 deletions

View File

@ -101,27 +101,27 @@ resource "aws_iam_policy" "ec2_s3_policy" {
}
}
# Create AMI
resource "aws_ami_from_instance" "ami_snapshot" {
name = "ami-snapshot-2025-06-17"
source_instance_id = aws_instance.my_first_linux.id
snapshot_without_reboot = true
tags = {
Name = "labs"
}
}
# Launch new instance from AMI
resource "aws_instance" "my_second_linux" {
instance_type = "t2.micro"
ami = aws_ami_from_instance.ami_snapshot.id
security_groups = ["ssh-access-witch"]
tags = {
Name = "labs"
}
}
# # Create AMI
# resource "aws_ami_from_instance" "ami_snapshot" {
# name = "ami-snapshot-2025-06-17"
# source_instance_id = aws_instance.my_first_linux.id
# snapshot_without_reboot = true
#
# tags = {
# Name = "labs"
# }
# }
#
# # Launch new instance from AMI
# resource "aws_instance" "my_second_linux" {
# instance_type = "t2.micro"
# ami = aws_ami_from_instance.ami_snapshot.id
# security_groups = ["ssh-access-witch"]
#
# tags = {
# Name = "labs"
# }
# }