[{"data":1,"prerenderedAt":2041},["ShallowReactive",2],{"/blog/managing-multiple-environments-with-terraform-and-gitlab-ci":3,"navigation-en-us":1278,"banner-en-us":1715,"footer-en-us":1723,"blog-post-authors-en-us-Sophia Manicor|Noah Ing":1969,"blog-related-posts-en-us-managing-multiple-environments-with-terraform-and-gitlab-ci":1996,"blog-share-wrapper-en-us":2021,"next-steps-en-us":2031},{"id":4,"title":5,"authors":6,"body":9,"category":1257,"date":1258,"description":1259,"extension":1260,"externalUrl":1261,"faq":1261,"featured":1262,"heroImage":1263,"hidePromo":1262,"meta":1264,"navigation":125,"path":1265,"seo":1266,"slug":1270,"stem":1271,"tags":1272,"template":1276,"updatedDate":1261,"__hash__":1277},"blogPosts/en-us/blog/managing-multiple-environments-with-terraform-and-gitlab-ci.md","Managing multiple environments with Terraform and GitLab CI",[7,8],"Sophia Manicor","Noah Ing",{"type":10,"value":11,"toc":1245},"minimark",[12,21,26,42,46,49,60,64,67,71,76,79,87,548,552,560,1041,1045,1052,1063,1196,1200,1203,1230,1234,1241],[13,14,15,16,20],"p",{},"Using multiple environments ensures that your infrastructure as code (IaC) is rigorously tested before it is deployed. This tutorial will show a setup of how to manage ",[17,18,19],"strong",{},"three different environments in one project"," using GitLab CI and Terraform.",[22,23,25],"h2",{"id":24},"prerequisites","Prerequisites",[27,28,29,33,36,39],"ul",{},[30,31,32],"li",{},"Working knowledge of GitLab CI/CD",[30,34,35],{},"An AWS / GCP account (where you will deploy to)",[30,37,38],{},"Working knowledge of Terraform",[30,40,41],{},"5 minutes",[22,43,45],{"id":44},"multiple-environments","Multiple environments",[13,47,48],{},"In this tutorial, we have three environments set up: dev, staging, and production.",[27,50,51,54,57],{},[30,52,53],{},"Dev: This should be where all the experimental changes go. This environment is intended to develop new features and/or test out new changes.",[30,55,56],{},"Staging: After you have confirmed your changes in dev, this environment should have parity with the production environment.",[30,58,59],{},"Production: This environment has the latest versions of infrastructure and applications are live.",[22,61,63],{"id":62},"file-structure","File structure",[13,65,66],{},"For each environment we set up a corresponding folder at the root level: folders are named dev, staging, and production respectively. Each folder stores all the Terraform infrastructure configuration for the corresponding environment. Within each of these folders, we created a CI file for that environment.",[22,68,70],{"id":69},"gitlab-ciyml",".gitlab-ci.yml",[72,73,75],"h3",{"id":74},"environment-specific-gitlab-ciyml","Environment-specific .gitlab-ci.yml",[13,77,78],{},"The file below is for the dev environment and is in the dev folder. Note that there is a rule with each job that only allows the jobs to run when a file in the dev folder is changed. There is a corresponding file in the staging and production folders that has the same rules to only allow jobs when those specific folders are changed. To keep each CI file running the same jobs we have made use of a helper file.",[13,80,81],{},[82,83,86],"a",{"href":84,"rel":85},"https://gitlab.com/demos/infrastructure/terraform-multi-env/-/blob/main/dev/.gitlab-ci.yml",[],"Environment-specific GitLab CI",[88,89,94],"pre",{"className":90,"code":91,"language":92,"meta":93,"style":93},"language-yaml shiki shiki-themes github-light","include:\n  - 'helper.yml'\n\nvariables:\n  TF_ROOT: ./dev  # The relative path to the root directory of the Terraform project\n  TF_STATE_NAME: default      # The name of the state file used by the GitLab-managed Terraform state backend\n  SECURE_ANALYZERS_PREFIX: \"$CI_TEMPLATE_REGISTRY_HOST/security-products\"\n  SAST_IMAGE_SUFFIX: \"\"\n  SAST_EXCLUDED_PATHS: \"spec, test, tests, tmp\"\n  PLAN: plan.cache\n  PLAN_JSON: plan.json\n\n\ncache:\n  key: \"${TF_ROOT}\"\n  paths:\n    - ${TF_ROOT}/.terraform/\n\nfmt-dev:\n  extends: .fmt\n  rules:\n      - changes:\n          - dev/**/*\n\nvalidate-dev:\n  extends: .validate\n  rules:\n      - changes:\n          - dev/**/*\n\nbuild-dev:\n  extends: .build\n  rules:\n      - changes:\n          - dev/**/*\n\nkics-iac-sast-dev:\n  extends: .kics-iac-sast\n  rules:\n      - changes:\n          - dev/**/*\n\ndeploy-dev:\n  extends: .deploy\n  rules:\n      - changes:\n          - dev/**/*\n\ndestroy-dev:\n  extends: .destroy\n  rules:\n      - changes:\n          - dev/**/*\n\n","yaml","",[95,96,97,110,120,127,135,151,165,176,187,198,209,220,225,230,238,249,257,266,271,279,290,298,309,318,323,331,341,348,357,364,369,377,387,394,403,410,415,423,433,440,449,456,461,469,479,486,495,502,507,515,525,532,541],"code",{"__ignoreMap":93},[98,99,102,106],"span",{"class":100,"line":101},"line",1,[98,103,105],{"class":104},"shJU0","include",[98,107,109],{"class":108},"sgsFI",":\n",[98,111,113,116],{"class":100,"line":112},2,[98,114,115],{"class":108},"  - ",[98,117,119],{"class":118},"sYBdl","'helper.yml'\n",[98,121,123],{"class":100,"line":122},3,[98,124,126],{"emptyLinePlaceholder":125},true,"\n",[98,128,130,133],{"class":100,"line":129},4,[98,131,132],{"class":104},"variables",[98,134,109],{"class":108},[98,136,138,141,144,147],{"class":100,"line":137},5,[98,139,140],{"class":104},"  TF_ROOT",[98,142,143],{"class":108},": ",[98,145,146],{"class":118},"./dev",[98,148,150],{"class":149},"sAwPA","  # The relative path to the root directory of the Terraform project\n",[98,152,154,157,159,162],{"class":100,"line":153},6,[98,155,156],{"class":104},"  TF_STATE_NAME",[98,158,143],{"class":108},[98,160,161],{"class":118},"default",[98,163,164],{"class":149},"      # The name of the state file used by the GitLab-managed Terraform state backend\n",[98,166,168,171,173],{"class":100,"line":167},7,[98,169,170],{"class":104},"  SECURE_ANALYZERS_PREFIX",[98,172,143],{"class":108},[98,174,175],{"class":118},"\"$CI_TEMPLATE_REGISTRY_HOST/security-products\"\n",[98,177,179,182,184],{"class":100,"line":178},8,[98,180,181],{"class":104},"  SAST_IMAGE_SUFFIX",[98,183,143],{"class":108},[98,185,186],{"class":118},"\"\"\n",[98,188,190,193,195],{"class":100,"line":189},9,[98,191,192],{"class":104},"  SAST_EXCLUDED_PATHS",[98,194,143],{"class":108},[98,196,197],{"class":118},"\"spec, test, tests, tmp\"\n",[98,199,201,204,206],{"class":100,"line":200},10,[98,202,203],{"class":104},"  PLAN",[98,205,143],{"class":108},[98,207,208],{"class":118},"plan.cache\n",[98,210,212,215,217],{"class":100,"line":211},11,[98,213,214],{"class":104},"  PLAN_JSON",[98,216,143],{"class":108},[98,218,219],{"class":118},"plan.json\n",[98,221,223],{"class":100,"line":222},12,[98,224,126],{"emptyLinePlaceholder":125},[98,226,228],{"class":100,"line":227},13,[98,229,126],{"emptyLinePlaceholder":125},[98,231,233,236],{"class":100,"line":232},14,[98,234,235],{"class":104},"cache",[98,237,109],{"class":108},[98,239,241,244,246],{"class":100,"line":240},15,[98,242,243],{"class":104},"  key",[98,245,143],{"class":108},[98,247,248],{"class":118},"\"${TF_ROOT}\"\n",[98,250,252,255],{"class":100,"line":251},16,[98,253,254],{"class":104},"  paths",[98,256,109],{"class":108},[98,258,260,263],{"class":100,"line":259},17,[98,261,262],{"class":108},"    - ",[98,264,265],{"class":118},"${TF_ROOT}/.terraform/\n",[98,267,269],{"class":100,"line":268},18,[98,270,126],{"emptyLinePlaceholder":125},[98,272,274,277],{"class":100,"line":273},19,[98,275,276],{"class":104},"fmt-dev",[98,278,109],{"class":108},[98,280,282,285,287],{"class":100,"line":281},20,[98,283,284],{"class":104},"  extends",[98,286,143],{"class":108},[98,288,289],{"class":118},".fmt\n",[98,291,293,296],{"class":100,"line":292},21,[98,294,295],{"class":104},"  rules",[98,297,109],{"class":108},[98,299,301,304,307],{"class":100,"line":300},22,[98,302,303],{"class":108},"      - ",[98,305,306],{"class":104},"changes",[98,308,109],{"class":108},[98,310,312,315],{"class":100,"line":311},23,[98,313,314],{"class":108},"          - ",[98,316,317],{"class":118},"dev/**/*\n",[98,319,321],{"class":100,"line":320},24,[98,322,126],{"emptyLinePlaceholder":125},[98,324,326,329],{"class":100,"line":325},25,[98,327,328],{"class":104},"validate-dev",[98,330,109],{"class":108},[98,332,334,336,338],{"class":100,"line":333},26,[98,335,284],{"class":104},[98,337,143],{"class":108},[98,339,340],{"class":118},".validate\n",[98,342,344,346],{"class":100,"line":343},27,[98,345,295],{"class":104},[98,347,109],{"class":108},[98,349,351,353,355],{"class":100,"line":350},28,[98,352,303],{"class":108},[98,354,306],{"class":104},[98,356,109],{"class":108},[98,358,360,362],{"class":100,"line":359},29,[98,361,314],{"class":108},[98,363,317],{"class":118},[98,365,367],{"class":100,"line":366},30,[98,368,126],{"emptyLinePlaceholder":125},[98,370,372,375],{"class":100,"line":371},31,[98,373,374],{"class":104},"build-dev",[98,376,109],{"class":108},[98,378,380,382,384],{"class":100,"line":379},32,[98,381,284],{"class":104},[98,383,143],{"class":108},[98,385,386],{"class":118},".build\n",[98,388,390,392],{"class":100,"line":389},33,[98,391,295],{"class":104},[98,393,109],{"class":108},[98,395,397,399,401],{"class":100,"line":396},34,[98,398,303],{"class":108},[98,400,306],{"class":104},[98,402,109],{"class":108},[98,404,406,408],{"class":100,"line":405},35,[98,407,314],{"class":108},[98,409,317],{"class":118},[98,411,413],{"class":100,"line":412},36,[98,414,126],{"emptyLinePlaceholder":125},[98,416,418,421],{"class":100,"line":417},37,[98,419,420],{"class":104},"kics-iac-sast-dev",[98,422,109],{"class":108},[98,424,426,428,430],{"class":100,"line":425},38,[98,427,284],{"class":104},[98,429,143],{"class":108},[98,431,432],{"class":118},".kics-iac-sast\n",[98,434,436,438],{"class":100,"line":435},39,[98,437,295],{"class":104},[98,439,109],{"class":108},[98,441,443,445,447],{"class":100,"line":442},40,[98,444,303],{"class":108},[98,446,306],{"class":104},[98,448,109],{"class":108},[98,450,452,454],{"class":100,"line":451},41,[98,453,314],{"class":108},[98,455,317],{"class":118},[98,457,459],{"class":100,"line":458},42,[98,460,126],{"emptyLinePlaceholder":125},[98,462,464,467],{"class":100,"line":463},43,[98,465,466],{"class":104},"deploy-dev",[98,468,109],{"class":108},[98,470,472,474,476],{"class":100,"line":471},44,[98,473,284],{"class":104},[98,475,143],{"class":108},[98,477,478],{"class":118},".deploy\n",[98,480,482,484],{"class":100,"line":481},45,[98,483,295],{"class":104},[98,485,109],{"class":108},[98,487,489,491,493],{"class":100,"line":488},46,[98,490,303],{"class":108},[98,492,306],{"class":104},[98,494,109],{"class":108},[98,496,498,500],{"class":100,"line":497},47,[98,499,314],{"class":108},[98,501,317],{"class":118},[98,503,505],{"class":100,"line":504},48,[98,506,126],{"emptyLinePlaceholder":125},[98,508,510,513],{"class":100,"line":509},49,[98,511,512],{"class":104},"destroy-dev",[98,514,109],{"class":108},[98,516,518,520,522],{"class":100,"line":517},50,[98,519,284],{"class":104},[98,521,143],{"class":108},[98,523,524],{"class":118},".destroy\n",[98,526,528,530],{"class":100,"line":527},51,[98,529,295],{"class":104},[98,531,109],{"class":108},[98,533,535,537,539],{"class":100,"line":534},52,[98,536,303],{"class":108},[98,538,306],{"class":104},[98,540,109],{"class":108},[98,542,544,546],{"class":100,"line":543},53,[98,545,314],{"class":108},[98,547,317],{"class":118},[72,549,551],{"id":550},"helperyml","helper.yml",[13,553,554,555,559],{},"This helper file was created at the root level so that it could be referenced by all of the environment-specific files. The ",[82,556,551],{"href":557,"rel":558},"https://gitlab.com/demos/infrastructure/terraform-multi-env/-/blob/main/helper.yml",[]," is where all the heavy lifting is happening. This will make sure that all the jobs throughout the environment-specific file's configuration stays up to date and consistent. In the environment-specific files we 'included' the helper file and extended the jobs outlined below.",[88,561,563],{"className":90,"code":562,"language":92,"meta":93,"style":93},".fmt:\n  stage: validate\n  script:\n    - cd \"${TF_ROOT}\"\n    - gitlab-terraform fmt\n  allow_failure: true\n\n\n.validate:\n  stage: validate\n  script:\n    - cd \"${TF_ROOT}\"\n    - gitlab-terraform validate\n\n\n.build:\n  stage: build\n  before_script:\n    - apk --no-cache add jq\n    - alias convert_report=\"jq -r '([.resource_changes[]?.change.actions?]|flatten)|{\\\"create\\\":(map(select(.==\\\"create\\\"))|length),\\\"update\\\":(map(select(.==\\\"update\\\"))|length),\\\"delete\\\":(map(select(.==\\\"delete\\\"))|length)}'\"\n  script:\n    - cd \"${TF_ROOT}\"\n    - gitlab-terraform plan -out=$PLAN\n    - gitlab-terraform plan-json | convert_report > $PLAN_JSON\n  resource_group: ${TF_STATE_NAME}\n  artifacts:\n    paths:\n      - ${TF_ROOT}/plan.cache\n    reports:\n      terraform: ${TF_ROOT}/$PLAN_JSON\n\n.kics-iac-sast:\n  stage: test\n  artifacts:\n    reports:\n      sast: gl-sast-report.json\n  image:\n    name: \"$SAST_ANALYZER_IMAGE\"\n  variables:\n    SEARCH_MAX_DEPTH: 4\n    SAST_ANALYZER_IMAGE_TAG: 3\n    SAST_ANALYZER_IMAGE: \"$SECURE_ANALYZERS_PREFIX/kics:$SAST_ANALYZER_IMAGE_TAG$SAST_IMAGE_SUFFIX\"\n  allow_failure: true\n  script:\n    - /analyzer run\n\n\n.deploy:\n  stage: deploy\n  script:\n    - cd \"${TF_ROOT}\"\n    - gitlab-terraform apply\n  resource_group: ${TF_STATE_NAME}\n  when: manual\n  rules:\n      - changes:\n          - ${TF_ENVIRONMENT}/**/*\n\n.destroy:\n  stage: cleanup\n  script:\n    - cd \"${TF_ROOT}\"\n    - gitlab-terraform destroy\n  resource_group: ${TF_STATE_NAME}\n  when: manual\n\n",[95,564,565,572,582,589,596,603,614,618,622,629,637,643,649,656,660,664,671,680,687,694,701,707,713,720,727,737,744,751,758,765,775,779,786,795,801,807,817,824,834,841,851,861,871,879,885,892,896,900,907,916,922,928,935,943,954,961,970,978,983,991,1001,1008,1015,1023,1032],{"__ignoreMap":93},[98,566,567,570],{"class":100,"line":101},[98,568,569],{"class":104},".fmt",[98,571,109],{"class":108},[98,573,574,577,579],{"class":100,"line":112},[98,575,576],{"class":104},"  stage",[98,578,143],{"class":108},[98,580,581],{"class":118},"validate\n",[98,583,584,587],{"class":100,"line":122},[98,585,586],{"class":104},"  script",[98,588,109],{"class":108},[98,590,591,593],{"class":100,"line":129},[98,592,262],{"class":108},[98,594,595],{"class":118},"cd \"${TF_ROOT}\"\n",[98,597,598,600],{"class":100,"line":137},[98,599,262],{"class":108},[98,601,602],{"class":118},"gitlab-terraform fmt\n",[98,604,605,608,610],{"class":100,"line":153},[98,606,607],{"class":104},"  allow_failure",[98,609,143],{"class":108},[98,611,613],{"class":612},"sYu0t","true\n",[98,615,616],{"class":100,"line":167},[98,617,126],{"emptyLinePlaceholder":125},[98,619,620],{"class":100,"line":178},[98,621,126],{"emptyLinePlaceholder":125},[98,623,624,627],{"class":100,"line":189},[98,625,626],{"class":104},".validate",[98,628,109],{"class":108},[98,630,631,633,635],{"class":100,"line":200},[98,632,576],{"class":104},[98,634,143],{"class":108},[98,636,581],{"class":118},[98,638,639,641],{"class":100,"line":211},[98,640,586],{"class":104},[98,642,109],{"class":108},[98,644,645,647],{"class":100,"line":222},[98,646,262],{"class":108},[98,648,595],{"class":118},[98,650,651,653],{"class":100,"line":227},[98,652,262],{"class":108},[98,654,655],{"class":118},"gitlab-terraform validate\n",[98,657,658],{"class":100,"line":232},[98,659,126],{"emptyLinePlaceholder":125},[98,661,662],{"class":100,"line":240},[98,663,126],{"emptyLinePlaceholder":125},[98,665,666,669],{"class":100,"line":251},[98,667,668],{"class":104},".build",[98,670,109],{"class":108},[98,672,673,675,677],{"class":100,"line":259},[98,674,576],{"class":104},[98,676,143],{"class":108},[98,678,679],{"class":118},"build\n",[98,681,682,685],{"class":100,"line":268},[98,683,684],{"class":104},"  before_script",[98,686,109],{"class":108},[98,688,689,691],{"class":100,"line":273},[98,690,262],{"class":108},[98,692,693],{"class":118},"apk --no-cache add jq\n",[98,695,696,698],{"class":100,"line":281},[98,697,262],{"class":108},[98,699,700],{"class":118},"alias convert_report=\"jq -r '([.resource_changes[]?.change.actions?]|flatten)|{\\\"create\\\":(map(select(.==\\\"create\\\"))|length),\\\"update\\\":(map(select(.==\\\"update\\\"))|length),\\\"delete\\\":(map(select(.==\\\"delete\\\"))|length)}'\"\n",[98,702,703,705],{"class":100,"line":292},[98,704,586],{"class":104},[98,706,109],{"class":108},[98,708,709,711],{"class":100,"line":300},[98,710,262],{"class":108},[98,712,595],{"class":118},[98,714,715,717],{"class":100,"line":311},[98,716,262],{"class":108},[98,718,719],{"class":118},"gitlab-terraform plan -out=$PLAN\n",[98,721,722,724],{"class":100,"line":320},[98,723,262],{"class":108},[98,725,726],{"class":118},"gitlab-terraform plan-json | convert_report > $PLAN_JSON\n",[98,728,729,732,734],{"class":100,"line":325},[98,730,731],{"class":104},"  resource_group",[98,733,143],{"class":108},[98,735,736],{"class":118},"${TF_STATE_NAME}\n",[98,738,739,742],{"class":100,"line":333},[98,740,741],{"class":104},"  artifacts",[98,743,109],{"class":108},[98,745,746,749],{"class":100,"line":343},[98,747,748],{"class":104},"    paths",[98,750,109],{"class":108},[98,752,753,755],{"class":100,"line":350},[98,754,303],{"class":108},[98,756,757],{"class":118},"${TF_ROOT}/plan.cache\n",[98,759,760,763],{"class":100,"line":359},[98,761,762],{"class":104},"    reports",[98,764,109],{"class":108},[98,766,767,770,772],{"class":100,"line":366},[98,768,769],{"class":104},"      terraform",[98,771,143],{"class":108},[98,773,774],{"class":118},"${TF_ROOT}/$PLAN_JSON\n",[98,776,777],{"class":100,"line":371},[98,778,126],{"emptyLinePlaceholder":125},[98,780,781,784],{"class":100,"line":379},[98,782,783],{"class":104},".kics-iac-sast",[98,785,109],{"class":108},[98,787,788,790,792],{"class":100,"line":389},[98,789,576],{"class":104},[98,791,143],{"class":108},[98,793,794],{"class":118},"test\n",[98,796,797,799],{"class":100,"line":396},[98,798,741],{"class":104},[98,800,109],{"class":108},[98,802,803,805],{"class":100,"line":405},[98,804,762],{"class":104},[98,806,109],{"class":108},[98,808,809,812,814],{"class":100,"line":412},[98,810,811],{"class":104},"      sast",[98,813,143],{"class":108},[98,815,816],{"class":118},"gl-sast-report.json\n",[98,818,819,822],{"class":100,"line":417},[98,820,821],{"class":104},"  image",[98,823,109],{"class":108},[98,825,826,829,831],{"class":100,"line":425},[98,827,828],{"class":104},"    name",[98,830,143],{"class":108},[98,832,833],{"class":118},"\"$SAST_ANALYZER_IMAGE\"\n",[98,835,836,839],{"class":100,"line":435},[98,837,838],{"class":104},"  variables",[98,840,109],{"class":108},[98,842,843,846,848],{"class":100,"line":442},[98,844,845],{"class":104},"    SEARCH_MAX_DEPTH",[98,847,143],{"class":108},[98,849,850],{"class":612},"4\n",[98,852,853,856,858],{"class":100,"line":451},[98,854,855],{"class":104},"    SAST_ANALYZER_IMAGE_TAG",[98,857,143],{"class":108},[98,859,860],{"class":612},"3\n",[98,862,863,866,868],{"class":100,"line":458},[98,864,865],{"class":104},"    SAST_ANALYZER_IMAGE",[98,867,143],{"class":108},[98,869,870],{"class":118},"\"$SECURE_ANALYZERS_PREFIX/kics:$SAST_ANALYZER_IMAGE_TAG$SAST_IMAGE_SUFFIX\"\n",[98,872,873,875,877],{"class":100,"line":463},[98,874,607],{"class":104},[98,876,143],{"class":108},[98,878,613],{"class":612},[98,880,881,883],{"class":100,"line":471},[98,882,586],{"class":104},[98,884,109],{"class":108},[98,886,887,889],{"class":100,"line":481},[98,888,262],{"class":108},[98,890,891],{"class":118},"/analyzer run\n",[98,893,894],{"class":100,"line":488},[98,895,126],{"emptyLinePlaceholder":125},[98,897,898],{"class":100,"line":497},[98,899,126],{"emptyLinePlaceholder":125},[98,901,902,905],{"class":100,"line":504},[98,903,904],{"class":104},".deploy",[98,906,109],{"class":108},[98,908,909,911,913],{"class":100,"line":509},[98,910,576],{"class":104},[98,912,143],{"class":108},[98,914,915],{"class":118},"deploy\n",[98,917,918,920],{"class":100,"line":517},[98,919,586],{"class":104},[98,921,109],{"class":108},[98,923,924,926],{"class":100,"line":527},[98,925,262],{"class":108},[98,927,595],{"class":118},[98,929,930,932],{"class":100,"line":534},[98,931,262],{"class":108},[98,933,934],{"class":118},"gitlab-terraform apply\n",[98,936,937,939,941],{"class":100,"line":543},[98,938,731],{"class":104},[98,940,143],{"class":108},[98,942,736],{"class":118},[98,944,946,949,951],{"class":100,"line":945},54,[98,947,948],{"class":104},"  when",[98,950,143],{"class":108},[98,952,953],{"class":118},"manual\n",[98,955,957,959],{"class":100,"line":956},55,[98,958,295],{"class":104},[98,960,109],{"class":108},[98,962,964,966,968],{"class":100,"line":963},56,[98,965,303],{"class":108},[98,967,306],{"class":104},[98,969,109],{"class":108},[98,971,973,975],{"class":100,"line":972},57,[98,974,314],{"class":108},[98,976,977],{"class":118},"${TF_ENVIRONMENT}/**/*\n",[98,979,981],{"class":100,"line":980},58,[98,982,126],{"emptyLinePlaceholder":125},[98,984,986,989],{"class":100,"line":985},59,[98,987,988],{"class":104},".destroy",[98,990,109],{"class":108},[98,992,994,996,998],{"class":100,"line":993},60,[98,995,576],{"class":104},[98,997,143],{"class":108},[98,999,1000],{"class":118},"cleanup\n",[98,1002,1004,1006],{"class":100,"line":1003},61,[98,1005,586],{"class":104},[98,1007,109],{"class":108},[98,1009,1011,1013],{"class":100,"line":1010},62,[98,1012,262],{"class":108},[98,1014,595],{"class":118},[98,1016,1018,1020],{"class":100,"line":1017},63,[98,1019,262],{"class":108},[98,1021,1022],{"class":118},"gitlab-terraform destroy\n",[98,1024,1026,1028,1030],{"class":100,"line":1025},64,[98,1027,731],{"class":104},[98,1029,143],{"class":108},[98,1031,736],{"class":118},[98,1033,1035,1037,1039],{"class":100,"line":1034},65,[98,1036,948],{"class":104},[98,1038,143],{"class":108},[98,1040,953],{"class":118},[72,1042,1044],{"id":1043},"root-level-gitlab-ciyml","Root-level .gitlab-ci.yml",[13,1046,1047],{},[82,1048,1051],{"href":1049,"rel":1050},"https://gitlab.com/demos/infrastructure/terraform-multi-env/-/blob/main/.gitlab-ci.yml",[],"Root-level GitLab CI",[13,1053,1054,1055,1059,1060,1062],{},"The file that brings everything above together is the root-level CI file. This will be what the pipeline initially references when run. The ",[82,1056,1058],{"href":1049,"rel":1057},[],"root-level GitLab CI"," is where all of the stages and container images are defined. Note that they are inheriting ",[95,1061,70],{}," from each of the individual folders themselves.",[88,1064,1066],{"className":90,"code":1065,"language":92,"meta":93,"style":93},"include:\n  - 'dev/.gitlab-ci.yml'\n  - 'staging/.gitlab-ci.yml'\n  - 'production/.gitlab-ci.yml'\n\n  \nimage:\n  name: \"$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/releases/1.1:v0.43.0\"\n\nstages:          \n  - validate\n  - build\n  - test\n  - deploy\n  - cleanup\n\nvariables:\n  # If not using GitLab's HTTP backend, remove this line and specify TF_HTTP_* variables\n  TF_STATE_NAME: default\n  TF_CACHE_KEY: default\n\n",[95,1067,1068,1074,1081,1088,1095,1099,1104,1111,1121,1125,1133,1139,1145,1151,1157,1163,1167,1173,1178,1187],{"__ignoreMap":93},[98,1069,1070,1072],{"class":100,"line":101},[98,1071,105],{"class":104},[98,1073,109],{"class":108},[98,1075,1076,1078],{"class":100,"line":112},[98,1077,115],{"class":108},[98,1079,1080],{"class":118},"'dev/.gitlab-ci.yml'\n",[98,1082,1083,1085],{"class":100,"line":122},[98,1084,115],{"class":108},[98,1086,1087],{"class":118},"'staging/.gitlab-ci.yml'\n",[98,1089,1090,1092],{"class":100,"line":129},[98,1091,115],{"class":108},[98,1093,1094],{"class":118},"'production/.gitlab-ci.yml'\n",[98,1096,1097],{"class":100,"line":137},[98,1098,126],{"emptyLinePlaceholder":125},[98,1100,1101],{"class":100,"line":153},[98,1102,1103],{"class":108},"  \n",[98,1105,1106,1109],{"class":100,"line":167},[98,1107,1108],{"class":104},"image",[98,1110,109],{"class":108},[98,1112,1113,1116,1118],{"class":100,"line":178},[98,1114,1115],{"class":104},"  name",[98,1117,143],{"class":108},[98,1119,1120],{"class":118},"\"$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/releases/1.1:v0.43.0\"\n",[98,1122,1123],{"class":100,"line":189},[98,1124,126],{"emptyLinePlaceholder":125},[98,1126,1127,1130],{"class":100,"line":200},[98,1128,1129],{"class":104},"stages",[98,1131,1132],{"class":108},":          \n",[98,1134,1135,1137],{"class":100,"line":211},[98,1136,115],{"class":108},[98,1138,581],{"class":118},[98,1140,1141,1143],{"class":100,"line":222},[98,1142,115],{"class":108},[98,1144,679],{"class":118},[98,1146,1147,1149],{"class":100,"line":227},[98,1148,115],{"class":108},[98,1150,794],{"class":118},[98,1152,1153,1155],{"class":100,"line":232},[98,1154,115],{"class":108},[98,1156,915],{"class":118},[98,1158,1159,1161],{"class":100,"line":240},[98,1160,115],{"class":108},[98,1162,1000],{"class":118},[98,1164,1165],{"class":100,"line":251},[98,1166,126],{"emptyLinePlaceholder":125},[98,1168,1169,1171],{"class":100,"line":259},[98,1170,132],{"class":104},[98,1172,109],{"class":108},[98,1174,1175],{"class":100,"line":268},[98,1176,1177],{"class":149},"  # If not using GitLab's HTTP backend, remove this line and specify TF_HTTP_* variables\n",[98,1179,1180,1182,1184],{"class":100,"line":273},[98,1181,156],{"class":104},[98,1183,143],{"class":108},[98,1185,1186],{"class":118},"default\n",[98,1188,1189,1192,1194],{"class":100,"line":281},[98,1190,1191],{"class":104},"  TF_CACHE_KEY",[98,1193,143],{"class":108},[98,1195,1186],{"class":118},[22,1197,1199],{"id":1198},"merge-request-promotion-through-environments","Merge request + promotion through environments",[13,1201,1202],{},"With the project set up and GitLab CI’s triggering only based off changes to the individual environment folders, you can now safely promote changes using merge requests. When you want to make a change:",[1204,1205,1206,1209,1218,1221,1224,1227],"ol",{},[30,1207,1208],{},"First create a merge request in the dev environment with your *.tf files.",[30,1210,1211,1212,1217],{},"Review the ",[82,1213,1216],{"href":1214,"rel":1215},"https://docs.gitlab.com/user/infrastructure/iac/mr_integration/",[],"Terraform integration in merge requests"," to see X changes, X to Add, and X to Remove.",[30,1219,1220],{},"If your changes are as expected, request your team members to review the changes and Terraform code.",[30,1222,1223],{},"Apply the changes to your dev environment and merge in the merge request.",[30,1225,1226],{},"If everything worked as intended, then make the same merge up into the staging environment.",[30,1228,1229],{},"If the staging environment remains stable, make a merge request up into the production environment.",[22,1231,1233],{"id":1232},"results","Results",[13,1235,1236,1237,1240],{},"Voila, and there you have it! ",[17,1238,1239],{},"A single project to manage three different infrastructure environments"," in a safe way to ensure that your changes to production are tested, reviewed, and approved by the rest of your team members.",[1242,1243,1244],"style",{},"html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}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}",{"title":93,"searchDepth":112,"depth":112,"links":1246},[1247,1248,1249,1250,1255,1256],{"id":24,"depth":112,"text":25},{"id":44,"depth":112,"text":45},{"id":62,"depth":112,"text":63},{"id":69,"depth":112,"text":70,"children":1251},[1252,1253,1254],{"id":74,"depth":122,"text":75},{"id":550,"depth":122,"text":551},{"id":1043,"depth":122,"text":1044},{"id":1198,"depth":112,"text":1199},{"id":1232,"depth":112,"text":1233},"security","2023-06-14","This tutorial shows how to set up and manage three different environments in one project using GitLab CI and Terraform.","md",null,false,"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749663779/Blog/Hero%20Images/cicd-2018_blogimage.jpg",{},"/en-us/blog/managing-multiple-environments-with-terraform-and-gitlab-ci",{"title":5,"description":1259,"ogTitle":5,"ogDescription":1259,"noIndex":1262,"ogImage":1263,"ogUrl":1267,"ogSiteName":1268,"ogType":1269,"canonicalUrls":1267},"https://about.gitlab.com/blog/managing-multiple-environments-with-terraform-and-gitlab-ci","https://about.gitlab.com","article","managing-multiple-environments-with-terraform-and-gitlab-ci","en-us/blog/managing-multiple-environments-with-terraform-and-gitlab-ci",[1273,1274,1275,1257],"DevOps","CI","DevSecOps","BlogPost","6y5eLlJM4N18DUWOnmI3TvMNzOgzjF_KFlPvTU7boWw",{"logo":1279,"freeTrial":1284,"sales":1289,"login":1294,"items":1299,"search":1634,"minimal":1666,"duo":1685,"switchNav":1694,"pricingDeployment":1705},{"config":1280},{"href":1281,"dataGaName":1282,"dataGaLocation":1283},"/","gitlab logo","header",{"text":1285,"config":1286},"Get free trial",{"href":1287,"dataGaName":1288,"dataGaLocation":1283},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com&glm_content=default-saas-trial/","free trial",{"text":1290,"config":1291},"Request a demo",{"href":1292,"dataGaName":1293,"dataGaLocation":1283},"/request-a-demo/","sales",{"text":1295,"config":1296},"Sign in",{"href":1297,"dataGaName":1298,"dataGaLocation":1283},"https://gitlab.com/users/sign_in/","sign in",[1300,1385,1473,1478,1558,1612],{"text":1301,"left":125,"config":1302,"menu":1304},"Platform",{"dataNavLevelOne":1303},"platform",{"type":1305,"link":1306,"columns":1310,"feature":1374},"lists",{"text":1307,"config":1308},"Explore the Platform",{"href":1309,"dataGaName":1303,"dataGaLocation":1283},"/platform/",[1311,1333,1356],{"title":1273,"items":1312},[1313,1318,1323,1328],{"text":1314,"config":1315},"CI/CD",{"href":1316,"dataGaLocation":1283,"dataGaName":1317},"/solutions/continuous-integration/","ci/cd",{"text":1319,"config":1320},"Source Code Management",{"href":1321,"dataGaLocation":1283,"dataGaName":1322},"/solutions/source-code-management/","source code management",{"text":1324,"config":1325},"Agile Delivery",{"href":1326,"dataGaLocation":1283,"dataGaName":1327},"/solutions/agile-delivery/","agile delivery",{"text":1329,"config":1330},"Artifact Management",{"href":1331,"dataGaLocation":1283,"dataGaName":1332},"/artifact-central/","artifact management",{"title":1334,"items":1335},"Security & Governance",[1336,1341,1346,1351],{"text":1337,"config":1338},"Application Security Testing",{"href":1339,"dataGaLocation":1283,"dataGaName":1340},"/solutions/application-security-testing/","application security testing",{"text":1342,"config":1343},"Governance & Compliance",{"href":1344,"dataGaLocation":1283,"dataGaName":1345},"/solutions/software-compliance/","governance and compliance",{"text":1347,"config":1348},"Secrets Management",{"href":1349,"dataGaLocation":1283,"dataGaName":1350},"/gitlab-secrets-manager/","secrets management",{"text":1352,"config":1353},"Supply Chain Security",{"href":1354,"dataGaLocation":1283,"dataGaName":1355},"/solutions/supply-chain/","supply chain security",{"title":1357,"items":1358},"Agentic AI & Context",[1359,1364,1369],{"text":1360,"config":1361},"Duo Agent Platform",{"href":1362,"dataGaLocation":1283,"dataGaName":1363},"/gitlab-duo-agent-platform/","duo agent platform",{"text":1365,"config":1366},"Orbit Context Graph",{"href":1367,"dataGaLocation":1283,"dataGaName":1368},"/gitlab-orbit/","orbit",{"text":1370,"config":1371},"Visibility & Measurement",{"href":1372,"dataGaLocation":1283,"dataGaName":1373},"/solutions/visibility-measurement/","visibility and measurement",{"config":1375,"title":1378,"text":1379,"link":1380},{"background":1376,"textColor":1377},"url('https://res.cloudinary.com/about-gitlab-com/image/upload/v1790185102/o7dn32anqcb6z8dgd3as.jpg')","#000","GitLab Orbit is generally available","Higher agent accuracy, lower token cost",{"text":1381,"config":1382},"Read the announcement",{"href":1383,"dataGaName":1384,"dataGaLocation":1283},"/blog/gitlab-orbit-ga/","orbit ga announcement",{"text":1386,"left":125,"config":1387,"menu":1389},"Solutions",{"dataNavLevelOne":1388},"solutions",{"type":1305,"link":1390,"columns":1394,"feature":1464},{"text":1391,"config":1392},"View all Solutions",{"href":1393,"dataGaName":1388,"dataGaLocation":1283},"/solutions/",[1395,1413,1431],{"title":1396,"items":1397},"Outcomes",[1398,1403,1408],{"text":1399,"config":1400},"DevOps Modernization",{"href":1401,"dataGaLocation":1283,"dataGaName":1402},"/assessments/devops-modernization-assessment/","devops modernization",{"text":1404,"config":1405},"Security Modernization",{"href":1406,"dataGaLocation":1283,"dataGaName":1407},"/assessments/security-modernization-assessment/","security modernization",{"text":1409,"config":1410},"AI Modernization",{"href":1411,"dataGaLocation":1283,"dataGaName":1412},"/assessments/ai-modernization-assessment/","ai modernization",{"title":1414,"items":1415},"By size",[1416,1421,1426],{"text":1417,"config":1418},"Enterprise",{"href":1419,"dataGaLocation":1283,"dataGaName":1420},"/enterprise/","enterprise",{"text":1422,"config":1423},"Small Business",{"href":1424,"dataGaLocation":1283,"dataGaName":1425},"/small-business/","small business",{"text":1427,"config":1428},"Startups",{"href":1429,"dataGaLocation":1283,"dataGaName":1430},"/solutions/startups/","startups",{"title":1432,"items":1433},"Industries",[1434,1439,1444,1449,1454,1459],{"text":1435,"config":1436},"Financial Services",{"href":1437,"dataGaLocation":1283,"dataGaName":1438},"/solutions/finance/","financial services",{"text":1440,"config":1441},"Public Sector",{"href":1442,"dataGaLocation":1283,"dataGaName":1443},"/solutions/public-sector/","public sector",{"text":1445,"config":1446},"Telecommunications",{"href":1447,"dataGaLocation":1283,"dataGaName":1448},"/solutions/telecommunications/","telecommunications",{"text":1450,"config":1451},"Automotive",{"href":1452,"dataGaLocation":1283,"dataGaName":1453},"/solutions/automotive/","automotive",{"text":1455,"config":1456},"Education",{"href":1457,"dataGaLocation":1283,"dataGaName":1458},"/solutions/education/","education",{"text":1460,"config":1461},"Aerospace",{"href":1462,"dataGaLocation":1283,"dataGaName":1463},"/solutions/aerospace/","aerospace",{"config":1465,"title":1466,"text":1467,"link":1468},{"background":1376,"textColor":1377},"GitLab Security Standard","Learn how to harden your software factory and let AI agents earn autonomy, without trading away security.",{"text":1469,"config":1470},"Explore the standard",{"href":1471,"dataGaName":1472,"dataGaLocation":1283},"/gitlab-security-standard/","gitlab security standard",{"text":1474,"config":1475},"Pricing",{"href":1476,"dataGaName":1477,"dataGaLocation":1283,"dataNavLevelOne":1477},"/pricing/","pricing",{"text":1479,"config":1480,"menu":1482},"Resources",{"dataNavLevelOne":1481},"resources",{"type":1305,"link":1483,"columns":1487,"feature":1549},{"text":1484,"config":1485},"View all resources",{"href":1486,"dataGaName":1481,"dataGaLocation":1283},"/resources/",[1488,1521],{"title":1489,"items":1490},"Discover",[1491,1496,1501,1506,1511,1516],{"text":1492,"config":1493},"Docs",{"href":1494,"dataGaName":1495,"dataGaLocation":1283},"https://docs.gitlab.com/","docs",{"text":1497,"config":1498},"University",{"href":1499,"dataGaName":1500,"dataGaLocation":1283},"https://university.gitlab.com/","university",{"text":1502,"config":1503},"Demo Series",{"href":1504,"dataGaName":1505,"dataGaLocation":1283},"/gitlab-technical-demo-series/","demo series",{"text":1507,"config":1508},"Demo Hub",{"href":1509,"dataGaName":1510,"dataGaLocation":1283},"/demo-hub/","demo hub",{"text":1512,"config":1513},"Services",{"href":1514,"dataGaName":1515,"dataGaLocation":1283},"/services/","services",{"text":1517,"config":1518},"Well Architected",{"href":1519,"dataGaName":1520,"dataGaLocation":1283},"/resources/well-architected/","well architected",{"title":1522,"items":1523},"Connect",[1524,1529,1534,1539,1544],{"text":1525,"config":1526},"Blog",{"href":1527,"dataGaName":1528,"dataGaLocation":1283},"/blog/","blog",{"text":1530,"config":1531},"Community",{"href":1532,"dataGaName":1533,"dataGaLocation":1283},"/community/","community",{"text":1535,"config":1536},"Customers",{"href":1537,"dataGaName":1538,"dataGaLocation":1283},"/customers/","customers",{"text":1540,"config":1541},"Partners",{"href":1542,"dataGaName":1543,"dataGaLocation":1283},"/partners/","partners",{"text":1545,"config":1546},"Events",{"href":1547,"dataGaName":1548,"dataGaLocation":1283},"/events/","events",{"config":1550,"title":1551,"text":1552,"link":1553},{"background":1376,"textColor":1377},"What’s new in GitLab","Stay updated with our latest features and improvements.",{"text":1554,"config":1555},"Read the latest",{"href":1556,"dataGaName":1557,"dataGaLocation":1283},"/whats-new/","whats new",{"text":1559,"config":1560,"menu":1562},"Company",{"dataNavLevelOne":1561},"company",{"type":1305,"columns":1563},[1564],{"items":1565},[1566,1571,1577,1582,1587,1592,1597,1602,1607],{"text":1567,"config":1568},"About",{"href":1569,"dataGaName":1570,"dataGaLocation":1283},"/company/","about",{"text":1572,"config":1573,"footerGa":1576},"Jobs",{"href":1574,"dataGaName":1575,"dataGaLocation":1283},"/jobs/","jobs",{"dataGaName":1575},{"text":1578,"config":1579},"Press",{"href":1580,"dataGaName":1581,"dataGaLocation":1283},"/press/","press",{"text":1583,"config":1584},"Handbook",{"href":1585,"dataGaName":1586,"dataGaLocation":1283},"https://handbook.gitlab.com/","handbook",{"text":1588,"config":1589},"Leadership",{"href":1590,"dataGaName":1591,"dataGaLocation":1283},"/company/team/e-group/","leadership",{"text":1593,"config":1594},"Investor relations",{"href":1595,"dataGaName":1596,"dataGaLocation":1283},"https://ir.gitlab.com/overview/default.aspx","investor relations",{"text":1598,"config":1599},"Trust Center",{"href":1600,"dataGaName":1601,"dataGaLocation":1283},"/security/","trust center",{"text":1603,"config":1604},"AI Transparency Center",{"href":1605,"dataGaName":1606,"dataGaLocation":1283},"/ai-transparency-center/","ai transparency center",{"text":1608,"config":1609},"Newsletter",{"href":1610,"dataGaName":1611,"dataGaLocation":1283},"/company/contact/#contact-forms","newsletter",{"text":1613,"config":1614,"menu":1615},"Contact us",{"dataNavLevelOne":1561},{"type":1305,"columns":1616},[1617],{"items":1618},[1619,1624,1629],{"text":1620,"config":1621},"Talk to sales",{"href":1622,"dataGaName":1623,"dataGaLocation":1283},"/sales/","talk to sales",{"text":1625,"config":1626},"Support portal",{"href":1627,"dataGaName":1628,"dataGaLocation":1283},"https://support.gitlab.com/hc/en-us","support portal",{"text":1630,"config":1631},"Customer portal",{"href":1632,"dataGaName":1633,"dataGaLocation":1283},"https://customers.gitlab.com/customers/sign_in/","customer portal",{"close":1635,"login":1636,"suggestions":1643},"Close",{"text":1637,"link":1638},"To search repositories and projects, login to",{"text":1639,"config":1640},"gitlab.com",{"href":1297,"dataGaName":1641,"dataGaLocation":1642},"search login","search",{"text":1644,"default":1645},"Suggestions",[1646,1649,1652,1654,1658,1662],{"text":1647,"config":1648},"GitLab Duo Agent Platform",{"href":1362,"dataGaName":1647,"dataGaLocation":1642},{"text":1650,"config":1651},"Code Suggestions (AI)",{"href":1362,"dataGaName":1650,"dataGaLocation":1642},{"text":1314,"config":1653},{"href":1316,"dataGaName":1314,"dataGaLocation":1642},{"text":1655,"config":1656},"GitLab on AWS",{"href":1657,"dataGaName":1655,"dataGaLocation":1642},"/partners/technology-partners/aws/",{"text":1659,"config":1660},"GitLab on Google Cloud",{"href":1661,"dataGaName":1659,"dataGaLocation":1642},"/partners/technology-partners/google-cloud-platform/",{"text":1663,"config":1664},"Why GitLab?",{"href":1665,"dataGaName":1663,"dataGaLocation":1642},"/why-gitlab/",{"freeTrial":1667,"mobileIcon":1672,"desktopIcon":1677,"secondaryButton":1680},{"text":1668,"config":1669},"Start free trial",{"href":1670,"dataGaName":1288,"dataGaLocation":1671},"https://gitlab.com/-/trials/new/","nav",{"altText":1673,"config":1674},"Gitlab Icon",{"src":1675,"dataGaName":1676,"dataGaLocation":1671},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203874/jypbw1jx72aexsoohd7x.svg","gitlab icon",{"altText":1673,"config":1678},{"src":1679,"dataGaName":1676,"dataGaLocation":1671},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203875/gs4c8p8opsgvflgkswz9.svg",{"text":1681,"config":1682},"Get Started",{"href":1683,"dataGaName":1684,"dataGaLocation":1671},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com/get-started/","get started",{"freeTrial":1686,"mobileIcon":1690,"desktopIcon":1692},{"text":1687,"config":1688},"Learn more about GitLab Duo",{"href":1362,"dataGaName":1689,"dataGaLocation":1671},"gitlab duo",{"altText":1673,"config":1691},{"src":1675,"dataGaName":1676,"dataGaLocation":1671},{"altText":1673,"config":1693},{"src":1679,"dataGaName":1676,"dataGaLocation":1671},{"button":1695,"mobileIcon":1700,"desktopIcon":1702},{"text":1696,"config":1697},"/switch",{"href":1698,"dataGaName":1699,"dataGaLocation":1671},"#contact","switch",{"altText":1673,"config":1701},{"src":1675,"dataGaName":1676,"dataGaLocation":1671},{"altText":1673,"config":1703},{"src":1704,"dataGaName":1676,"dataGaLocation":1671},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1773335277/ohhpiuoxoldryzrnhfrh.png",{"freeTrial":1706,"mobileIcon":1711,"desktopIcon":1713},{"text":1707,"config":1708},"Back to pricing",{"href":1476,"dataGaName":1709,"dataGaLocation":1671,"icon":1710},"back to pricing","GoBack",{"altText":1673,"config":1712},{"src":1675,"dataGaName":1676,"dataGaLocation":1671},{"altText":1673,"config":1714},{"src":1679,"dataGaName":1676,"dataGaLocation":1671},{"title":1716,"button":1717,"config":1721},"GitLab Orbit is generally available. Increase agent accuracy and lower token cost",{"text":1381,"config":1718},{"href":1383,"dataGaName":1719,"dataGaLocation":1720},"orbit-ga-banner","global-banner",{"layout":1722,"disabled":1262},"release",{"data":1724},{"text":1725,"config":1726,"items":1731,"minimal":1958},"Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license",{"twitter":1727,"facebook":1728,"youtube":1729,"linkedin":1730},"https://twitter.com/gitlab","https://www.facebook.com/gitlab","https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg","https://www.linkedin.com/company/gitlab-com",[1732,1780,1838,1885,1926],{"title":1474,"links":1733,"subMenu":1749},[1734,1739,1744],{"text":1735,"config":1736},"View plans",{"href":1476,"dataGaName":1737,"dataGaLocation":1738},"view plans","footer",{"text":1740,"config":1741},"Why Premium?",{"href":1742,"dataGaName":1743,"dataGaLocation":1738},"/pricing/premium/","why premium",{"text":1745,"config":1746},"Why Ultimate?",{"href":1747,"dataGaName":1748,"dataGaLocation":1738},"/pricing/ultimate/","why ultimate",[1750],{"title":1751,"links":1752},"Contact Us",[1753,1756,1758,1760,1765,1770,1775],{"text":1754,"config":1755},"Contact sales",{"href":1622,"dataGaName":1293,"dataGaLocation":1738},{"text":1625,"config":1757},{"href":1627,"dataGaName":1628,"dataGaLocation":1738},{"text":1630,"config":1759},{"href":1632,"dataGaName":1633,"dataGaLocation":1738},{"text":1761,"config":1762},"Status",{"href":1763,"dataGaName":1764,"dataGaLocation":1738},"https://status.gitlab.com/","status",{"text":1766,"config":1767},"Terms of use",{"href":1768,"dataGaName":1769,"dataGaLocation":1738},"/terms/","terms of use",{"text":1771,"config":1772},"Privacy statement",{"href":1773,"dataGaName":1774,"dataGaLocation":1738},"/privacy/","privacy statement",{"text":1776,"config":1777},"Cookie preferences",{"dataGaName":1778,"dataGaLocation":1738,"id":1779,"isOneTrustButton":125},"cookie preferences","ot-sdk-btn",{"title":1301,"links":1781,"subMenu":1797},[1782,1785,1787,1789,1791,1793],{"text":1783,"config":1784},"Explore the platform",{"href":1309,"dataGaName":1303,"dataGaLocation":1738},{"text":1360,"config":1786},{"href":1362,"dataGaName":1363,"dataGaLocation":1738},{"text":1314,"config":1788},{"href":1316,"dataGaName":1317,"dataGaLocation":1738},{"text":1365,"config":1790},{"href":1367,"dataGaName":1368,"dataGaLocation":1738},{"text":1347,"config":1792},{"href":1349,"dataGaName":1350,"dataGaLocation":1738},{"text":1794,"config":1795},"Why GitLab",{"href":1665,"dataGaName":1796,"dataGaLocation":1738},"why gitlab",[1798],{"title":1799,"links":1800},"Topics",[1801,1805,1810,1814,1819,1823,1828,1833],{"text":1314,"config":1802},{"href":1803,"dataGaName":1804,"dataGaLocation":1738},"/topics/ci-cd/","cicd",{"text":1806,"config":1807},"GitOps",{"href":1808,"dataGaName":1809,"dataGaLocation":1738},"/topics/gitops/","gitops",{"text":1273,"config":1811},{"href":1812,"dataGaName":1813,"dataGaLocation":1738},"/topics/devops/","devops",{"text":1815,"config":1816},"Version Control",{"href":1817,"dataGaName":1818,"dataGaLocation":1738},"/topics/version-control/","version control",{"text":1275,"config":1820},{"href":1821,"dataGaName":1822,"dataGaLocation":1738},"/topics/devsecops/","devsecops",{"text":1824,"config":1825},"Cloud Native",{"href":1826,"dataGaName":1827,"dataGaLocation":1738},"/topics/cloud-native/","cloud native",{"text":1829,"config":1830},"AI for Coding",{"href":1831,"dataGaName":1832,"dataGaLocation":1738},"/topics/devops/ai-for-coding/","ai for coding",{"text":1834,"config":1835},"Agentic AI",{"href":1836,"dataGaName":1837,"dataGaLocation":1738},"/topics/agentic-ai/","agentic ai",{"title":1386,"links":1839},[1840,1843,1846,1849,1852,1855,1857,1859,1861,1863,1865,1868,1870,1873,1877,1881],{"text":1841,"config":1842},"DevOps modernization",{"href":1401,"dataGaName":1402,"dataGaLocation":1738},{"text":1844,"config":1845},"Security modernization",{"href":1406,"dataGaName":1407,"dataGaLocation":1738},{"text":1847,"config":1848},"AI modernization",{"href":1411,"dataGaName":1412,"dataGaLocation":1738},{"text":1850,"config":1851},"Financial services",{"href":1437,"dataGaName":1438,"dataGaLocation":1738},{"text":1853,"config":1854},"Public sector",{"href":1442,"dataGaName":1443,"dataGaLocation":1738},{"text":1445,"config":1856},{"href":1447,"dataGaName":1448,"dataGaLocation":1738},{"text":1450,"config":1858},{"href":1452,"dataGaName":1453,"dataGaLocation":1738},{"text":1455,"config":1860},{"href":1457,"dataGaName":1458,"dataGaLocation":1738},{"text":1460,"config":1862},{"href":1462,"dataGaName":1463,"dataGaLocation":1738},{"text":1417,"config":1864},{"href":1419,"dataGaName":1420,"dataGaLocation":1738},{"text":1866,"config":1867},"Small business",{"href":1424,"dataGaName":1425,"dataGaLocation":1738},{"text":1427,"config":1869},{"href":1429,"dataGaName":1430,"dataGaLocation":1738},{"text":1806,"config":1871},{"href":1872,"dataGaName":1809,"dataGaLocation":1738},"/solutions/gitops/",{"text":1874,"config":1875},"Software composition analysis",{"href":1354,"dataGaName":1876,"dataGaLocation":1738},"software composition analysis",{"text":1878,"config":1879},"Value stream management",{"href":1372,"dataGaName":1880,"dataGaLocation":1738},"value stream management",{"text":1882,"config":1883},"All solutions",{"href":1393,"dataGaName":1884,"dataGaLocation":1738},"all solutions",{"title":1479,"links":1886},[1887,1892,1897,1899,1901,1903,1905,1907,1909,1911,1913,1915,1917,1919,1922],{"text":1888,"config":1889},"Install",{"href":1890,"dataGaName":1891,"dataGaLocation":1738},"/install/","install",{"text":1893,"config":1894},"Quick start guides",{"href":1895,"dataGaName":1896,"dataGaLocation":1738},"/get-started/","quick setup checklists",{"text":1492,"config":1898},{"href":1494,"dataGaName":1495,"dataGaLocation":1738},{"text":1497,"config":1900},{"href":1499,"dataGaName":1500,"dataGaLocation":1738},{"text":1502,"config":1902},{"href":1504,"dataGaName":1505,"dataGaLocation":1738},{"text":1507,"config":1904},{"href":1509,"dataGaName":1510,"dataGaLocation":1738},{"text":1512,"config":1906},{"href":1514,"dataGaName":1515,"dataGaLocation":1738},{"text":1525,"config":1908},{"href":1527,"dataGaName":1528,"dataGaLocation":1738},{"text":1530,"config":1910},{"href":1532,"dataGaName":1533,"dataGaLocation":1738},{"text":1535,"config":1912},{"href":1537,"dataGaName":1538,"dataGaLocation":1738},{"text":1540,"config":1914},{"href":1542,"dataGaName":1543,"dataGaLocation":1738},{"text":1545,"config":1916},{"href":1547,"dataGaName":1548,"dataGaLocation":1738},{"text":1608,"config":1918},{"href":1610,"dataGaName":1611,"dataGaLocation":1738},{"text":1920,"config":1921},"What's new",{"href":1556,"dataGaName":1557,"dataGaLocation":1738},{"text":1923,"config":1924},"All resources",{"href":1486,"dataGaName":1925,"dataGaLocation":1738},"all resources",{"title":1559,"links":1927},[1928,1930,1932,1934,1936,1938,1940,1942,1944,1948,1953],{"text":1567,"config":1929},{"href":1569,"dataGaName":1561,"dataGaLocation":1738},{"text":1572,"config":1931},{"href":1574,"dataGaName":1575,"dataGaLocation":1738},{"text":1578,"config":1933},{"href":1580,"dataGaName":1581,"dataGaLocation":1738},{"text":1583,"config":1935},{"href":1585,"dataGaName":1586,"dataGaLocation":1738},{"text":1588,"config":1937},{"href":1590,"dataGaName":1591,"dataGaLocation":1738},{"text":1593,"config":1939},{"href":1595,"dataGaName":1596,"dataGaLocation":1738},{"text":1598,"config":1941},{"href":1600,"dataGaName":1601,"dataGaLocation":1738},{"text":1603,"config":1943},{"href":1605,"dataGaName":1606,"dataGaLocation":1738},{"text":1945,"config":1946},"Sustainability",{"href":1947,"dataGaName":1945,"dataGaLocation":1738},"/sustainability/",{"text":1949,"config":1950},"Diversity, inclusion and belonging (DIB)",{"href":1951,"dataGaName":1952,"dataGaLocation":1738},"/diversity-inclusion-belonging/","Diversity, inclusion and belonging",{"text":1954,"config":1955},"Modern Slavery Transparency Statement",{"href":1956,"dataGaName":1957,"dataGaLocation":1738},"https://handbook.gitlab.com/handbook/legal/modern-slavery-act-transparency-statement/","modern slavery transparency statement",{"items":1959},[1960,1963,1966],{"text":1961,"config":1962},"Terms",{"href":1768,"dataGaName":1769,"dataGaLocation":1738},{"text":1964,"config":1965},"Cookies",{"dataGaName":1778,"dataGaLocation":1738,"id":1779,"isOneTrustButton":125},{"text":1967,"config":1968},"Privacy",{"href":1773,"dataGaName":1774,"dataGaLocation":1738},[1970,1984],{"id":1971,"title":7,"body":1261,"config":1972,"content":1974,"description":1261,"extension":1978,"meta":1979,"navigation":125,"path":1980,"seo":1981,"stem":1982,"__hash__":1983},"blogAuthors/en-us/blog/authors/sophia-manicor.yml",{"template":1973},"BlogAuthor",{"name":7,"config":1975},{"headshot":1976,"ctfId":1977},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749665576/Blog/Author%20Headshots/sophie_manicor_headshot.png","79Msqcc9YZrC0IvTggfQ5y","yml",{},"/en-us/blog/authors/sophia-manicor",{},"en-us/blog/authors/sophia-manicor","i6tZEYh0BGVe56GYn5Z59J7fVNHk3-yVCcPBXBlfXJY",{"id":1985,"title":8,"body":1261,"config":1986,"content":1987,"description":1261,"extension":1978,"meta":1991,"navigation":125,"path":1992,"seo":1993,"stem":1994,"__hash__":1995},"blogAuthors/en-us/blog/authors/noah-ing.yml",{"template":1973},{"name":8,"config":1988},{"headshot":1989,"ctfId":1990},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749664410/Blog/Author%20Headshots/noahing.png","noahing",{},"/en-us/blog/authors/noah-ing",{},"en-us/blog/authors/noah-ing","NHgV_yTX8kHX01mE2SSxC6hcOMw3BCWiblr8m6csLkw",[1997,2005,2013],{"title":1998,"description":1999,"heroImage":2000,"category":1257,"date":2001,"authors":2002,"slug":2004,"externalUrl":1261},"GitLab Orbit: Find vulnerability blast radius without the manual hunt","Exploitation happens at machine speed now. Map every project, owner, and pipeline a critical CVE touches so remediation can keep up.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1780996524/sd1vpl8empy26wizarqj.png","2026-10-29",[2003],"Rebecca Carter","find-vulnerability-blast-radius-with-gitlab-orbit",{"title":2006,"description":2007,"heroImage":2008,"category":1257,"date":2009,"authors":2010,"slug":2012,"externalUrl":1261},"What happens when vulnerabilities are discovered faster than you can fix them?","Frontier AI is changing how quickly vulnerabilities can be discovered and exploited. The next challenge is bringing that same speed to remediation and prevention, inside the software factory.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1772195014/ooezwusxjl1f7ijfmbvj.png","2026-10-28",[2011],"Bill Staples","security-at-machine-speed",{"title":2014,"description":2015,"heroImage":2016,"category":1257,"date":2017,"authors":2018,"slug":2020,"externalUrl":1261},"Uncover the business logic vulnerabilities SAST scanners miss","Now in early access, Business Logic Security Analyzer reads your repository, infers what each endpoint should enforce, and flags the gaps.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1756122536/akivvcnafog9c4dhhzkp.png","2026-10-20",[2019],"Chris Widstrom","gitlab-business-logic-security-analyzer",{"header":2022,"text":2023,"button":2027,"disclaimer":2030},"Start your free\n\n30-day GitLab trial\n",[2024,2025,2026],"GitLab Duo Agent Platform access","Try our most advanced features","Automate complex tasks with AI",{"text":1285,"config":2028},{"href":2029,"dataGaName":1288,"dataGaLocation":1528},"https://gitlab.com/-/trials/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/blog/","No credit card required.",{"header":2032,"blurb":2033,"button":2034,"secondaryButton":2039},"Start building faster today","See what your team can do with the intelligent orchestration platform for DevSecOps.\n",{"text":2035,"config":2036},"Get your free trial",{"href":2037,"dataGaName":1288,"dataGaLocation":2038},"https://gitlab.com/-/trial_registrations/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/","feature",{"text":1754,"config":2040},{"href":1622,"dataGaName":1293,"dataGaLocation":2038},1794911781844]