Amazon Q integration for testing and evaluation
This guide combines and builds on the following guides and sources. It describes Amazon Q set-up for testing and evaluation purposes:
This guide describes how to set up Amazon Q in a GitLab Linux package running in a VM, using the staging AI Gateway. The reason we need a GitLab Linux package instance instead of GDK is that the GitLab instance needs an HTTPS URL that can be accessed by Amazon Q.
Install and configure a GitLab Linux package on a virtual machine
Create a VM in AWS
- Go to cloud sandbox, and login with OKTA
- Click “Create Individual Account”, and choose
aws-***
(notaws-services-***
oraws-dedicated-***
). This will create a AWS sandbox and display login credentials - Configure an EC2 machine
A few things to note:
- Need to enable both HTTP and HTTPS traffic under firewall setting.
- Copy the external IP of the VM instance created.
Install GitLab
Follow this guide on how to install GitLab Linux package. We need to set up the external URL and an initial password. Install GitLab using the following command:
sudo GITLAB_ROOT_PASSWORD="your_password" EXTERNAL_URL="https://<vm-instance-external-ip>.nip.io" apt install gitlab-ee
This will use nip.io as the DNS service so the GitLab instance can be accessed through HTTPs
Config the newly installed GitLab instance
SSH into the VM, and add the following config into
/etc/gitlab/gitlab.rb
gitlab_rails['env'] = { "GITLAB_LICENSE_MODE" => "test", "CUSTOMER_PORTAL_URL" => "https://customers.staging.gitlab.com", "CLOUD_CONNECTOR_BASE_URL" => "https://cloud.staging.gitlab.com" }
Apply the config changes by
sudo gitlab-ctl reconfigure
Obtain and activate a self-managed ultimate license
- Go to staging customers portal, select “Signin with GitLab.com account”.
- Instead of clicking “Buy new subscription”, go to the product page directly. For reason of this, see buy_subscription
- Purchase the subscription using a test credit card. An activation code will be given. Do not purchase a duo-pro add-on, because currently duo-pro and Q are mutually exclusive.
- Go to the GitLab instance created earlier (
https://<vm-instance-external-ip>.nip.io
), log in with root account. Then on the left sidebar, go to Admin > Subscription, and enter the activation code
Create and configure an AWS sandbox
Follow the same step described above on how to create an AWS sandbox if you haven’t had one already.
Login into the newly created AWS account and create an Identity Provider following this instruction with slight modifications:
- Provider URL:
https://glgo.staging.runway.gitlab.net/cc/oidc/<your_gitlab_instance_id>
- Audience:
gitlab-cc-<your_gitlab_instance_id>
The GitLab instance ID can be found at
<gitlab_url>/admin/ai/amazon_q_settings
- Provider URL:
Create a new role using the identity provider. For this, we can follow this section exactly.
Add Amazon Q to GitLab
- Follow Enter the ARN in GitLab and enable Amazon Q exactly
- Now Q should be working. We can test it like this