List

List

A list or tuple is a squence of values (e.g ipAddr = ["192.168.1.1", "192.168.1.2"]). Lists are zero-indexed, so elements can be selected with this syntax ipAddr[0].

Example Resource

The Terraform Resource digitalocean_spaces_bucket

...
  cors_rule {
    allowed_headers = ["*"]
    allowed_methods = ["PUT", "POST", "DELETE"]
    allowed_origins = ["https://www.example.com"]
    max_age_seconds = 3000
  }
...

Source Code

The corresponding source code.

   "cors_rule": {
        Type:        schema.TypeList,
        Optional:    true,
        Description: "A container holding a list of elements describing allowed methods for a specific origin.",
        Elem: &schema.Resource{
         Schema: map[string]*schema.Schema{
          "allowed_methods": {
           Type:        schema.TypeList,
           Required:    true,
           Description: "A list of HTTP methods (e.g. GET) which are allowed from the specified origin.",
           Elem:        &schema.Schema{Type: schema.TypeString},
          },
          "allowed_origins": {
           Type:        schema.TypeList,
           Required:    true,
           Description: "A list of hosts from which requests using the specified methods are allowed. A host may contain one wildcard (e.g. http://*.example.com).",
           Elem:        &schema.Schema{Type: schema.TypeString},
          },
          "allowed_headers": {
           Type:        schema.TypeList,
           Optional:    true,
           Description: "A list of headers that will be included in the CORS preflight request's Access-Control-Request-Headers. A header may contain one wildcard (e.g. x-amz-*).",
           Elem:        &schema.Schema{Type: schema.TypeString},
          },
          "max_age_seconds": {
           Type:     schema.TypeInt,
           Optional: true,
          },
         },
        },
   },

References

Terraform Docs