Giter Club home page Giter Club logo

dwp.terraform-gitlab-project's Introduction

project

This module creates a GitLab project with a default set of permissions.

Terraform module to manage GitLab projects with DWP default settings. This module is published on Terraform Registry and it should be referred to for usage documentation.

Requirements

  • See the versions.tf file for required Terraform and provider versions.
  • GitLab personal access token with the following permissions:
    • api
  • A GitLub group

Usage

module "my_gitlab_project" {
  source = "dwp/project/gitlab"

  group_id = 123
  name     = "my-project"
}

Example

variable "gitlab_token" {
  type        = string
  description = "GitLab personal access token for managing projects"
}

provider "gitlab" {
  token = var.gitlab_token
}

resource "gitlab_group" "my_group" {
  name        = "my-group"
  path        = "my-group"
  description = "An example group"
}

module "my_gitlab_project" {
  source = "dwp/project/gitlab"

  group_id = gitlab_group.example.id
  name     = "my-project"
}

Naming your projects

As per the engineering practice guidance:

Projects must be named in lowercase, using a-z, 0-9, and - symbols only. The name should reflect the contents and must not have any generic or repetitive prefixes or suffixes, or abbreviations, acronyms, or initialisms.

For example, the following would not be an acceptable project name:

module "project" {
  source = "dwp/project/gitlab"

  group_id = 123
  name     = "apply for pension credit citizen UI"
}

Instead, it should be something like this:

module "project" {
  source = "dwp/project/gitlab"

  group_id = 123
  name     = "citizen-frontend"
}

Deleting your project

To avoid accidental destruction, particularly for modifications that require replacement, this module will not destroy the project resource. Unfortunately, Terraform only allows literal values for lifecycle rules, so this cannot be variable or conditional. As a result, the project should be manually deleted from GitLab and Terraform state.

dwp.terraform-gitlab-project's People

Contributors

dan-hill2802 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.