Terraform-provider-vault: vault_aws_auth_backend_role - policies ordering issue (triggers plan update)

Created on 5 Apr 2019  路  4Comments  路  Source: hashicorp/terraform-provider-vault

Terraform Version

0.11.13
vault provider version 1.7.0

Affected Resource(s)

  • vault_aws_auth_backend_role

Terraform Configuration Files

# admin role
resource "vault_aws_auth_backend_role" "admin_access" {
  backend                  = "${vault_auth_backend.aws.path}"
  role                     = "admin-access"
  auth_type                = "iam"
  policies                 = ["default", "admin-access" ]
  bound_iam_principal_arns = ["arn:aws:iam::******:role/admin_role"]
}

Expected Behavior

Subsequent re-runs of plan to not trigger changes.

Actual Behavior

It triggers a change on every plan re-run even if applied many times.

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ vault_aws_auth_backend_role.admin_access
      policies.0: "admin-access" => "default"
      policies.1: "default" => "admin-access"


Plan: 0 to add, 1 to change, 0 to destroy.

------------------------------------------------------------------------

Steps to Reproduce

  1. terraform plan

Most helpful comment

@lcgkm #224 is not related to this. I think that issue should have been fixed by https://github.com/terraform-providers/terraform-provider-vault/pull/305

All 4 comments

We are running into the same issue as well.

The fix is to change this line to schema.TypeSet.

224

@lcgkm #224 is not related to this. I think that issue should have been fixed by https://github.com/terraform-providers/terraform-provider-vault/pull/305

Was this page helpful?
0 / 5 - 0 ratings