Handle creating/destroying instances from Terraform/tofu
This commit is contained in:
@@ -11,12 +11,49 @@ provider "aws" {
|
||||
region = "eu-west-1"
|
||||
}
|
||||
|
||||
resource "aws_instance" "test-instance" {
|
||||
ami = "0c4dcaafb6a14dbb93b402f1fd6a9dfb"
|
||||
# https://geo.mirror.pkgbuild.com/images/v20250315.322357/Arch-Linux-x86_64-cloudimg.qcow2
|
||||
# Import using:
|
||||
# aws ec2 import-image --disk-container "Url=https://geo.mirror.pkgbuild.com/images/v20250315.322357/Arch-Linux-x86_64-cloudimg.qcow2" --tag-specification 'Tags=[{Key="Linux",Value="ArchLinux-nocloud"}]'
|
||||
data "aws_ami" "archlinux-nocloud" {
|
||||
filter {
|
||||
name = "tag:Linux"
|
||||
values = ["ArchLinux-nocloud"]
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_instance" "test-instance-1" {
|
||||
ami = data.aws_ami.archlinux-nocloud.id
|
||||
instance_type = "micro"
|
||||
availability_zone = "az-1"
|
||||
|
||||
private_ip = "192.168.122.3"
|
||||
|
||||
tags = {
|
||||
TestTag = "TestValue"
|
||||
UseCase = "k8s-control-plane"
|
||||
}
|
||||
}
|
||||
|
||||
# resource "aws_instance" "test-instance-2" {
|
||||
# ami = "0c4dcaafb6a14dbb93b402f1fd6a9dfb"
|
||||
# instance_type = "micro"
|
||||
# availability_zone = "az-1"
|
||||
|
||||
# private_ip = "192.168.122.4"
|
||||
|
||||
# tags = {
|
||||
# UseCase = "k8s-control-plane"
|
||||
# }
|
||||
# }
|
||||
|
||||
|
||||
# resource "aws_instance" "test-instance-3" {
|
||||
# ami = "0c4dcaafb6a14dbb93b402f1fd6a9dfb"
|
||||
# instance_type = "micro"
|
||||
# availability_zone = "az-1"
|
||||
|
||||
# private_ip = "192.168.122.5"
|
||||
|
||||
# tags = {
|
||||
# UseCase = "k8s-control-plane"
|
||||
# }
|
||||
# }
|
||||
|
||||
Reference in New Issue
Block a user