this not work(((
file: create.tf #####################
terraform { required_providers { gitlab = { source = “gitlabhq/gitlab” } } } variable “gitlab_token” { type = string default = “SECRET” } variable “base_url” { type = string default = “https://gitlab.com/errooorr/api/v4/” } provider “gitlab” { token = var.gitlab_token base_url = var.base_url ########################
and
file: terraform.tfvars
############
gitlab_token = blablabla
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
From what you have provided there could be a couple of issues.
Incorrect base_url - The base_url you provided looks a bit strange. Usually, for GitLab, it’s https://gitlab.com/api/v4/. You have “errooorr” in the middle of your URL which is incorrect.
Spacing and Indentation - Consistent spacing and indentation are crucial for Terraform to interpret the configuration correctly.
Here’s a cleaner version of your create.tf:
terraform {
required_providers {
gitlab = {
source = "gitlabhq/gitlab"
}
}
}
variable "gitlab_token" {
description = "Token for accessing GitLab API"
type = string
default = "" # Empty default, it's best to provide this via tfvars or environment variables
}
variable "base_url" {
description = "Base URL for GitLab API"
type = string
default = "https://gitlab.com/api/v4/"
}
provider "gitlab" {
token = var.gitlab_token
base_url = var.base_url
}
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
