Bcloud
Bcloud

Reputation: 43

Terraform error: Provider produced inconsistent final plan when expanding the plan

I got an error when create iam policy for ec2 role via bamboo pipeline.

Error: Provider produced inconsistent final plan when expanding the plan for aws_iam_policy.this[xx] to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid new value for policy: was cty.StringVal(xx), but now cty.StringVal(xx). This is a bug in the provider, which should be reported in the provider's own issue tracker. It was good when ran terraform from local machine but the error occurred when deployed via bamboo pipeline.

Versions on my local machine: Terraform v1.2.5 AWS v4.29.0

I tried to specify the aws provider version=4.29.0 but got another error:

"Provider requirements cannot be satisfied by locked dependencies".

Upvotes: 1

Views: 4198

Answers (2)

Roopa
Roopa

Reputation: 46

If the error is regarding tags use tags_all instead tag i.e

tags = {
     Environment = "Prod"
     Owner       = "Bits Lovers"
     Goal        = "Biggest Blog about DevOps"
   }
###use below

tags_all = {
     Environment = "Prod"
     Owner       = "Bits Lovers"
     Goal        = "Biggest Blog about DevOps"
   }

Upvotes: 0

nmishin
nmishin

Reputation: 3064

I believe you need to write about this types of errors to the AWS provider github

Also, I suggest to double check your terraform code, maybe a little bit simplify it.

About:

Provider requirements cannot be satisfied by locked dependencies

looks like your forget to run terraform init after provider version changing

Upvotes: 0

Related Questions