You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
Using regula on terraform resources that have dynamic blocks, generates mock_resources (and mock_input) that contains a "dynamic" list/array of maps but no "key" to identify what values corresponds to which argument.
How you're running Regula
Please include versions of all relevant tools. Some examples:
regula version
❯ regula version
3.2.1, build fed1e44, built with OPA v0.46.0-dev
I'm using Regula 3.2.1, build fed1e44 as a Rego library with OPA v0.46.0-dev and a Terraform plan JSON input that I generated with Terraform v1.3.6
Operating System
macOS v13.3.1
Steps to reproduce
# Loding just the tf file...
❯ regula repl main.tf --no-built-ins
INFO Loaded 1 IaC configurations as test inputs
Regula 3.2.1 - built with OPA v0.46.0-dev
Run 'help' to see a list of commands.
> data.main_tf.mock_resources["aws_security_group.main"]
{
"_filepath": "main.tf",
"_provider": "aws",
"_tags": {
"Name": "AWS security group dynamic block"
},
"_type": "aws_security_group",
"dynamic": [
{
"content": [
{
"cidr_blocks": [
"0.0.0.0/0"
],
"description": "ingress.value.description",
"from_port": "ingress.value.port",
"protocol": "tcp",
"to_port": "ingress.value.port"
}
],
"for_each": [
{
"description": "foo-ing",
"port": "123"
},
{
"description": "bar-ing",
"port": "456"
}
]
},
{
"content": [
{
"cidr_blocks": [
"0.0.0.0/0"
],
"description": "egress.value.description",
"from_port": "egress.value.port",
"protocol": "tcp",
"to_port": "egress.value.port"
}
],
"for_each": [
{
"description": "foo-eg",
"port": "123"
},
{
"description": "bar-eg",
"port": "456"
}
]
}
],
"id": "aws_security_group.main",
"name": "resource_with_dynamic_block",
"tags": {
"Name": "AWS security group dynamic block"
},
"vpc_id": "foobar"
}
Describe the bug
Using regula on terraform resources that have dynamic blocks, generates mock_resources (and mock_input) that contains a "dynamic" list/array of maps but no "key" to identify what values corresponds to which argument.
How you're running Regula
Please include versions of all relevant tools. Some examples:
3.2.1, build fed1e44
as a Rego library with OPAv0.46.0-dev
and a Terraform plan JSON input that I generated with Terraformv1.3.6
Operating System
macOS v13.3.1
Steps to reproduce
IaC Configuration
It'd be beneficial for dynamic list of maps to have a key that would identify the resource that the dynamic block belonged to.
So for example,
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: