Editing Terraform: subnet id

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:
Terraform <code>[[subnet_id]]</code> [[argument]] used in:
+
<code>[[subnet_id]]</code>
* [[Terraform resource: aws_instance]]
 
* [[Terraform module: ec2-instance]]
 
  
 
+
* <code>[[aws ec2 describe-subnets]]</code>
* <code>[[aws ec2 describe-subnets]] --output json | grep SubnetId</code>
 
 
* <code>[[aws ec2 describe-instances]]  | grep -i [[SubnetId]]</code>
 
* <code>[[aws ec2 describe-instances]]  | grep -i [[SubnetId]]</code>
  
 
== Examples ==
 
== Examples ==
 
* <code>subnet_id = "subnet-0a72be05b421abcde"</code>
 
* <code>subnet_id = "subnet-0a72be05b421abcde"</code>
* <code>subnet_id = [[element]]([[data.aws_subnets]].all_private.ids, 0)</code>
 
  
 
== Errors ==
 
== Errors ==
Line 16: Line 12:
 
  │
 
  │
 
  │  on ../path_to_your/plan.tf line 7, in resource "[[aws_instance]]" "this":
 
  │  on ../path_to_your/plan.tf line 7, in resource "[[aws_instance]]" "this":
  │    7:  subnet_id = element([[var.subnet_ids]],[[count.index]])
+
  │    7:  subnet_id = element(var.subnet_ids,count.index)
 
  │    ├────────────────
 
  │    ├────────────────
 
  │    │ count.index is 0
 
  │    │ count.index is 0
Line 22: Line 18:
 
  │
 
  │
 
  │ Call to function "[[element]]" failed: cannot use element function with an empty list.
 
  │ Call to function "[[element]]" failed: cannot use element function with an empty list.
 
* <code>[[InvalidSubnetID]]</code>
 
  
 
== Related  ==
 
== Related  ==
Line 29: Line 23:
 
* [[aws_subnet]]
 
* [[aws_subnet]]
 
* [[Terraform: VPCIdNotSpecified]]
 
* [[Terraform: VPCIdNotSpecified]]
 +
* [[InvalidSubnetID]]
 
  tf show | grep subnet_id
 
  tf show | grep subnet_id
 
  tf show | egrep "subnet_id|connectivity_type"
 
  tf show | egrep "subnet_id|connectivity_type"
Line 35: Line 30:
 
== See also ==
 
== See also ==
 
* {{aws_instance}}
 
* {{aws_instance}}
 +
* {{Terraform}}
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]

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: