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

cloudflare_access_application doesn't recognize bookmark type #1358

Closed
2 tasks done
joshdvir opened this issue Dec 24, 2021 · 2 comments · Fixed by #1539
Closed
2 tasks done

cloudflare_access_application doesn't recognize bookmark type #1358

joshdvir opened this issue Dec 24, 2021 · 2 comments · Fixed by #1539
Labels
kind/bug Categorizes issue or PR as related to a bug. service/access Categorizes issue or PR as related to the Access service. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@joshdvir
Copy link

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.1.2
on linux_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.6.0

Affected resource(s)

cloudflare_access_application

Terraform configuration files

terraform {
  required_version = "= 1.1.2"

  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 3.0"
    }
  }
}

provider "cloudflare" {
  # make sure you setup your "CLOUDFLARE_API_TOKEN" in ../../.envrc.private
}

resource "cloudflare_access_application" "bookmark_applications" {
  account_id = "123456"
  name       = "Example"
  domain     = "https://example.com"
  type       = "bookmark"
}

Debug output

TF_LOG=DEBUG tf plan
2021-12-24T09:34:16.352-0500 [INFO]  Terraform version: 1.1.2
2021-12-24T09:34:16.352-0500 [INFO]  Go runtime version: go1.17.2
2021-12-24T09:34:16.352-0500 [INFO]  CLI args: []string{"/home/josh/.tfenv/versions/1.1.2/terraform", "plan"}
2021-12-24T09:34:16.352-0500 [DEBUG] Attempting to open CLI config file: /home/josh/.terraformrc
2021-12-24T09:34:16.352-0500 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory /home/josh/.terraform.d/plugins
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory /home/josh/.local/share/terraform/plugins
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory /usr/share/pop/terraform/plugins
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory /home/josh/.local/share/flatpak/exports/share/terraform/plugins
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021-12-24T09:34:16.352-0500 [DEBUG] ignoring non-existing provider search directory /var/lib/snapd/desktop/terraform/plugins
2021-12-24T09:34:16.353-0500 [INFO]  CLI command args: []string{"plan"}
2021-12-24T09:34:16.354-0500 [DEBUG] New state was assigned lineage "c0da4c01-e82e-32ec-1537-49721d0a580b"
2021-12-24T09:34:16.406-0500 [DEBUG] checking for provisioner in "."
2021-12-24T09:34:16.406-0500 [DEBUG] checking for provisioner in "/home/josh/.tfenv/versions/1.1.2"
2021-12-24T09:34:16.407-0500 [INFO]  backend/local: starting Plan operation
2021-12-24T09:34:16.407-0500 [DEBUG] created provider logger: level=debug
2021-12-24T09:34:16.407-0500 [INFO]  provider: configuring client automatic mTLS
2021-12-24T09:34:16.417-0500 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0]
2021-12-24T09:34:16.417-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0 pid=1404123
2021-12-24T09:34:16.417-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0
2021-12-24T09:34:16.423-0500 [INFO]  provider.terraform-provider-cloudflare_v3.6.0: configuring server automatic mTLS: timestamp=2021-12-24T09:34:16.422-0500
2021-12-24T09:34:16.432-0500 [DEBUG] provider: using plugin: version=5
2021-12-24T09:34:16.432-0500 [DEBUG] provider.terraform-provider-cloudflare_v3.6.0: plugin address: address=/tmp/plugin871673585 network=unix timestamp=2021-12-24T09:34:16.432-0500
2021-12-24T09:34:16.457-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-12-24T09:34:16.458-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0 pid=1404123
2021-12-24T09:34:16.458-0500 [DEBUG] provider: plugin exited
2021-12-24T09:34:16.458-0500 [DEBUG] Building and walking validate graph
2021-12-24T09:34:16.458-0500 [DEBUG] ProviderTransformer: "cloudflare_access_application.bookmark_applications" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2021-12-24T09:34:16.458-0500 [DEBUG] ReferenceTransformer: "cloudflare_access_application.bookmark_applications" references: []
2021-12-24T09:34:16.458-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" references: []
2021-12-24T09:34:16.459-0500 [DEBUG] Starting graph walk: walkValidate
2021-12-24T09:34:16.459-0500 [DEBUG] created provider logger: level=debug
2021-12-24T09:34:16.459-0500 [INFO]  provider: configuring client automatic mTLS
2021-12-24T09:34:16.469-0500 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0]
2021-12-24T09:34:16.470-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0 pid=1404133
2021-12-24T09:34:16.470-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0
2021-12-24T09:34:16.477-0500 [INFO]  provider.terraform-provider-cloudflare_v3.6.0: configuring server automatic mTLS: timestamp=2021-12-24T09:34:16.477-0500
2021-12-24T09:34:16.488-0500 [DEBUG] provider.terraform-provider-cloudflare_v3.6.0: plugin address: network=unix address=/tmp/plugin2766715512 timestamp=2021-12-24T09:34:16.488-0500
2021-12-24T09:34:16.488-0500 [DEBUG] provider: using plugin: version=5
2021-12-24T09:34:16.513-0500 [ERROR] vertex "cloudflare_access_application.bookmark_applications" error: expected type to be one of [self_hosted ssh vnc file], got bookmark
╷
│ Error: expected type to be one of [self_hosted ssh vnc file], got bookmark
│ 
│   with cloudflare_access_application.bookmark_applications,
│   on main.tf line 20, in resource "cloudflare_access_application" "bookmark_applications":
│   20:   type       = "bookmark"
│ 
╵
2021-12-24T09:34:16.515-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-12-24T09:34:16.516-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.6.0/linux_amd64/terraform-provider-cloudflare_v3.6.0 pid=1404133
2021-12-24T09:34:16.516-0500 [DEBUG] provider: plugin exited

Panic output

No response

Expected output

a bookmark application created

Actual output

Get the following error

Error: expected type to be one of [self_hosted ssh vnc file], got bookmark
│ 
│   with cloudflare_access_application.bookmark_applications,
│   on main.tf line 20, in resource "cloudflare_access_application" "bookmark_applications":
│   20:   type       = "bookmark"

Steps to reproduce

  1. add code
  2. terraform plan/apply
  3. get error

Additional factoids

No response

References

#1343

@joshdvir joshdvir added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 24, 2021
@jacobbednarz
Copy link
Member

cc @AkemiDavisson

@jacobbednarz jacobbednarz added service/access Categorizes issue or PR as related to the Access service. 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 Dec 24, 2021
@ouranos
Copy link
Contributor

ouranos commented Dec 29, 2021

@jacobbednarz I tried to add the app type to provider in this draft PR: #1363

But when testing, I find out that it doesn't work as the Bookmark apps need a different endpoint:

"bookmark application must be updated at the /access/bookmark path"

So the SDK change is more involved than just adding the bookmark type.
In addition, this doesn't seem to be documented in the API documentation.

Happy to look further into it, but I think it's going to be the same as SaaS applications that are not officially supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. service/access Categorizes issue or PR as related to the Access service. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
3 participants