Skip to content

Commit

Permalink
E2E Test: Ensure the use of IMDSv2 in EC2 instances (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
majanjua-amzn authored Nov 29, 2023
1 parent 24bfb35 commit 9d3b384
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion testing/terraform/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ resource "aws_instance" "main_service_instance" {
vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id]
associate_public_ip_address = true
instance_initiated_shutdown_behavior = "terminate"
metadata_options {
http_tokens = "required"
}

tags = {
Name = "main-service-${var.test_id}"
Expand Down Expand Up @@ -92,6 +95,9 @@ resource "aws_instance" "remote_service_instance" {
vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id]
associate_public_ip_address = true
instance_initiated_shutdown_behavior = "terminate"
metadata_options {
http_tokens = "required"
}

tags = {
Name = "remote-service-${var.test_id}"
Expand Down Expand Up @@ -140,4 +146,4 @@ resource "null_resource" "remote_service_setup" {
}

depends_on = [aws_instance.remote_service_instance]
}
}

0 comments on commit 9d3b384

Please sign in to comment.