This example will prepare the AWS infrastructure and services required to run Artifactory and Xray (installed with the jfrog-platform Helm Chart) using Terraform:
- The AWS VPC
- RDS (PostgreSQL) as the database for each application
- S3 as the Artifactory object storage
- EKS as the Kubernetes cluster for running Artifactory and Xray with pre-defined node groups for the different services
The resources are split between individual files for easy and clear separation.
The jfrog-values.yaml file has the values that Helm will use to configure the JFrog Platform 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 and Xray have pre-defined sizing templates that you can use to deploy them. The supported sizing templates in this project are small
, medium
, large
, xlarge
, and 2xlarge
.
The sizing templates will be pulled from the official Helm Charts 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'
- Apply the Terraform configuration by running the following command
terraform apply -var 'sizing=small'
- 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 the JFrog Platform (Artifactory and Xray) 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 jfrog jfrog/jfrog-platform \
--version <version> \
--namespace <namesapce>> --create-namespace \
-f ./jfrog-values.yaml \
-f ./artifactory-license.yaml \
-f ./jfrog-artifactory-<sizing>-adjusted.yaml \
-f ./jfrog-xray--<sizing>-adjusted.yaml \
-f ./jfrog-custom.yaml \
--timeout 600s