Error: Invalid function argument (no file exists)

From wikieduonline
Jump to navigation Jump to search
╷
│ Error: Invalid function argument
│
│   on main.tf line 626, in data "template_file" "buildspec":
│  626:   template = "${file("buildspec.yaml")}"
│
│ Invalid value for "path" parameter: no file exists at buildspec.yaml; this function works only with files that are distributed as part of the
│ configuration source code, so if this file will be created by a resource in this configuration you must instead obtain this result from an
│ attribute of that resource.
╵
╷
│ Error: Invalid function argument
│
│   on .terraform/modules/path_to_tffile.tf line 24, in resource "aws_s3_bucket" "s3_bucket":
│   24:      for_each = var.s3_static_website_vars == null ? []:tolist(var.s3_static_website_vars)
│     ├────────────────
│     │ var.s3_static_website_vars is object with 4 attributes
│
│ Invalid value for "v" parameter: cannot convert object to list of any single type.
╵


│ Error: Invalid function argument
│
│   on .terraform/modules/path/to/file.tf line 4, in resource "aws_s3_bucket" "s3_bucket":
│    4:     for_each = toset(var.s3_bucket_name)
│     ├────────────────
│     │ var.s3_bucket_name is a string, known only after apply
│
│ Invalid value for "v" parameter: cannot convert string to set of any single type.

Related terms[edit]

See also[edit]

Advertising: