Skip to content

Commit

Permalink
Set associate_public_ip_address to false and added lifecycle block
Browse files Browse the repository at this point in the history
  • Loading branch information
jodiejones-moj committed Nov 8, 2024
1 parent 0333241 commit 42562bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions terraform/environments/panda-cyber-appsec-lab/ec2.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Kali Linux Instance
resource "aws_instance" "kali_linux" {
ami = "ami-0f398bcc12f72f967" // aws-marketplace/kali-last-snapshot-amd64-2024.2.0-804fcc46-63fc-4eb6-85a1-50e66d6c7215
associate_public_ip_address = false
instance_type = "t2.micro"
subnet_id = module.vpc.private_subnets.0
vpc_security_group_ids = [aws_security_group.kali_linux_sg.id]
Expand Down Expand Up @@ -52,6 +53,7 @@ resource "aws_instance" "kali_linux" {
# Defect Dojo Instance
resource "aws_instance" "defect_dojo" {
ami = "ami-0e8d228ad90af673b"
associate_public_ip_address = false
instance_type = "t2.micro"
subnet_id = module.vpc.private_subnets.0
vpc_security_group_ids = [aws_security_group.kali_linux_sg.id]
Expand Down Expand Up @@ -79,6 +81,9 @@ resource "aws_instance" "defect_dojo" {
tags = {
Name = "Defect-Dojo"
}
lifecycle {
replace_triggered_by = [aws_instance.defect_dojo.user_data]
}
}


Expand Down

0 comments on commit 42562bb

Please sign in to comment.