Skip to content

Authorization error #42

@alelapi

Description

@alelapi

Hello all,
We are experiencing a 403 authorization error when using this provider. Our cloud provider is GCP.

We are trying to retrieve information about a CircleCI project using Terraform. When making an HTTP request directly, it works (i.e., without using this provider).

data "http" "circleci_project" {
  url = "https://circleci.com/api/v2/project/bb/org_name/${var.project_name}"

  request_headers = {
    "Circle-Token" = data.google_secret_manager_secret_version.circleci_robot_personal_access_token.secret_data
    "Accept"       = "application/json"
  }
}

When using the provider's data resource, we encounter a 403 Authorization error:

terraform {

  required_version = ">= 1.0"

  required_providers {
    circleci = {
      source = "CircleCI-Public/circleci"
      version = "0.2.0"
    }
  }
}

provider "circleci" {
  key  = data.google_secret_manager_secret_version.circleci_robot_personal_access_token.secret_data
}

data "circleci_project" "self" {
  slug = "bb/org_name/${var.project_name}"
}

This is the error we get:

│ Error: Unable to Read CircleCI project settings
│ 
│   with module.circleci_identity.data.circleci_project.self,
│   on ../main.tf line 7, in data "circleci_project" "self":
│    7: data "circleci_project" "self" {
│ 
│ 403 Forbidden: {"message":"Permission denied."}

Is this a bug or I'm doing something wrong?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions