-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance.tf
More file actions
23 lines (21 loc) · 842 Bytes
/
instance.tf
File metadata and controls
23 lines (21 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
resource "aws_iam_instance_profile" "this" {
name = local.resource_name
role = aws_iam_role.this.name
}
resource "aws_instance" "this" {
ami = local.ami
instance_type = var.instance_type
subnet_id = local.private_subnet_ids[0]
vpc_security_group_ids = [aws_security_group.this.id]
associate_public_ip_address = false
iam_instance_profile = aws_iam_instance_profile.this.name
disable_api_termination = false
monitoring = false
user_data = local.user-data
tags = merge(local.tags, { Name = local.resource_name })
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "required"
}
}