terraform-aws-ecs
terraform-aws-ecs copied to clipboard
module is incompatible with data resources
Description
Please provide a clear and concise description of the issue you are encountering, and a reproduction of your configuration (see the examples/* directory for references that you can copy+paste and tailor to match your configs if you are unable to copy your exact configuration). The reproduction MUST be executable by running terraform init && terraform apply without any further changes.
If your request is for a new feature, please use the Feature request template.
- [x] β I have searched the open/closed issues and my issue is not listed.
β οΈ Note
Before you submit an issue, please perform the following first:
- Remove the local
.terraformdirectory (! ONLY if state is stored remotely, which hopefully you are following that best practice!):rm -rf .terraform/ - Re-initialize the project root to pull down modules:
terraform init - Re-attempt your terraform plan or apply and check if the issue still persists
Versions
- Module version [Required]:
5.11.4
Reproduction Code [Required]
When using cdktf, the tasks_iam_role_statements variable (and probably all others statement iam variables too) are incompatible with by cdktf generated data resources.
builder.tasksIamRoleStatements(listOf(DataAwsIamPolicyDocumentStatement.builder()
.effect("Allow")
...
.condition(listOf(...))
.build()))
The problem is, that part:
dynamic "condition" {
for_each = try(statement.value.conditions, [])
content {
test = condition.value.test
values = condition.value.values
variable = condition.value.variable
}
}
which looks for conditions instead of condition.
Expected behavior
Use condition instead of conditions to make it interact with cdktf.
Actual behavior
You need to manually map all statements.