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!
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.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.