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: | ||
− | + | <code>[[subnet_id]]</code> | |
− | |||
− | |||
− | + | * <code>[[aws ec2 describe-subnets]]</code> | |
− | * <code>[[aws ec2 describe-subnets]] | ||
* <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> | ||
− | |||
== 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( | + | │ 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. | ||
− | |||
− | |||
== 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]] |
Advertising: