[{"data":1,"prerenderedAt":3239},["ShallowReactive",2],{"/blog/gitops-with-gitlab-infrastructure-provisioning":3,"navigation-en-us":2453,"banner-en-us":2880,"footer-en-us":2890,"blog-post-authors-en-us-Viktor Nagy":3134,"blog-related-posts-en-us-gitops-with-gitlab-infrastructure-provisioning":3149,"blog-promotions-en-us":3175,"next-steps-en-us":3229},{"id":4,"title":5,"authors":6,"body":8,"category":2432,"date":2433,"description":2434,"extension":2435,"externalUrl":2436,"faq":2436,"featured":2437,"heroImage":2438,"meta":2439,"navigation":212,"path":2440,"seo":2441,"slug":2445,"stem":2446,"tags":2447,"template":2451,"updatedDate":2436,"__hash__":2452},"blogPosts/en-us/blog/gitops-with-gitlab-infrastructure-provisioning.md","GitOps with GitLab: Infrastructure provisioning with GitLab and Terraform",[7],"Viktor Nagy",{"type":9,"value":10,"toc":2420},"minimark",[11,24,27,47,55,60,70,79,82,86,95,106,287,306,312,319,358,361,368,394,412,419,458,461,464,468,471,476,485,493,500,509,547,568,574,779,796,806,873,880,890,905,924,928,931,950,953,956,968,982,986,989,992,999,1360,1369,1426,1429,1433,1436,1444,1682,1692,1699,1836,1845,1919,1926,1948,1955,1987,1991,1994,1999,2007,2035,2038,2063,2067,2074,2399,2405,2408,2416],[12,13,14],"p",{},[15,16,17,18,23],"em",{},"It is possible to use GitLab as a best-in-class GitOps tool, and this blog post series is going to show you how. These easy-to-follow tutorials will focus on different user problems, including provisioning, managing a base infrastructure, and deploying various third-party or custom applications on top of them. You can find the entire \"Ultimate guide to GitOps with GitLab\" tutorial series ",[19,20,22],"a",{"href":21},"/blog/the-ultimate-guide-to-gitops-with-gitlab/","here",".",[12,25,26],{},"This post focuses on setting up the underlying infrastructure using GitLab and Terraform.",[12,28,29,30,35,36,41,42,23],{},"The first step is to have a network and some computing instances that we can use as our Kubernetes cluster. In this project, I’ll use ",[19,31,34],{"href":32,"rel":33},"https://www.civo.com",[],"Civo"," to host the infrastructure as it has the most minimal setup, but the same can be achieved using any of the hyperclouds. GitLab documentation provides examples on how to set up a ",[19,37,40],{"href":38,"rel":39},"https://docs.gitlab.com/user/infrastructure/clusters/connect/new_eks_cluster/",[],"cluster on AWS"," or ",[19,43,46],{"href":44,"rel":45},"https://docs.gitlab.com/user/infrastructure/clusters/connect/new_gke_cluster/",[],"GCP",[12,48,49,50,54],{},"We want to have a project that describes our ",[19,51,53],{"href":52},"/topics/gitops/infrastructure-as-code/","infrastructure as code (IaC)",". As Terraform is today the de facto standard in infrastructure provisioning, we’ll use Terraform for the task. Terraform requires a state storage backend; We will use the GitLab managed Terraform state that is very easy to get started. Moreover, we will set up a pipeline to run the infrastructure changes automatically if they are merged to the main branch.",[56,57,59],"h2",{"id":58},"what-infrastructure-related-steps-are-we-going-to-codify","What infrastructure related steps are we going to codify?",[61,62,63,67],"ol",{},[64,65,66],"li",{},"Create a VPC",[64,68,69],{},"Set up a Kubernetes cluster",[12,71,72,73,78],{},"Actually, we will create separate Terraform projects for these 3 steps under a single GitLab project. We split the infrastructure because in a real world scenario, these projects will likely be a bit bigger, and Terraform slows down quite a lot if it has to deal with big projects. In general, it is a good practice to have small Terraform projects, and think about the infrastructure in a layered way, where higher layers can reference the output of lower layers. There are ",[19,74,77],{"href":75,"rel":76},"https://www.terraform.io/docs/language/state/remote-state-data.html#alternative-ways-to-share-data-between-configurations",[],"many ways to access the output of another Terraform project",", and we leave it up to the reader to learn more about these. In this case, we will use simple data resources.",[12,80,81],{},"After this long intro, let’s get started!",[56,83,85],{"id":84},"creating-the-network","Creating the network",[12,87,88,89,94],{},"First, let’s create a new GitLab project. You can use either an empty project or any of the project templates. If you plan to do all these tutorials, I recommend starting with the ",[19,90,93],{"href":91,"rel":92},"https://docs.gitlab.com/user/clusters/management_project_template/",[],"Cluster Management Project template",". Once the project is ready, let’s create the following files:",[96,97,98],"ul",{},[64,99,100,101,105],{},"A ",[102,103,104],"code",{},"terraform/network/main.tf"," file:",[107,108,113],"pre",{"className":109,"code":110,"language":111,"meta":112,"style":112},"language-hcl shiki shiki-themes github-light","terraform {\n  required_providers {\n    civo = {\n      source = \"civo/civo\"\n      version = \"0.10.10”\n    }\n  }\n  backend \"http\" {\n  }\n}\n\n# Configure the Civo Provider\nprovider \"civo\" {\n  token = var.civo_token\n  region = local.region\n}\n\nresource \"civo_network\" \"network\" {\n    label = \"development\"\n}\n","hcl","",[102,114,115,128,136,148,161,172,178,184,196,201,207,214,220,231,237,243,248,253,270,282],{"__ignoreMap":112},[116,117,120,124],"span",{"class":118,"line":119},"line",1,[116,121,123],{"class":122},"s7eDp","terraform",[116,125,127],{"class":126},"sgsFI"," {\n",[116,129,131,134],{"class":118,"line":130},2,[116,132,133],{"class":122},"  required_providers",[116,135,127],{"class":126},[116,137,139,142,146],{"class":118,"line":138},3,[116,140,141],{"class":126},"    civo",[116,143,145],{"class":144},"sD7c4"," =",[116,147,127],{"class":126},[116,149,151,154,157],{"class":118,"line":150},4,[116,152,153],{"class":126},"      source ",[116,155,156],{"class":144},"=",[116,158,160],{"class":159},"sYBdl"," \"civo/civo\"\n",[116,162,164,167,169],{"class":118,"line":163},5,[116,165,166],{"class":126},"      version ",[116,168,156],{"class":144},[116,170,171],{"class":159}," \"0.10.10”\n",[116,173,175],{"class":118,"line":174},6,[116,176,177],{"class":159},"    }\n",[116,179,181],{"class":118,"line":180},7,[116,182,183],{"class":159},"  }\n",[116,185,187,190,193],{"class":118,"line":186},8,[116,188,189],{"class":159},"  backend \"",[116,191,192],{"class":126},"http",[116,194,195],{"class":159},"\" {\n",[116,197,199],{"class":118,"line":198},9,[116,200,183],{"class":159},[116,202,204],{"class":118,"line":203},10,[116,205,206],{"class":159},"}\n",[116,208,210],{"class":118,"line":209},11,[116,211,213],{"emptyLinePlaceholder":212},true,"\n",[116,215,217],{"class":118,"line":216},12,[116,218,219],{"class":159},"# Configure the Civo Provider\n",[116,221,223,226,229],{"class":118,"line":222},13,[116,224,225],{"class":159},"provider \"",[116,227,228],{"class":126},"civo",[116,230,195],{"class":159},[116,232,234],{"class":118,"line":233},14,[116,235,236],{"class":159},"  token = var.civo_token\n",[116,238,240],{"class":118,"line":239},15,[116,241,242],{"class":159},"  region = local.region\n",[116,244,246],{"class":118,"line":245},16,[116,247,206],{"class":159},[116,249,251],{"class":118,"line":250},17,[116,252,213],{"emptyLinePlaceholder":212},[116,254,256,259,262,265,268],{"class":118,"line":255},18,[116,257,258],{"class":159},"resource \"",[116,260,261],{"class":126},"civo_network",[116,263,264],{"class":159},"\" \"",[116,266,267],{"class":126},"network",[116,269,195],{"class":159},[116,271,273,276,279],{"class":118,"line":272},19,[116,274,275],{"class":159},"    label = \"",[116,277,278],{"class":126},"development",[116,280,281],{"class":159},"\"\n",[116,283,285],{"class":118,"line":284},20,[116,286,206],{"class":159},[12,288,289,290,293,294,296,297,302,303,305],{},"This file describes almost everything we want this project to do. The first block configures Terraform to use the ",[102,291,292],{},"civo/civo"," provider and a simple ",[102,295,192],{}," backend for state storage. As I mentioned above, we will use ",[19,298,301],{"href":299,"rel":300},"https://docs.gitlab.com/user/infrastructure/iac/terraform_state/",[],"the GitLab managed Terraform state",", that acts like an ",[102,304,192],{}," backend from Terraform’s point of view. The GitLab backend is versioned and encrypted by default, and GitLab CI/CD contains all the environment variables needed to access it. I will demonstrate later how you can access the backend either from the local command line or from GitLab CI/CD.",[12,307,308,309,311],{},"Next we configure the ",[102,310,34],{}," provider. You can see that here we use two variables, an input and a local variable. These will be defined in separate files below. Finally, we describe a network and give it the “development” label.",[96,313,314],{},[64,315,100,316,105],{},[102,317,318],{},"terraform/network/outputs.tf",[107,320,322],{"className":109,"code":321,"language":111,"meta":112,"style":112},"output \"network\" {\n  value = civo_network.network.id\n}\n",[102,323,324,335,354],{"__ignoreMap":112},[116,325,326,329,333],{"class":118,"line":119},[116,327,328],{"class":122},"output",[116,330,332],{"class":331},"sYu0t"," \"network\"",[116,334,127],{"class":126},[116,336,337,340,342,345,347,349,351],{"class":118,"line":130},[116,338,339],{"class":126},"  value",[116,341,145],{"class":144},[116,343,344],{"class":126}," civo_network",[116,346,23],{"class":144},[116,348,267],{"class":126},[116,350,23],{"class":144},[116,352,353],{"class":126},"id\n",[116,355,356],{"class":118,"line":138},[116,357,206],{"class":126},[12,359,360],{},"This file just provides the network id as an output variable from Terraform. Other projects could consume it. We won’t use this, but I consider it a good practice as it might help to debug issues.",[96,362,363],{},[64,364,100,365,105],{},[102,366,367],{},"terraform/network/locals.tf",[107,369,371],{"className":109,"code":370,"language":111,"meta":112,"style":112},"locals {\n  region = \"LON1\"\n}\n",[102,372,373,380,390],{"__ignoreMap":112},[116,374,375,378],{"class":118,"line":119},[116,376,377],{"class":122},"locals",[116,379,127],{"class":126},[116,381,382,385,387],{"class":118,"line":130},[116,383,384],{"class":126},"  region",[116,386,145],{"class":144},[116,388,389],{"class":159}," \"LON1\"\n",[116,391,392],{"class":118,"line":138},[116,393,206],{"class":126},[12,395,396,397,400,401,404,405,408,409,411],{},"Here we define the ",[102,398,399],{},"region"," local as mentioned under the description of the ",[102,402,403],{},"main.tf"," file. Why aren’t we making it an input variable? Because this is closely related to our infrastructure and for this reason we want to keep it in code. It should be version controlled and changes should be reviewed following the team’s processes. We could write the values into a ",[102,406,407],{},".tfvars"," file also to achieve versioning and have it as a variable. I prefer to keep it in ",[102,410,111],{}," to have it closer to the rest of the code.",[96,413,414],{},[64,415,100,416,105],{},[102,417,418],{},"terraform/network/variables.tf",[107,420,422],{"className":109,"code":421,"language":111,"meta":112,"style":112},"variable \"civo_token\" {\n  type = string\n  sensitive = true\n}\n",[102,423,424,434,444,454],{"__ignoreMap":112},[116,425,426,429,432],{"class":118,"line":119},[116,427,428],{"class":122},"variable",[116,430,431],{"class":331}," \"civo_token\"",[116,433,127],{"class":126},[116,435,436,439,441],{"class":118,"line":130},[116,437,438],{"class":126},"  type",[116,440,145],{"class":144},[116,442,443],{"class":144}," string\n",[116,445,446,449,451],{"class":118,"line":138},[116,447,448],{"class":126},"  sensitive",[116,450,145],{"class":144},[116,452,453],{"class":331}," true\n",[116,455,456],{"class":118,"line":150},[116,457,206],{"class":126},[12,459,460],{},"Finally, we define the Civo access token as an input variable.",[12,462,463],{},"Now, we are ready with the Terraform code, but we cannot access the GitLab state backend yet. For that we either need to configure our local environment or GitLab CI/CD. Let’s see both setups.",[56,465,467],{"id":466},"running-terraform-locally","Running Terraform locally",[12,469,470],{},"You can run Terraform either locally or using GitLab CI/CD. The following two sections present both approaches.",[472,473,475],"h3",{"id":474},"accessing-the-gitlab-terraform-state-backend-locally","Accessing the GitLab Terraform state backend locally",[12,477,478,479,484],{},"The simplest way to configure the “http” backend is using environment variables. There are many environment variables needed though! For this reason, I prefer to use a collection of ",[19,480,483],{"href":481,"rel":482},"https://direnv.net/",[],"direnv"," files. We will need all these environment variables configured:",[107,486,491],{"className":487,"code":489,"language":490,"meta":112},[488],"language-text","TF_HTTP_PASSWORD\nTF_HTTP_USERNAME\nTF_HTTP_ADDRESS\nTF_HTTP_LOCK_ADDRESS\nTF_HTTP_LOCK_METHOD\nTF_HTTP_UNLOCK_ADDRESS\nTF_HTTP_UNLOCK_METHOD\nTF_HTTP_RETRY_WAIT_MIN\n","text",[102,492,489],{"__ignoreMap":112},[12,494,495,496,499],{},"Direnv enables us to add a few files to our repository to describe the above environment variables in a nice and scalable way. Clearly, there are some variables that are sensitive, like ",[102,497,498],{},"TF_HTTP_PASSWORD",", so this should not be stored in git. Moreover, we could reuse most of these variables in the other two Terraform projects we are going to create. With these considerations in mind, let’s create the following 3 files:",[96,501,502],{},[64,503,504,505,508],{},"Create ",[102,506,507],{},"terraform/network/.envrc",":",[107,510,514],{"className":511,"code":512,"language":513,"meta":112,"style":112},"language-shell shiki shiki-themes github-light","export TF_STATE_NAME=civo-${PWD##*terraform/}\nsource_env ../../.main.env\n","shell",[102,515,516,539],{"__ignoreMap":112},[116,517,518,521,524,526,529,532,534,537],{"class":118,"line":119},[116,519,520],{"class":144},"export",[116,522,523],{"class":126}," TF_STATE_NAME",[116,525,156],{"class":144},[116,527,528],{"class":126},"civo-${PWD",[116,530,531],{"class":144},"##*",[116,533,123],{"class":126},[116,535,536],{"class":144},"/",[116,538,206],{"class":126},[116,540,541,544],{"class":118,"line":130},[116,542,543],{"class":122},"source_env",[116,545,546],{"class":159}," ../../.main.env\n",[12,548,549,550,553,554,557,558,561,562,564,565,567],{},"This sets the ",[102,551,552],{},"TF_STATE_NAME"," variable to ",[102,555,556],{},"civo-network"," using some bash magic and loads the ",[102,559,560],{},".main.env"," file from the root of the repository using the ",[102,563,543],{}," method provided by ",[102,566,483],{},". This can be added to version control safely.",[96,569,570],{},[64,571,504,572,508],{},[102,573,560],{},[107,575,577],{"className":511,"code":576,"language":513,"meta":112,"style":112},"source_env_if_exists ./.local.env\n\nCI_PROJECT_ID=28431043\nexport TF_HTTP_PASSWORD=\"${CI_JOB_TOKEN:-$GITLAB_ACCESS_TOKEN}\"\nexport TF_HTTP_USERNAME=\"${GITLAB_USER_LOGIN}\"\nexport GITLAB_URL=https://gitlab.com\n\nexport TF_VAR_remote_address_base=\"${GITLAB_URL}/api/v4/projects/${CI_PROJECT_ID}/terraform/state\"\nexport TF_HTTP_ADDRESS=\"${TF_VAR_remote_address_base}/${TF_STATE_NAME}\"\nexport TF_HTTP_LOCK_ADDRESS=\"${TF_HTTP_ADDRESS}/lock\"\nexport TF_HTTP_LOCK_METHOD=\"POST\"\nexport TF_HTTP_UNLOCK_ADDRESS=\"${TF_HTTP_LOCK_ADDRESS}\"\nexport TF_HTTP_UNLOCK_METHOD=\"DELETE\"\nexport TF_HTTP_RETRY_WAIT_MIN=5\n\n# export TF_LOG=\"TRACE\"\n",[102,578,579,587,591,601,625,641,653,657,679,700,717,729,745,757,769,773],{"__ignoreMap":112},[116,580,581,584],{"class":118,"line":119},[116,582,583],{"class":122},"source_env_if_exists",[116,585,586],{"class":159}," ./.local.env\n",[116,588,589],{"class":118,"line":130},[116,590,213],{"emptyLinePlaceholder":212},[116,592,593,596,598],{"class":118,"line":138},[116,594,595],{"class":126},"CI_PROJECT_ID",[116,597,156],{"class":144},[116,599,600],{"class":159},"28431043\n",[116,602,603,605,608,610,613,616,619,622],{"class":118,"line":150},[116,604,520],{"class":144},[116,606,607],{"class":126}," TF_HTTP_PASSWORD",[116,609,156],{"class":144},[116,611,612],{"class":159},"\"${",[116,614,615],{"class":126},"CI_JOB_TOKEN",[116,617,618],{"class":144},":-",[116,620,621],{"class":126},"$GITLAB_ACCESS_TOKEN",[116,623,624],{"class":159},"}\"\n",[116,626,627,629,632,634,636,639],{"class":118,"line":163},[116,628,520],{"class":144},[116,630,631],{"class":126}," TF_HTTP_USERNAME",[116,633,156],{"class":144},[116,635,612],{"class":159},[116,637,638],{"class":126},"GITLAB_USER_LOGIN",[116,640,624],{"class":159},[116,642,643,645,648,650],{"class":118,"line":174},[116,644,520],{"class":144},[116,646,647],{"class":126}," GITLAB_URL",[116,649,156],{"class":144},[116,651,652],{"class":126},"https://gitlab.com\n",[116,654,655],{"class":118,"line":180},[116,656,213],{"emptyLinePlaceholder":212},[116,658,659,661,664,666,668,671,674,676],{"class":118,"line":186},[116,660,520],{"class":144},[116,662,663],{"class":126}," TF_VAR_remote_address_base",[116,665,156],{"class":144},[116,667,612],{"class":159},[116,669,670],{"class":126},"GITLAB_URL",[116,672,673],{"class":159},"}/api/v4/projects/${",[116,675,595],{"class":126},[116,677,678],{"class":159},"}/terraform/state\"\n",[116,680,681,683,686,688,690,693,696,698],{"class":118,"line":198},[116,682,520],{"class":144},[116,684,685],{"class":126}," TF_HTTP_ADDRESS",[116,687,156],{"class":144},[116,689,612],{"class":159},[116,691,692],{"class":126},"TF_VAR_remote_address_base",[116,694,695],{"class":159},"}/${",[116,697,552],{"class":126},[116,699,624],{"class":159},[116,701,702,704,707,709,711,714],{"class":118,"line":203},[116,703,520],{"class":144},[116,705,706],{"class":126}," TF_HTTP_LOCK_ADDRESS",[116,708,156],{"class":144},[116,710,612],{"class":159},[116,712,713],{"class":126},"TF_HTTP_ADDRESS",[116,715,716],{"class":159},"}/lock\"\n",[116,718,719,721,724,726],{"class":118,"line":209},[116,720,520],{"class":144},[116,722,723],{"class":126}," TF_HTTP_LOCK_METHOD",[116,725,156],{"class":144},[116,727,728],{"class":159},"\"POST\"\n",[116,730,731,733,736,738,740,743],{"class":118,"line":216},[116,732,520],{"class":144},[116,734,735],{"class":126}," TF_HTTP_UNLOCK_ADDRESS",[116,737,156],{"class":144},[116,739,612],{"class":159},[116,741,742],{"class":126},"TF_HTTP_LOCK_ADDRESS",[116,744,624],{"class":159},[116,746,747,749,752,754],{"class":118,"line":222},[116,748,520],{"class":144},[116,750,751],{"class":126}," TF_HTTP_UNLOCK_METHOD",[116,753,156],{"class":144},[116,755,756],{"class":159},"\"DELETE\"\n",[116,758,759,761,764,766],{"class":118,"line":233},[116,760,520],{"class":144},[116,762,763],{"class":126}," TF_HTTP_RETRY_WAIT_MIN",[116,765,156],{"class":144},[116,767,768],{"class":331},"5\n",[116,770,771],{"class":118,"line":239},[116,772,213],{"emptyLinePlaceholder":212},[116,774,775],{"class":118,"line":245},[116,776,778],{"class":777},"sAwPA","# export TF_LOG=\"TRACE\"\n",[12,780,781,782,785,786,788,789,792,793,795],{},"This file contains the bulk of the environment variables we need, and can be added to version control safely as no secrets are stored there. The first line loads the ",[102,783,784],{},".local.env"," file that will contain the sensitive values, again using a ",[102,787,483],{}," method. The second line contains the GitLab project ID. This is shown under the project name of your GitLab project. The next three lines configure access to GitLab. The username and password will be populated from the ",[102,790,791],{},"local.env"," file, while the ",[102,794,670],{}," variable is there to help you if you are on a self-managed GitLab instance.",[96,797,798],{},[64,799,504,800,802,803,508],{},[102,801,784],{}," and add it to ",[102,804,805],{},".gitignore",[107,807,809],{"className":511,"code":808,"language":513,"meta":112,"style":112},"GITLAB_ACCESS_TOKEN=\u003Cyour GitLab personal access token>\nGITLAB_USER_LOGIN=\u003Cyour GitLAb username>\nexport TF_VAR_civo_token=\u003Cyour Civo access token>\n",[102,810,811,840,859],{"__ignoreMap":112},[116,812,813,816,819,822,825,828,831,834,837],{"class":118,"line":119},[116,814,815],{"class":126},"GITLAB_ACCESS_TOKEN",[116,817,818],{"class":144},"=\u003C",[116,820,821],{"class":159},"your",[116,823,824],{"class":122}," GitLab",[116,826,827],{"class":159}," personal",[116,829,830],{"class":159}," access",[116,832,833],{"class":159}," toke",[116,835,836],{"class":126},"n",[116,838,839],{"class":144},">\n",[116,841,842,844,846,848,851,854,857],{"class":118,"line":130},[116,843,638],{"class":126},[116,845,818],{"class":144},[116,847,821],{"class":159},[116,849,850],{"class":122}," GitLAb",[116,852,853],{"class":159}," usernam",[116,855,856],{"class":126},"e",[116,858,839],{"class":144},[116,860,861,863,866,868,871],{"class":118,"line":138},[116,862,520],{"class":144},[116,864,865],{"class":126}," TF_VAR_civo_token",[116,867,818],{"class":144},[116,869,870],{"class":126},"your Civo access token",[116,872,839],{"class":144},[12,874,875,876,879],{},"Clearly, I cannot provide the values for this file. Please fill them out with your credentials. You can generate a GitLab personal access token under your settings. To access the GitLab managed Terraform state using a personal access token, the token should have the ",[102,877,878],{},"api"," scope enabled.",[12,881,882,883,889],{},"Warning: ",[884,885,886,887],"strong",{},"Don’t forget to add this file to ",[102,888,805],{},". Actually, I have it in my global gitignore file to avoid accidental commits.",[12,891,892,893,896,897,900,901,904],{},"As the environment variables are set up, you should make direnv to start using these variables. When you ",[102,894,895],{},"cd"," into the ",[102,898,899],{},"terraform/network"," directory a warning should appear asking you to run ",[102,902,903],{},"direnv allow",". Enable the environment variables:",[107,906,908],{"className":511,"code":907,"language":513,"meta":112,"style":112},"cd terraform/network\ndirenv allow\n",[102,909,910,917],{"__ignoreMap":112},[116,911,912,914],{"class":118,"line":119},[116,913,895],{"class":331},[116,915,916],{"class":159}," terraform/network\n",[116,918,919,921],{"class":118,"line":130},[116,920,483],{"class":122},[116,922,923],{"class":159}," allow\n",[472,925,927],{"id":926},"creating-the-network-finally","Creating the network - finally",[12,929,930],{},"Let’s see if we managed to set up everything right!",[107,932,934],{"className":511,"code":933,"language":513,"meta":112,"style":112},"terraform init\nterraform plan\n",[102,935,936,943],{"__ignoreMap":112},[116,937,938,940],{"class":118,"line":119},[116,939,123],{"class":122},[116,941,942],{"class":159}," init\n",[116,944,945,947],{"class":118,"line":130},[116,946,123],{"class":122},[116,948,949],{"class":159}," plan\n",[12,951,952],{},"The first command just initializes Terraform, downloads the Civo plugin and does some sanity checks. The second command on the other hand connects to the remote state backend, and computes the necessary changes to provide the infrastructure we described in this project.",[12,954,955],{},"If we like the changes, we can apply them with",[107,957,959],{"className":511,"code":958,"language":513,"meta":112,"style":112},"terraform apply\n",[102,960,961],{"__ignoreMap":112},[116,962,963,965],{"class":118,"line":119},[116,964,123],{"class":122},[116,966,967],{"class":159}," apply\n",[12,969,970,973,974,977,978,981],{},[15,971,972],{},"Nota bene",", in a real world setup, you would likely output a plan file from ",[102,975,976],{},"terraform plan"," and feed it into ",[102,979,980],{},"terraform apply",", just like the CI/CD setup will do it later. Anyway, this is good enough for us, so let’s create the cluster next.",[472,983,985],{"id":984},"running-terraform-using-gitlab-cicd","Running Terraform using GitLab CI/CD",[12,987,988],{},"Note: This section assumes that you have access to GitLab Runners to run the CI/CD jobs.",[12,990,991],{},"Given the flexibility of GitLab CI/CD it can be set up in many different ways. Here we will build a pipeline that incorporates the most important aspects of a Terraform-oriented pipeline, without restricting you to require merge requests or any other processes. The only restriction we'll place on it is that changes should only be applied on the main branch and this should be a manual action.",[12,993,994,995,998],{},"Copy the following code into ",[102,996,997],{},".gitlab-ci.yml"," in the root of your project:",[107,1000,1004],{"className":1001,"code":1002,"language":1003,"meta":112,"style":112},"language-yaml shiki shiki-themes github-light","include:\n  - template: \"Terraform/Base.latest.gitlab-ci.yml\"\n\nstages:\n- init\n- build\n- deploy\n\nnetwork:init:\n  extends: .terraform:init\n  stage: init\n  variables:\n    TF_ROOT: terraform/network\n    TF_STATE_NAME: network\n  only:\n    changes:\n      - \"terraform/network/*\"\n\nnetwork:review:\n  extends: .terraform:build\n  stage: build\n  variables:\n    TF_ROOT: terraform/network\n    TF_STATE_NAME: network\n  resource_group: tf:network\n  only:\n    changes:\n      - \"terraform/network/*\"\n\nnetwork:deploy:\n  extends: .terraform:deploy\n  stage: deploy\n  variables:\n    TF_ROOT: terraform/network\n    TF_STATE_NAME: network\n  resource_group: tf:network\n  environment:\n    name: dns\n  when: manual\n  only:\n    changes:\n      - \"terraform/network/*\"\n    variables:\n      - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n\n","yaml",[102,1005,1006,1015,1029,1033,1040,1048,1055,1062,1066,1073,1083,1092,1099,1109,1119,1126,1133,1141,1145,1152,1161,1170,1177,1186,1195,1206,1213,1220,1227,1232,1240,1250,1259,1266,1275,1284,1293,1301,1312,1323,1330,1337,1344,1352],{"__ignoreMap":112},[116,1007,1008,1012],{"class":118,"line":119},[116,1009,1011],{"class":1010},"shJU0","include",[116,1013,1014],{"class":126},":\n",[116,1016,1017,1020,1023,1026],{"class":118,"line":130},[116,1018,1019],{"class":126},"  - ",[116,1021,1022],{"class":1010},"template",[116,1024,1025],{"class":126},": ",[116,1027,1028],{"class":159},"\"Terraform/Base.latest.gitlab-ci.yml\"\n",[116,1030,1031],{"class":118,"line":138},[116,1032,213],{"emptyLinePlaceholder":212},[116,1034,1035,1038],{"class":118,"line":150},[116,1036,1037],{"class":1010},"stages",[116,1039,1014],{"class":126},[116,1041,1042,1045],{"class":118,"line":163},[116,1043,1044],{"class":126},"- ",[116,1046,1047],{"class":159},"init\n",[116,1049,1050,1052],{"class":118,"line":174},[116,1051,1044],{"class":126},[116,1053,1054],{"class":159},"build\n",[116,1056,1057,1059],{"class":118,"line":180},[116,1058,1044],{"class":126},[116,1060,1061],{"class":159},"deploy\n",[116,1063,1064],{"class":118,"line":186},[116,1065,213],{"emptyLinePlaceholder":212},[116,1067,1068,1071],{"class":118,"line":198},[116,1069,1070],{"class":1010},"network:init",[116,1072,1014],{"class":126},[116,1074,1075,1078,1080],{"class":118,"line":203},[116,1076,1077],{"class":1010},"  extends",[116,1079,1025],{"class":126},[116,1081,1082],{"class":159},".terraform:init\n",[116,1084,1085,1088,1090],{"class":118,"line":209},[116,1086,1087],{"class":1010},"  stage",[116,1089,1025],{"class":126},[116,1091,1047],{"class":159},[116,1093,1094,1097],{"class":118,"line":216},[116,1095,1096],{"class":1010},"  variables",[116,1098,1014],{"class":126},[116,1100,1101,1104,1106],{"class":118,"line":222},[116,1102,1103],{"class":1010},"    TF_ROOT",[116,1105,1025],{"class":126},[116,1107,1108],{"class":159},"terraform/network\n",[116,1110,1111,1114,1116],{"class":118,"line":233},[116,1112,1113],{"class":1010},"    TF_STATE_NAME",[116,1115,1025],{"class":126},[116,1117,1118],{"class":159},"network\n",[116,1120,1121,1124],{"class":118,"line":239},[116,1122,1123],{"class":1010},"  only",[116,1125,1014],{"class":126},[116,1127,1128,1131],{"class":118,"line":245},[116,1129,1130],{"class":1010},"    changes",[116,1132,1014],{"class":126},[116,1134,1135,1138],{"class":118,"line":250},[116,1136,1137],{"class":126},"      - ",[116,1139,1140],{"class":159},"\"terraform/network/*\"\n",[116,1142,1143],{"class":118,"line":255},[116,1144,213],{"emptyLinePlaceholder":212},[116,1146,1147,1150],{"class":118,"line":272},[116,1148,1149],{"class":1010},"network:review",[116,1151,1014],{"class":126},[116,1153,1154,1156,1158],{"class":118,"line":284},[116,1155,1077],{"class":1010},[116,1157,1025],{"class":126},[116,1159,1160],{"class":159},".terraform:build\n",[116,1162,1164,1166,1168],{"class":118,"line":1163},21,[116,1165,1087],{"class":1010},[116,1167,1025],{"class":126},[116,1169,1054],{"class":159},[116,1171,1173,1175],{"class":118,"line":1172},22,[116,1174,1096],{"class":1010},[116,1176,1014],{"class":126},[116,1178,1180,1182,1184],{"class":118,"line":1179},23,[116,1181,1103],{"class":1010},[116,1183,1025],{"class":126},[116,1185,1108],{"class":159},[116,1187,1189,1191,1193],{"class":118,"line":1188},24,[116,1190,1113],{"class":1010},[116,1192,1025],{"class":126},[116,1194,1118],{"class":159},[116,1196,1198,1201,1203],{"class":118,"line":1197},25,[116,1199,1200],{"class":1010},"  resource_group",[116,1202,1025],{"class":126},[116,1204,1205],{"class":159},"tf:network\n",[116,1207,1209,1211],{"class":118,"line":1208},26,[116,1210,1123],{"class":1010},[116,1212,1014],{"class":126},[116,1214,1216,1218],{"class":118,"line":1215},27,[116,1217,1130],{"class":1010},[116,1219,1014],{"class":126},[116,1221,1223,1225],{"class":118,"line":1222},28,[116,1224,1137],{"class":126},[116,1226,1140],{"class":159},[116,1228,1230],{"class":118,"line":1229},29,[116,1231,213],{"emptyLinePlaceholder":212},[116,1233,1235,1238],{"class":118,"line":1234},30,[116,1236,1237],{"class":1010},"network:deploy",[116,1239,1014],{"class":126},[116,1241,1243,1245,1247],{"class":118,"line":1242},31,[116,1244,1077],{"class":1010},[116,1246,1025],{"class":126},[116,1248,1249],{"class":159},".terraform:deploy\n",[116,1251,1253,1255,1257],{"class":118,"line":1252},32,[116,1254,1087],{"class":1010},[116,1256,1025],{"class":126},[116,1258,1061],{"class":159},[116,1260,1262,1264],{"class":118,"line":1261},33,[116,1263,1096],{"class":1010},[116,1265,1014],{"class":126},[116,1267,1269,1271,1273],{"class":118,"line":1268},34,[116,1270,1103],{"class":1010},[116,1272,1025],{"class":126},[116,1274,1108],{"class":159},[116,1276,1278,1280,1282],{"class":118,"line":1277},35,[116,1279,1113],{"class":1010},[116,1281,1025],{"class":126},[116,1283,1118],{"class":159},[116,1285,1287,1289,1291],{"class":118,"line":1286},36,[116,1288,1200],{"class":1010},[116,1290,1025],{"class":126},[116,1292,1205],{"class":159},[116,1294,1296,1299],{"class":118,"line":1295},37,[116,1297,1298],{"class":1010},"  environment",[116,1300,1014],{"class":126},[116,1302,1304,1307,1309],{"class":118,"line":1303},38,[116,1305,1306],{"class":1010},"    name",[116,1308,1025],{"class":126},[116,1310,1311],{"class":159},"dns\n",[116,1313,1315,1318,1320],{"class":118,"line":1314},39,[116,1316,1317],{"class":1010},"  when",[116,1319,1025],{"class":126},[116,1321,1322],{"class":159},"manual\n",[116,1324,1326,1328],{"class":118,"line":1325},40,[116,1327,1123],{"class":1010},[116,1329,1014],{"class":126},[116,1331,1333,1335],{"class":118,"line":1332},41,[116,1334,1130],{"class":1010},[116,1336,1014],{"class":126},[116,1338,1340,1342],{"class":118,"line":1339},42,[116,1341,1137],{"class":126},[116,1343,1140],{"class":159},[116,1345,1347,1350],{"class":118,"line":1346},43,[116,1348,1349],{"class":1010},"    variables",[116,1351,1014],{"class":126},[116,1353,1355,1357],{"class":118,"line":1354},44,[116,1356,1137],{"class":126},[116,1358,1359],{"class":159},"$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n",[12,1361,1362,1363,1368],{},"This CI pipeline re-uses ",[19,1364,1367],{"href":1365,"rel":1366},"https://gitlab.com/gitlab-org/gitlab/-/tree/master/lib/gitlab/ci/templates/Terraform",[],"the latest base Terraform CI template"," shipped with GitLab, and runs the jobs by simply parameterizing them as function calls. Let's review quickly the keys used:",[96,1370,1371,1381,1396,1406,1416],{},[64,1372,1373,1374,1380],{},"the ",[19,1375,1378],{"href":1376,"rel":1377},"https://docs.gitlab.com/ci/yaml/#stages",[],[102,1379,1037],{}," keyword provides a list of stages to compose the pipeline",[64,1382,1373,1383,1390,1391],{},[19,1384,1387],{"href":1385,"rel":1386},"https://docs.gitlab.com/ci/yaml/#extends",[],[102,1388,1389],{},"extends"," keyword refers to the job defined in ",[19,1392,1395],{"href":1393,"rel":1394},"https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml",[],"the base Terraform template",[64,1397,1373,1398,1405],{},[19,1399,1402],{"href":1400,"rel":1401},"https://docs.gitlab.com/ci/yaml/#variables",[],[102,1403,1404],{},"variables"," keywords parameterizes the job for our requirements",[64,1407,1373,1408,1415],{},[19,1409,1412],{"href":1410,"rel":1411},"https://docs.gitlab.com/ci/yaml/#resource_group",[],[102,1413,1414],{},"resource_group"," keyword assures that always only one potentially conflicting job is run",[64,1417,1373,1418,1425],{},[19,1419,1422],{"href":1420,"rel":1421},"https://docs.gitlab.com/ci/yaml/#only--except",[],[102,1423,1424],{},"only"," keyword restricts runs to specific situations",[12,1427,1428],{},"If you commit this file and push it to GitLab, a new pipeline will be created that as a last step provides you a manual job to create your network. We will extend this file later throughout this tutorial series.",[56,1430,1432],{"id":1431},"create-a-kubernetes-cluster","Create a Kubernetes cluster",[12,1434,1435],{},"The code required for the cluster will be very similar to the code for the network.",[96,1437,1438],{},[64,1439,1440,1441,105],{},"Add ",[102,1442,1443],{},"terraform/cluster/outputs.tf",[107,1445,1447],{"className":109,"code":1446,"language":111,"meta":112,"style":112},"terraform {\n  required_providers {\n    civo = {\n      source = \"civo/civo\"\n      version = \"0.10.4\"\n    }\n  }\n  backend \"http\" {\n  }\n}\n\n# Configure the Civo Provider\nprovider \"civo\" {\n  token = var.civo_token\n  region = local.region\n}\n\nresource \"civo_kubernetes_cluster\" \"dev-cluster\" {\n    name = \"dev-cluster\"\n    // tags = \"gitlab demo\"  // Do not add tags! There is a bug in the civo-provider :(\n    network_id = data.civo_network.network.id\n    applications = \"\"\n    num_target_nodes = 3\n    target_nodes_size = element(data.civo_instances_size.small.sizes, 0).name\n}\n",[102,1448,1449,1455,1461,1469,1477,1486,1490,1494,1504,1508,1512,1516,1520,1530,1545,1559,1563,1567,1580,1589,1597,1619,1629,1639,1678],{"__ignoreMap":112},[116,1450,1451,1453],{"class":118,"line":119},[116,1452,123],{"class":122},[116,1454,127],{"class":126},[116,1456,1457,1459],{"class":118,"line":130},[116,1458,133],{"class":122},[116,1460,127],{"class":126},[116,1462,1463,1465,1467],{"class":118,"line":138},[116,1464,141],{"class":126},[116,1466,145],{"class":144},[116,1468,127],{"class":126},[116,1470,1471,1473,1475],{"class":118,"line":150},[116,1472,153],{"class":126},[116,1474,156],{"class":144},[116,1476,160],{"class":159},[116,1478,1479,1481,1483],{"class":118,"line":163},[116,1480,166],{"class":126},[116,1482,156],{"class":144},[116,1484,1485],{"class":159}," \"0.10.4\"\n",[116,1487,1488],{"class":118,"line":174},[116,1489,177],{"class":126},[116,1491,1492],{"class":118,"line":180},[116,1493,183],{"class":126},[116,1495,1496,1499,1502],{"class":118,"line":186},[116,1497,1498],{"class":122},"  backend",[116,1500,1501],{"class":331}," \"http\"",[116,1503,127],{"class":126},[116,1505,1506],{"class":118,"line":198},[116,1507,183],{"class":126},[116,1509,1510],{"class":118,"line":203},[116,1511,206],{"class":126},[116,1513,1514],{"class":118,"line":209},[116,1515,213],{"emptyLinePlaceholder":212},[116,1517,1518],{"class":118,"line":216},[116,1519,219],{"class":777},[116,1521,1522,1525,1528],{"class":118,"line":222},[116,1523,1524],{"class":122},"provider",[116,1526,1527],{"class":331}," \"civo\"",[116,1529,127],{"class":126},[116,1531,1532,1535,1537,1540,1542],{"class":118,"line":233},[116,1533,1534],{"class":126},"  token",[116,1536,145],{"class":144},[116,1538,1539],{"class":126}," var",[116,1541,23],{"class":144},[116,1543,1544],{"class":126},"civo_token\n",[116,1546,1547,1549,1551,1554,1556],{"class":118,"line":239},[116,1548,384],{"class":126},[116,1550,145],{"class":144},[116,1552,1553],{"class":126}," local",[116,1555,23],{"class":144},[116,1557,1558],{"class":126},"region\n",[116,1560,1561],{"class":118,"line":245},[116,1562,206],{"class":126},[116,1564,1565],{"class":118,"line":250},[116,1566,213],{"emptyLinePlaceholder":212},[116,1568,1569,1572,1575,1578],{"class":118,"line":255},[116,1570,1571],{"class":122},"resource",[116,1573,1574],{"class":331}," \"civo_kubernetes_cluster\"",[116,1576,1577],{"class":331}," \"dev-cluster\"",[116,1579,127],{"class":126},[116,1581,1582,1584,1586],{"class":118,"line":272},[116,1583,1306],{"class":126},[116,1585,145],{"class":144},[116,1587,1588],{"class":159}," \"dev-cluster\"\n",[116,1590,1591,1594],{"class":118,"line":284},[116,1592,1593],{"class":777},"    // tags = \"gitlab demo\"",[116,1595,1596],{"class":777},"  // Do not add tags! There is a bug in the civo-provider :(\n",[116,1598,1599,1602,1604,1607,1609,1611,1613,1615,1617],{"class":118,"line":1163},[116,1600,1601],{"class":126},"    network_id",[116,1603,145],{"class":144},[116,1605,1606],{"class":126}," data",[116,1608,23],{"class":144},[116,1610,261],{"class":126},[116,1612,23],{"class":144},[116,1614,267],{"class":126},[116,1616,23],{"class":144},[116,1618,353],{"class":126},[116,1620,1621,1624,1626],{"class":118,"line":1172},[116,1622,1623],{"class":126},"    applications",[116,1625,145],{"class":144},[116,1627,1628],{"class":159}," \"\"\n",[116,1630,1631,1634,1636],{"class":118,"line":1179},[116,1632,1633],{"class":126},"    num_target_nodes",[116,1635,145],{"class":144},[116,1637,1638],{"class":331}," 3\n",[116,1640,1641,1644,1646,1649,1652,1654,1657,1659,1662,1664,1667,1670,1673,1675],{"class":118,"line":1188},[116,1642,1643],{"class":126},"    target_nodes_size",[116,1645,145],{"class":144},[116,1647,1648],{"class":331}," element",[116,1650,1651],{"class":126},"(data",[116,1653,23],{"class":144},[116,1655,1656],{"class":126},"civo_instances_size",[116,1658,23],{"class":144},[116,1660,1661],{"class":126},"small",[116,1663,23],{"class":144},[116,1665,1666],{"class":126},"sizes, ",[116,1668,1669],{"class":331},"0",[116,1671,1672],{"class":126},")",[116,1674,23],{"class":144},[116,1676,1677],{"class":126},"name\n",[116,1679,1680],{"class":118,"line":1197},[116,1681,206],{"class":126},[12,1683,1684,1685,1687,1688,1691],{},"The only difference compared to ",[102,1686,318],{}," is the last resource as that describes the cluster. You can see how we reference the network created before. Of course, we'll need a ",[102,1689,1690],{},"data"," resource for this and the instance sizes.",[96,1693,1694],{},[64,1695,1440,1696,105],{},[102,1697,1698],{},"terraform/cluster/data.tf",[107,1700,1702],{"className":109,"code":1701,"language":111,"meta":112,"style":112},"data \"civo_instances_size\" \"small\" {\n    filter {\n        key = \"name\"\n        values = [\"g3.small\"]\n        match_by = \"re\"\n    }\n\n    filter {\n        key = \"type\"\n        values = [\"instance\"]\n    }\n\n}\n\ndata \"civo_network\" \"network\" {\n    label = \"development\"\n}\n",[102,1703,1704,1716,1723,1733,1749,1759,1763,1767,1773,1782,1795,1799,1803,1807,1811,1822,1832],{"__ignoreMap":112},[116,1705,1706,1708,1711,1714],{"class":118,"line":119},[116,1707,1690],{"class":122},[116,1709,1710],{"class":331}," \"civo_instances_size\"",[116,1712,1713],{"class":331}," \"small\"",[116,1715,127],{"class":126},[116,1717,1718,1721],{"class":118,"line":130},[116,1719,1720],{"class":122},"    filter",[116,1722,127],{"class":126},[116,1724,1725,1728,1730],{"class":118,"line":138},[116,1726,1727],{"class":126},"        key",[116,1729,145],{"class":144},[116,1731,1732],{"class":159}," \"name\"\n",[116,1734,1735,1738,1740,1743,1746],{"class":118,"line":150},[116,1736,1737],{"class":126},"        values",[116,1739,145],{"class":144},[116,1741,1742],{"class":126}," [",[116,1744,1745],{"class":159},"\"g3.small\"",[116,1747,1748],{"class":126},"]\n",[116,1750,1751,1754,1756],{"class":118,"line":163},[116,1752,1753],{"class":126},"        match_by",[116,1755,145],{"class":144},[116,1757,1758],{"class":159}," \"re\"\n",[116,1760,1761],{"class":118,"line":174},[116,1762,177],{"class":126},[116,1764,1765],{"class":118,"line":180},[116,1766,213],{"emptyLinePlaceholder":212},[116,1768,1769,1771],{"class":118,"line":186},[116,1770,1720],{"class":122},[116,1772,127],{"class":126},[116,1774,1775,1777,1779],{"class":118,"line":198},[116,1776,1727],{"class":126},[116,1778,145],{"class":144},[116,1780,1781],{"class":159}," \"type\"\n",[116,1783,1784,1786,1788,1790,1793],{"class":118,"line":203},[116,1785,1737],{"class":126},[116,1787,145],{"class":144},[116,1789,1742],{"class":126},[116,1791,1792],{"class":159},"\"instance\"",[116,1794,1748],{"class":126},[116,1796,1797],{"class":118,"line":209},[116,1798,177],{"class":126},[116,1800,1801],{"class":118,"line":216},[116,1802,213],{"emptyLinePlaceholder":212},[116,1804,1805],{"class":118,"line":222},[116,1806,206],{"class":126},[116,1808,1809],{"class":118,"line":233},[116,1810,213],{"emptyLinePlaceholder":212},[116,1812,1813,1815,1818,1820],{"class":118,"line":239},[116,1814,1690],{"class":122},[116,1816,1817],{"class":331}," \"civo_network\"",[116,1819,332],{"class":331},[116,1821,127],{"class":126},[116,1823,1824,1827,1829],{"class":118,"line":245},[116,1825,1826],{"class":126},"    label",[116,1828,145],{"class":144},[116,1830,1831],{"class":159}," \"development\"\n",[116,1833,1834],{"class":118,"line":250},[116,1835,206],{"class":126},[96,1837,1838],{},[64,1839,1840,1841,1844],{},"The ",[102,1842,1843],{},"terraform/cluster/locals.tf"," file outputs some useful details. We won't use them now, but they often come in handy in the longer term.",[107,1846,1848],{"className":109,"code":1847,"language":111,"meta":112,"style":112},"output \"cluster\" {\n  value = {\n    status = civo_kubernetes_cluster.dev-cluster.status\n    master_ip = civo_kubernetes_cluster.dev-cluster.master_ip\n    dns_entry = civo_kubernetes_cluster.dev-cluster.dns_entry\n  }\n}\n",[102,1849,1850,1859,1867,1883,1897,1911,1915],{"__ignoreMap":112},[116,1851,1852,1854,1857],{"class":118,"line":119},[116,1853,328],{"class":122},[116,1855,1856],{"class":331}," \"cluster\"",[116,1858,127],{"class":126},[116,1860,1861,1863,1865],{"class":118,"line":130},[116,1862,339],{"class":126},[116,1864,145],{"class":144},[116,1866,127],{"class":126},[116,1868,1869,1872,1874,1877,1880],{"class":118,"line":138},[116,1870,1871],{"class":126},"    status ",[116,1873,156],{"class":144},[116,1875,1876],{"class":126}," civo_kubernetes_cluster.dev",[116,1878,1879],{"class":144},"-",[116,1881,1882],{"class":126},"cluster.status\n",[116,1884,1885,1888,1890,1892,1894],{"class":118,"line":150},[116,1886,1887],{"class":126},"    master_ip ",[116,1889,156],{"class":144},[116,1891,1876],{"class":126},[116,1893,1879],{"class":144},[116,1895,1896],{"class":126},"cluster.master_ip\n",[116,1898,1899,1902,1904,1906,1908],{"class":118,"line":163},[116,1900,1901],{"class":126},"    dns_entry ",[116,1903,156],{"class":144},[116,1905,1876],{"class":126},[116,1907,1879],{"class":144},[116,1909,1910],{"class":126},"cluster.dns_entry\n",[116,1912,1913],{"class":118,"line":174},[116,1914,183],{"class":126},[116,1916,1917],{"class":118,"line":180},[116,1918,206],{"class":126},[96,1920,1921],{},[64,1922,1840,1923,1925],{},[102,1924,1843],{}," file is the same as for the network project:",[107,1927,1928],{"className":109,"code":370,"language":111,"meta":112,"style":112},[102,1929,1930,1936,1944],{"__ignoreMap":112},[116,1931,1932,1934],{"class":118,"line":119},[116,1933,377],{"class":122},[116,1935,127],{"class":126},[116,1937,1938,1940,1942],{"class":118,"line":130},[116,1939,384],{"class":126},[116,1941,145],{"class":144},[116,1943,389],{"class":159},[116,1945,1946],{"class":118,"line":138},[116,1947,206],{"class":126},[96,1949,1950],{},[64,1951,1840,1952,1925],{},[102,1953,1954],{},"terraform/cluster/variables.tf",[107,1956,1957],{"className":109,"code":421,"language":111,"meta":112,"style":112},[102,1958,1959,1967,1975,1983],{"__ignoreMap":112},[116,1960,1961,1963,1965],{"class":118,"line":119},[116,1962,428],{"class":122},[116,1964,431],{"class":331},[116,1966,127],{"class":126},[116,1968,1969,1971,1973],{"class":118,"line":130},[116,1970,438],{"class":126},[116,1972,145],{"class":144},[116,1974,443],{"class":144},[116,1976,1977,1979,1981],{"class":118,"line":138},[116,1978,448],{"class":126},[116,1980,145],{"class":144},[116,1982,453],{"class":331},[116,1984,1985],{"class":118,"line":150},[116,1986,206],{"class":126},[472,1988,1990],{"id":1989},"provision-the-cluster","Provision the cluster",[12,1992,1993],{},"Let's see how can we extend the previous local and CI/CD setups to run this Terraform project!",[1995,1996,1998],"h4",{"id":1997},"running-locally","Running locally",[96,2000,2001],{},[64,2002,504,2003,2006],{},[102,2004,2005],{},"terraform/cluster/.envrc","  as you did for the network project:",[107,2008,2009],{"className":511,"code":512,"language":513,"meta":112,"style":112},[102,2010,2011,2029],{"__ignoreMap":112},[116,2012,2013,2015,2017,2019,2021,2023,2025,2027],{"class":118,"line":119},[116,2014,520],{"class":144},[116,2016,523],{"class":126},[116,2018,156],{"class":144},[116,2020,528],{"class":126},[116,2022,531],{"class":144},[116,2024,123],{"class":126},[116,2026,536],{"class":144},[116,2028,206],{"class":126},[116,2030,2031,2033],{"class":118,"line":130},[116,2032,543],{"class":122},[116,2034,546],{"class":159},[12,2036,2037],{},"Now run Terraform:",[107,2039,2043],{"className":2040,"code":2041,"language":2042,"meta":112,"style":112},"language-bash shiki shiki-themes github-light","terraform init\nterraform plan\nterraform apply\n","bash",[102,2044,2045,2051,2057],{"__ignoreMap":112},[116,2046,2047,2049],{"class":118,"line":119},[116,2048,123],{"class":122},[116,2050,942],{"class":159},[116,2052,2053,2055],{"class":118,"line":130},[116,2054,123],{"class":122},[116,2056,949],{"class":159},[116,2058,2059,2061],{"class":118,"line":138},[116,2060,123],{"class":122},[116,2062,967],{"class":159},[1995,2064,2066],{"id":2065},"running-from-cicd","Running from CI/CD",[12,2068,2069,2070,2073],{},"Extend the ",[102,2071,2072],{},".gitlab-ci.yaml"," file with the following 3 jobs:",[107,2075,2077],{"className":109,"code":2076,"language":111,"meta":112,"style":112},"cluster:init:\n  extends: .terraform:init\n  stage: init\n  variables:\n    TF_ROOT: terraform/cluster\n    TF_STATE_NAME: cluster\n  only:\n    changes:\n      - \"terraform/cluster/*\"\n\ncluster:review:\n  extends: .terraform:build\n  stage: build\n  variables:\n    TF_ROOT: terraform/cluster\n    TF_STATE_NAME: cluster\n  resource_group: tf:cluster\n  only:\n    changes:\n      - \"terraform/cluster/*\"\n\ncluster:deploy:\n  extends: .terraform:deploy\n  stage: deploy\n  variables:\n    TF_ROOT: terraform/cluster\n    TF_STATE_NAME: cluster\n  resource_group: tf:cluster\n  environment:\n    name: dev-cluster\n  when: manual\n  only:\n    changes:\n      - \"terraform/cluster/*\"\n    variables:\n      - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n\n",[102,2078,2079,2091,2106,2114,2120,2134,2143,2149,2155,2163,2167,2178,2192,2201,2207,2219,2227,2240,2246,2252,2258,2262,2273,2287,2296,2302,2314,2322,2334,2340,2353,2362,2368,2374,2380,2386],{"__ignoreMap":112},[116,2080,2081,2084,2086,2089],{"class":118,"line":119},[116,2082,2083],{"class":126},"cluster",[116,2085,508],{"class":144},[116,2087,2088],{"class":126},"init",[116,2090,1014],{"class":144},[116,2092,2093,2095,2097,2100,2102,2104],{"class":118,"line":130},[116,2094,1077],{"class":126},[116,2096,508],{"class":144},[116,2098,2099],{"class":144}," .",[116,2101,123],{"class":126},[116,2103,508],{"class":144},[116,2105,1047],{"class":126},[116,2107,2108,2110,2112],{"class":118,"line":138},[116,2109,1087],{"class":126},[116,2111,508],{"class":144},[116,2113,942],{"class":126},[116,2115,2116,2118],{"class":118,"line":150},[116,2117,1096],{"class":126},[116,2119,1014],{"class":144},[116,2121,2122,2124,2126,2129,2131],{"class":118,"line":163},[116,2123,1103],{"class":126},[116,2125,508],{"class":144},[116,2127,2128],{"class":126}," terraform",[116,2130,536],{"class":144},[116,2132,2133],{"class":126},"cluster\n",[116,2135,2136,2138,2140],{"class":118,"line":174},[116,2137,1113],{"class":126},[116,2139,508],{"class":144},[116,2141,2142],{"class":126}," cluster\n",[116,2144,2145,2147],{"class":118,"line":180},[116,2146,1123],{"class":126},[116,2148,1014],{"class":144},[116,2150,2151,2153],{"class":118,"line":186},[116,2152,1130],{"class":126},[116,2154,1014],{"class":144},[116,2156,2157,2160],{"class":118,"line":198},[116,2158,2159],{"class":144},"      -",[116,2161,2162],{"class":159}," \"terraform/cluster/*\"\n",[116,2164,2165],{"class":118,"line":203},[116,2166,213],{"emptyLinePlaceholder":212},[116,2168,2169,2171,2173,2176],{"class":118,"line":209},[116,2170,2083],{"class":126},[116,2172,508],{"class":144},[116,2174,2175],{"class":126},"review",[116,2177,1014],{"class":144},[116,2179,2180,2182,2184,2186,2188,2190],{"class":118,"line":216},[116,2181,1077],{"class":126},[116,2183,508],{"class":144},[116,2185,2099],{"class":144},[116,2187,123],{"class":126},[116,2189,508],{"class":144},[116,2191,1054],{"class":126},[116,2193,2194,2196,2198],{"class":118,"line":222},[116,2195,1087],{"class":126},[116,2197,508],{"class":144},[116,2199,2200],{"class":126}," build\n",[116,2202,2203,2205],{"class":118,"line":233},[116,2204,1096],{"class":126},[116,2206,1014],{"class":144},[116,2208,2209,2211,2213,2215,2217],{"class":118,"line":239},[116,2210,1103],{"class":126},[116,2212,508],{"class":144},[116,2214,2128],{"class":126},[116,2216,536],{"class":144},[116,2218,2133],{"class":126},[116,2220,2221,2223,2225],{"class":118,"line":245},[116,2222,1113],{"class":126},[116,2224,508],{"class":144},[116,2226,2142],{"class":126},[116,2228,2229,2231,2233,2236,2238],{"class":118,"line":250},[116,2230,1200],{"class":126},[116,2232,508],{"class":144},[116,2234,2235],{"class":126}," tf",[116,2237,508],{"class":144},[116,2239,2133],{"class":126},[116,2241,2242,2244],{"class":118,"line":255},[116,2243,1123],{"class":126},[116,2245,1014],{"class":144},[116,2247,2248,2250],{"class":118,"line":272},[116,2249,1130],{"class":126},[116,2251,1014],{"class":144},[116,2253,2254,2256],{"class":118,"line":284},[116,2255,2159],{"class":144},[116,2257,2162],{"class":159},[116,2259,2260],{"class":118,"line":1163},[116,2261,213],{"emptyLinePlaceholder":212},[116,2263,2264,2266,2268,2271],{"class":118,"line":1172},[116,2265,2083],{"class":126},[116,2267,508],{"class":144},[116,2269,2270],{"class":126},"deploy",[116,2272,1014],{"class":144},[116,2274,2275,2277,2279,2281,2283,2285],{"class":118,"line":1179},[116,2276,1077],{"class":126},[116,2278,508],{"class":144},[116,2280,2099],{"class":144},[116,2282,123],{"class":126},[116,2284,508],{"class":144},[116,2286,1061],{"class":126},[116,2288,2289,2291,2293],{"class":118,"line":1188},[116,2290,1087],{"class":126},[116,2292,508],{"class":144},[116,2294,2295],{"class":126}," deploy\n",[116,2297,2298,2300],{"class":118,"line":1197},[116,2299,1096],{"class":126},[116,2301,1014],{"class":144},[116,2303,2304,2306,2308,2310,2312],{"class":118,"line":1208},[116,2305,1103],{"class":126},[116,2307,508],{"class":144},[116,2309,2128],{"class":126},[116,2311,536],{"class":144},[116,2313,2133],{"class":126},[116,2315,2316,2318,2320],{"class":118,"line":1215},[116,2317,1113],{"class":126},[116,2319,508],{"class":144},[116,2321,2142],{"class":126},[116,2323,2324,2326,2328,2330,2332],{"class":118,"line":1222},[116,2325,1200],{"class":126},[116,2327,508],{"class":144},[116,2329,2235],{"class":126},[116,2331,508],{"class":144},[116,2333,2133],{"class":126},[116,2335,2336,2338],{"class":118,"line":1229},[116,2337,1298],{"class":126},[116,2339,1014],{"class":144},[116,2341,2342,2344,2346,2349,2351],{"class":118,"line":1234},[116,2343,1306],{"class":126},[116,2345,508],{"class":144},[116,2347,2348],{"class":126}," dev",[116,2350,1879],{"class":144},[116,2352,2133],{"class":126},[116,2354,2355,2357,2359],{"class":118,"line":1242},[116,2356,1317],{"class":126},[116,2358,508],{"class":144},[116,2360,2361],{"class":126}," manual\n",[116,2363,2364,2366],{"class":118,"line":1252},[116,2365,1123],{"class":126},[116,2367,1014],{"class":144},[116,2369,2370,2372],{"class":118,"line":1261},[116,2371,1130],{"class":126},[116,2373,1014],{"class":144},[116,2375,2376,2378],{"class":118,"line":1268},[116,2377,2159],{"class":144},[116,2379,2162],{"class":159},[116,2381,2382,2384],{"class":118,"line":1277},[116,2383,1349],{"class":126},[116,2385,1014],{"class":144},[116,2387,2388,2390,2393,2396],{"class":118,"line":1286},[116,2389,2159],{"class":144},[116,2391,2392],{"class":126}," $CI_COMMIT_BRANCH ",[116,2394,2395],{"class":144},"==",[116,2397,2398],{"class":126}," $CI_DEFAULT_BRANCH\n",[12,2400,2401,2402,2404],{},"As you can see these are the same jobs that we saw already, they are just parameterized for the ",[102,2403,2083],{}," Terraform project.",[12,2406,2407],{},"Once you push your code to GitLab, you cluster should be ready in a few minutes!",[12,2409,2410],{},[15,2411,2412,2415],{},[19,2413,2414],{"href":21},"Click here"," for the next tutorial.",[2417,2418,2419],"style",{},"html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}",{"title":112,"searchDepth":130,"depth":130,"links":2421},[2422,2423,2424,2429],{"id":58,"depth":130,"text":59},{"id":84,"depth":130,"text":85},{"id":466,"depth":130,"text":467,"children":2425},[2426,2427,2428],{"id":474,"depth":138,"text":475},{"id":926,"depth":138,"text":927},{"id":984,"depth":138,"text":985},{"id":1431,"depth":130,"text":1432,"children":2430},[2431],{"id":1989,"depth":138,"text":1990},"engineering","2021-11-04","In part two of our GitOps series, we set up the infrastructure using GitLab and Terraform. Here's everything you need to know.","md",null,false,"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749663397/Blog/Hero%20Images/logoforblogpost.jpg",{},"/en-us/blog/gitops-with-gitlab-infrastructure-provisioning",{"title":5,"description":2434,"ogTitle":5,"ogDescription":2434,"noIndex":2437,"ogImage":2438,"ogUrl":2442,"ogSiteName":2443,"ogType":2444,"canonicalUrls":2442},"https://about.gitlab.com/blog/gitops-with-gitlab-infrastructure-provisioning","https://about.gitlab.com","article","gitops-with-gitlab-infrastructure-provisioning","en-us/blog/gitops-with-gitlab-infrastructure-provisioning",[2448,2449,2450],"GitOps","kubernetes","inside GitLab","BlogPost","ggetd9mFdEXpOmvYJulv96mvbI-ZFhERQ-cTFhE-e8Y",{"logo":2454,"freeTrial":2458,"sales":2463,"login":2468,"items":2473,"search":2800,"minimal":2831,"duo":2850,"switchNav":2859,"pricingDeployment":2870},{"config":2455},{"href":536,"dataGaName":2456,"dataGaLocation":2457},"gitlab logo","header",{"text":2459,"config":2460},"Get free trial",{"href":2461,"dataGaName":2462,"dataGaLocation":2457},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com&glm_content=default-saas-trial/","free trial",{"text":2464,"config":2465},"Request a demo",{"href":2466,"dataGaName":2467,"dataGaLocation":2457},"/sales/?contact-topic=request-demo","sales",{"text":2469,"config":2470},"Sign in",{"href":2471,"dataGaName":2472,"dataGaLocation":2457},"https://gitlab.com/users/sign_in/","sign in",[2474,2503,2603,2608,2722,2778],{"text":2475,"config":2476,"menu":2478},"Platform",{"dataNavLevelOne":2477},"platform",{"type":2479,"columns":2480},"cards",[2481,2487,2495],{"title":2475,"description":2482,"link":2483},"The intelligent orchestration platform for DevSecOps",{"text":2484,"config":2485},"Explore our Platform",{"href":2486,"dataGaName":2477,"dataGaLocation":2457},"/platform/",{"title":2488,"description":2489,"link":2490},"GitLab Duo Agent Platform","Agentic AI for the entire software lifecycle",{"text":2491,"config":2492},"Meet GitLab Duo",{"href":2493,"dataGaName":2494,"dataGaLocation":2457},"/gitlab-duo-agent-platform/","gitlab duo agent platform",{"title":2496,"description":2497,"link":2498},"Why GitLab","See the top reasons enterprises choose GitLab",{"text":2499,"config":2500},"Learn more",{"href":2501,"dataGaName":2502,"dataGaLocation":2457},"/why-gitlab/","why gitlab",{"text":2504,"left":212,"config":2505,"menu":2507},"Product",{"dataNavLevelOne":2506},"solutions",{"type":2508,"link":2509,"columns":2513,"feature":2582},"lists",{"text":2510,"config":2511},"View all Solutions",{"href":2512,"dataGaName":2506,"dataGaLocation":2457},"/solutions/",[2514,2538,2561],{"title":2515,"description":2516,"link":2517,"items":2522},"Automation","CI/CD and automation to accelerate deployment",{"config":2518},{"icon":2519,"href":2520,"dataGaName":2521,"dataGaLocation":2457},"AutomatedCodeAlt","/solutions/delivery-automation/","automated software delivery",[2523,2527,2530,2534],{"text":2524,"config":2525},"CI/CD",{"href":2526,"dataGaLocation":2457,"dataGaName":2524},"/solutions/continuous-integration/",{"text":2488,"config":2528},{"href":2493,"dataGaLocation":2457,"dataGaName":2529},"gitlab duo agent platform - product menu",{"text":2531,"config":2532},"Source Code Management",{"href":2533,"dataGaLocation":2457,"dataGaName":2531},"/solutions/source-code-management/",{"text":2535,"config":2536},"Automated Software Delivery",{"href":2520,"dataGaLocation":2457,"dataGaName":2537},"Automated software delivery",{"title":2539,"description":2540,"link":2541,"items":2546},"Security","Deliver code faster without compromising security",{"config":2542},{"href":2543,"dataGaName":2544,"dataGaLocation":2457,"icon":2545},"/solutions/application-security-testing/","security and compliance","ShieldCheckLight",[2547,2551,2556],{"text":2548,"config":2549},"Application Security Testing",{"href":2543,"dataGaName":2550,"dataGaLocation":2457},"Application security testing",{"text":2552,"config":2553},"Software Supply Chain Security",{"href":2554,"dataGaLocation":2457,"dataGaName":2555},"/solutions/supply-chain/","Software supply chain security",{"text":2557,"config":2558},"Software Compliance",{"href":2559,"dataGaName":2560,"dataGaLocation":2457},"/solutions/software-compliance/","software compliance",{"title":2562,"link":2563,"items":2568},"Measurement",{"config":2564},{"icon":2565,"href":2566,"dataGaName":2567,"dataGaLocation":2457},"DigitalTransformation","/solutions/visibility-measurement/","visibility and measurement",[2569,2573,2577],{"text":2570,"config":2571},"Visibility & Measurement",{"href":2566,"dataGaLocation":2457,"dataGaName":2572},"Visibility and Measurement",{"text":2574,"config":2575},"Value Stream Management",{"href":2576,"dataGaLocation":2457,"dataGaName":2574},"/solutions/value-stream-management/",{"text":2578,"config":2579},"Analytics & Insights",{"href":2580,"dataGaLocation":2457,"dataGaName":2581},"/solutions/analytics-and-insights/","Analytics and insights",{"title":2583,"type":2508,"items":2584},"GitLab for",[2585,2591,2597],{"text":2586,"config":2587},"Enterprise",{"icon":2588,"href":2589,"dataGaLocation":2457,"dataGaName":2590},"Building","/enterprise/","enterprise",{"text":2592,"config":2593},"Small Business",{"icon":2594,"href":2595,"dataGaLocation":2457,"dataGaName":2596},"Work","/small-business/","small business",{"text":2598,"config":2599},"Public Sector",{"icon":2600,"href":2601,"dataGaLocation":2457,"dataGaName":2602},"Organization","/solutions/public-sector/","public sector",{"text":2604,"config":2605},"Pricing",{"href":2606,"dataGaName":2607,"dataGaLocation":2457,"dataNavLevelOne":2607},"/pricing/","pricing",{"text":2609,"config":2610,"menu":2612},"Resources",{"dataNavLevelOne":2611},"resources",{"type":2508,"link":2613,"columns":2617,"feature":2711},{"text":2614,"config":2615},"View all resources",{"href":2616,"dataGaName":2611,"dataGaLocation":2457},"/resources/",[2618,2651,2678],{"title":2619,"items":2620},"Getting started",[2621,2626,2631,2636,2641,2646],{"text":2622,"config":2623},"Install",{"href":2624,"dataGaName":2625,"dataGaLocation":2457},"/install/","install",{"text":2627,"config":2628},"Quick start guides",{"href":2629,"dataGaName":2630,"dataGaLocation":2457},"/get-started/","quick setup checklists",{"text":2632,"config":2633},"Learn",{"href":2634,"dataGaLocation":2457,"dataGaName":2635},"https://university.gitlab.com/","learn",{"text":2637,"config":2638},"Product documentation",{"href":2639,"dataGaName":2640,"dataGaLocation":2457},"https://docs.gitlab.com/","product documentation",{"text":2642,"config":2643},"Best practice videos",{"href":2644,"dataGaName":2645,"dataGaLocation":2457},"/getting-started-videos/","best practice videos",{"text":2647,"config":2648},"Integrations",{"href":2649,"dataGaName":2650,"dataGaLocation":2457},"/integrations/","integrations",{"title":2652,"items":2653},"Discover",[2654,2659,2664,2669,2673],{"text":2655,"config":2656},"Customer success stories",{"href":2657,"dataGaName":2658,"dataGaLocation":2457},"/customers/","customer success stories",{"text":2660,"config":2661},"Blog",{"href":2662,"dataGaName":2663,"dataGaLocation":2457},"/blog/","blog",{"text":2665,"config":2666},"Demo Hub",{"href":2667,"dataGaName":2668,"dataGaLocation":2457},"/demo-hub/","demo hub",{"text":2670,"config":2671},"The Source",{"href":2672,"dataGaName":2663,"dataGaLocation":2457},"/the-source/",{"text":2674,"config":2675},"Remote",{"href":2676,"dataGaName":2677,"dataGaLocation":2457},"https://handbook.gitlab.com/handbook/company/culture/all-remote/","remote",{"title":2679,"items":2680},"Connect",[2681,2686,2691,2696,2701,2706],{"text":2682,"config":2683},"GitLab Services",{"href":2684,"dataGaName":2685,"dataGaLocation":2457},"/services/","services",{"text":2687,"config":2688},"Contribute",{"href":2689,"dataGaName":2690,"dataGaLocation":2457},"https://contributors.gitlab.com","contribute",{"text":2692,"config":2693},"Community",{"href":2694,"dataGaName":2695,"dataGaLocation":2457},"/community/","community",{"text":2697,"config":2698},"Forum",{"href":2699,"dataGaName":2700,"dataGaLocation":2457},"https://forum.gitlab.com/","forum",{"text":2702,"config":2703},"Events",{"href":2704,"dataGaName":2705,"dataGaLocation":2457},"/events/","events",{"text":2707,"config":2708},"Partners",{"href":2709,"dataGaName":2710,"dataGaLocation":2457},"/partners/","partners",{"config":2712,"title":2715,"text":2716,"link":2717},{"background":2713,"textColor":2714},"url('https://res.cloudinary.com/about-gitlab-com/image/upload/v1777322348/qpq8yrgn8knii57omj0c.png')","#000","What’s new in GitLab","Stay updated with our latest features and improvements.",{"text":2718,"config":2719},"Read the latest",{"href":2720,"dataGaName":2721,"dataGaLocation":2457},"/whats-new/","whats new",{"text":2723,"config":2724,"menu":2726},"Company",{"dataNavLevelOne":2725},"company",{"type":2508,"columns":2727},[2728],{"items":2729},[2730,2735,2741,2743,2748,2753,2758,2763,2768,2773],{"text":2731,"config":2732},"About",{"href":2733,"dataGaName":2734,"dataGaLocation":2457},"/company/","about",{"text":2736,"config":2737,"footerGa":2740},"Jobs",{"href":2738,"dataGaName":2739,"dataGaLocation":2457},"/jobs/","jobs",{"dataGaName":2739},{"text":2702,"config":2742},{"href":2704,"dataGaName":2705,"dataGaLocation":2457},{"text":2744,"config":2745},"Leadership",{"href":2746,"dataGaName":2747,"dataGaLocation":2457},"/company/team/e-group/","leadership",{"text":2749,"config":2750},"Handbook",{"href":2751,"dataGaName":2752,"dataGaLocation":2457},"https://handbook.gitlab.com/","handbook",{"text":2754,"config":2755},"Investor relations",{"href":2756,"dataGaName":2757,"dataGaLocation":2457},"https://ir.gitlab.com/overview/default.aspx","investor relations",{"text":2759,"config":2760},"Trust Center",{"href":2761,"dataGaName":2762,"dataGaLocation":2457},"/security/","trust center",{"text":2764,"config":2765},"AI Transparency Center",{"href":2766,"dataGaName":2767,"dataGaLocation":2457},"/ai-transparency-center/","ai transparency center",{"text":2769,"config":2770},"Newsletter",{"href":2771,"dataGaName":2772,"dataGaLocation":2457},"/company/contact/#contact-forms","newsletter",{"text":2774,"config":2775},"Press",{"href":2776,"dataGaName":2777,"dataGaLocation":2457},"/press/","press",{"text":2779,"config":2780,"menu":2781},"Contact us",{"dataNavLevelOne":2725},{"type":2508,"columns":2782},[2783],{"items":2784},[2785,2790,2795],{"text":2786,"config":2787},"Talk to sales",{"href":2788,"dataGaName":2789,"dataGaLocation":2457},"/sales/","talk to sales",{"text":2791,"config":2792},"Support portal",{"href":2793,"dataGaName":2794,"dataGaLocation":2457},"https://support.gitlab.com/hc/en-us","support portal",{"text":2796,"config":2797},"Customer portal",{"href":2798,"dataGaName":2799,"dataGaLocation":2457},"https://customers.gitlab.com/customers/sign_in/","customer portal",{"close":2801,"login":2802,"suggestions":2809},"Close",{"text":2803,"link":2804},"To search repositories and projects, login to",{"text":2805,"config":2806},"gitlab.com",{"href":2471,"dataGaName":2807,"dataGaLocation":2808},"search login","search",{"text":2810,"default":2811},"Suggestions",[2812,2814,2818,2820,2824,2828],{"text":2488,"config":2813},{"href":2493,"dataGaName":2488,"dataGaLocation":2808},{"text":2815,"config":2816},"Code Suggestions (AI)",{"href":2817,"dataGaName":2815,"dataGaLocation":2808},"/solutions/code-suggestions/",{"text":2524,"config":2819},{"href":2526,"dataGaName":2524,"dataGaLocation":2808},{"text":2821,"config":2822},"GitLab on AWS",{"href":2823,"dataGaName":2821,"dataGaLocation":2808},"/partners/technology-partners/aws/",{"text":2825,"config":2826},"GitLab on Google Cloud",{"href":2827,"dataGaName":2825,"dataGaLocation":2808},"/partners/technology-partners/google-cloud-platform/",{"text":2829,"config":2830},"Why GitLab?",{"href":2501,"dataGaName":2829,"dataGaLocation":2808},{"freeTrial":2832,"mobileIcon":2837,"desktopIcon":2842,"secondaryButton":2845},{"text":2833,"config":2834},"Start free trial",{"href":2835,"dataGaName":2462,"dataGaLocation":2836},"https://gitlab.com/-/trials/new/","nav",{"altText":2838,"config":2839},"Gitlab Icon",{"src":2840,"dataGaName":2841,"dataGaLocation":2836},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203874/jypbw1jx72aexsoohd7x.svg","gitlab icon",{"altText":2838,"config":2843},{"src":2844,"dataGaName":2841,"dataGaLocation":2836},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203875/gs4c8p8opsgvflgkswz9.svg",{"text":2846,"config":2847},"Get Started",{"href":2848,"dataGaName":2849,"dataGaLocation":2836},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com/get-started/","get started",{"freeTrial":2851,"mobileIcon":2855,"desktopIcon":2857},{"text":2852,"config":2853},"Learn more about GitLab Duo",{"href":2493,"dataGaName":2854,"dataGaLocation":2836},"gitlab duo",{"altText":2838,"config":2856},{"src":2840,"dataGaName":2841,"dataGaLocation":2836},{"altText":2838,"config":2858},{"src":2844,"dataGaName":2841,"dataGaLocation":2836},{"button":2860,"mobileIcon":2865,"desktopIcon":2867},{"text":2861,"config":2862},"/switch",{"href":2863,"dataGaName":2864,"dataGaLocation":2836},"#contact","switch",{"altText":2838,"config":2866},{"src":2840,"dataGaName":2841,"dataGaLocation":2836},{"altText":2838,"config":2868},{"src":2869,"dataGaName":2841,"dataGaLocation":2836},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1773335277/ohhpiuoxoldryzrnhfrh.png",{"freeTrial":2871,"mobileIcon":2876,"desktopIcon":2878},{"text":2872,"config":2873},"Back to pricing",{"href":2606,"dataGaName":2874,"dataGaLocation":2836,"icon":2875},"back to pricing","GoBack",{"altText":2838,"config":2877},{"src":2840,"dataGaName":2841,"dataGaLocation":2836},{"altText":2838,"config":2879},{"src":2844,"dataGaName":2841,"dataGaLocation":2836},{"title":2881,"titleMobile":2882,"button":2883,"config":2888},"Duo Agent Platform delivers 400% ROI, per new Forrester Consulting study.","400% ROI: Forrester TEI for GitLab Duo",{"text":2499,"config":2884},{"href":2885,"dataGaName":2886,"dataGaLocation":2887},"https://about.gitlab.com/blog/gitlab-duo-agent-platform-delivers-400-percent-roi/","forrester-tei-dap-banner","global-banner",{"layout":2889,"disabled":2437},"release",{"data":2891},{"text":2892,"source":2893,"edit":2899,"contribute":2904,"config":2909,"items":2914,"minimal":3123},"Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license",{"text":2894,"config":2895},"View page source",{"href":2896,"dataGaName":2897,"dataGaLocation":2898},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/","page source","footer",{"text":2900,"config":2901},"Edit this page",{"href":2902,"dataGaName":2903,"dataGaLocation":2898},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/content/","web ide",{"text":2905,"config":2906},"Please contribute",{"href":2907,"dataGaName":2908,"dataGaLocation":2898},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/CONTRIBUTING.md/","please contribute",{"twitter":2910,"facebook":2911,"youtube":2912,"linkedin":2913},"https://twitter.com/gitlab","https://www.facebook.com/gitlab","https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg","https://www.linkedin.com/company/gitlab-com",[2915,2962,3015,3059,3091],{"title":2604,"links":2916,"subMenu":2931},[2917,2921,2926],{"text":2918,"config":2919},"View plans",{"href":2606,"dataGaName":2920,"dataGaLocation":2898},"view plans",{"text":2922,"config":2923},"Why Premium?",{"href":2924,"dataGaName":2925,"dataGaLocation":2898},"/pricing/premium/","why premium",{"text":2927,"config":2928},"Why Ultimate?",{"href":2929,"dataGaName":2930,"dataGaLocation":2898},"/pricing/ultimate/","why ultimate",[2932],{"title":2933,"links":2934},"Contact Us",[2935,2938,2940,2942,2947,2952,2957],{"text":2936,"config":2937},"Contact sales",{"href":2788,"dataGaName":2467,"dataGaLocation":2898},{"text":2791,"config":2939},{"href":2793,"dataGaName":2794,"dataGaLocation":2898},{"text":2796,"config":2941},{"href":2798,"dataGaName":2799,"dataGaLocation":2898},{"text":2943,"config":2944},"Status",{"href":2945,"dataGaName":2946,"dataGaLocation":2898},"https://status.gitlab.com/","status",{"text":2948,"config":2949},"Terms of use",{"href":2950,"dataGaName":2951,"dataGaLocation":2898},"/terms/","terms of use",{"text":2953,"config":2954},"Privacy statement",{"href":2955,"dataGaName":2956,"dataGaLocation":2898},"/privacy/","privacy statement",{"text":2958,"config":2959},"Cookie preferences",{"dataGaName":2960,"dataGaLocation":2898,"id":2961,"isOneTrustButton":212},"cookie preferences","ot-sdk-btn",{"title":2504,"links":2963,"subMenu":2972},[2964,2968],{"text":2965,"config":2966},"DevSecOps platform",{"href":2486,"dataGaName":2967,"dataGaLocation":2898},"devsecops platform",{"text":2969,"config":2970},"AI-Assisted Development",{"href":2493,"dataGaName":2971,"dataGaLocation":2898},"ai-assisted development",[2973],{"title":2974,"links":2975},"Topics",[2976,2981,2985,2990,2995,3000,3005,3010],{"text":2977,"config":2978},"CICD",{"href":2979,"dataGaName":2980,"dataGaLocation":2898},"/topics/ci-cd/","cicd",{"text":2448,"config":2982},{"href":2983,"dataGaName":2984,"dataGaLocation":2898},"/topics/gitops/","gitops",{"text":2986,"config":2987},"DevOps",{"href":2988,"dataGaName":2989,"dataGaLocation":2898},"/topics/devops/","devops",{"text":2991,"config":2992},"Version Control",{"href":2993,"dataGaName":2994,"dataGaLocation":2898},"/topics/version-control/","version control",{"text":2996,"config":2997},"DevSecOps",{"href":2998,"dataGaName":2999,"dataGaLocation":2898},"/topics/devsecops/","devsecops",{"text":3001,"config":3002},"Cloud Native",{"href":3003,"dataGaName":3004,"dataGaLocation":2898},"/topics/cloud-native/","cloud native",{"text":3006,"config":3007},"AI for Coding",{"href":3008,"dataGaName":3009,"dataGaLocation":2898},"/topics/devops/ai-for-coding/","ai for coding",{"text":3011,"config":3012},"Agentic AI",{"href":3013,"dataGaName":3014,"dataGaLocation":2898},"/topics/agentic-ai/","agentic ai",{"title":3016,"links":3017},"Solutions",[3018,3020,3022,3027,3031,3034,3038,3041,3043,3046,3049,3054],{"text":2548,"config":3019},{"href":2543,"dataGaName":2548,"dataGaLocation":2898},{"text":2537,"config":3021},{"href":2520,"dataGaName":2521,"dataGaLocation":2898},{"text":3023,"config":3024},"Agile development",{"href":3025,"dataGaName":3026,"dataGaLocation":2898},"/solutions/agile-delivery/","agile delivery",{"text":3028,"config":3029},"SCM",{"href":2533,"dataGaName":3030,"dataGaLocation":2898},"source code management",{"text":2977,"config":3032},{"href":2526,"dataGaName":3033,"dataGaLocation":2898},"continuous integration & delivery",{"text":3035,"config":3036},"Value stream management",{"href":2576,"dataGaName":3037,"dataGaLocation":2898},"value stream management",{"text":2448,"config":3039},{"href":3040,"dataGaName":2984,"dataGaLocation":2898},"/solutions/gitops/",{"text":2586,"config":3042},{"href":2589,"dataGaName":2590,"dataGaLocation":2898},{"text":3044,"config":3045},"Small business",{"href":2595,"dataGaName":2596,"dataGaLocation":2898},{"text":3047,"config":3048},"Public sector",{"href":2601,"dataGaName":2602,"dataGaLocation":2898},{"text":3050,"config":3051},"Education",{"href":3052,"dataGaName":3053,"dataGaLocation":2898},"/solutions/education/","education",{"text":3055,"config":3056},"Financial services",{"href":3057,"dataGaName":3058,"dataGaLocation":2898},"/solutions/finance/","financial services",{"title":2609,"links":3060},[3061,3063,3065,3067,3070,3072,3075,3077,3079,3081,3083,3085,3087,3089],{"text":2622,"config":3062},{"href":2624,"dataGaName":2625,"dataGaLocation":2898},{"text":2627,"config":3064},{"href":2629,"dataGaName":2630,"dataGaLocation":2898},{"text":2632,"config":3066},{"href":2634,"dataGaName":2635,"dataGaLocation":2898},{"text":2637,"config":3068},{"href":2639,"dataGaName":3069,"dataGaLocation":2898},"docs",{"text":2660,"config":3071},{"href":2662,"dataGaName":2663,"dataGaLocation":2898},{"text":3073,"config":3074},"What's new",{"href":2720,"dataGaName":2721,"dataGaLocation":2898},{"text":2655,"config":3076},{"href":2657,"dataGaName":2658,"dataGaLocation":2898},{"text":2674,"config":3078},{"href":2676,"dataGaName":2677,"dataGaLocation":2898},{"text":2682,"config":3080},{"href":2684,"dataGaName":2685,"dataGaLocation":2898},{"text":2687,"config":3082},{"href":2689,"dataGaName":2690,"dataGaLocation":2898},{"text":2692,"config":3084},{"href":2694,"dataGaName":2695,"dataGaLocation":2898},{"text":2697,"config":3086},{"href":2699,"dataGaName":2700,"dataGaLocation":2898},{"text":2702,"config":3088},{"href":2704,"dataGaName":2705,"dataGaLocation":2898},{"text":2707,"config":3090},{"href":2709,"dataGaName":2710,"dataGaLocation":2898},{"title":2723,"links":3092},[3093,3095,3097,3099,3101,3103,3107,3112,3114,3116,3118],{"text":2731,"config":3094},{"href":2733,"dataGaName":2725,"dataGaLocation":2898},{"text":2736,"config":3096},{"href":2738,"dataGaName":2739,"dataGaLocation":2898},{"text":2744,"config":3098},{"href":2746,"dataGaName":2747,"dataGaLocation":2898},{"text":2749,"config":3100},{"href":2751,"dataGaName":2752,"dataGaLocation":2898},{"text":2754,"config":3102},{"href":2756,"dataGaName":2757,"dataGaLocation":2898},{"text":3104,"config":3105},"Sustainability",{"href":3106,"dataGaName":3104,"dataGaLocation":2898},"/sustainability/",{"text":3108,"config":3109},"Diversity, inclusion and belonging (DIB)",{"href":3110,"dataGaName":3111,"dataGaLocation":2898},"/diversity-inclusion-belonging/","Diversity, inclusion and belonging",{"text":2759,"config":3113},{"href":2761,"dataGaName":2762,"dataGaLocation":2898},{"text":2769,"config":3115},{"href":2771,"dataGaName":2772,"dataGaLocation":2898},{"text":2774,"config":3117},{"href":2776,"dataGaName":2777,"dataGaLocation":2898},{"text":3119,"config":3120},"Modern Slavery Transparency Statement",{"href":3121,"dataGaName":3122,"dataGaLocation":2898},"https://handbook.gitlab.com/handbook/legal/modern-slavery-act-transparency-statement/","modern slavery transparency statement",{"items":3124},[3125,3128,3131],{"text":3126,"config":3127},"Terms",{"href":2950,"dataGaName":2951,"dataGaLocation":2898},{"text":3129,"config":3130},"Cookies",{"dataGaName":2960,"dataGaLocation":2898,"id":2961,"isOneTrustButton":212},{"text":3132,"config":3133},"Privacy",{"href":2955,"dataGaName":2956,"dataGaLocation":2898},[3135],{"id":3136,"title":7,"body":2436,"config":3137,"content":3139,"description":2436,"extension":3143,"meta":3144,"navigation":212,"path":3145,"seo":3146,"stem":3147,"__hash__":3148},"blogAuthors/en-us/blog/authors/viktor-nagy.yml",{"template":3138},"BlogAuthor",{"name":7,"config":3140},{"headshot":3141,"ctfId":3142},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749662918/Blog/Author%20Headshots/nagy-headshot.jpg","nagyvgitlab","yml",{},"/en-us/blog/authors/viktor-nagy",{},"en-us/blog/authors/viktor-nagy","rM3QZ5iaPa1fk9rDH9Dq-owlsuuFm699I03jWP1dUY4",[3150,3159,3167],{"title":3151,"description":3152,"heroImage":3153,"category":2432,"date":3154,"authors":3155,"slug":3158,"externalUrl":2436},"Confidential AI for GitLab Self-Hosted","Give developers AI coding agents in GitLab Duo without source code leaving a hardware-encrypted boundary — no GPUs needed.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1773866173/vte9qh8rriznvyclhkes.png","2026-08-06",[3156,3157],"Mathias Ewald","Martin Paloncy, Edgeless Systems","confidential-ai-for-gitlab-self-hosted",{"title":3160,"description":3161,"heroImage":3162,"category":2432,"date":3163,"authors":3164,"slug":3166,"externalUrl":2436},"Green DevOps: Why carbon measurement belongs in your CI/CD pipeline","CI/CD pipelines have a hidden carbon cost. Here's why measuring it matters, and how you can get started with Eco CI and Carmen in GitLab.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1765809212/noh0mdfn9o94ry9ykura.png","2026-07-09",[3165],"Lysanne Pinto","green-devops-carbon-measurement-cicd-pipeline",{"title":3168,"description":3169,"heroImage":3170,"category":2432,"date":3171,"authors":3172,"slug":3174,"externalUrl":2436},"How to build CI/CD observability at scale","This practical guide to GitLab pipeline analytics helps self-managed users gain operational insights using Prometheus and Grafana.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1774465167/n5hlvrsrheadeccyr1oz.png","2026-04-28",[3173],"Paul Meresanu","how-to-build-ci-cd-observability-at-scale",{"promotions":3176},[3177,3191,3203,3215],{"id":3178,"categories":3179,"header":3181,"text":3182,"button":3183,"image":3188},"ai-modernization",[3180],"ai","Is AI achieving its promise at scale?","Quiz will take 5 minutes or less",{"text":3184,"config":3185},"Get your AI maturity score",{"href":3186,"dataGaName":3187,"dataGaLocation":2663},"/assessments/ai-modernization-assessment/","modernization assessment",{"config":3189},{"src":3190},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138786/qix0m7kwnd8x2fh1zq49.png",{"id":3192,"categories":3193,"header":3195,"text":3182,"button":3196,"image":3200},"devops-modernization",[3194,2999],"product","Are you just managing tools or shipping innovation?",{"text":3197,"config":3198},"Get your DevOps maturity score",{"href":3199,"dataGaName":3187,"dataGaLocation":2663},"/assessments/devops-modernization-assessment/",{"config":3201},{"src":3202},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138785/eg818fmakweyuznttgid.png",{"id":3204,"categories":3205,"header":3207,"text":3182,"button":3208,"image":3212},"security-modernization",[3206],"security","Are you trading speed for security?",{"text":3209,"config":3210},"Get your security maturity score",{"href":3211,"dataGaName":3187,"dataGaLocation":2663},"/assessments/security-modernization-assessment/",{"config":3213},{"src":3214},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138786/p4pbqd9nnjejg5ds6mdk.png",{"id":3216,"paths":3217,"header":3220,"text":3221,"button":3222,"image":3227},"github-azure-migration",[3218,3219],"migration-from-azure-devops-to-gitlab","integrating-azure-devops-scm-and-gitlab","Is your team ready for GitHub's Azure move?","GitHub is already rebuilding around Azure. Find out what it means for you.",{"text":3223,"config":3224},"See how GitLab compares to GitHub",{"href":3225,"dataGaName":3226,"dataGaLocation":2663},"/compare/gitlab-vs-github/github-azure-migration/","github azure migration",{"config":3228},{"src":3202},{"header":3230,"blurb":3231,"button":3232,"secondaryButton":3237},"Start building faster today","See what your team can do with the intelligent orchestration platform for DevSecOps.\n",{"text":3233,"config":3234},"Get your free trial",{"href":3235,"dataGaName":2462,"dataGaLocation":3236},"https://gitlab.com/-/trial_registrations/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/","feature",{"text":2936,"config":3238},{"href":2788,"dataGaName":2467,"dataGaLocation":3236},1786803734216]