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 Oct 8, 2020. It is now read-only.
With a terraform plan -out plan.tfplan and a terraform apply plan.tfplan all the resources should be created.
Actual Behavior
If I call plan, it looks good. When I apply that plan, it also seems like the dependencies are right, It wants to create the ECR repository policy with the rendered file (correct instance role ARN is in place in output). But AWS sends back InvalidParameterException: Invalid parameter at 'PolicyText' failed to satisfy constraint: 'Invalid repository policy provided' . The interesting part is if I call another plan + apply now, it creates the remaining resource (the ECR policy, what is using the template, also listing the right ARN in place) correctly. and in AWS console I see the wanted results.
I tried the same configuration with hardcoded (pre-existent ARN) without the template file data soruce, and it worked like a charm for the first try, but I need to be able to parameterize my policies, that's why I choose template files, (the IAM policy_document data source format is far less convenient format for me, I prefer providing the JSON for these things)
Steps to Reproduce
terraform plan -out plan.tfplan
terraform apply plan.tfplan
AWS rejection happens, don't change anything
terraform plan -out plan.tfplan
terraform apply plan.tfplan
It works just fine... ?!
The text was updated successfully, but these errors were encountered:
I tried providing an existent ARN (hardcoded string instead of interpolation) for the variable in the template, and it worked just fine. My guess is now, that the template rendering does not wait for other resources it depends on. Maybe a core issue? and not provider related?
Terraform Version
v0.9.11
Affected Resource(s)
Terraform Configuration Files
Template file (ECRPolicy_InstancePull.tpl)
AssumeRolePolicy.json for the IAM role
Expected Behavior
With a
terraform plan -out plan.tfplan
and aterraform apply plan.tfplan
all the resources should be created.Actual Behavior
If I call plan, it looks good. When I apply that plan, it also seems like the dependencies are right, It wants to create the ECR repository policy with the rendered file (correct instance role ARN is in place in output). But AWS sends back InvalidParameterException: Invalid parameter at 'PolicyText' failed to satisfy constraint: 'Invalid repository policy provided' . The interesting part is if I call another plan + apply now, it creates the remaining resource (the ECR policy, what is using the template, also listing the right ARN in place) correctly. and in AWS console I see the wanted results.
I tried the same configuration with hardcoded (pre-existent ARN) without the template file data soruce, and it worked like a charm for the first try, but I need to be able to parameterize my policies, that's why I choose template files, (the IAM policy_document data source format is far less convenient format for me, I prefer providing the JSON for these things)
Steps to Reproduce
terraform plan -out plan.tfplan
terraform apply plan.tfplan
terraform plan -out plan.tfplan
terraform apply plan.tfplan
The text was updated successfully, but these errors were encountered: