Difference between revisions of "Terraform module: ec2-instance"
Jump to navigation
Jump to search
(9 intermediate revisions by 3 users not shown) | |||
Line 7: | Line 7: | ||
[[Terraform modules|module]] "ec2_instance" { | [[Terraform modules|module]] "ec2_instance" { | ||
− | source = "terraform-aws-modules/ec2-instance/aws" | + | source = "[[terraform-aws-modules/ec2-instance/aws]]" |
version = "~> 3.0" | version = "~> 3.0" | ||
Line 16: | Line 16: | ||
key_name = "user1" | key_name = "user1" | ||
monitoring = true | monitoring = true | ||
− | vpc_security_group_ids = ["sg-12345678"] | + | [[vpc_security_group_ids]] = ["sg-12345678"] |
− | subnet_id = "subnet-eddcdzz4" | + | [[subnet_id]] = "subnet-eddcdzz4" |
tags = { | tags = { | ||
Line 27: | Line 27: | ||
== Related == | == Related == | ||
− | * [[Terraform resource: aws | + | * <code>[[Terraform resource: aws_instance]]</code> |
+ | * [[Terraform: AWS instance example with aws ami lookup and key name]] | ||
+ | * <code>[[ebs_block_device]]</code> | ||
+ | * [[metadata_options]] Default: { "http_endpoint": "enabled", "http_put_response_hop_limit": 1, "[[http_tokens]]": "optional" } | ||
== See also == | == See also == | ||
+ | * {{tf ec2}} | ||
* {{terraform resources}} | * {{terraform resources}} | ||
+ | * {{terraform aws resources}} | ||
[[Category:Terraform]] | [[Category:Terraform]] |
Latest revision as of 09:44, 28 June 2024
Module: https://registry.terraform.io/modules/terraform-aws-modules/ec2-instance/aws/latest?tab=inputs
Resources:
aws_instance.this
aws_spot_instance_request.this
module "ec2_instance" { source = "terraform-aws-modules/ec2-instance/aws" version = "~> 3.0" name = "single-instance" ami = "ami-ebd02392" instance_type = "t2.micro" key_name = "user1" monitoring = true vpc_security_group_ids = ["sg-12345678"] subnet_id = "subnet-eddcdzz4" tags = { Terraform = "true" Environment = "dev" } }
Related[edit]
Terraform resource: aws_instance
- Terraform: AWS instance example with aws ami lookup and key name
ebs_block_device
- metadata_options Default: { "http_endpoint": "enabled", "http_put_response_hop_limit": 1, "http_tokens": "optional" }
See also[edit]
- Terraform EC2 resources:
aws_instance, aws_ebs_volume, aws_volume_attachment, aws_ec2_tag
, Terraform module:ec2-instance
,ebs_block_device
,argument/input
- Terraform resources, Terraform providers, Terraform provisioner,
random_password, random_string, null_resource
- Terraform AWS resources: IAM, Net, EC2, ECS, ECR, S3, Route53, ACM, CloudWatch, CloudFront SES, RDS, DLM
Advertising: