mirror of
https://github.com/Telecominfraproject/wlan-toolsmith.git
synced 2025-10-29 18:12:20 +00:00
Remove EC2 instance after switch to dynamic instance creation
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
This commit is contained in:
@@ -26,22 +26,6 @@ resource "aws_key_pair" "openwifi_virtual_ap" {
|
||||
tags = local.common_tags
|
||||
}
|
||||
|
||||
data "aws_ami" "ubuntu" {
|
||||
most_recent = true
|
||||
|
||||
filter {
|
||||
name = "name"
|
||||
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
|
||||
}
|
||||
|
||||
filter {
|
||||
name = "virtualization-type"
|
||||
values = ["hvm"]
|
||||
}
|
||||
|
||||
owners = ["099720109477"] # Canonical
|
||||
}
|
||||
|
||||
resource "aws_security_group" "openwifi_virtual_ap" {
|
||||
name = "openwifi-virtual-ap"
|
||||
|
||||
@@ -70,26 +54,6 @@ resource "aws_security_group" "openwifi_virtual_ap" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_instance" "openwifi_virtual_ap" {
|
||||
ami = data.aws_ami.ubuntu.id
|
||||
instance_type = "t2.nano"
|
||||
associate_public_ip_address = true
|
||||
key_name = aws_key_pair.openwifi_virtual_ap.id
|
||||
security_groups = [aws_security_group.openwifi_virtual_ap.name]
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [ami]
|
||||
}
|
||||
|
||||
root_block_device {
|
||||
delete_on_termination = true
|
||||
}
|
||||
|
||||
tags = merge({
|
||||
"Name" : "${var.org}-${var.project}-${var.env} OpenWifi virtual AP (WIFI-7204)"
|
||||
}, local.common_tags)
|
||||
}
|
||||
|
||||
resource "aws_iam_role_policy" "vmimport" {
|
||||
name = "vmimport"
|
||||
role = aws_iam_role.vmimport.id
|
||||
|
||||
Reference in New Issue
Block a user