pingidentity / terraform-provider-pingone

Terraform PingOne provider
https://registry.terraform.io/providers/pingidentity/pingone/
Mozilla Public License 2.0
13 stars 6 forks source link

Remove the requirement for the `organization_id` on the `pingone_license` and `pingone_licenses` datasources. Should be defaulted from the client connection. #240

Open patrickcping opened 1 year ago

patrickcping commented 1 year ago

Community Note

Description

The organization_id schema field is a required field of the pingone_license and pingone_licenses datasources, but is very unlikely (if ever) going to be different to the organization ID that the client connection will use in the provider {} block.

The enhancement is to make organization_id an optional field (defaulted to the organization ID that the client can provide) to reduce some friction of obtaining data about a license (or set of licenses)

New or Affected Resource(s)

Potential Terraform Configuration

# Copy-paste your PingOne related Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

# Remember to replace any account/customer sensitive information in the configuration before submitting the issue

### pingone_license - Current
data "pingone_license" "my_license" {
  organization_id = var.organization_id
  license_id      = var.license_id
}

### pingone_license - Desired
data "pingone_license" "my_license" {
  license_id      = var.license_id
}

### pingone_licenses - Current
data "pingone_licenses" "my_licenses_by_data_filter" {
  organization_id = var.organization_id

  data_filter {
    name   = "name"
    values = ["My License"]
  }

  data_filter {
    name   = "status"
    values = ["ACTIVE"]
  }
}

### pingone_licenses - Desired
data "pingone_licenses" "my_licenses_by_data_filter" {
  data_filter {
    name   = "name"
    values = ["My License"]
  }

  data_filter {
    name   = "status"
    values = ["ACTIVE"]
  }
}

References

dbryar commented 1 year ago

If the licence auto selection is smart enough it should be able to choose the "main" license from the pool. In any given organisation there is going to be active and inactive licenses, as well as an admin licence (e.g. max 50 users) and a "production" or "main" license with many thousand or millions of users.

The organisation is, as you say, unlikely to ever change and should be defaulted