Skip to content

Crash when creating entity that already exists #451

Description

@craigday

The entity "craig" already existed, created manually, so not strictly a valid configuration.

Terraform Version

Terraform v0.11.14

  • provider.vault v1.8.0

Affected Resource(s)

Please list the resources as a list, for example:

  • vault_identity_entity.craig

Terraform Configuration Files

provider "vault" {
  address = "https://vault.local"
}

resource "vault_aws_secret_backend" "aws" {
  access_key = "<redacted>"
  secret_key = "<redacted>"
  region = "ap-southeast-2"
  default_lease_ttl_seconds = 300
  max_lease_ttl_seconds = 300
  lifecycle {
    ignore_changes = [ "access_key", "secret_key" ]
  }
}

resource "vault_aws_secret_backend_role" "dev_role" {
  backend = "${vault_aws_secret_backend.aws.path}"
  name = "dev-role"
  credential_type = "iam_user"
  policy_document = "${file("policies/ec2/dev-policy.json")}"
}

resource "vault_policy" "admin_policy" {
  name = "admin"
  policy = "${file("policies/vault/admin-policy.hcl")}"
}

resource "vault_policy" "dev_policy" {
  name = "dev-policy"
  policy = "${file("policies/vault/dev-policy.hcl")}"
}

resource "vault_identity_entity" "craig" {
  name      = "craig"
  policies  = ["admin-policy"]
}

Debug Output

https://gist.github.com/craigday/100d82f1db91e6e1940c4640d92fc53c

Panic Output

https://gist.github.com/craigday/411386f58cd120dfbf1582076f3ab9ad

Expected Behavior

Probably should have just errored normally, not crash.

Actual Behavior

Crashed!

Steps to Reproduce

  1. terraform apply

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions