Start by downloading this repository to your local machine (or wherever you would like to issue the Terraform commands from)
- If you do not have Terraform installed, please install from Hashicorp
- Copy terraform.tfvars.sample to terraform.tfvars
- Update terrform.tfvars with the relevant data
- Follow these steps to get an Aiven API Key
- Use a GitHub token to allow secure access for GitHub.
- Generate a key for SSH to the AWS instances.
- Set the temporary Access for accessing AWS, these will expire and need to be reset.
- Please note that the AWS AMI is tied to the region. After you set the region, please find a valid AMI from the EC2 AMI catalog.
terraform init
terraform apply -auto-approve
- The kafka_executors will build for a few minutes after terraform finishes.
- Connect to the application servers using
terraform output dataGeneratorURL
- The username and password are in terraform.tfvars, and seen via
terraform output dataGeneratorUserPass
- The username and password are in terraform.tfvars, and seen via
- Can connect to Grafana through the application or through the Aiven console.
terraform destroy -auto-approve
Please be responsible and teardown your environment when your testing as completed.
All terraform commands must be issued inside the Terraform directory!!! and while Thanos is in Beta please execute the following export for Terraform...
export PROVIDER_AIVEN_ENABLE_BETA=true
terraform init
- Used to initialize the Terraform clientterraform plan
- Used to check what Terraform plans to do if appliedterraform apply -auto-approve
- Used to execute the Terraform planterraform apply -replace="aws_instance.data-generator[0]" -auto-approve
- used to rebuild one componentterraform output
- Show output parameters from the previous applyterraform plan -destroy
- Used to check what Terraform plans to do if a destroy command is issuedterraform destroy -auto-approve
- Used to remove the resources from the Terraform plan
ssh -i ~/Downloads/ohio-jturner.pem ubuntu@$(terraform output -json dataGeneratorDNS |jq -r '.[0][0]')
ssh -i ~/Downloads/ohio-jturner.pem ubuntu@$(terraform output -json dataGeneratorDNS |jq -r '.[0][1]')
to get 2nd instance
Please update the commands to use the pem file defined in terraform.tfvars
Filename | Description |
---|---|
dataGenerator.tf | Creates cloud application server(s) |
dataGenerator.tftpl | Template file for setting up the application server(s) |
grafana.tf | Creates the Grafana instance |
kafka.tf | Creates a Kafka instance and 2 connectors used to pull data from Postgresql to MySQL |
provider.tf | Sets up the Aiven Terraform provider |
terraform.tfvars.sample | Template to create the terraform.tfvars file. Please set before attempting to run |
thanos.tf | Creates the Thanos instance |
variables.tf | Creates variables that get set by the terraform.tfvars file |