In this section, you will configure project-level CI/CD environment variables in GitLab and trigger an automated release pipeline by publishing a Git tag. These variables supply infrastructure identifiers and AWS credentials to our pipeline jobs without hardcoding secrets into the source code repository.
GitLab CI/CD uses environment variables to pass configuration parameters and credentials to runner execution shells. In containerized deployments targeting Amazon ECS:
In your forked GitLab repository, navigate to the left sidebar menu:

Click the Add variable button to create each required environment variable.

For each variable in the table below, configure the Key, Value, and security flags:
AWS_SECRET_ACCESS_KEY).

| Variable Key | Description | Example / Recommended Value | Protected | Masked |
|---|---|---|---|---|
CLUSTER_NAME | Amazon ECS cluster name hosting frontend and backend | fcaj-lab-cluster | No | No |
SERVICE_NAME_FE | ECS Service name for the frontend application | app-frontend | No | No |
SERVICE_NAME_BE | ECS Service name for the backend | app-backend | No | No |
AWS_REGION | AWS Region where resources are deployed | us-east-1 | No | No |
AWS_ACCOUNT_NUMBER | 12-digit AWS Account ID | YOUR_AWS_ACCOUNT_NUMBER | No | No |
AWS_ACCESS_KEY_ID | IAM Access Key ID for CLI authentication | YOUR_AWS_ACCESS_KEY_ID | No | Yes |
AWS_SECRET_ACCESS_KEY | IAM Secret Access Key for CLI authentication | YOUR_AWS_SECRET_ACCESS_KEY | No | Yes |
CI_PROJECT_BE_NAME | Amazon ECR repository name for the backend image | aws-fcaj-container-app-backend | No | No |
CI_PROJECT_FE_NAME | Amazon ECR repository name for the frontend image | aws-fcaj-container-app-frontend | No | No |
TASK_NAME_FE | Amazon ECS Task Definition family name for frontend | FCAJResbar-task-fe | No | No |
TASK_NAME_BE | Amazon ECS Task Definition family name for backend | FCAJResbar-task-be | No | No |
Ensure that Protect variable is UNCHECKED for all variables unless your Git tags are explicitly configured as protected tags under Settings → Repository → Protected tags. If this checkbox remains checked on an unprotected tag, the runner shell will receive empty strings, causing deploy-backend.sh to fail with: [-] Error: Environment variable CLUSTER_NAME is required but not set.
Our .gitlab-ci.yml pipeline uses conditional rules that automatically trigger build and deployment workflows whenever a Git release tag is pushed.
In the left navigation menu of your GitLab project:

Fill in the release tag parameters:
Click Create tag to publish the release point.

Using semantic versioning (such as v1.0.0, v1.0.1, v1.0.2) provides traceable release lineages. In this pipeline, the Git tag name ($CI_COMMIT_TAG) is directly used to tag container images pushed to Amazon ECR.
Verify that the tag exists in your repository:
| Verification Item | Target Value | Validation Procedure |
|---|---|---|
| Tag Identifier | v1.0.0 | In GitLab UI, navigate to Code → Tags and confirm v1.0.0 is listed |
| Commit Reference | Latest commit on main | Confirm the tag points to your commit: feat(frontend): update dashboard title to v1.0.0 |
Once the tag is published, GitLab automatically generates a pipeline consisting of three stages: build, push, and deploy.
In the left sidebar menu, navigate to Build → Pipelines.
Locate the pipeline triggered for tag v1.0.0.

Click on the pipeline status badge to inspect the execution graph.

Select the Job dependencies tab and enable Show dependencies to visualize the pipeline:

Click on the deploy:backend job to view its live execution log.

The job execution output details:
A solid green on all jobs indicates end-to-end success. If any job fails, click the red failure badge to inspect the stdout/stderr trace. Common root causes include incorrect variable spellings, missing permissions on CustomRWECRRole, or offline GitLab Runners.