Difference between revisions of "Terraform: list type"

From wikieduonline
Jump to navigation Jump to search
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[wikipedia:List (abstract data type)]]
+
Terraform [[wikipedia:List (abstract data type)]] or tuple.
https://www.terraform.io/language/expressions/types#list
+
 
 +
* https://www.terraform.io/language/expressions/types#list
  
 
[[Type (Terraform)|Terraform Types]]:
 
[[Type (Terraform)|Terraform Types]]:
Line 6: Line 7:
 
* <code>type        = list(string)</code>
 
* <code>type        = list(string)</code>
 
* <code>default    = []</code>
 
* <code>default    = []</code>
 +
* <code>["us-west-1a", "us-west-1c"]</code>
  
 +
== Errors ==
 +
{{tuple error}}
  
* <code>["us-west-1a", "us-west-1c"]</code>
+
== Related terms ==
 
+
* [[Terraform plan errors]]: <code>[[List of string required]]</code>
==Related terms==
 
* [[Terraform plan errors]]
 
 
* <code>[[requires_compatibilities]]</code>
 
* <code>[[requires_compatibilities]]</code>
 
* <code>[[variables.tf]]</code>
 
* <code>[[variables.tf]]</code>
 
* [[Terraform function]]: <code>[[tolist]]([...])</code>
 
* [[Terraform function]]: <code>[[tolist]]([...])</code>
* [[Tuple]]
+
* [[Terraform function: element]]
* [[map]]
+
* <code>[[list]]</code> function is deprecated since [[Terraform v0.12]] (May 2019).
* [[Terraform function]]: list function is deprecated since [[Terraform v0.12]] (May 2019).
+
* <code>[[slice]]</code> [[terraform function]]
* [[List of string required]]
+
* [[Terraform object]]
 +
* <code>[[ The error was: list object has no element]]</code>
  
 
== See also ==
 
== See also ==
 
* {{Terraform types}}
 
* {{Terraform types}}
* {{Terraform}}
+
* {{Terraform variables}}
  
 
[[Category:Programming]]
 
[[Category:Programming]]

Latest revision as of 09:40, 20 April 2023

Terraform wikipedia:List (abstract data type) or tuple.

Terraform Types:

  • type = list(string)
  • default = []
  • ["us-west-1a", "us-west-1c"]

Errors[edit]

╷
│ Error: Invalid index
│
│   on api.tf line 15, in resource "aws_ecs_service" "your_service":
│   15:     target_group_arn = aws_lb_target_group.your_tg[0].arn
│     ├────────────────
│     │ aws_lb_target_group.your_tg is empty tuple
│
│ The given key does not identify an element in this collection value: the
│ collection has no elements.
╵

Related terms[edit]

See also[edit]

Advertising: