Difference between revisions of "Terraform: subnet id"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
* <code>[[aws ec2 describe-instances]] | grep -i SubnetId</code> | * <code>[[aws ec2 describe-instances]] | grep -i SubnetId</code> | ||
+ | |||
+ | |||
+ | <code>[[terraform plan]]</code> | ||
+ | │ Error: Error in function call | ||
+ | │ | ||
+ | │ on ../path_to_your/plan.tf line 7, in resource "[[aws_instance]]" "this": | ||
+ | │ 7: subnet_id = element(var.subnet_ids,count.index) | ||
+ | │ ├──────────────── | ||
+ | │ │ count.index is 0 | ||
+ | │ │ var.[[subnet_ids]] is empty list of string | ||
+ | │ | ||
+ | │ Call to function "element" failed: cannot use element function with an empty list. | ||
Revision as of 19:22, 6 September 2021
aws ec2 describe-instances | grep -i SubnetId
│ Error: Error in function call │ │ on ../path_to_your/plan.tf line 7, in resource "aws_instance" "this": │ 7: subnet_id = element(var.subnet_ids,count.index) │ ├──────────────── │ │ count.index is 0 │ │ var.subnet_ids is empty list of string │ │ Call to function "element" failed: cannot use element function with an empty list.
See also
- Terraform AWS:
aws_instance
:ami
,availability_zone
,instance_type
,key_name
,aws_key_pair
,monitoring
,associate_public_ip_address
,tenancy
,subnet_id, user_data, iam_instance_profile, vpc_security_group_ids, root_block_device, ebs_block_device
- Terraform, OpenTofu, Terrakube.org, Installation, Terraform AWS, Terraform GCP, Terraform commands, Terraform Cloud, Terraform Enterprise (TFE), HCL, HIL, meta-arguments, providers, modules, resource, provisioners, data sources, backends: remote backends, examples, configuration files, state files, variables, types, Terraform Registry, conditionals:
depends_on
, functions, Blocks, dynamic blocks, errors, Terragrunt, Terraformer, Terratest, Terraform certifications, Terraform map type, Terraform Associate, Terraform: list type,TF_VAR_, TF_LOG
, Terraform provider versioning, Terraform Style Conventions, Required version, Terraform plugin, Terraform Named Values, tags, Changelog,tfsec, tflint
, Operators, Expressions:for, splat
, Debugging, Namespaces, Terraform Landing Zones, CDKTF, Atmos
Advertising: