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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cloudflare_access_identity_provider data source #1225

Closed
jeffreymlewis opened this issue Sep 29, 2021 · 0 comments · Fixed by #1300
Closed

Add cloudflare_access_identity_provider data source #1225

jeffreymlewis opened this issue Sep 29, 2021 · 0 comments · Fixed by #1300
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature. triage/accepted Indicates an issue or PR is ready to be actively worked on. workflow/pr-attached Indicates the issue has PR(s) attached.

Comments

@jeffreymlewis
Copy link

Current Terraform and Cloudflare provider version

% terraform -v 
Terraform v0.13.7
+ provider registry.terraform.io/cloudflare/cloudflare v3.1.0
+ provider registry.terraform.io/hashicorp/aws v3.60.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Description

I request adding a data source named cloudflare_access_identity_provider, allowing one to lookup metadata of a previously configured identity provider via the friendly name.

Use cases

Resources like cloudflare_access_application require the unique ID number of an identity provider (the allowed_idps input variable). In situations where the Identity Provider's unique ID number cannot be shared via the terraform remote state, it would be great to lookup this ID number via a data source.

The Cloudflare API supports lookup of this ID as shown here.

https://api.cloudflare.com/#access-identity-providers-list-access-identity-providers

curl -X GET "https://api.cloudflare.com/client/v4/accounts/699d98642c564d2e855e9661899b7252/access/identity_providers" \
    -H "Authorization: Bearer XXXXXXXXXXX" \
    -H "Content-Type: application/json"

Potential Terraform configuration

resource "cloudflare_access_application" "main" {
  zone_id                   = "example.com"
  name                      = "name"
  domain                    = "name.example.com"
  type                      = "self_hosted"
  session_duration          = "24h"
  allowed_idps              = [data.cloudflare_access_identity_provider.main.id]
  auto_redirect_to_identity = true
}

data "cloudflare_access_identity_provider" "main" {
  name = "my-idp"
}

References

No response

@jeffreymlewis jeffreymlewis added kind/enhancement Categorizes issue or PR as related to improving an existing feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 29, 2021
@jacobbednarz jacobbednarz added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 5, 2021
@jacobbednarz jacobbednarz added the workflow/pr-attached Indicates the issue has PR(s) attached. label Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature. triage/accepted Indicates an issue or PR is ready to be actively worked on. workflow/pr-attached Indicates the issue has PR(s) attached.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants