Editing Terraform resource: aws instance

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
<code>[[aws_instance]]</code> ([https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance ref])
+
<code>[[aws_instance]] </code>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance
 
 
== Arguments ==
 
* <code>[[subnet_id]]</code>
 
* <code>[[instance_type]]</code>
 
* <code>[[ami]]</code>
 
* <code>[[key_name]]</code>
 
* <code>[[vpc_security_group_ids]]</code>
 
* <code>[[metadata_options]]</code>: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#metadata-options
 
** <code>[[http_tokens]] = required</code>
 
  
 
== [[Terraform examples|Examples]] ==
 
== [[Terraform examples|Examples]] ==
Line 44: Line 35:
 
  resource "aws_instance" "restore-backups-machine" {
 
  resource "aws_instance" "restore-backups-machine" {
 
   # (resource arguments)
 
   # (resource arguments)
}
 
 
 
resource "aws_instance" "myUbuntuMicroInstance" {
 
  ami          = [[data.]]aws_ami.ubuntu.id
 
  .../...
 
 
 
resource "aws_instance" "my-instance" {
 
  count        = var.instance_count
 
  ami          = [[lookup]](var.ami,var.aws_region)
 
  instance_type = var.instance_type
 
  key_name      = aws_key_pair.terraform-demo.key_name
 
  user_data    = file("install_apache.sh")
 
 
  tags = {
 
    Name  = "Terraform-${count.index + 1}"
 
    Batch = "5AM"
 
  }
 
 
  }
 
  }
  
Line 70: Line 42:
 
   value = [[aws_instance.]]your_server[[.private_ip]]
 
   value = [[aws_instance.]]your_server[[.private_ip]]
 
  }
 
  }
 
== Errors ==
 
* [[Error: creating EC2 Instance: UnauthorizedOperation: You are not authorized to perform this operation]]
 
  
 
== aws_instance arguments ==  
 
== aws_instance arguments ==  
Line 91: Line 60:
 
* <code>[[lifecycle]]</code>
 
* <code>[[lifecycle]]</code>
 
* <code>[[tenancy]]</code>
 
* <code>[[tenancy]]</code>
* <code>[[instance_state]]</code>
 
  
 
== Related terms ==
 
== Related terms ==
Line 100: Line 68:
 
* [[Terraform: Data sources]]
 
* [[Terraform: Data sources]]
 
* <code>[[Terraform: VPCIdNotSpecified]]</code>
 
* <code>[[Terraform: VPCIdNotSpecified]]</code>
* [[Terraform module]]: <code>[[Terraform module: ec2-instance|ec2-instance]]</code>
+
* [[Terraform module: ec2-instance]]
 
* [[Terraform resource]]: <code>[[Terraform resource: aws volume attachment|aws_volume_attachment]]</code>
 
* [[Terraform resource]]: <code>[[Terraform resource: aws volume attachment|aws_volume_attachment]]</code>
 
* [[volume_size]]
 
* [[volume_size]]
Line 106: Line 74:
 
* <code>[[aws_eip]]</code>
 
* <code>[[aws_eip]]</code>
 
* <code>[[aws instance.your_instance_name will be updated in-place]]</code>
 
* <code>[[aws instance.your_instance_name will be updated in-place]]</code>
* <code>[[count]]</code>
+
* [[count]]
* <code>[[VcpuLimitExceeded]]</code>
 
* [[Datadog: EC2 instances should enforce IMDSv2]]
 
* <code>[[aws_ec2_instance_metadata_defaults]]</code>
 
  
 
== See also ==
 
== See also ==

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Template used on this page:

Advertising: