deployfish-mysql
deployfish-mysql is a plugin for deployfish that
allows you to manage databases in remote MySQL servers in AWS.
deploy mysql create {name}: Create database a database and user, with appropriateGRANTs.deploy mysql update {name}: Update the user's password andGRANTsdeploy mysql validate {name}: Validate that the username/password combination is validdeploy mysql dump {name}: Dump MySQL databases as SQL files to local file systems.deploy mysql load {name} {filename}: Load a local SQL file into remote MySQL databasesdeploy mysql show-grants {name}: Show GRANTs for your user
{name} above refers to the name of a MySQL connection from the mysql: section of your deployfish.yml file. See below for how the mysql: connection works.
Install deployfish-mysql
pip install deployfish deployfish-mysql
Configure deployfish-mysql
First follow the instructions for installing and configuring deployfish, then
add this stanza to your ~/.deployfish.yml file:
plugin.mysql:
enabled: true
NOTE: ~/.deployfish.yml is the config file for deployfish itself. This is different from the deployfish.yml file that defines your services and tasks.
Instrument your deployfish.yml
deployfish-mysql looks in your deployfish.yml file (the one with your services and task definitions, not the ~/.deployfish.yml config file for deployfish iteslf) for a section named mysql, which has definitions of mysql databases:
mysql:
- name: test
service: service-test
host: my-remote-rds-host.amazonaws.com
db: mydb
user: myuser
pass: password
- name: config-test
service: service-test
host: config.DB_HOST
db: config.DB_NAME
user: config.DB_USER
pass: config.DB_PASSWORD
services:
- name: dftest-test
cluster: my-cluster
environment: test
config:
- DEBUG=False
- DB_HOST=${terraform.rds_address}
- DB_NAME=dftest
- DB_USER=dftest_u
- DB_PASSWORD:secure:kms_key_arn=${env.DB_PASSWORD}
Entries in the mysql: section must minimally define these keys:
name: the name of the connection. This will be used in all thedeploy mysqlcommands as the connection name.service: the name of a service in theservices:section. This will be used to determine which host we use to use for SSH when doing our mysql commandshost: the hostname of the remote MySQL serverdb: the name of the database to work with inhostuser: the username of the user to use to authenticate tohostpass: the password of the user to use to authenticate tohost
These are optional keys that you can add to your connection definition:
port: the port to connect to on the remote MySQL server. Default: 3306character_set: set the character set of your database to this (used fordeploy mysql createanddeploy mysql update). Default:utf8.collation: set the collation set of your database to this (used fordeploy mysql createanddeploy mysql update). Default:utf8_unicode_ci.
As you can see in the examples above, you can either hard code host, db, user and password in or you can reference config parameters from the config: section of the definition of our service. For the latter, deployfish-mysql will retrieve those parameters directly from AWS SSM Parameter Store, so ensure you write the service config to AWS before trying to establish a MySQL connection.
Metadata
Release files for deployfish-mysql 1.2.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| deployfish-mysql-1.2.16.tar.gz | 13.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deployfish_mysql-1.2.16-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 27.7 kB
Release files / deployfish-mysql-1.2.16.tar.gz
| Download URL | deployfish-mysql-1.2.16.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
524e5e43757e714e78289e2d08e00ad07667ea01efe1c4b288aedbb082ffd3c4
|
|
BLAKE2b-256 checksum How to use checksums |
23a52312cff8659c07b696ace22a7a811839992119bc1a2e383ca1cff01d0335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Release files / deployfish_mysql-1.2.16-py2.py3-none-any.whl
| Download URL | deployfish_mysql-1.2.16-py2.py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
68857add21375946bd86f4123f7c40fa85d99eed787e0ae7cad5c8f4c0ca60df
|
|
BLAKE2b-256 checksum How to use checksums |
5e97e493eefee5af3eccd4da938d5d6e5a6a8ea00722813fcfa44288cecee037
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Security for deployfish-mysql 1.2.16
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.