r53_ptr_vpc_associator
This is a program to association reverse zones to vpcs. It is associated with https://github.com/aws-samples/aws-lambda-ddns-function
Prerequisites
It is highly recommended you run this package within a python virtual environment, so you do not affect your desktop/laptop. To setup a python virtual environment, you should make sure you have python3 installed, and do the following.
NOTE: Why am I doing this. With a python virtual environment, you can create as many virtual environmentsa as you would like, and with different python versions. These virtual environments are isolated in a directory, and will not affect anything else on your computer. This way, you can test and ensure things will work.
First, figure out the path to the python version installed on your machine.
which python3
/usr/local/bin/python3
Next, you should pip install the virtualenv package
pip install virtualenv
Next, you should create a directory, where you are going to keep the virtual environments, and create a new virtualenv by using the path to the python version you found above.
mkdir ~/virtual_environments
cd virtual_environments
virtualenv -p /usr/local/bin/python3 my_python3_virtualenv
To activate the virtual environment
source ~/virtual_environments/my_python3_virutalenv/bin/activate
NOTE: To deactivate the virtual environment
deactivate
Installation
For general usage:
pip install r53_ptr_vpc_associator
For local development:
git clone https://github.com/rubelw/r53_ptr_vpc_associator
cd r53_ptr_vpc_associator
pip install --editable . # Install the local dir as a package, including the 'dev' extras
Example
Getting help
$ associator --help
Usage: associator [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
associate Associated hosted zones to vpc
zone-list List vpcs for hosted zones
Listing current zone/vpc associations
$ associator zone-list --profile-name default
{
'/hostedzone/Z1H1CDD4PZKKPB': [
{
'VPCRegion': 'us-east-1',
'VPCId': 'vpc-99999999'
},
{
'VPCRegion': 'us-east-2',
'VPCId': 'vpc-99999999'
}
]
}
Associating zones
$ associator associate --profile-name default --vpc-id vpc-99999999 --vpc-region us-east-2
[
'Successfully associated zone: /hostedzone/A3G1CDD4PZKKPB with vpc: vpc-99999999',
'Successfully associated zone: /hostedzone/HR2F2BVHDW5UD with vpc: vpc-99999999',
'Successfully associated zone: /hostedzone/V6B06KVZ0ZL9U5 with vpc: vpc-99999999',
'Successfully associated zone: /hostedzone/D7JTQ7EDFFYOWN with vpc: vpc-99999999'
]
To run as a lambda
Run the make_lambda-zip command. This will utilize the /tmp directory to create the package.
associator make-lambda-zip
################################################################################
Zip package located at: /tmp/r53_ptr_vpc_associator/LambdaDeploymentPackage.zip
################################################################################
Deploy the lambda and you would any other lambda package, but ensure the following environmental variables are set.
PROFILE_NAME = lambda
VPC_ID = vpc-xxxxxxx
VPC_REGION = us-east-1
Once deployed, you can test the lambda by creating any test in the console. The lambda does not use the event message, so any event message will work to trigger the lambda.
Testing
Before commiting changes, be sure to run the test suite:
tox
Python 3 Compatibility
This tool is compatible with python 3.5+.
The tox library is used to run tests with multiple python versions. To run these tests, first ensure that all supported python versions are installed locally. Then, simply run:
tox
Metadata
Release files for r53-ptr-vpc-associator 0.1.2
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 | Actions |
|---|---|---|---|---|
| r53_ptr_vpc_associator-0.1.2.tar.gz | 8.3 kB | Without provenance | Details for r53_ptr_vpc_associator-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| r53_ptr_vpc_associator-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for r53_ptr_vpc_associator-0.1.2-py3-none-any.whl |
Total release size: 17.0 kB
Release files / r53_ptr_vpc_associator-0.1.2.tar.gz
| Download URL | r53_ptr_vpc_associator-0.1.2.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b48514c133ebfbf0f9a636f4970d99cc2e77a5bf04e2cf0fa2602213bcd9e92
|
|
BLAKE2b-256 checksum How to use checksums |
cca89a6c674f3fd0563a5dfbcb3e8e739dcf9d8fb2ed87b73a5c749bba7d336c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0
|
Release files / r53_ptr_vpc_associator-0.1.2-py3-none-any.whl
| Download URL | r53_ptr_vpc_associator-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ed00c1387222a21d71b2966f2ac099d88e5daf93c3fec489bdf5ebf99b66264
|
|
BLAKE2b-256 checksum How to use checksums |
1a5ae8756ac9f56402b68c993c53d8f379d3592c1e2d2f0bf892c6f0f9ace797
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0
|
Security for r53-ptr-vpc-associator 0.1.2
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.