terraform-provider-cloudflare icon indicating copy to clipboard operation
terraform-provider-cloudflare copied to clipboard

Support for Access Organizations

Open trjstewart opened this issue 3 years ago • 1 comments

Current Terraform and Cloudflare provider version

v3.7.0

Description

I ran into an issue a few weeks ago where I needed to get ahold of our access auth domain within Terraform and quickly found out that it wasn't currently possible. Being able to create and manage Access Organizations using this provider would be handy for managing our Cloudflare environment end-to-end with Terraform. The cloudflare-go library looks like it has support for it already.

I'd like to propose the creation of a new data source and resource, called cloudflare_access_organization.

I'll throw up a work in progress PR shortly. I've already written and have been using the data source internally for the past few weeks but need to add the resource and tests for both, and any nessicarry documentation.

Use cases

Management of Access Organizations using Terraform.

Potential Terraform configuration

data "cloudflare_access_organization" "default" {
  account_id = var.cloudflare_account_id
}

resource "cloudflare_access_organization" "default" {
  account_id  = var.cloudflare_account_id  
  name        = "Widget Corps Internal Applications"
  auth_domain = "widget.cloudflareaccess.com"

  login_design {
    background_color = "#c5ed1b"
    logo_path        = "https://example.com/logo.png"
    header_text      = "Widget Corps"
    footer_text      = "Widget Corps"
  }
}

References

No response

trjstewart avatar Jan 13 '22 11:01 trjstewart

I hit a similar issue when trying to get the account_id which is available using the REST API.

https://gist.github.com/nitrocode/c5be3e043623c26c4048d39a9c4dd9b7

Hope this helps people while we wait for a cloudflare data source to do the above

nitrocode avatar Sep 08 '22 14:09 nitrocode

This functionality has been released in v3.27.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] avatar Nov 02 '22 00:11 github-actions[bot]