I’m encountering inconsistent deployment speeds when using Terraform with GitLab CI/CD to deploy infrastructure on AWS. The resources are an EKS Cluster with 4 worker nodes and a set of IAM roles. Throughout the deployment the tf configuration / .gitlab-ci.yml both are untouched.
Is this because of some network latency issues between AWS and GitLab? Any insights or suggestions would be greatly appreciated.
provider version = “~> 5.44.0”
.gitlab-ci.yml
stages:
- plan
- apply
- cleanup
image:
name: “$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/releases/1.4:v1.0.0”
variables:
TF_ROOT: ${CI_PROJECT_DIR}
TF_STATE_NAME: default
GIT_DEPTH: 1
CLUSTER_NAME: TF-Cluster
FF_USE_FASTZIP: “true”
ARTIFACT_COMPRESSION_LEVEL: “fast”
CACHE_COMPRESSION_LEVEL: “fast”
cache:
key: “${TF_ROOT}”
paths:
– ${TF_ROOT}/.terraform/
terraform:plan:
stage: plan
script:
– gitlab-terraform plan
– gitlab-terraform plan-json
resource_group: ${TF_STATE_NAME}
artifacts:
public: false
paths:
– ${TF_ROOT}/plan.cache
reports:
terraform: ${TF_ROOT}/plan.json
terraform:apply:
stage: apply
variables:
GIT_CHECKOUT: “false”
script:
– gitlab-terraform apply
resource_group: ${TF_STATE_NAME}
rules:
– when: always
terraform:destroy:
stage: cleanup
variables:
GIT_CHECKOUT: “false”
script:
– gitlab-terraform destroy
resource_group: ${TF_STATE_NAME}
rules:
– when: always
Initially, I expected consistent deployment times, given that the Terraform configuration and GitLab CI/CD pipeline setup remained unchanged. However, despite this, the deployment speeds varied significantly across runs.
[Deployment speeds:]
working_pod is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.