Package: edb-pot
Getting Startededb-pottool is an easy way to provision Cloud resources and deploy
PostgreSQL, EDB Postgres Advanced Server and tools (high availability and monitoring)
for Proof Of Technology.Supported Cloud providers areAWS,AzureandGoogle Cloud.edb-pothelps user to deploy custom Postgres Reference Architectures tailored for showing functionalities of EDB Tech.edb-potis an open source tool and is not officially supported by EDB
Support. It is maintained and supported by the GitHub members of this
repository. Please provide feedback by posting issues and providing pull
requests.Before starting to delve into this repository, it is best to get familiar with
the steps in the deployment process of a specific cloud (AWS, Azure and Google
Cloud).Pre-Requisitesedb-potis dependent on following components. Install the following
components before using it.Python 3pip3Third party pre-requisites:Latest vendorCloud CLI or SDK ( AWS, Azure or Google Cloud )Depending on the cloud provider, install thelatest versionfor: AWS
CLI, Azure CLI or Google Cloud SDK on the system.Terraform>= 0.13Ansible>= 2.9To help the installation of the third party pre-requisites listed above,edb-potprovides installation scripts for Linux (x64) and MacOS (x64).
Please refer to sectionPre-Requisites installation scripts.InstallationFrom source codeInstallation is done using thepip3command. Once the code has been
downloaded, either by cloning the repository or downloading a release, go to
the created folder and run the commandpip3 install:$cdpostgres-deployment
$sudopip3install.--upgradeFrom Pypi$sudopip3installedb-potMake sure the tool is well installed by running the command:$edb-pot--versionShell auto-completionedb-potsupports command line auto-completion with thetabkey.Supported shells arebashanszsh.To enable auto-completion in current session, the following command must be
ran:$eval"$(register-python-argcompleteedb-pot)"To enable auto-completion for all the sessions, the command above must be added
at the end of your~/.bashrcfile or~/.zshrcfile, depending on the shell
you use.Pre-Requisites installation scriptsTo ease installation of the third party pre-requisites tools likeaws,terraform,ansible, etc.. some bash installation scripts are provided for
Linux (x64) and MacOS (x64). They are located in thescript/folder.The following packages are required in order to execute the installation
script:gcc(Linux only),python3-devel(Linux only),unzip,wget,tar. These packages should be installed through usual package manager (dnf,apt,brew, etc..).Finally, Pythonvirtualenvmust be installed withrootprivileges:$sudopip3installvirtualenvThe pre-requisites installation script can now be run. By default, third party
tools are installed into the folder$HOME/.edb-cloud-tools, this path can be
changed by setting the environment variableINSTALL_PATH.On Linux:$/usr/local/share/edb-pot/scripts/install_requirements_linux_x64.shOn MacOS (Python 3.9 installed withbrew):$/usr/local/share/edb-pot/scripts/install_requirements_darwin_x64.shThe last action is to add the installation path to thePATHvariable. If your
shell isbash, just enter:$source~/.bashrcFor other shells, you have to re-export the environment variablePATHthis
way:$exportPATH=$PATH:$HOME/.edb-cloud-tools/binYou can now check if the tools are ready to use with the commandsaws --version,ansible --version, etc..UsageEach new deployment will be done under a dedicated name space, this the<PROJECT_NAME>.edb-potCLI features are implemented through sub-commands. Each
sub-command can be executed like this:$edb-pot<CLOUD_VENDOR><SUB_COMMAND>[<PROJECT_NAME>]Cloud vendor listaws: Amazon Web Servicesazure: Microsoft Azure Cloudgcloud: Google CloudSub-commandsconfigure: New project initialization and configurationprovision: Cloud resources provisioningdestroy: Cloud resources destructiondeploy: Postgres and tools deploymentdisplay: Display the project informationpasswords: Display the project passwordsshow: Show configurationlist: List projectsspecs: Show Cloud Vendor default specificationslogs: Show project logsremove: Remove projectHow to UseDeployment of new project should follow the work flow below:Configure Cloud credentialsProject configurationCloud resources provisioningPostgres and tools deploymentConfigure Cloud credentialsThis step depends on the target Cloud vendor.AWS credentials configurationAWS credentials configuration will be done throughawstool. For this step,
we need to get yourAWS Access Key IDandAWS Secret Access Key. For
more information about Amazon Access Key management, please go toofficial documentation page.Run the following command and enter the Access Key ID and Secret Access Key:$awsconfigureAzure credentials configurationAzure Cloud credentials configuration can be achieved using theaztool with
the following command:$azlogin--use-device-codeGCloud credentials configurationGCloud credentials configuration includes more steps than the other Cloud
vendors.GCloud project IDis required.Login with your email address:$gcloudauthlogin<LOGIN_EMAIL>--no-launch-browserOpen the link in your browser and copy the given verification code.Project configuration$gcloudconfigsetproject<PROJECT_ID>To find the IAM account of the service, please enter the following command
to list service accounts:$gcloudiamservice-accountslistFinally, to create and download a new service account key:$gcloudiamservice-accountskeyscreate~/accounts.json--iam-account=<IAM_ACCOUNT>The JSON file$HOME/accounts.jsonmust be kept and will be required byedb-pot.Project configurationOnce Cloud vendor credentials have been configured, you can proceed with
project configuration step.Cloud vendor specificationsedb-potbrings default configuration values for the Cloud resources
to be provisioned, likeinstance type,disk size,OS image,additional volumes, etc..To change these configuration values, you need first to dump the default values
with:$edb-pot<CLOUD_VENDOR>specs>my_configuration.jsonThen, you can edit and update resources configuration stored in the JSON file.Project initializationProject initialialization will done using theconfiguresub-command:$edb-deploy<CLOUD_VENDOR>configure<PROJECT_NAME>\--route53-access-key<route53-acccess-key>\--route53-secret<route53-secret>\--email-id<email-id>\-u"<EDB_REPO_USERNAME>:<EDB_REPO_PASSWORD>"\-r<CLOUD_REGION>\-smy_configuration.jsonNotes:"EDB_REPO_USERNAME:EDB_REPO_PASSWORD"EDB Packages repository credentials.Required.CLOUD_REGIONCloud vendor region. Default value depends on Cloud vendor.For more details, please use:$edb-pot<CLOUD_VENDOR>configure--helpCloud resources provisioningAfter project configuration, we can proceed to Cloud resources provisioning:$edb-pot<CLOUD_VENDOR>provision<PROJECT_NAME>Components deploymentFinally, we can deploy the components with thedeploysub-command:$edb-pot<CLOUD_VENDOR>deploy<PROJECT_NAME>Other featuresList of projects:$edb-pot<CLOUD_VENDOR>listDisplay of projects inventory:$edb-pot<CLOUD_VENDOR>display<PROJECT_NAME>Display of projects passwords:$edb-pot<CLOUD_VENDOR>passwords<PROJECT_NAME>Cloud resources destruction:$edb-pot<CLOUD_VENDOR>destroy<PROJECT_NAME>Project tree deletion:$edb-pot<CLOUD_VENDOR>remove<PROJECT_NAME>LicenseOriginal work Copyright 2019-2020, EnterpriseDB CorporationAll rights reserved.Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.Neither the name of EnterpriseDB nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE.