Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map function is no longer in terraform #5

Open
babyhuey opened this issue Feb 23, 2022 · 1 comment
Open

map function is no longer in terraform #5

babyhuey opened this issue Feb 23, 2022 · 1 comment

Comments

@babyhuey
Copy link

╷
│ Error: Error in function call
│ 
│   on .terraform/modules/camellia-image/main.tf line 360, in resource "aws_codebuild_project" "packer":
│  360:     for_each = local.is_vpc_provided ? map(var.vpc_id, var.subnet_ids) : {}
│     ├────────────────
│     │ var.subnet_ids is list of string with 3 elements
│     │ var.vpc_id is "vpc-xxxxxxxx"
│ 
│ Call to function "map" failed: the "map" function was deprecated in
│ Terraform v0.12 and is no longer available; use tomap({ ... }) syntax to
│ write a literal map.
╵
ERRO[0039] 1 error occurred:
        * exit status 1

I tried just changing to tomap but that did not work

@babyhuey
Copy link
Author

tomap error:

╷
│ Error: Too many function arguments
│ 
│   on .terraform/modules/camellia-image/main.tf line 360, in resource "aws_codebuild_project" "packer":
│  360:     for_each = local.is_vpc_provided ? tomap(var.vpc_id, var.subnet_ids) : {}
│     ├────────────────
│     │ var.subnet_ids is list of string with 3 elements
│     │ var.vpc_id is "vpc-0bf8b798434eb3961"
│ 
│ Function "tomap" expects only 1 argument(s).
╵
Releasing state lock. This may take a few moments...
ERRO[0039] 1 error occurred:
        * exit status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant