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
I attempted to use the submodule repository-template with the variable repository_policy_statements, however I was unsuccessful in intrepreting the desired format.
description="A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage"
type=any
default={}
}
The following would appear to be valid for your object constraints:
description="The JSON policy to apply to the repository. If not specified, uses the default policy"
type=string
default=null
}
Ideally I would simply amend the additional statements and make use of the existing policy however the error produced was as follows:
terraform plan (error)
Error: Unsupported attribute
on .terraform/modules/docker-pullthrough-template/modules/repository-template/main.tf line 135, in data "aws_iam_policy_document" "repository":
135: type = principals.value.type
├────────────────
│ principals.value is tuple with 1 element
This value does not have any attributes.
Error: Unsupported attribute
on .terraform/modules/docker-pullthrough-template/modules/repository-template/main.tf line 135, in data "aws_iam_policy_document" "repository":
135: type = principals.value.type
├────────────────
│ principals.value is "AWS"
Can't access attributes on a primitive-typed value (string).
Error: Unsupported attribute
on .terraform/modules/docker-pullthrough-template/modules/repository-template/main.tf line 135, in data "aws_iam_policy_document" "repository":
135: type = principals.value.type
├────────────────
│ principals.value is tuple with 1 element
This value does not have any attributes.
Error: Unsupported attribute
on .terraform/modules/docker-pullthrough-template/modules/repository-template/main.tf line 135, in data "aws_iam_policy_document" "repository":
135: type = principals.value.type
├────────────────
│ principals.value is "Service"
Can't access attributes on a primitive-typed value (string).
Error: Unsupported attribute
on .terraform/modules/docker-pullthrough-template/modules/repository-template/main.tf line 136, in data "aws_iam_policy_document" "repository":
136: identifiers = principals.value.identifiers
├────────────────
│ principals.value is tuple with 1 element
This value does not have any attributes.
Error: Unsupported attribute
on .terraform/modules/docker-pullthrough-template/modules/repository-template/main.tf line 136, in data "aws_iam_policy_document" "repository":
136: identifiers = principals.value.identifiers
├────────────────
│ principals.value is "AWS"
Can't access attributes on a primitive-typed value (string).
Error: Unsupported attribute
on .terraform/modules/docker-pullthrough-template/modules/repository-template/main.tf line 136, in data "aws_iam_policy_document" "repository":
136: identifiers = principals.value.identifiers
├────────────────
│ principals.value is tuple with 1 element
This value does not have any attributes.
Error: Unsupported attribute
on .terraform/modules/docker-pullthrough-template/modules/repository-template/main.tf line 136, in data "aws_iam_policy_document" "repository":
136: identifiers = principals.value.identifiers
├────────────────
│ principals.value is "Service"
Can't access attributes on a primitive-typed value (string).
✋ I have searched the open/closed issues and my issue is not listed.
Versions
Module version [Required]: 2.3.1
Terraform version: 1.10.5
Provider version(s): 5.86.0
Reproduction Code [Required]
Steps to reproduce the behavior:
This is just a simple terraform plan. I used the default example, and provided values to var.repository_policy_statements and a few other options
If the variable were a defined map(object(...)) that would provide more clarity on usage of this variable, and with new optional() functions it could be setup in a way that would work with not all options provided.
I also remember something about nested dynamic statements being potentially an issue ... but not sure that remains true today.
Description
I attempted to use the submodule
repository-template
with the variablerepository_policy_statements
, however I was unsuccessful in intrepreting the desired format.terraform-aws-ecr/modules/repository-template/variables.tf
Lines 127 to 131 in 8105d04
The following would appear to be valid for your object constraints:
var.repository_policy_statements input
Unfortunately this produced an error, so I reverted to using
repository_policy
and absorb the default policy the module providesterraform-aws-ecr/modules/repository-template/variables.tf
Lines 65 to 69 in 8105d04
Ideally I would simply amend the additional statements and make use of the existing policy however the error produced was as follows:
terraform plan (error)
Versions
Module version [Required]: 2.3.1
Terraform version: 1.10.5
Provider version(s): 5.86.0
Reproduction Code [Required]
Steps to reproduce the behavior:
This is just a simple terraform plan. I used the default example, and provided values to
var.repository_policy_statements
and a few other optionsterraform minimal plan
The above gives warnings during
terraform plan
Expected behavior
Terraform should parse
principals
andconditions
elements normally and correctly populate the dynamic statement portionActual behavior
Error
Terminal Output Screenshot(s)
Included above
Additional context
The text was updated successfully, but these errors were encountered: