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

dynamic-blocks: An argument named "key" is not expected here #8967

Closed
nextus opened this issue Mar 29, 2020 · 5 comments · Fixed by #9078
Closed

dynamic-blocks: An argument named "key" is not expected here #8967

nextus opened this issue Mar 29, 2020 · 5 comments · Fixed by #9078
Assignees
Milestone

Comments

@nextus
Copy link
Contributor

nextus commented Mar 29, 2020

Overview of the Issue

According to the documentation, I have to use key and value in the content block but it doesn't work:

  on ./packer.pkr.hcl line 56, in source "amazon-ebs" "ebs":
  56:       key   = tag.key

An argument named "key" is not expected here.

It seems this default schema is applied:

Blocks: []hcl.BlockHeaderSchema{

I replaced in my configuration key to name as a workaround and everything starts working but this is implicit behavior.

Reproduction Steps

Run build with dynamic block from the documentation.

Packer version

1.5.5

@nextus nextus added the bug label Mar 29, 2020
@sylviamoss sylviamoss added this to the 1.5.6 milestone Mar 30, 2020
@sylviamoss
Copy link
Member

Hey there, thanks for reaching out! We'll try to take a look for the next release.
Could you please provide us your simplified Packer hcl template?

@azr azr added docs and removed bug labels Apr 6, 2020
@azr
Copy link
Contributor

azr commented Apr 6, 2020

Hello there ! I first implemented it using the key key but then later changed it to name to remain consistent with filter/subnet_filters/etc., updating the docs now.

@azr
Copy link
Contributor

azr commented Apr 9, 2020

Ah scratch that, it's a little more complex. So when I implemented #8889 to allow to use tags/filters/subnetfilters key value maps I used the key "name" everywhere for consistency across Packer builders and Terraform I though; also it made implementation simpler.

But what Terraform providers do is using the naming convention of the upstream service. For example for the tags aws uses key/value (docs) and for VPC filters it is name/value (docs).

We'll soon work on fixing this to have this behaviour, note that this will be a breaking change.

@azr
Copy link
Contributor

azr commented Apr 21, 2020

Hello there, #9078 should address this. Binaries can be found here: artifacts.

@azr azr closed this as completed in #9078 Apr 23, 2020
@ghost
Copy link

ghost commented May 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants