hashicorp / hashicorp/packer-plugin-amazon

Inappropriate value for attribute "Resource": list of string required.

Open
#210 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
91
Forks
141
Avg merge
2d 18h
Merged PRs (30d)
3

Description

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

#### Overview of the Issue

Documentation for https://www.packer.io/plugins/builders/amazon/ebs#temporary_iam_instance_profile_policy_document shows a string as the value for `Resource` but the accepted type is list(string)

#### Reproduction Steps

Create an Ami Builder configuration with the documented example:
```hcl
temporary_iam_instance_profile_policy_document {
Statement {
Action = ["logs:*"]
Effect = "Allow"
Resource = "*"
}
Version = "2012-10-17"
}
```

### Plugin and Packer version

Packer v1.8.0
plugin `amazon-ebs` v1.0.8

### Simplified Packer Buildfile

If the file is longer than a few dozen lines, please include the URL to the
[gist](https://gist.github.com/) of the log or use the [Github detailed
format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d)
instead of posting it directly in the issue.

### Operating system and Environment details

linux, AWS

### Log Fragments and crash.log files

```
Installed plugin github.com/hashicorp/amazon v1.0.8 in "/var/run/packer/.config/packer/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.0.8_x5.0_linux_amd64"
Installed plugin github.com/hashicorp/ansible v1.0.1 in "/var/run/packer/.config/packer/plugins/github.com/hashicorp/ansible/packer-plugin-ansible_v1.0.1_x5.0_linux_amd64"
Error: Incorrect attribute value type
on ami.pkr.hcl line 57:
(source code not available)
Inappropriate value for attribute "Resource": list of string required.
```

The solution is to specify Resource as a `list(string)`, so this requires a small change to the documentation:
```hcl
temporary_iam_instance_profile_policy_document {
Statement {
Action = ["logs:*"]
Effect = "Allow"
Resource = ["*"]
}
Version = "2012-10-17"
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.