This example will prepare the AWS infrastructure and services required to run JFrog Artifactory using Terraform:
- The AWS VPC
- RDS (PostgreSQL) as the database
- S3 as the object storage
- EKS as the Kubernetes cluster for running Artifactory
The resources are split between individual files for easy and clear separation.
After all the resources are created, you can install Artifactory using the official Artifactory Helm Chart.
The Terraform configuration will output the Artifactory install command.
The artifactory-values.yaml file has the values that Helm will use to configure the Artifactory installation.
The artifactory-license-template.yaml file has the license key(s) template that you will need to copy to a artifactory-license.yaml
file.
cp artifactory-license-template.yaml artifactory-license.yaml
If you plan on skipping the license key(s) for now, you can leave the artifactory-license.yaml
file empty. Terraform will create an empty one for you if you don't create it.
Artifactory has pre-defined sizing templates that you can use to deploy Artifactory. The supported sizing templates in this project are small
, medium
, large
, xlarge
, and 2xlarge
.
The sizing templates will be pulled from the official Artifactory Helm Chart during the execution of the Terraform configuration.
- Initialize the Terraform configuration by running the following command
terraform init
- Plan the Terraform configuration by running the following command
terraform plan -var 'sizing=small' -var 'env_name=my-env'
- Apply the Terraform configuration by running the following command
terraform apply -var 'sizing=small' -var 'env_name=my-env'
- When you are done, you can destroy the resources by running the following command
terraform destroy
To get the kubectl
configuration for the EKS cluster, run the following command
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
Once done, install Artifactory using the Helm Chart with the following command.
Terraform will create the needed configuration files to be used for the helm install
command.
This command will auto generate and be writen to the console when you run the terraform apply
command.
helm upgrade --install artifactory jfrog/artifactory \
--version <version> \
--namespace <namespace> --create-namespace \
-f artifactory-values.yaml \
-f artifactory-license.yaml \
-f artifactory/sizing/artifactory-<sizing>.yaml \
-f artifactory-custom.yaml \
--timeout 600s