Hi, I am trying to do a terraform apply inside of a gitlab pipelines but I get an error related to the auth token.
error:
Error: Required token could not be found
When doing terrafom init I would have expected it to init terraform, instead I get the token error.
I am using regular gitlab pipeline.
Inside of repo I have a terraform folder that contains configuration for a fargate task definition, I want to use sed to update the container image name then apply terraform in this new config.
ci-config looks like:
Apply dev:
image:
name: registry.gitlab.com/gitlab-org/terraform-images/stable:latest
stage: apply
only:
- dev
script:
- cd ${TF_ROOT}
- gitlab-terraform init
- gitlab-terraform validate
- gitlab-terraform plan
- gitlab-terraform plan-json
I had a look at lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml · master · GitLab.org / GitLab · GitLab
terraform backend is like:
terraform {
backend "remote" {
organization = "spockee"
workspaces {
name = "Prestashop"
}
}
}
Any help would be appraciated, or maybe there is something I am not doing right?
Thanks in advance, have a good day!