

GitHub - Percona-Lab/terraform-provider-percona: Terraform modules to deploy Per...
source link: https://github.com/Percona-Lab/terraform-provider-percona
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Percona Terraform Provider
DISCLAIMER
This is an experimental project, use on your own risk. This project is not covered by Percona Support
Requirements
How to run on AWS
- Clone repo
- Configure AWS CLI - tutorial
- Switch to project directory
- Execute in console
make all
or go through Makefile(in the root of project) manually - When cluster is set up, connect to one of the PXC instances
- Login to mysql with command
sudo mysql -uroot -p
and enter passwordpassword
- Check cluster status
show status like 'wsrep%';
- Connect to one of the Percona Server replica
- Check replication status using
SHOW SLAVE STATUS\G
on replica
How to run on Google Cloud Platform
- Create service account in Google Cloud Console and create key for it (for more info, visit https://cloud.google.com/docs/authentication/getting-started)
- Export
GOOGLE_APPLICATION_CREDENTIALS
environment variable to point to the file with credentials (e.g.export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
) - Execute
make all
Configuration
File main.tf
# AWS provider configuration
provider "percona" {
region = "eu-north-1" # required
profile = "default" # optional
cloud = "aws" # required, supported values: "aws", "gcp"
ignore_errors_on_destroy = true # optional, default: false
}
# GCP provider configuration
#provider "percona" {
# region = "europe-west1"
# zone = "europe-west1-c"
# project = "project-name"
# cloud = "gcp"
# ignore_errors_on_destroy = false
#}
resource "percona_ps" "ps" {
instance_type = "t3.micro" # required
key_pair_name = "sshKey1" # required
password = "password" # optional, default: "password"
replica_password = "replicaPassword" # optional, default: "replicaPassword"
cluster_size = 2 # optional, default: 3
path_to_key_pair_storage = "/tmp/" # optional, default: "."
volume_type = "gp2" # optional, default: "gp2" for AWS, "pd-balanced" for GCP
volume_size = 20 # optional, default: 20
volume_iops = 4000 # optional
config_file_path = "./config.cnf" # optional, saves config file to /etc/mysql/mysql.conf.d/custom.cnf
version = "8.0.28" # optional, installs last version if not specified
myrocks_install = true # optional, default: false
vpc_name = "percona_vpc_1" # optional
}
resource "percona_pxc" "pxc" {
instance_type = "t3.micro" # required
key_pair_name = "sshKey2" # required
password = "password" # optional, default: "password"
cluster_size = 2 # optional, default: 3
path_to_key_pair_storage = "/tmp/" # optional, default: "."
volume_type = "gp2" # optional, default: "gp2" for AWS, "pd-balanced" for GCP
volume_size = 20 # optional, default: 20
volume_iops = 4000 # optional
config_file_path = "./config.cnf" # optional, saves config file to /etc/mysql/mysql.conf.d/custom.cnf
version = "8.0.28" # optional, installs last version if not specified
vpc_name = "percona_vpc_1" # optional
}
File version.tf
terraform {
required_providers {
percona = {
version = "~> 0.9.0"
source = "terraform-percona.com/terraform-percona/percona"
}
}
}
Required permissions
For AWS
Instance types, in some regions some may be available and in others they may not.
Recommend
-
46
README.md Terraform Provider for Linode Website: https://www.terraform.io Documentation:
-
8
Today, we’ll cover a cool Terraspace feature. It allows you to deploy all of your infrastructure in a single command. terraspace all up Terraspace...
-
26
In this post, I’m going to configure the continuous delivery process for Azure WebApp (Azure Function in this case, but that’s pretty much the same) with Octopus Deploy. To make it a little bit interesting I’m going to use Configuration-as-Co...
-
3
Files Permalink Latest commit message Commit time
-
6
2021_10_arm_cpu_comparison_m6 overview Performance comparison of AWS vCPU (Graviton, Intel and AMD) main goal of this research was compare different CPU (AWS) and how they work with Mysql. For that purposes we...
-
8
2021_10_arm_cpu_comparison overview Performance comparison of AWS vCPU (Graviton, Intel and AMD) main goal of this research was compare different CPU (AWS) and how they work with Mysql. For that purposes we too...
-
13
Percona-Lab/install-repo-pmm-server main
-
4
GitHub - Percona-Lab/serverless-postgresql-build Skip to content...
-
9
My Automated Lab project: #6 Create a S3 Bucket with Terraform Luca Dell'Oca,
-
9
BlogHow to create and update Google terraform provider magic modules resource definitions Mark van Holsteijn 31...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK