{"id":22870935,"url":"https://github.com/percona-lab/terraform-provider-percona","last_synced_at":"2025-05-05T22:17:17.526Z","repository":{"id":68884208,"uuid":"529341403","full_name":"Percona-Lab/terraform-provider-percona","owner":"Percona-Lab","description":"Terraform modules to deploy Percona Server and Percona XtraDB Cluster","archived":false,"fork":false,"pushed_at":"2024-01-29T11:13:24.000Z","size":199,"stargazers_count":11,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-05T22:17:04.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Percona-Lab.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-08-26T17:05:04.000Z","updated_at":"2024-01-27T02:56:09.000Z","dependencies_parsed_at":"2023-03-22T07:34:17.295Z","dependency_job_id":null,"html_url":"https://github.com/Percona-Lab/terraform-provider-percona","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fterraform-provider-percona","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fterraform-provider-percona/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fterraform-provider-percona/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fterraform-provider-percona/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Percona-Lab","download_url":"https://codeload.github.com/Percona-Lab/terraform-provider-percona/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252584333,"owners_count":21771945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T13:16:38.134Z","updated_at":"2025-05-05T22:17:17.508Z","avatar_url":"https://github.com/Percona-Lab.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Percona Terraform Provider\n\n### DISCLAIMER\n\nThis is an experimental project, use on your own risk. This project is not covered by Percona Support\n\n## Requirements\n\n- [Terraform](https://www.terraform.io/downloads.html) 1.1.2\n- [Go](https://golang.org/doc/install) 1.18.x (to build the provider plugin)\n- [AWS](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) 1 or 2 version\n\n## How to run on AWS\n\n1. Clone repo\n2. Configure AWS CLI - [tutorial](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html)\n3. Switch to project directory\n4. Execute in console `make all` or go through **Makefile**(in the root of project) manually\n5. When cluster is set up, connect to one of the PXC instances\n6. Login to mysql with command `sudo mysql -uroot -p` and enter password `password`\n7. Check cluster status `show status like 'wsrep%';`\n8. Connect to one of the Percona Server replica\n9. Check replication status using `SHOW SLAVE STATUS\\G` on replica\n\n## How to run on Google Cloud Platform\n\n1. Create service account in Google Cloud Console and create key for it (for more info, visit https://cloud.google.com/docs/authentication/getting-started)\n2. Export `GOOGLE_APPLICATION_CREDENTIALS` environment variable to point to the file with credentials (e.g. `export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json`)\n3. Execute `make all`\n\n## Configuration\n\nFile **main.tf**\n\n```\n# AWS provider configuration\nprovider \"percona\" {\n  region                   = \"eu-north-1\"               # required\n  profile                  = \"default\"                  # optional\n  cloud                    = \"aws\"                      # required, supported values: \"aws\", \"gcp\"\n  ignore_errors_on_destroy = true                       # optional, default: false\n  disable_telemetry        = true                       # optional, default: false\n}\n\n# GCP provider configuration\n#provider \"percona\" {\n#  region                   = \"europe-west1\"\n#  zone                     = \"europe-west1-c\"\n#  project                  = \"project-name\"\n#  cloud                    = \"gcp\"\n#  ignore_errors_on_destroy = false\n#}\n\nresource \"percona_ps\" \"ps\" {\n  instance_type            = \"t3.micro\"                          # required\n  key_pair_name            = \"sshKey1\"                           # required\n  password                 = \"password\"                          # optional, default: \"password\"\n  replication_type         = \"async\"                             # optional, default: \"async\", supported values: \"async\", \"group-replication\"\n  replication_password     = \"replicaPassword\"                   # optional, default: \"replicaPassword\"\n  cluster_size             = 2                                   # optional, default: 3\n  path_to_key_pair_storage = \"/tmp/\"                             # optional, default: \".\"\n  volume_type              = \"gp2\"                               # optional, default: \"gp2\" for AWS, \"pd-balanced\" for GCP\n  volume_size              = 20                                  # optional, default: 20\n  volume_iops              = 4000                                # optional\n  volume_throughput        = 4000                                # optional, AWS only\n  config_file_path         = \"./config.cnf\"                      # optional, saves config file to /etc/mysql/mysql.conf.d/custom.cnf\n  version                  = \"8.0.28\"                            # optional, installs last version if not specified\n  myrocks_install          = true                                # optional, default: false\n  vpc_name                 = \"percona_vpc_1\"                     # optional\n  vpc_id                   = \"cGVyY29uYV92cGNfMQ==\"              # optional, AWS only\n  port                     = 3306                                # optional, default: 3306\n  pmm_address              = \"http://admin:admin@127.0.0.1\"      # optional\n  pmm_password             = \"password\"                          # optional, password for internal `pmm` user in db\n  orchestrator_size        = 3                                   # optional, default: 0\n  orchestrator_password    = \"password\"                          # optional, default: \"password\"\n}\n\nresource \"percona_pxc\" \"pxc\" {\n  instance_type            = \"t3.micro\"                          # required\n  key_pair_name            = \"sshKey2\"                           # required\n  password                 = \"password\"\t                         # optional, default: \"password\"\n  cluster_size             = 2                                   # optional, default: 3\n  path_to_key_pair_storage = \"/tmp/\"                             # optional, default: \".\"\n  volume_type              = \"gp2\"                               # optional, default: \"gp2\" for AWS, \"pd-balanced\" for GCP\n  volume_size              = 20                                  # optional, default: 20\n  volume_iops              = 4000                                # optional\n  volume_throughput        = 4000                                # optional, AWS only\n  config_file_path         = \"./config.cnf\"                      # optional, saves config file to /etc/mysql/mysql.conf.d/custom.cnf\n  version                  = \"8.0.28\"                            # optional, installs last version if not specified\n  vpc_name                 = \"percona_vpc_1\"                     # optional\n  vpc_id                   = \"cGVyY29uYV92cGNfMQ==\"              # optional, AWS only\n  port                     = 3306                                # optional, default: 3306\n  galera_port              = 4567                                # optional, default: 4567\n  pmm_address              = \"http://admin:admin@127.0.0.1\"      # optional\n  pmm_password             = \"password\"                          # optional, password for internal `pmm` user in db\n}\n\nresource \"percona_pmm\" \"pmm\" {\n  instance_type            = \"t3.micro\"                          # required\n  key_pair_name            = \"sshKey2\"                           # required\n  path_to_key_pair_storage = \"/tmp/\"                             # optional, default: \".\"\n  volume_type              = \"gp2\"                               # optional, default: \"gp2\" for AWS, \"pd-balanced\" for GCP\n  volume_size              = 20                                  # optional, default: 20\n  volume_iops              = 4000                                # optional\n  volume_throughput        = 4000                                # optional, AWS only\n  vpc_name                 = \"percona_vpc_1\"                     # optional\n  vpc_id                   = \"cGVyY29uYV92cGNfMQ==\"              # optional, AWS only\n\n  rds_username             = \"postgres\"                          # optional, default: \"\"\n  rds_password             = \"password\"                          # optional, default: \"\"\n}\n\nresource \"percona_pmm_rds\" \"pmm_rds\" {\n  pmm_address              = \"http://admin:admin@localhost\"      # required\n  rds_id                   = \"database-1\"                        # required\n  rds_username             = \"postgres\"                          # required\n  rds_password             = \"password\"                          # required\n  rds_pmm_user_password    = \"password\"                          # optional, default: \"password\"\n}\n```\n\nFile **version.tf**\n\n```\nterraform {\n  required_providers {\n    percona = {\n      version = \"~\u003e 0.9.10\"\n      source  = \"terraform-percona.com/terraform-percona/percona\"\n    }\n  }\n}\n```\n\n## Required permissions\n\n\u003cdetails\u003e\n\u003csummary\u003eFor AWS\u003c/summary\u003e\n\nAWS managed policy: AmazonEC2ContainerServiceAutoscaleRole\n\n```bash\n//AmazonEC2ContainerServiceAutoscaleRole\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ecs:DescribeServices\",\n                \"ecs:UpdateService\"\n            ],\n            \"Resource\": [\n                \"*\"\n            ]\n        },\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"cloudwatch:DescribeAlarms\",\n                \"cloudwatch:PutMetricAlarm\"\n            ],\n            \"Resource\": [\n                \"*\"\n            ]\n        }\n    ]\n}\n```\n\nCustom AWS Policy\n\n```bash\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"VisualEditor0\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ec2:CreateDhcpOptions\",\n                \"ec2:AuthorizeSecurityGroupIngress\",\n                \"ec2:DeleteSubnet\",\n                \"ec2:DescribeInstances\",\n                \"ec2:MonitorInstances\",\n                \"ec2:CreateKeyPair\",\n                \"ec2:AttachInternetGateway\",\n                \"ec2:UpdateSecurityGroupRuleDescriptionsIngress\",\n                \"ec2:AssociateRouteTable\",\n                \"ec2:DeleteRouteTable\",\n                \"ec2:StartInstances\",\n                \"ec2:RevokeSecurityGroupEgress\",\n                \"ec2:CreateRoute\",\n                \"ec2:CreateInternetGateway\",\n                \"ec2:DescribeVolumes\",\n                \"ec2:DeleteInternetGateway\",\n                \"ec2:DescribeReservedInstances\",\n                \"ec2:DescribeKeyPairs\",\n                \"ec2:DescribeRouteTables\",\n                \"ec2:DetachVolume\",\n                \"ec2:UpdateSecurityGroupRuleDescriptionsEgress\",\n                \"ec2:DescribeReservedInstancesOfferings\",\n                \"ec2:CreateRouteTable\",\n                \"ec2:RunInstances\",\n                \"ec2:ModifySecurityGroupRules\",\n                \"ec2:StopInstances\",\n                \"ec2:CreateVolume\",\n                \"ec2:RevokeSecurityGroupIngress\",\n                \"ec2:DescribeSecurityGroupRules\",\n                \"ec2:DeleteDhcpOptions\",\n                \"ec2:DescribeInstanceTypes\",\n                \"ec2:DeleteVpc\",\n                \"ec2:AssociateAddress\",\n                \"ec2:CreateSubnet\",\n                \"ec2:DescribeSubnets\",\n                \"ec2:DeleteKeyPair\",\n                \"ec2:AttachVolume\",\n                \"ec2:DisassociateAddress\",\n                \"ec2:DescribeAddresses\",\n                \"ec2:PurchaseReservedInstancesOffering\",\n                \"ec2:DescribeInstanceAttribute\",\n                \"ec2:CreateVpc\",\n                \"ec2:DescribeDhcpOptions\",\n                \"ec2:DescribeAvailabilityZones\",\n                \"ec2:CreateSecurityGroup\",\n                \"ec2:ModifyVpcAttribute\",\n                \"ec2:ModifyReservedInstances\",\n                \"ec2:DescribeInstanceStatus\",\n                \"ec2:RebootInstances\",\n                \"ec2:AuthorizeSecurityGroupEgress\",\n                \"ec2:AssociateDhcpOptions\",\n                \"ec2:TerminateInstances\",\n                \"ec2:DescribeIamInstanceProfileAssociations\",\n                \"ec2:DescribeTags\",\n                \"ec2:DeleteRoute\",\n                \"ec2:AllocateAddress\",\n                \"ec2:DescribeSecurityGroups\",\n                \"ec2:DescribeImages\",\n                \"ec2:DescribeVpcs\",\n                \"ec2:DeleteSecurityGroup\",\n                \"ec2:CreateNetworkInterface\",\n                \"ec2:DescribeInternetGateways\",\n                \"ec2:DescribeVpcAttribute\",\n                \"ec2:DeleteNetworkInterface\",\n                \"ec2:DeleteSecurityGroup\",\n                \"ec2:ModifyNetworkInterfaceAttribute\"\n            ],\n            \"Resource\": \"*\"\n        }\n    ]\n}\n```\n\n\u003c/details\u003e\n\n## NOTE\n\n**Instance types**, in some regions some may be available and in others they may not.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona-lab%2Fterraform-provider-percona","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercona-lab%2Fterraform-provider-percona","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona-lab%2Fterraform-provider-percona/lists"}