Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

permission_target - empty 'actions' block crashes Terraform. #73

Open
kubiak95 opened this issue Mar 4, 2020 · 0 comments
Open

permission_target - empty 'actions' block crashes Terraform. #73

kubiak95 opened this issue Mar 4, 2020 · 0 comments

Comments

@kubiak95
Copy link

kubiak95 commented Mar 4, 2020

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.21
terraform-provider-artifactory 2.0.0-alpha1

Affected Resource(s)

  • artifactory_permission_target

Terraform Configuration Files

provider "artifactory" {
  url = var.auth_url
  api_key = var.auth_api_key
}

resource "artifactory_permission_target" "permission_target" {

  name = "test-permission-target"

  repo {
    excludes_pattern = [ "npm/**" ]
    includes_pattern = [ "pypi/**" ]
    repositories = [ "test-repo" ]

    actions {
    }
  }
}

Panic Output

https://gist.github.com/kubiak95/4d9650bdb47a481b7d58128fdc7ea256

Expected Behavior

  1. Terraform should return an error message (e.g. 'actions block cannot be empty') and exit 'gracefully'.
    OR
  2. Terraform should omit the empty actions block.

Actual Behavior

Terraform panics and crashes.

Steps to Reproduce

  1. Create a config file like the one shown above with an empty actions block.
  2. terraform apply

Additional Context

This crash is an outcome of me playing with dynamic blocks like so:

actions {
  dynamic "users" {
    for_each...
    }
  }
}

If I don't specify any users or groups, the result is an empty actions block. I will get around this by making actions dynamic as well, but ultimately Terraform crashed so I'm reporting it.

References

hashicorp/terraform#24098

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant