Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Can we support id in addition to name on data.rancher_environment #67

Open
charandas opened this issue Dec 29, 2017 · 0 comments
Open

Comments

@charandas
Copy link

Rancher allows one to create multiple environments with the same name. Perhaps they have been created under a different account and the terraform user does not even know about their existence.

By supporting id in additon to name, we will provide users a sure-shot way of specifying which environment they are meaning to get the data for. What do others think?

Terraform Version

Terraform v0.11.1
+ provider.rancher v1.2.0

Terraform manifest

{
   "data": {
      "rancher_environment": {
         "default": {
            "name": "some name"
         }
      }
   },
   "provider": {
      "rancher": {
         "access_key": "some access key",
         "api_url": "https://my.rancher",
         "secret_key": "some secret key"
      }
   }
}

Output to demonstrate this

❯ terraform show
data.rancher_environment.default:
  id = 1a381
  description =
  member.# = 1
  member.0.external_id = some stuff
  member.0.external_id_type = ldap_user
  member.0.role = owner
  name = buildcl
  orchestration = kubernetes
  project_template_id = 1pt1

# Now go delete one of the duplicately named environments
❯ terraform apply
data.rancher_environment.default: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

❯ terraform show
data.rancher_environment.default:
  id = 1a382
  description =
  member.# = 1
  member.0.external_id = some stuff
  member.0.external_id_type = ldap_user
  member.0.role = owner
  name = buildcl
  orchestration = kubernetes
  project_template_id = 1pt1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants