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

Support for SaaS Access Application #1226

Closed
ouranos opened this issue Sep 30, 2021 · 5 comments · Fixed by #1762
Closed

Support for SaaS Access Application #1226

ouranos opened this issue Sep 30, 2021 · 5 comments · Fixed by #1762
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature. workflow/pending-upstream-library Indicates an issue or PR requires changes from an upstream library.
Milestone

Comments

@ouranos
Copy link
Contributor

ouranos commented Sep 30, 2021

Current Terraform and Cloudflare provider version

Terraform v1.0.7
on darwin_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.1.0

Description

We'd like to manage our SaaS application through Terraform.

However, the cloudflare_access_application resource currently doesn't support the saas type.
The API seems to support it.

I tried to patch the provider to accept this type but it's more complicated as we need to be able to configure the saas_app block and the domain required field would be the value returned after creating the app (eg: <organization>.cloudflareaccess.com/cdn-cgi/access/sso/saml/<uid>).
This doesn't seem to be documented in the API so I'm not sure if it's actually supported.

Use cases

Support for SaaS applications.

Potential Terraform configuration

resource "cloudflare_access_application" "saas_app" {
  account_id = var.cloudflare_account_id
  name       = "My Great Saas App"
  type       = "saas"
  domain     = "???"

  saas_app {
      consumer_service_url = "https://saas-app.example/sso/saml/consume",
      sp_entity_id  = "saas-app.example"
      name_id_format =  "email"
  }

  ...
}  

References

No response

@ouranos ouranos 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 30, 2021
@ouranos
Copy link
Contributor Author

ouranos commented Oct 1, 2021

I did some more testing today and this JSON payload correctly created a SaaS application:

{
    "name": "Test SaaS",
    "type": "saas",
    "allowed_idps": [
        "..."
    ],
    "saas_app": {
        "sp_entity_id": "test",
        "consumer_service_url": "https://test.example.org/sso/saml",
        "name_id_format": "email"
    },
    "auto_redirect_to_identity": true,
    "session_duration": "24h"
}

The domain field is not required for a SaaS application.

Not sure if it's not officially supported or if the documentation is lagging behind.

@ouranos
Copy link
Contributor Author

ouranos commented Oct 1, 2021

I've tried to patch the provider but the SDK doesn't seem to support it either.

@jacobbednarz
Copy link
Member

Please see my comments on your cloudflare-go PR. This isn't yet publicly supported so this will be pending that release and won't be merged here before that.

@jacobbednarz jacobbednarz added workflow/pending-upstream-library Indicates an issue or PR requires changes from an upstream library. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 1, 2021
@ouranos
Copy link
Contributor Author

ouranos commented Jul 8, 2022

This has now been added in v0.41.0 of the SDK with cloudflare/cloudflare-go#900

I'll rebase my local branch and make it work with the new SDK and submit it for review after testing it in our environment.

@github-actions
Copy link
Contributor

This functionality has been released in v3.20.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!

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. workflow/pending-upstream-library Indicates an issue or PR requires changes from an upstream library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants