The gitlab_topic
resource allows to manage the lifecycle of topics that are then assignable to projects.
Upstream API: GitLab REST API docs for topics
resource "gitlab_topic" "functional_programming" {
name = "functional-programming"
title = "Functional Programming"
description = "In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions."
avatar = "${path.module}/avatar.png"
avatar_hash = filesha256("${path.module}/avatar.png")
}
name
(String) The topic's name.avatar
(String) A local path to the avatar image to upload. Note: not available for imported resources.avatar_hash
(String) The hash of the avatar image. Use filesha256("path/to/avatar.png")
whenever possible. Note: this is used to trigger an update of the avatar. If it's not given, but an avatar is given, the avatar will be updated each time.description
(String) A text describing the topic.soft_destroy
(Boolean, Deprecated) Empty the topics fields instead of deleting it.title
(String) The topic's description. Requires at least GitLab 15.0 for which it's a required argument.avatar_url
(String) The URL of the avatar image.id
(String) The ID of this resource.Import is supported using the following syntax:
# You can import a topic to terraform state using `terraform import <resource> <id>`.
# The `id` must be an integer for the id of the topic you want to import,
# for example:
terraform import gitlab_topic.functional_programming 1