-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstance.tf
More file actions
28 lines (25 loc) · 1.05 KB
/
Copy pathinstance.tf
File metadata and controls
28 lines (25 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# ==============================================================================
# EC2 Instance
# ==============================================================================
module "examplesite_instance" {
source = "terraform-aws-modules/ec2-instance/aws"
version = local.instance_version
name = "my-infra-${var.env}"
instance_type = "t3.micro"
vpc_security_group_ids = [module.ec2_security_group.security_group_id]
subnet_id = module.vpc.public_subnets[0]
associate_public_ip_address = false
iam_instance_profile = aws_iam_instance_profile.ec2_ssm_profile.name
user_data = local.ec2_user_data
user_data_replace_on_change = false
metadata_options = {
http_endpoint = "enabled"
http_tokens = "required"
http_put_response_hop_limit = 2
instance_metadata_tags = "enabled"
}
tags = {
Terraform = "true"
Environment = "${var.env}"
}
}