[{"data":1,"prerenderedAt":2120},["ShallowReactive",2],{"/blog/how-to-deploy-react-to-amazon-s3":3,"navigation-en-us":1370,"banner-en-us":1806,"footer-en-us":1814,"blog-post-authors-en-us-Jeremy Wagner":2060,"blog-related-posts-en-us-how-to-deploy-react-to-amazon-s3":2075,"blog-share-wrapper-en-us":2100,"next-steps-en-us":2110},{"id":4,"title":5,"authors":6,"body":8,"category":1350,"date":1351,"description":1352,"extension":1353,"externalUrl":1354,"faq":1354,"featured":1355,"heroImage":1356,"hidePromo":1355,"meta":1357,"navigation":1358,"path":1359,"seo":1360,"slug":1364,"stem":1365,"tags":1366,"template":1368,"updatedDate":1354,"__hash__":1369},"blogPosts/en-us/blog/how-to-deploy-react-to-amazon-s3.md","How to deploy a React application to Amazon S3 using GitLab CI/CD",[7],"Jeremy Wagner",{"type":9,"value":10,"toc":1330},"minimark",[11,15,30,38,43,46,83,96,100,103,108,111,119,126,137,140,146,150,157,163,185,191,195,202,218,224,227,233,243,373,381,384,390,394,397,400,419,422,429,435,441,447,453,456,462,466,474,478,487,490,496,514,528,546,558,562,565,582,733,744,748,764,776,791,797,809,812,818,822,839,842,846,852,860,868,872,875,888,926,932,1051,1062,1067,1189,1209,1219,1225,1231,1235,1253,1259,1268,1275,1289,1293,1326],[12,13,14],"p",{},"Amazon S3 has a Static Website Hosting feature which allows you to host a static website directly from an S3 bucket. When you\nhost your website on S3, your website content is stored in the S3 bucket and served directly to your users, without the need\nfor additional resources. Combine this with Amazon CloudFront and you will have a cost-effective and scalable solution for\nhosting static websites – making it a popular choice for single-page applications.",[12,16,17,18,24,25,29],{},"In this post, I will walk you through setting up your Amazon S3 bucket, setting up OpenID Connect (",[19,20,23],"a",{"href":21,"rel":22},"https://openid.net/connect/",[],"OIDC",") in AWS, and deploying your application\nto your Amazon S3 bucket using a GitLab ",[19,26,28],{"href":27},"/topics/ci-cd/","CI/CD"," pipeline.",[12,31,32,33,37],{},"By the end of this post, you will have a ",[19,34,36],{"href":35},"/blog/how-to-keep-up-with-ci-cd-best-practices/","CI/CD pipeline"," built in GitLab that automatically deploys to your Amazon S3 bucket. Let's dive in.",[39,40,42],"h2",{"id":41},"prerequisites","Prerequisites",[12,44,45],{},"For this guide you will need the following:",[47,48,49,58,66,75],"ul",{},[50,51,52,57],"li",{},[19,53,56],{"href":54,"rel":55},"https://nodejs.org/en/",[],"Node.js"," >= 14.0.0 and npm >= 5.6 installed on your system",[50,59,60,65],{},[19,61,64],{"href":62,"rel":63},"https://git-scm.com/",[],"Git"," installed on your system",[50,67,68,69,74],{},"A ",[19,70,73],{"href":71,"rel":72},"https://gitlab.com/-/trial_registrations/new",[],"GitLab"," account",[50,76,77,78,74],{},"An ",[19,79,82],{"href":80,"rel":81},"https://aws.amazon.com/free/",[],"AWS",[12,84,85,89,90,95],{},[19,86,88],{"href":87},"/blog/how-to-automate-testing-for-a-react-application-with-gitlab/","A previous tutorial"," demonstrated how to create a new React\napplication, run unit tests as part of the CI process in GitLab, and output the test results and code coverage into the pipeline. This post continues where that project left off, so to follow along you can fork ",[19,91,94],{"href":92,"rel":93},"https://gitlab.com/guided-explorations/engineering-tutorials/react-unit-testing",[],"this project"," or complete the guide in the linked post.",[39,97,99],{"id":98},"configure-your-amazon-s3-bucket","Configure your Amazon S3 bucket",[12,101,102],{},"You'll need to configure your Amazon S3 bucket so let's do that first.",[104,105,107],"h3",{"id":106},"create-your-bucket","Create your bucket",[12,109,110],{},"After you log in to your AWS account, search for S3 using the search bar and select the S3 service. This will open the S3 service home page.",[12,112,113,114,118],{},"Right away, you should see the option to create a bucket. The bucket is where you are going to store your built React application. Click the ",[115,116,117],"strong",{},"Create bucket"," button to continue.",[12,120,121],{},[122,123],"img",{"alt":124,"src":125},"Create S3 bucket","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397759/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/create_bucket.png",[12,127,128,129,131,132,136],{},"Give your bucket a name, select your region, leave the rest of the settings as default (we’ll come back to these later), and continue by\nclicking the ",[115,130,117],{}," button. When naming your bucket, it’s important to remember that your bucket name must be unique and follow the\nbucket naming rules. I named mine ",[133,134,135],"code",{},"jw-gl-react",".",[12,138,139],{},"After creating your bucket, you should be taken to a list of your buckets as shown below.",[12,141,142],{},[122,143],{"alt":144,"src":145},"S3 bucket list","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397758/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/bucket_list.png",[104,147,149],{"id":148},"configure-static-website-hosting","Configure static website hosting",[12,151,152,153,156],{},"The next step is to configure static website hosting. Open your S3 bucket by clicking into the bucket name. Select the ",[115,154,155],{},"Properties"," tab and\nscroll to the bottom to find the static website hosting option.",[12,158,159],{},[122,160],{"alt":161,"src":162},"static hosting button","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397760/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/static_hosting_1.png",[12,164,165,166,169,170,173,174,177,178,181,182,136],{},"Click ",[115,167,168],{},"Edit"," and then enable static website hosting. For the ",[115,171,172],{},"Index"," and ",[115,175,176],{},"Error"," document, enter ",[133,179,180],{},"index.html"," and then click ",[115,183,184],{},"Save changes",[12,186,187],{},[122,188],{"alt":189,"src":190},"edit static hosting","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397761/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/static_hosting_2.png",[104,192,194],{"id":193},"set-up-permissions","Set up permissions",[12,196,197,198,201],{},"Now that you have enabled static website hosting, you need to update your permissions so the public can visit your website. Return to your bucket and select the ",[115,199,200],{},"Permissions"," tab.",[12,203,204,205,208,209,211,212,215,216,136],{},"Under ",[115,206,207],{},"Block public access (bucket settings)",", click ",[115,210,168],{}," and uncheck ",[115,213,214],{},"Block all public access"," and continue to ",[115,217,184],{},[12,219,220],{},[122,221],{"alt":222,"src":223},"block public access","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397757/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/block_access_1.png",[12,225,226],{},"Your page should now look this this:",[12,228,229],{},[122,230],{"alt":231,"src":232},"saved blocked public access","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397757/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/block_access_2.png",[12,234,235,236,238,239,242],{},"Now, you need to edit the Bucket Policy. Click the ",[115,237,168],{}," button in the ",[115,240,241],{},"Bucket Policy"," section. Paste the following code into your new policy:",[244,245,250],"pre",{"className":246,"code":247,"language":248,"meta":249,"style":249},"language-javascript shiki shiki-themes github-light","{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"PublicReadGetObject\",\n            \"Effect\": \"Allow\",\n            \"Principal\": \"*\",\n            \"Action\": \"s3:GetObject\",\n            \"Resource\": \"arn:aws:s3:::jw-gl-react/*\"\n        }\n    ]\n}\n","javascript","",[133,251,252,261,277,286,292,305,318,331,344,355,361,367],{"__ignoreMap":249},[253,254,257],"span",{"class":255,"line":256},"line",1,[253,258,260],{"class":259},"sgsFI","{\n",[253,262,264,268,271,274],{"class":255,"line":263},2,[253,265,267],{"class":266},"sYBdl","    \"Version\"",[253,269,270],{"class":259},": ",[253,272,273],{"class":266},"\"2012-10-17\"",[253,275,276],{"class":259},",\n",[253,278,280,283],{"class":255,"line":279},3,[253,281,282],{"class":266},"    \"Statement\"",[253,284,285],{"class":259},": [\n",[253,287,289],{"class":255,"line":288},4,[253,290,291],{"class":259},"        {\n",[253,293,295,298,300,303],{"class":255,"line":294},5,[253,296,297],{"class":266},"            \"Sid\"",[253,299,270],{"class":259},[253,301,302],{"class":266},"\"PublicReadGetObject\"",[253,304,276],{"class":259},[253,306,308,311,313,316],{"class":255,"line":307},6,[253,309,310],{"class":266},"            \"Effect\"",[253,312,270],{"class":259},[253,314,315],{"class":266},"\"Allow\"",[253,317,276],{"class":259},[253,319,321,324,326,329],{"class":255,"line":320},7,[253,322,323],{"class":266},"            \"Principal\"",[253,325,270],{"class":259},[253,327,328],{"class":266},"\"*\"",[253,330,276],{"class":259},[253,332,334,337,339,342],{"class":255,"line":333},8,[253,335,336],{"class":266},"            \"Action\"",[253,338,270],{"class":259},[253,340,341],{"class":266},"\"s3:GetObject\"",[253,343,276],{"class":259},[253,345,347,350,352],{"class":255,"line":346},9,[253,348,349],{"class":266},"            \"Resource\"",[253,351,270],{"class":259},[253,353,354],{"class":266},"\"arn:aws:s3:::jw-gl-react/*\"\n",[253,356,358],{"class":255,"line":357},10,[253,359,360],{"class":259},"        }\n",[253,362,364],{"class":255,"line":363},11,[253,365,366],{"class":259},"    ]\n",[253,368,370],{"class":255,"line":369},12,[253,371,372],{"class":259},"}\n",[12,374,375,376,378,379,136],{},"Replace ",[133,377,135],{}," on the resource property with the name of your bucket and ",[115,380,184],{},[12,382,383],{},"Your bucket should now look like this:",[12,385,386],{},[122,387],{"alt":388,"src":389},"publicly accessible bucket","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397757/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/block_access_3.png",[39,391,393],{"id":392},"manually-upload-your-react-application","Manually upload your React application",[12,395,396],{},"Now, let’s build your React application and manually publish it to your S3 bucket.",[12,398,399],{},"To build the application, make sure your project is cloned to your local machine and run the following command in your terminal inside of your\nrepository directory:",[244,401,405],{"className":402,"code":403,"language":404,"meta":249,"style":249},"language-shell shiki shiki-themes github-light","npm run build\n","shell",[133,406,407],{"__ignoreMap":249},[253,408,409,413,416],{"class":255,"line":256},[253,410,412],{"class":411},"s7eDp","npm",[253,414,415],{"class":266}," run",[253,417,418],{"class":266}," build\n",[12,420,421],{},"This will create a build folder inside of your repository directory.",[12,423,424,425,428],{},"Inside of your bucket, click the ",[115,426,427],{},"Upload"," button.",[12,430,431],{},[122,432],{"alt":433,"src":434},"manual bucket upload","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397762/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/upload_1.png",[12,436,437,438,440],{},"Drag the contents of your newly created build folder (not the folder itself) into the upload area. This will\nupload the contents of your application into your S3 bucket. Make sure to click ",[115,439,427],{}," at the bottom of the page to start the upload.",[12,442,443,444,446],{},"Now return to your bucket ",[115,445,155],{}," tab and scroll to the bottom to find the URL of your static website.",[12,448,449],{},[122,450],{"alt":451,"src":452},"static website url","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397762/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/upload_2.png",[12,454,455],{},"Click the link and you should see your built React application open in your browser.",[12,457,458],{},[122,459],{"alt":460,"src":461},"deployed app","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397760/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/manual_deploy.png",[39,463,465],{"id":464},"set-up-openid-connect-in-aws","Set up OpenID Connect in AWS",[12,467,468,469,136],{},"To deploy to your S3 Bucket from GitLab, we’re going to use a GitLab CI/CD job to receive temporary credentials\nfrom AWS without needing to store secrets. To do this, we’re going to configure OIDC for ID federation\nbetween GitLab and AWS. We’ll be following the ",[19,470,473],{"href":471,"rel":472},"https://docs.gitlab.com/ci/cloud_services/aws/",[],"related GitLab documentation",[104,475,477],{"id":476},"add-the-identity-provider","Add the identity provider",[12,479,480,481,486],{},"The first step is going to be adding GitLab as an identity and access management (IAM) OIDC provider in AWS. AWS has instructions located ",[19,482,485],{"href":483,"rel":484},"https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html",[],"here",",\nbut I will walk through it step by step.",[12,488,489],{},"Open the IAM console inside of AWS.",[12,491,492],{},[122,493],{"alt":494,"src":495},"iam search","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397759/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/iam_1.png",[12,497,498,499,502,503,506,507,510,511,136],{},"On the left navigation pane, under ",[115,500,501],{},"Access management"," choose ",[115,504,505],{},"Identity providers"," and then choose ",[115,508,509],{},"Add provider",".\nFor provider type, select ",[115,512,513],{},"OpenID Connect",[12,515,516,517,520,521,524,525,136],{},"For ",[115,518,519],{},"Provider URL",", enter the address of your GitLab instance, such as ",[133,522,523],{},"https://gitlab.com"," or ",[133,526,527],{},"https://gitlab.example.com",[12,529,516,530,533,534,537,538,541,542,545],{},[115,531,532],{},"Audience",", enter something that is generic and specific to your application. In my case, I'm going to\nenter ",[133,535,536],{},"react_s3_gl",". To prevent confused deputy attacks, it's best to make this something that is not easy to guess. Take a note of\nthis value, you will use it to set the ",[133,539,540],{},"ID_TOKEN"," in your ",[133,543,544],{},".gitlab-ci.yml"," file.",[12,547,548,549,208,551,554,555,557],{},"After entering the ",[115,550,519],{},[115,552,553],{},"Get thumbprint"," to verify the server certificate of your IdP. After this, go\nahead and choose ",[115,556,509],{}," to finish up.",[104,559,561],{"id":560},"create-the-permissions-policy","Create the permissions policy",[12,563,564],{},"After you create the identity provider, you need to create a permissions policy.",[12,566,567,568,570,571,574,575,578,579,581],{},"From the IAM dashboard, under ",[115,569,501],{}," select ",[115,572,573],{},"Policies"," and then ",[115,576,577],{},"Create policy",".\nSelect the JSON tab and paste the following policy replacing ",[133,580,135],{}," on the resource line with your bucket name.",[244,583,585],{"className":246,"code":584,"language":248,"meta":249,"style":249},"{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\"s3:ListBucket\"],\n      \"Resource\": [\"arn:aws:s3:::jw-gl-react\"]\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:PutObject\",\n        \"s3:GetObject\",\n        \"s3:DeleteObject\"\n      ],\n      \"Resource\": [\"arn:aws:s3:::jw-gl-react/*\"]\n    }\n  ]\n}\n",[133,586,587,591,602,609,614,625,639,652,657,661,671,677,684,692,698,704,716,722,728],{"__ignoreMap":249},[253,588,589],{"class":255,"line":256},[253,590,260],{"class":259},[253,592,593,596,598,600],{"class":255,"line":263},[253,594,595],{"class":266},"  \"Version\"",[253,597,270],{"class":259},[253,599,273],{"class":266},[253,601,276],{"class":259},[253,603,604,607],{"class":255,"line":279},[253,605,606],{"class":266},"  \"Statement\"",[253,608,285],{"class":259},[253,610,611],{"class":255,"line":288},[253,612,613],{"class":259},"    {\n",[253,615,616,619,621,623],{"class":255,"line":294},[253,617,618],{"class":266},"      \"Effect\"",[253,620,270],{"class":259},[253,622,315],{"class":266},[253,624,276],{"class":259},[253,626,627,630,633,636],{"class":255,"line":307},[253,628,629],{"class":266},"      \"Action\"",[253,631,632],{"class":259},": [",[253,634,635],{"class":266},"\"s3:ListBucket\"",[253,637,638],{"class":259},"],\n",[253,640,641,644,646,649],{"class":255,"line":320},[253,642,643],{"class":266},"      \"Resource\"",[253,645,632],{"class":259},[253,647,648],{"class":266},"\"arn:aws:s3:::jw-gl-react\"",[253,650,651],{"class":259},"]\n",[253,653,654],{"class":255,"line":333},[253,655,656],{"class":259},"    },\n",[253,658,659],{"class":255,"line":346},[253,660,613],{"class":259},[253,662,663,665,667,669],{"class":255,"line":357},[253,664,618],{"class":266},[253,666,270],{"class":259},[253,668,315],{"class":266},[253,670,276],{"class":259},[253,672,673,675],{"class":255,"line":363},[253,674,629],{"class":266},[253,676,285],{"class":259},[253,678,679,682],{"class":255,"line":369},[253,680,681],{"class":266},"        \"s3:PutObject\"",[253,683,276],{"class":259},[253,685,687,690],{"class":255,"line":686},13,[253,688,689],{"class":266},"        \"s3:GetObject\"",[253,691,276],{"class":259},[253,693,695],{"class":255,"line":694},14,[253,696,697],{"class":266},"        \"s3:DeleteObject\"\n",[253,699,701],{"class":255,"line":700},15,[253,702,703],{"class":259},"      ],\n",[253,705,707,709,711,714],{"class":255,"line":706},16,[253,708,643],{"class":266},[253,710,632],{"class":259},[253,712,713],{"class":266},"\"arn:aws:s3:::jw-gl-react/*\"",[253,715,651],{"class":259},[253,717,719],{"class":255,"line":718},17,[253,720,721],{"class":259},"    }\n",[253,723,725],{"class":255,"line":724},18,[253,726,727],{"class":259},"  ]\n",[253,729,731],{"class":255,"line":730},19,[253,732,372],{"class":259},[12,734,735,736,739,740,743],{},"Select the ",[115,737,738],{},"Next: Tags"," button, add any tags you want, and then select the ",[115,741,742],{},"Next: Review"," button.\nEnter a name for your policy and finish up by creating the policy.",[104,745,747],{"id":746},"configure-the-role","Configure the role",[12,749,750,751,570,753,756,757,760,761,136],{},"Now it’s time to add the role. From the IAM dashboard, under ",[115,752,501],{},[115,754,755],{},"Roles","\nand then select ",[115,758,759],{},"Create role",". Select ",[115,762,763],{},"Web identity",[12,765,766,767,769,770,772,773,118],{},"In the ",[115,768,763],{}," section, select the identity provider you created earlier. For the\n",[115,771,532],{},", select the audience you created earlier. Select the ",[115,774,775],{},"Next",[12,777,778,779,782,783,785,786,136],{},"If you wanted to limit authorization to a specific group, project, branch, or tag, you could create a ",[115,780,781],{},"Custom trust policy","\ninstead of a ",[115,784,763],{},". Since I will be deleting these resources after the tutorial, I'm going to keep it simple. For a\nfull list of supported filterting types, see the ",[19,787,790],{"href":788,"rel":789},"https://docs.gitlab.com/ci/cloud_services/#configure-a-conditional-role-with-oidc-claims",[],"GitLab documentation",[12,792,793],{},[122,794],{"alt":795,"src":796},"web identity","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397760/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/iam_2.png",[12,798,799,800,803,804,806,807,136],{},"During the ",[115,801,802],{},"Add permissions"," step, select the policy you created and select ",[115,805,775],{}," to continue. Give your role a name and click ",[115,808,759],{},[12,810,811],{},"Open the Role you just created. In the summary section, find the Amazon Resource Name (ARN) and save it somewhere secure. You will use this in your pipeline.",[12,813,814],{},[122,815],{"alt":816,"src":817},"role","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397760/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/iam_3.png",[39,819,821],{"id":820},"deploy-to-your-amazon-s3-bucket-using-a-gitlab-cicd-pipeline","Deploy to your Amazon S3 bucket using a GitLab CI/CD pipeline",[12,823,824,825,830,831,834,835,838],{},"Inside of your project, create two ",[19,826,829],{"href":827,"rel":828},"https://docs.gitlab.com/ci/variables/#define-a-cicd-variable-in-the-ui",[],"CI/CD variables",". The first variable should be named ",[133,832,833],{},"ROLE_ARN",". For the value, paste the ARN of the\nrole you just created. The second variable should be named ",[133,836,837],{},"S3_BUCKET",". For the value, paste the name of the S3 bucket you created\nearlier in this post.",[12,840,841],{},"I have chosen to mask my variables for an extra layer of security.",[104,843,845],{"id":844},"retrieve-your-temporary-credentials","Retrieve your temporary credentials",[12,847,848,849,851],{},"Inside of your ",[133,850,544],{}," file, paste the following code:",[244,853,858],{"className":854,"code":856,"language":857,"meta":249},[855],"language-text",".assume_role: &assume_role\n    - >\n      STS=($(aws sts assume-role-with-web-identity\n      --role-arn ${ROLE_ARN}\n      --role-session-name \"GitLabRunner-${CI_PROJECT_ID}-${CI_PIPELINE_ID}\"\n      --web-identity-token $ID_TOKEN\n      --duration-seconds 3600\n      --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]'\n      --output text))\n    - export AWS_ACCESS_KEY_ID=\"${STS[0]}\"\n    - export AWS_SECRET_ACCESS_KEY=\"${STS[1]}\"\n    - export AWS_SESSION_TOKEN=\"${STS[2]}\"\n\n","text",[133,859,856],{"__ignoreMap":249},[12,861,862,863,867],{},"This is going to use the the AWS Security Token Service to generate temporary (",[864,865,866],"em",{},"3,600 seconds",") credentials utilizing the OIDC role you created earlier.",[104,869,871],{"id":870},"create-the-deploy-job","Create the deploy job",[12,873,874],{},"Now, let's add a build and deploy job to build your application and deploy it to your S3 bucket.",[12,876,877,878,880,881,173,884,887],{},"First, update the stages in your ",[133,879,544],{}," file to include a ",[133,882,883],{},"build",[133,885,886],{},"deploy"," stage as shown below:",[244,889,893],{"className":890,"code":891,"language":892,"meta":249,"style":249},"language-yaml shiki shiki-themes github-light","stages:\n  - build\n  - test\n  - deploy\n\n","yaml",[133,894,895,904,912,919],{"__ignoreMap":249},[253,896,897,901],{"class":255,"line":256},[253,898,900],{"class":899},"shJU0","stages",[253,902,903],{"class":259},":\n",[253,905,906,909],{"class":255,"line":263},[253,907,908],{"class":259},"  - ",[253,910,911],{"class":266},"build\n",[253,913,914,916],{"class":255,"line":279},[253,915,908],{"class":259},[253,917,918],{"class":266},"test\n",[253,920,921,923],{"class":255,"line":288},[253,922,908],{"class":259},[253,924,925],{"class":266},"deploy\n",[12,927,928,929,931],{},"Next, let's add a job to build your application. Paste the following code in your ",[133,930,544],{}," file:",[244,933,935],{"className":890,"code":934,"language":892,"meta":249,"style":249},"build artifact:\n  stage: build\n  image: node:latest\n  before_script:\n    - npm install\n  script:\n    - npm run build\n  artifacts:\n    paths:\n      - build/\n    when: always\n  rules:\n    - if: '$CI_COMMIT_REF_NAME == \"main\"'\n      when: always\n\n",[133,936,937,944,953,963,970,978,985,991,998,1005,1013,1023,1030,1042],{"__ignoreMap":249},[253,938,939,942],{"class":255,"line":256},[253,940,941],{"class":899},"build artifact",[253,943,903],{"class":259},[253,945,946,949,951],{"class":255,"line":263},[253,947,948],{"class":899},"  stage",[253,950,270],{"class":259},[253,952,911],{"class":266},[253,954,955,958,960],{"class":255,"line":279},[253,956,957],{"class":899},"  image",[253,959,270],{"class":259},[253,961,962],{"class":266},"node:latest\n",[253,964,965,968],{"class":255,"line":288},[253,966,967],{"class":899},"  before_script",[253,969,903],{"class":259},[253,971,972,975],{"class":255,"line":294},[253,973,974],{"class":259},"    - ",[253,976,977],{"class":266},"npm install\n",[253,979,980,983],{"class":255,"line":307},[253,981,982],{"class":899},"  script",[253,984,903],{"class":259},[253,986,987,989],{"class":255,"line":320},[253,988,974],{"class":259},[253,990,403],{"class":266},[253,992,993,996],{"class":255,"line":333},[253,994,995],{"class":899},"  artifacts",[253,997,903],{"class":259},[253,999,1000,1003],{"class":255,"line":346},[253,1001,1002],{"class":899},"    paths",[253,1004,903],{"class":259},[253,1006,1007,1010],{"class":255,"line":357},[253,1008,1009],{"class":259},"      - ",[253,1011,1012],{"class":266},"build/\n",[253,1014,1015,1018,1020],{"class":255,"line":363},[253,1016,1017],{"class":899},"    when",[253,1019,270],{"class":259},[253,1021,1022],{"class":266},"always\n",[253,1024,1025,1028],{"class":255,"line":369},[253,1026,1027],{"class":899},"  rules",[253,1029,903],{"class":259},[253,1031,1032,1034,1037,1039],{"class":255,"line":686},[253,1033,974],{"class":259},[253,1035,1036],{"class":899},"if",[253,1038,270],{"class":259},[253,1040,1041],{"class":266},"'$CI_COMMIT_REF_NAME == \"main\"'\n",[253,1043,1044,1047,1049],{"class":255,"line":694},[253,1045,1046],{"class":899},"      when",[253,1048,270],{"class":259},[253,1050,1022],{"class":266},[12,1052,1053,1054,1057,1058,1061],{},"This is going to run ",[133,1055,1056],{},"npm run build"," if the change occurs on the ",[133,1059,1060],{},"main"," branch and upload the build directory as an\nartifact to be used during the next step.",[12,1063,1064,1065,931],{},"Next, let's add a job to actually deploy to your S3 bucket. Paste the following code in your ",[133,1066,544],{},[244,1068,1070],{"className":890,"code":1069,"language":892,"meta":249,"style":249},"deploy s3:\n  stage: deploy\n  image:\n    name: amazon/aws-cli:latest\n    entrypoint:\n      - '/usr/bin/env'\n  id_tokens:\n      ID_TOKEN:\n        aud: react_s3_gl\n  script:\n    - *assume_role\n    - aws s3 sync build/ s3://$S3_BUCKET\n  rules:\n    - if: '$CI_COMMIT_REF_NAME == \"main\"'\n      when: always\n\n",[133,1071,1072,1079,1087,1093,1103,1110,1117,1124,1131,1141,1147,1158,1165,1171,1181],{"__ignoreMap":249},[253,1073,1074,1077],{"class":255,"line":256},[253,1075,1076],{"class":899},"deploy s3",[253,1078,903],{"class":259},[253,1080,1081,1083,1085],{"class":255,"line":263},[253,1082,948],{"class":899},[253,1084,270],{"class":259},[253,1086,925],{"class":266},[253,1088,1089,1091],{"class":255,"line":279},[253,1090,957],{"class":899},[253,1092,903],{"class":259},[253,1094,1095,1098,1100],{"class":255,"line":288},[253,1096,1097],{"class":899},"    name",[253,1099,270],{"class":259},[253,1101,1102],{"class":266},"amazon/aws-cli:latest\n",[253,1104,1105,1108],{"class":255,"line":294},[253,1106,1107],{"class":899},"    entrypoint",[253,1109,903],{"class":259},[253,1111,1112,1114],{"class":255,"line":307},[253,1113,1009],{"class":259},[253,1115,1116],{"class":266},"'/usr/bin/env'\n",[253,1118,1119,1122],{"class":255,"line":320},[253,1120,1121],{"class":899},"  id_tokens",[253,1123,903],{"class":259},[253,1125,1126,1129],{"class":255,"line":333},[253,1127,1128],{"class":899},"      ID_TOKEN",[253,1130,903],{"class":259},[253,1132,1133,1136,1138],{"class":255,"line":346},[253,1134,1135],{"class":899},"        aud",[253,1137,270],{"class":259},[253,1139,1140],{"class":266},"react_s3_gl\n",[253,1142,1143,1145],{"class":255,"line":357},[253,1144,982],{"class":899},[253,1146,903],{"class":259},[253,1148,1149,1151,1155],{"class":255,"line":363},[253,1150,974],{"class":259},[253,1152,1154],{"class":1153},"sD7c4","*",[253,1156,1157],{"class":259},"assume_role\n",[253,1159,1160,1162],{"class":255,"line":369},[253,1161,974],{"class":259},[253,1163,1164],{"class":266},"aws s3 sync build/ s3://$S3_BUCKET\n",[253,1166,1167,1169],{"class":255,"line":686},[253,1168,1027],{"class":899},[253,1170,903],{"class":259},[253,1172,1173,1175,1177,1179],{"class":255,"line":694},[253,1174,974],{"class":259},[253,1176,1036],{"class":899},[253,1178,270],{"class":259},[253,1180,1041],{"class":266},[253,1182,1183,1185,1187],{"class":255,"line":700},[253,1184,1046],{"class":899},[253,1186,270],{"class":259},[253,1188,1022],{"class":266},[12,1190,1191,1192,1197,1198,1201,1202,1205,1206,1208],{},"This uses ",[19,1193,1196],{"href":1194,"rel":1195},"https://docs.gitlab.com/ci/yaml/yaml_optimization/#yaml-anchors-for-scripts",[],"YAML anchors"," to run the ",[133,1199,1200],{},"assume_role"," script,\nand then uses the ",[133,1203,1204],{},"aws cli"," to upload your build artifact to the bucket you defined as a variable. This job also only runs if the change occurs\non the ",[133,1207,1060],{}," branch.",[12,1210,1211,1212,1215,1216,136],{},"Make sure the ",[133,1213,1214],{},"aud"," value matches the value you entered for your audience when you setup the identity provider. In my case, I entered ",[133,1217,1218],{},"react-s3_gl",[12,1220,1221,1222,1224],{},"Your complete ",[133,1223,544],{}," file should look like this:",[244,1226,1229],{"className":1227,"code":1228,"language":857,"meta":249},[855],"stages:\n  - build\n  - test\n  - deploy\n\n.assume_role: &assume_role\n    - >\n      STS=($(aws sts assume-role-with-web-identity\n      --role-arn ${ROLE_ARN}\n      --role-session-name \"GitLabRunner-${CI_PROJECT_ID}-${CI_PIPELINE_ID}\"\n      --web-identity-token $ID_TOKEN\n      --duration-seconds 3600\n      --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]'\n      --output text))\n    - export AWS_ACCESS_KEY_ID=\"${STS[0]}\"\n    - export AWS_SECRET_ACCESS_KEY=\"${STS[1]}\"\n    - export AWS_SESSION_TOKEN=\"${STS[2]}\"\n\nunit test:\n  image: node:latest\n  stage: test\n  before_script:\n    - npm install\n  script:\n    - npm run test:ci\n  coverage: /All files[^|]*\\|[^|]*\\s+([\\d\\.]+)/\n  artifacts:\n    paths:\n      - coverage/\n    when: always\n    reports:\n      junit:\n        - junit.xml\n\nbuild artifact:\n  stage: build\n  image: node:latest\n  before_script:\n    - npm install\n  script:\n    - npm run build\n  artifacts:\n    paths:\n      - build/\n    when: always\n  rules:\n    - if: '$CI_COMMIT_REF_NAME == \"main\"'\n      when: always\n\n\ndeploy s3:\n  stage: deploy\n  image:\n    name: amazon/aws-cli:latest\n    entrypoint:\n      - '/usr/bin/env'\n  id_tokens:\n      ID_TOKEN:\n        aud: react_s3_gl\n  script:\n    - *assume_role\n    - aws s3 sync build/ s3://$S3_BUCKET\n  rules:\n    - if: '$CI_COMMIT_REF_NAME == \"main\"'\n      when: always\n\n",[133,1230,1228],{"__ignoreMap":249},[104,1232,1234],{"id":1233},"make-a-change-and-test-your-pipeline","Make a change and test your pipeline",[12,1236,1237,1238,1241,1242,1245,1246,1249,1250,1252],{},"To test your pipeline, inside of ",[133,1239,1240],{},"App.js",", change this line ",[133,1243,1244],{},"Edit \u003Ccode>src/App.js\u003C/code> and save to reload."," to\n",[133,1247,1248],{},"This was deployed from GitLab!"," and commit your changes to the ",[133,1251,1060],{}," branch. The pipeline should kick off and when\nit finishes successfully you should see your updated application at the URL of your static website.",[12,1254,1255],{},[122,1256],{"alt":1257,"src":1258},"updated app","https://res.cloudinary.com/about-gitlab-com/image/upload/v1782397756/blog/Content%20Images/2023-02-10-how-to-deploy-react-to-amazon-s3/auto_deploy.png",[12,1260,1261,1262,1267],{},"You now have a CI/CD pipeline built in GitLab that receives temporary credentials from AWS using OIDC and\nautomatically deploys to your Amazon S3 bucket. To take it a step further, you can ",[19,1263,1266],{"href":1264,"rel":1265},"https://docs.gitlab.com/user/application_security/secure_your_application/",[],"secure your application","\nwith GitLab's built-in security tools.",[12,1269,1270,1271,136],{},"All code for this project can be found ",[19,1272,485],{"href":1273,"rel":1274},"https://gitlab.com/guided-explorations/engineering-tutorials/react-s3",[],[12,1276,1277,1278,1283,1284],{},"Cover image by ",[19,1279,1282],{"href":1280,"rel":1281},"https://unsplash.com/@switch_dtp_fotografie?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText",[],"Lucas van Oor"," on ",[19,1285,1288],{"href":1286,"rel":1287},"https://unsplash.com/s/photos/bucket?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText",[],"Unsplash",[39,1290,1292],{"id":1291},"related-posts-and-documentation","Related posts and documentation",[47,1294,1295,1300,1306,1313,1319],{},[50,1296,1297],{},[19,1298,1299],{"href":87},"How to automate testing for a React application with GitLab",[50,1301,1302],{},[19,1303,1305],{"href":1304},"/blog/deploy-aws/","How to deploy AWS with GitLab",[50,1307,1308],{},[19,1309,1312],{"href":1310,"rel":1311},"https://docs.gitlab.com/ci/cloud_deployment/",[],"Deploy to AWS from GitLab CI/CD",[50,1314,1315],{},[19,1316,1318],{"href":471,"rel":1317},[],"Configure OpenID Connect in AWS to retrieve temporary credentials",[50,1320,1321],{},[19,1322,1325],{"href":1323,"rel":1324},"https://about.gitlab.com/blog/oidc/",[],"Secure GitLab CI/CD workflows using OIDC JWT on a DevSecOps platform",[1327,1328,1329],"style",{},"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 .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 .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}",{"title":249,"searchDepth":263,"depth":263,"links":1331},[1332,1333,1338,1339,1344,1349],{"id":41,"depth":263,"text":42},{"id":98,"depth":263,"text":99,"children":1334},[1335,1336,1337],{"id":106,"depth":279,"text":107},{"id":148,"depth":279,"text":149},{"id":193,"depth":279,"text":194},{"id":392,"depth":263,"text":393},{"id":464,"depth":263,"text":465,"children":1340},[1341,1342,1343],{"id":476,"depth":279,"text":477},{"id":560,"depth":279,"text":561},{"id":746,"depth":279,"text":747},{"id":820,"depth":263,"text":821,"children":1345},[1346,1347,1348],{"id":844,"depth":279,"text":845},{"id":870,"depth":279,"text":871},{"id":1233,"depth":279,"text":1234},{"id":1291,"depth":263,"text":1292},"engineering","2023-03-01","Follow this guide to use OpenID Connect to connect to AWS and deploy a React application to Amazon S3.","md",null,false,"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749663291/Blog/Hero%20Images/cover1.jpg",{},true,"/en-us/blog/how-to-deploy-react-to-amazon-s3",{"title":5,"description":1352,"ogTitle":5,"ogDescription":1352,"noIndex":1355,"ogImage":1356,"ogUrl":1361,"ogSiteName":1362,"ogType":1363,"canonicalUrls":1361},"https://about.gitlab.com/blog/how-to-deploy-react-to-amazon-s3","https://about.gitlab.com","article","how-to-deploy-react-to-amazon-s3","en-us/blog/how-to-deploy-react-to-amazon-s3",[1367,28],"DevOps","BlogPost","tWrwIB-X7ik0e-JAVjH9-rFjLfwNHRbM3kA5-M7OsaI",{"logo":1371,"freeTrial":1376,"sales":1381,"login":1386,"items":1391,"search":1725,"minimal":1757,"duo":1776,"switchNav":1785,"pricingDeployment":1796},{"config":1372},{"href":1373,"dataGaName":1374,"dataGaLocation":1375},"/","gitlab logo","header",{"text":1377,"config":1378},"Get free trial",{"href":1379,"dataGaName":1380,"dataGaLocation":1375},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com&glm_content=default-saas-trial/","free trial",{"text":1382,"config":1383},"Request a demo",{"href":1384,"dataGaName":1385,"dataGaLocation":1375},"/request-a-demo/","sales",{"text":1387,"config":1388},"Sign in",{"href":1389,"dataGaName":1390,"dataGaLocation":1375},"https://gitlab.com/users/sign_in/","sign in",[1392,1476,1564,1569,1649,1703],{"text":1393,"left":1358,"config":1394,"menu":1396},"Platform",{"dataNavLevelOne":1395},"platform",{"type":1397,"link":1398,"columns":1402,"feature":1465},"lists",{"text":1399,"config":1400},"Explore the Platform",{"href":1401,"dataGaName":1395,"dataGaLocation":1375},"/platform/",[1403,1424,1447],{"title":1367,"items":1404},[1405,1409,1414,1419],{"text":28,"config":1406},{"href":1407,"dataGaLocation":1375,"dataGaName":1408},"/solutions/continuous-integration/","ci/cd",{"text":1410,"config":1411},"Source Code Management",{"href":1412,"dataGaLocation":1375,"dataGaName":1413},"/solutions/source-code-management/","source code management",{"text":1415,"config":1416},"Agile Delivery",{"href":1417,"dataGaLocation":1375,"dataGaName":1418},"/solutions/agile-delivery/","agile delivery",{"text":1420,"config":1421},"Artifact Management",{"href":1422,"dataGaLocation":1375,"dataGaName":1423},"/artifact-central/","artifact management",{"title":1425,"items":1426},"Security & Governance",[1427,1432,1437,1442],{"text":1428,"config":1429},"Application Security Testing",{"href":1430,"dataGaLocation":1375,"dataGaName":1431},"/solutions/application-security-testing/","application security testing",{"text":1433,"config":1434},"Governance & Compliance",{"href":1435,"dataGaLocation":1375,"dataGaName":1436},"/solutions/software-compliance/","governance and compliance",{"text":1438,"config":1439},"Secrets Management",{"href":1440,"dataGaLocation":1375,"dataGaName":1441},"/gitlab-secrets-manager/","secrets management",{"text":1443,"config":1444},"Supply Chain Security",{"href":1445,"dataGaLocation":1375,"dataGaName":1446},"/solutions/supply-chain/","supply chain security",{"title":1448,"items":1449},"Agentic AI & Context",[1450,1455,1460],{"text":1451,"config":1452},"Duo Agent Platform",{"href":1453,"dataGaLocation":1375,"dataGaName":1454},"/gitlab-duo-agent-platform/","duo agent platform",{"text":1456,"config":1457},"Orbit Context Graph",{"href":1458,"dataGaLocation":1375,"dataGaName":1459},"/gitlab-orbit/","orbit",{"text":1461,"config":1462},"Visibility & Measurement",{"href":1463,"dataGaLocation":1375,"dataGaName":1464},"/solutions/visibility-measurement/","visibility and measurement",{"config":1466,"title":1469,"text":1470,"link":1471},{"background":1467,"textColor":1468},"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":1472,"config":1473},"Read the announcement",{"href":1474,"dataGaName":1475,"dataGaLocation":1375},"/blog/gitlab-orbit-ga/","orbit ga announcement",{"text":1477,"left":1358,"config":1478,"menu":1480},"Solutions",{"dataNavLevelOne":1479},"solutions",{"type":1397,"link":1481,"columns":1485,"feature":1555},{"text":1482,"config":1483},"View all Solutions",{"href":1484,"dataGaName":1479,"dataGaLocation":1375},"/solutions/",[1486,1504,1522],{"title":1487,"items":1488},"Outcomes",[1489,1494,1499],{"text":1490,"config":1491},"DevOps Modernization",{"href":1492,"dataGaLocation":1375,"dataGaName":1493},"/assessments/devops-modernization-assessment/","devops modernization",{"text":1495,"config":1496},"Security Modernization",{"href":1497,"dataGaLocation":1375,"dataGaName":1498},"/assessments/security-modernization-assessment/","security modernization",{"text":1500,"config":1501},"AI Modernization",{"href":1502,"dataGaLocation":1375,"dataGaName":1503},"/assessments/ai-modernization-assessment/","ai modernization",{"title":1505,"items":1506},"By size",[1507,1512,1517],{"text":1508,"config":1509},"Enterprise",{"href":1510,"dataGaLocation":1375,"dataGaName":1511},"/enterprise/","enterprise",{"text":1513,"config":1514},"Small Business",{"href":1515,"dataGaLocation":1375,"dataGaName":1516},"/small-business/","small business",{"text":1518,"config":1519},"Startups",{"href":1520,"dataGaLocation":1375,"dataGaName":1521},"/solutions/startups/","startups",{"title":1523,"items":1524},"Industries",[1525,1530,1535,1540,1545,1550],{"text":1526,"config":1527},"Financial Services",{"href":1528,"dataGaLocation":1375,"dataGaName":1529},"/solutions/finance/","financial services",{"text":1531,"config":1532},"Public Sector",{"href":1533,"dataGaLocation":1375,"dataGaName":1534},"/solutions/public-sector/","public sector",{"text":1536,"config":1537},"Telecommunications",{"href":1538,"dataGaLocation":1375,"dataGaName":1539},"/solutions/telecommunications/","telecommunications",{"text":1541,"config":1542},"Automotive",{"href":1543,"dataGaLocation":1375,"dataGaName":1544},"/solutions/automotive/","automotive",{"text":1546,"config":1547},"Education",{"href":1548,"dataGaLocation":1375,"dataGaName":1549},"/solutions/education/","education",{"text":1551,"config":1552},"Aerospace",{"href":1553,"dataGaLocation":1375,"dataGaName":1554},"/solutions/aerospace/","aerospace",{"config":1556,"title":1557,"text":1558,"link":1559},{"background":1467,"textColor":1468},"GitLab Security Standard","Learn how to harden your software factory and let AI agents earn autonomy, without trading away security.",{"text":1560,"config":1561},"Explore the standard",{"href":1562,"dataGaName":1563,"dataGaLocation":1375},"/gitlab-security-standard/","gitlab security standard",{"text":1565,"config":1566},"Pricing",{"href":1567,"dataGaName":1568,"dataGaLocation":1375,"dataNavLevelOne":1568},"/pricing/","pricing",{"text":1570,"config":1571,"menu":1573},"Resources",{"dataNavLevelOne":1572},"resources",{"type":1397,"link":1574,"columns":1578,"feature":1640},{"text":1575,"config":1576},"View all resources",{"href":1577,"dataGaName":1572,"dataGaLocation":1375},"/resources/",[1579,1612],{"title":1580,"items":1581},"Discover",[1582,1587,1592,1597,1602,1607],{"text":1583,"config":1584},"Docs",{"href":1585,"dataGaName":1586,"dataGaLocation":1375},"https://docs.gitlab.com/","docs",{"text":1588,"config":1589},"University",{"href":1590,"dataGaName":1591,"dataGaLocation":1375},"https://university.gitlab.com/","university",{"text":1593,"config":1594},"Demo Series",{"href":1595,"dataGaName":1596,"dataGaLocation":1375},"/gitlab-technical-demo-series/","demo series",{"text":1598,"config":1599},"Demo Hub",{"href":1600,"dataGaName":1601,"dataGaLocation":1375},"/demo-hub/","demo hub",{"text":1603,"config":1604},"Services",{"href":1605,"dataGaName":1606,"dataGaLocation":1375},"/services/","services",{"text":1608,"config":1609},"Well Architected",{"href":1610,"dataGaName":1611,"dataGaLocation":1375},"/resources/well-architected/","well architected",{"title":1613,"items":1614},"Connect",[1615,1620,1625,1630,1635],{"text":1616,"config":1617},"Blog",{"href":1618,"dataGaName":1619,"dataGaLocation":1375},"/blog/","blog",{"text":1621,"config":1622},"Community",{"href":1623,"dataGaName":1624,"dataGaLocation":1375},"/community/","community",{"text":1626,"config":1627},"Customers",{"href":1628,"dataGaName":1629,"dataGaLocation":1375},"/customers/","customers",{"text":1631,"config":1632},"Partners",{"href":1633,"dataGaName":1634,"dataGaLocation":1375},"/partners/","partners",{"text":1636,"config":1637},"Events",{"href":1638,"dataGaName":1639,"dataGaLocation":1375},"/events/","events",{"config":1641,"title":1642,"text":1643,"link":1644},{"background":1467,"textColor":1468},"What’s new in GitLab","Stay updated with our latest features and improvements.",{"text":1645,"config":1646},"Read the latest",{"href":1647,"dataGaName":1648,"dataGaLocation":1375},"/whats-new/","whats new",{"text":1650,"config":1651,"menu":1653},"Company",{"dataNavLevelOne":1652},"company",{"type":1397,"columns":1654},[1655],{"items":1656},[1657,1662,1668,1673,1678,1683,1688,1693,1698],{"text":1658,"config":1659},"About",{"href":1660,"dataGaName":1661,"dataGaLocation":1375},"/company/","about",{"text":1663,"config":1664,"footerGa":1667},"Jobs",{"href":1665,"dataGaName":1666,"dataGaLocation":1375},"/jobs/","jobs",{"dataGaName":1666},{"text":1669,"config":1670},"Press",{"href":1671,"dataGaName":1672,"dataGaLocation":1375},"/press/","press",{"text":1674,"config":1675},"Handbook",{"href":1676,"dataGaName":1677,"dataGaLocation":1375},"https://handbook.gitlab.com/","handbook",{"text":1679,"config":1680},"Leadership",{"href":1681,"dataGaName":1682,"dataGaLocation":1375},"/company/team/e-group/","leadership",{"text":1684,"config":1685},"Investor relations",{"href":1686,"dataGaName":1687,"dataGaLocation":1375},"https://ir.gitlab.com/overview/default.aspx","investor relations",{"text":1689,"config":1690},"Trust Center",{"href":1691,"dataGaName":1692,"dataGaLocation":1375},"/security/","trust center",{"text":1694,"config":1695},"AI Transparency Center",{"href":1696,"dataGaName":1697,"dataGaLocation":1375},"/ai-transparency-center/","ai transparency center",{"text":1699,"config":1700},"Newsletter",{"href":1701,"dataGaName":1702,"dataGaLocation":1375},"/company/contact/#contact-forms","newsletter",{"text":1704,"config":1705,"menu":1706},"Contact us",{"dataNavLevelOne":1652},{"type":1397,"columns":1707},[1708],{"items":1709},[1710,1715,1720],{"text":1711,"config":1712},"Talk to sales",{"href":1713,"dataGaName":1714,"dataGaLocation":1375},"/sales/","talk to sales",{"text":1716,"config":1717},"Support portal",{"href":1718,"dataGaName":1719,"dataGaLocation":1375},"https://support.gitlab.com/hc/en-us","support portal",{"text":1721,"config":1722},"Customer portal",{"href":1723,"dataGaName":1724,"dataGaLocation":1375},"https://customers.gitlab.com/customers/sign_in/","customer portal",{"close":1726,"login":1727,"suggestions":1734},"Close",{"text":1728,"link":1729},"To search repositories and projects, login to",{"text":1730,"config":1731},"gitlab.com",{"href":1389,"dataGaName":1732,"dataGaLocation":1733},"search login","search",{"text":1735,"default":1736},"Suggestions",[1737,1740,1743,1745,1749,1753],{"text":1738,"config":1739},"GitLab Duo Agent Platform",{"href":1453,"dataGaName":1738,"dataGaLocation":1733},{"text":1741,"config":1742},"Code Suggestions (AI)",{"href":1453,"dataGaName":1741,"dataGaLocation":1733},{"text":28,"config":1744},{"href":1407,"dataGaName":28,"dataGaLocation":1733},{"text":1746,"config":1747},"GitLab on AWS",{"href":1748,"dataGaName":1746,"dataGaLocation":1733},"/partners/technology-partners/aws/",{"text":1750,"config":1751},"GitLab on Google Cloud",{"href":1752,"dataGaName":1750,"dataGaLocation":1733},"/partners/technology-partners/google-cloud-platform/",{"text":1754,"config":1755},"Why GitLab?",{"href":1756,"dataGaName":1754,"dataGaLocation":1733},"/why-gitlab/",{"freeTrial":1758,"mobileIcon":1763,"desktopIcon":1768,"secondaryButton":1771},{"text":1759,"config":1760},"Start free trial",{"href":1761,"dataGaName":1380,"dataGaLocation":1762},"https://gitlab.com/-/trials/new/","nav",{"altText":1764,"config":1765},"Gitlab Icon",{"src":1766,"dataGaName":1767,"dataGaLocation":1762},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203874/jypbw1jx72aexsoohd7x.svg","gitlab icon",{"altText":1764,"config":1769},{"src":1770,"dataGaName":1767,"dataGaLocation":1762},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203875/gs4c8p8opsgvflgkswz9.svg",{"text":1772,"config":1773},"Get Started",{"href":1774,"dataGaName":1775,"dataGaLocation":1762},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com/get-started/","get started",{"freeTrial":1777,"mobileIcon":1781,"desktopIcon":1783},{"text":1778,"config":1779},"Learn more about GitLab Duo",{"href":1453,"dataGaName":1780,"dataGaLocation":1762},"gitlab duo",{"altText":1764,"config":1782},{"src":1766,"dataGaName":1767,"dataGaLocation":1762},{"altText":1764,"config":1784},{"src":1770,"dataGaName":1767,"dataGaLocation":1762},{"button":1786,"mobileIcon":1791,"desktopIcon":1793},{"text":1787,"config":1788},"/switch",{"href":1789,"dataGaName":1790,"dataGaLocation":1762},"#contact","switch",{"altText":1764,"config":1792},{"src":1766,"dataGaName":1767,"dataGaLocation":1762},{"altText":1764,"config":1794},{"src":1795,"dataGaName":1767,"dataGaLocation":1762},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1773335277/ohhpiuoxoldryzrnhfrh.png",{"freeTrial":1797,"mobileIcon":1802,"desktopIcon":1804},{"text":1798,"config":1799},"Back to pricing",{"href":1567,"dataGaName":1800,"dataGaLocation":1762,"icon":1801},"back to pricing","GoBack",{"altText":1764,"config":1803},{"src":1766,"dataGaName":1767,"dataGaLocation":1762},{"altText":1764,"config":1805},{"src":1770,"dataGaName":1767,"dataGaLocation":1762},{"title":1807,"button":1808,"config":1812},"GitLab Orbit is generally available. Increase agent accuracy and lower token cost",{"text":1472,"config":1809},{"href":1474,"dataGaName":1810,"dataGaLocation":1811},"orbit-ga-banner","global-banner",{"layout":1813,"disabled":1355},"release",{"data":1815},{"text":1816,"config":1817,"items":1822,"minimal":2049},"Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license",{"twitter":1818,"facebook":1819,"youtube":1820,"linkedin":1821},"https://twitter.com/gitlab","https://www.facebook.com/gitlab","https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg","https://www.linkedin.com/company/gitlab-com",[1823,1871,1929,1976,2017],{"title":1565,"links":1824,"subMenu":1840},[1825,1830,1835],{"text":1826,"config":1827},"View plans",{"href":1567,"dataGaName":1828,"dataGaLocation":1829},"view plans","footer",{"text":1831,"config":1832},"Why Premium?",{"href":1833,"dataGaName":1834,"dataGaLocation":1829},"/pricing/premium/","why premium",{"text":1836,"config":1837},"Why Ultimate?",{"href":1838,"dataGaName":1839,"dataGaLocation":1829},"/pricing/ultimate/","why ultimate",[1841],{"title":1842,"links":1843},"Contact Us",[1844,1847,1849,1851,1856,1861,1866],{"text":1845,"config":1846},"Contact sales",{"href":1713,"dataGaName":1385,"dataGaLocation":1829},{"text":1716,"config":1848},{"href":1718,"dataGaName":1719,"dataGaLocation":1829},{"text":1721,"config":1850},{"href":1723,"dataGaName":1724,"dataGaLocation":1829},{"text":1852,"config":1853},"Status",{"href":1854,"dataGaName":1855,"dataGaLocation":1829},"https://status.gitlab.com/","status",{"text":1857,"config":1858},"Terms of use",{"href":1859,"dataGaName":1860,"dataGaLocation":1829},"/terms/","terms of use",{"text":1862,"config":1863},"Privacy statement",{"href":1864,"dataGaName":1865,"dataGaLocation":1829},"/privacy/","privacy statement",{"text":1867,"config":1868},"Cookie preferences",{"dataGaName":1869,"dataGaLocation":1829,"id":1870,"isOneTrustButton":1358},"cookie preferences","ot-sdk-btn",{"title":1393,"links":1872,"subMenu":1888},[1873,1876,1878,1880,1882,1884],{"text":1874,"config":1875},"Explore the platform",{"href":1401,"dataGaName":1395,"dataGaLocation":1829},{"text":1451,"config":1877},{"href":1453,"dataGaName":1454,"dataGaLocation":1829},{"text":28,"config":1879},{"href":1407,"dataGaName":1408,"dataGaLocation":1829},{"text":1456,"config":1881},{"href":1458,"dataGaName":1459,"dataGaLocation":1829},{"text":1438,"config":1883},{"href":1440,"dataGaName":1441,"dataGaLocation":1829},{"text":1885,"config":1886},"Why GitLab",{"href":1756,"dataGaName":1887,"dataGaLocation":1829},"why gitlab",[1889],{"title":1890,"links":1891},"Topics",[1892,1895,1900,1904,1909,1914,1919,1924],{"text":28,"config":1893},{"href":27,"dataGaName":1894,"dataGaLocation":1829},"cicd",{"text":1896,"config":1897},"GitOps",{"href":1898,"dataGaName":1899,"dataGaLocation":1829},"/topics/gitops/","gitops",{"text":1367,"config":1901},{"href":1902,"dataGaName":1903,"dataGaLocation":1829},"/topics/devops/","devops",{"text":1905,"config":1906},"Version Control",{"href":1907,"dataGaName":1908,"dataGaLocation":1829},"/topics/version-control/","version control",{"text":1910,"config":1911},"DevSecOps",{"href":1912,"dataGaName":1913,"dataGaLocation":1829},"/topics/devsecops/","devsecops",{"text":1915,"config":1916},"Cloud Native",{"href":1917,"dataGaName":1918,"dataGaLocation":1829},"/topics/cloud-native/","cloud native",{"text":1920,"config":1921},"AI for Coding",{"href":1922,"dataGaName":1923,"dataGaLocation":1829},"/topics/devops/ai-for-coding/","ai for coding",{"text":1925,"config":1926},"Agentic AI",{"href":1927,"dataGaName":1928,"dataGaLocation":1829},"/topics/agentic-ai/","agentic ai",{"title":1477,"links":1930},[1931,1934,1937,1940,1943,1946,1948,1950,1952,1954,1956,1959,1961,1964,1968,1972],{"text":1932,"config":1933},"DevOps modernization",{"href":1492,"dataGaName":1493,"dataGaLocation":1829},{"text":1935,"config":1936},"Security modernization",{"href":1497,"dataGaName":1498,"dataGaLocation":1829},{"text":1938,"config":1939},"AI modernization",{"href":1502,"dataGaName":1503,"dataGaLocation":1829},{"text":1941,"config":1942},"Financial services",{"href":1528,"dataGaName":1529,"dataGaLocation":1829},{"text":1944,"config":1945},"Public sector",{"href":1533,"dataGaName":1534,"dataGaLocation":1829},{"text":1536,"config":1947},{"href":1538,"dataGaName":1539,"dataGaLocation":1829},{"text":1541,"config":1949},{"href":1543,"dataGaName":1544,"dataGaLocation":1829},{"text":1546,"config":1951},{"href":1548,"dataGaName":1549,"dataGaLocation":1829},{"text":1551,"config":1953},{"href":1553,"dataGaName":1554,"dataGaLocation":1829},{"text":1508,"config":1955},{"href":1510,"dataGaName":1511,"dataGaLocation":1829},{"text":1957,"config":1958},"Small business",{"href":1515,"dataGaName":1516,"dataGaLocation":1829},{"text":1518,"config":1960},{"href":1520,"dataGaName":1521,"dataGaLocation":1829},{"text":1896,"config":1962},{"href":1963,"dataGaName":1899,"dataGaLocation":1829},"/solutions/gitops/",{"text":1965,"config":1966},"Software composition analysis",{"href":1445,"dataGaName":1967,"dataGaLocation":1829},"software composition analysis",{"text":1969,"config":1970},"Value stream management",{"href":1463,"dataGaName":1971,"dataGaLocation":1829},"value stream management",{"text":1973,"config":1974},"All solutions",{"href":1484,"dataGaName":1975,"dataGaLocation":1829},"all solutions",{"title":1570,"links":1977},[1978,1983,1988,1990,1992,1994,1996,1998,2000,2002,2004,2006,2008,2010,2013],{"text":1979,"config":1980},"Install",{"href":1981,"dataGaName":1982,"dataGaLocation":1829},"/install/","install",{"text":1984,"config":1985},"Quick start guides",{"href":1986,"dataGaName":1987,"dataGaLocation":1829},"/get-started/","quick setup checklists",{"text":1583,"config":1989},{"href":1585,"dataGaName":1586,"dataGaLocation":1829},{"text":1588,"config":1991},{"href":1590,"dataGaName":1591,"dataGaLocation":1829},{"text":1593,"config":1993},{"href":1595,"dataGaName":1596,"dataGaLocation":1829},{"text":1598,"config":1995},{"href":1600,"dataGaName":1601,"dataGaLocation":1829},{"text":1603,"config":1997},{"href":1605,"dataGaName":1606,"dataGaLocation":1829},{"text":1616,"config":1999},{"href":1618,"dataGaName":1619,"dataGaLocation":1829},{"text":1621,"config":2001},{"href":1623,"dataGaName":1624,"dataGaLocation":1829},{"text":1626,"config":2003},{"href":1628,"dataGaName":1629,"dataGaLocation":1829},{"text":1631,"config":2005},{"href":1633,"dataGaName":1634,"dataGaLocation":1829},{"text":1636,"config":2007},{"href":1638,"dataGaName":1639,"dataGaLocation":1829},{"text":1699,"config":2009},{"href":1701,"dataGaName":1702,"dataGaLocation":1829},{"text":2011,"config":2012},"What's new",{"href":1647,"dataGaName":1648,"dataGaLocation":1829},{"text":2014,"config":2015},"All resources",{"href":1577,"dataGaName":2016,"dataGaLocation":1829},"all resources",{"title":1650,"links":2018},[2019,2021,2023,2025,2027,2029,2031,2033,2035,2039,2044],{"text":1658,"config":2020},{"href":1660,"dataGaName":1652,"dataGaLocation":1829},{"text":1663,"config":2022},{"href":1665,"dataGaName":1666,"dataGaLocation":1829},{"text":1669,"config":2024},{"href":1671,"dataGaName":1672,"dataGaLocation":1829},{"text":1674,"config":2026},{"href":1676,"dataGaName":1677,"dataGaLocation":1829},{"text":1679,"config":2028},{"href":1681,"dataGaName":1682,"dataGaLocation":1829},{"text":1684,"config":2030},{"href":1686,"dataGaName":1687,"dataGaLocation":1829},{"text":1689,"config":2032},{"href":1691,"dataGaName":1692,"dataGaLocation":1829},{"text":1694,"config":2034},{"href":1696,"dataGaName":1697,"dataGaLocation":1829},{"text":2036,"config":2037},"Sustainability",{"href":2038,"dataGaName":2036,"dataGaLocation":1829},"/sustainability/",{"text":2040,"config":2041},"Diversity, inclusion and belonging (DIB)",{"href":2042,"dataGaName":2043,"dataGaLocation":1829},"/diversity-inclusion-belonging/","Diversity, inclusion and belonging",{"text":2045,"config":2046},"Modern Slavery Transparency Statement",{"href":2047,"dataGaName":2048,"dataGaLocation":1829},"https://handbook.gitlab.com/handbook/legal/modern-slavery-act-transparency-statement/","modern slavery transparency statement",{"items":2050},[2051,2054,2057],{"text":2052,"config":2053},"Terms",{"href":1859,"dataGaName":1860,"dataGaLocation":1829},{"text":2055,"config":2056},"Cookies",{"dataGaName":1869,"dataGaLocation":1829,"id":1870,"isOneTrustButton":1358},{"text":2058,"config":2059},"Privacy",{"href":1864,"dataGaName":1865,"dataGaLocation":1829},[2061],{"id":2062,"title":7,"body":1354,"config":2063,"content":2065,"description":1354,"extension":2069,"meta":2070,"navigation":1358,"path":2071,"seo":2072,"stem":2073,"__hash__":2074},"blogAuthors/en-us/blog/authors/jeremy-wagner.yml",{"template":2064},"BlogAuthor",{"name":7,"config":2066},{"headshot":2067,"ctfId":2068},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749663285/Blog/Author%20Headshots/jeremywagner-headshot.jpg","jeremywagner","yml",{},"/en-us/blog/authors/jeremy-wagner",{},"en-us/blog/authors/jeremy-wagner","qVGFwwZ8NjcAgNoHIzoSozJkDFQZ4I1sbboOxEvREG8",[2076,2084,2092],{"title":2077,"description":2078,"heroImage":2079,"category":1350,"date":2080,"authors":2081,"slug":2083,"externalUrl":1354},"Two front doors: Module-level access in a Django GRC app","A technical deep-dive on restructuring a Django internal tool to support two distinct GitLab teams: Security Compliance and Internal Audit.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1750097663/Blog/Hero%20Images/Blog/Hero%20Images/Workflow%201800x945_2gQoQIbY9NvjLFpXtsxtXy_1750097663612.png","2026-10-05",[2082],"Donovan Felton","module-level-access-in-a-django-grc-app",{"title":2085,"description":2086,"heroImage":2087,"category":1350,"date":2088,"authors":2089,"slug":2091,"externalUrl":1354},"How GitLab reduced code-per-agentic-flow ratio by 45%","Learn how Flow Registry, a component-based framework that compiles YAML configurations into fully functional LangGraph flows, helped improve scalability and more.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1774465167/n5hlvrsrheadeccyr1oz.png","2026-09-22",[2090],"Mikolaj Wawrzyniak","how-gitlab-reduced-code-per-agentic-flow-ratio",{"title":2093,"description":2094,"heroImage":2095,"category":1350,"date":2096,"authors":2097,"slug":2099,"externalUrl":1354},"Co-Create: Building GitLab with our users","How GitLab users collaborated with us to build practical product improvements in the first half of 2026.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1750099203/Blog/Hero%20Images/Blog/Hero%20Images/blog-image-template-1800x945%20%2820%29_2bJGC5ZP3WheoqzlLT05C5_1750099203484.png","2026-09-10",[2098],"Isa Huerga","co-create-h1-2026",{"header":2101,"text":2102,"button":2106,"disclaimer":2109},"Start your free\n\n30-day GitLab trial\n",[2103,2104,2105],"GitLab Duo Agent Platform access","Try our most advanced features","Automate complex tasks with AI",{"text":1377,"config":2107},{"href":2108,"dataGaName":1380,"dataGaLocation":1619},"https://gitlab.com/-/trials/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/blog/","No credit card required.",{"header":2111,"blurb":2112,"button":2113,"secondaryButton":2118},"Start building faster today","See what your team can do with the intelligent orchestration platform for DevSecOps.\n",{"text":2114,"config":2115},"Get your free trial",{"href":2116,"dataGaName":1380,"dataGaLocation":2117},"https://gitlab.com/-/trial_registrations/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/","feature",{"text":1845,"config":2119},{"href":1713,"dataGaName":1385,"dataGaLocation":2117},1794911780449]