This ready to use example show you how to deploy a lifecycle job from GitHub (and from an image) on AWS. All of that in just a few lines of Terraform file.
Terraform providers used:
Behind the scene, Qovery:
- Creates a complete infrastructure on your AWS account (VPC, Security Groups, Subnet, EKS/Kubernetes...)
- Creates Qovery resources:
- Organization
Terraform Demo
- Project
lifecycle-job
- Environment
production
- Application
lifecycle-job
- Builds
echo app
application - Pushes
echo app
container image in your ECR registry - Deploys it on your EKS cluster (created by Qovery) and run it on the schedule you've defined
It will take approximately 20 minutes to create your infrastructure and less than 5 minutes to deploy your lifecycle job.
- Clone this repository
- Sign in to Qovery
- Install the Qovery CLI and generate an API Token with this guide.
- Generate your AWS credentials (
Access Key ID
andSecret Access Key
) with this guide - Open you terminal and run the following command by changing the values:
export TF_VAR_aws_access_key_id=YOUR_AWS_ACCESS_KEY_ID \
TF_VAR_aws_secret_access_key=YOUR_AWS_SECRET_ACCESS_KEY \
TF_VAR_qovery_access_token=YOUR_QOVERY_API_TOKEN \
TF_VAR_qovery_organization_id=YOUR_QOVERY_ORG_ID
- Clone my Echo app
- Edit the
main.tf
file and change:
- Resource
resource "qovery_job" "lifecycle-job"
fieldsource.git_repository.url
(=https://github.com/Qovery/terraform-provider-testing.git
) with yours - Resource
resource "qovery_job" "lifecycle-job"
fieldsource.git_repository.branch
(=job-echo-n-seconds
) with yours
- You can now run the Terraform commands
terraform init
terraform plan
terraform apply
- Open your Qovery console to find out the newly created lifecycle job.
- To tear down your infrastructure and avoid unnecessary cloud costs you can run
terraform destroy
.