Question: How to create an IAM policy using hclwrite
- Dominant language
- Go
- Stars
- 5.8k
- Forks
- 657
- Avg merge
- 20h 36m
- Merged PRs (30d)
- 6
Description
Hello
We are trying to create terragrunt files programatically with hclwrite and having some difficulties with writing iam policies. What I am trying to achieve is this terragrunt.hcl file for an s3 bucket.
- How can I create the policy and add it to the inputs as an attribute?
```
include {
path = find_in_parent_folders()
}
locals {
common_vars = yamldecode(file(find_in_parent_folders("common_vars.yaml")))
name = "product-images"
}
terraform {
source = "../../../../common//terragrunt-base/modules/terraform-aws-s3-bucket"
}
inputs = {
bucket = "${local.common_vars.namespace}-${local.common_vars.environment}-${local.name}"
policy = <
Contributor guide
No contributing guide indexed for this repository
Research direction
No repository file or test is named. Start by reading the hclwrite API and searching existing examples or tests for constructing attributes and heredoc-like values; done means identifying a supported way to build the policy and assign it to the inputs attribute, or documenting that limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, go, json
- Domain
- cloud, security, tooling
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100