Skip to main content

GCP Cloud Provider for Idem

Project description

Made with pop, a Python implementation of Plugin Oriented Programming Made with idem, a Python implementation of Plugin Oriented Programming Documentation is published with Sphinx on docs.idemproject.io Made with Python

GCP Cloud Provider for Idem.

About

idem-gcp helps manage GCP with idem.

What is POP?

This project is built with pop, a Python-based implementation of Plugin Oriented Programming (POP). POP seeks to bring together concepts and wisdom from the history of computing in new ways to solve modern computing problems.

For more information:

What is Idem?

This project is built with idem, an idempotent, imperatively executed, declarative programming language written in Python. This project extends idem!

For more information:

Getting Started

DEVELOPMENT

Clone the idem_gcp repository and install with pip.

git clone git@gitlab.com:my-user/idem_gcp.git
cd idem_gcp

Create a virtual environment, and then activate it:

python3 -m venv venv
source venv/bin/activate

Install idem-gcp and other base requirements:

pip3 install -e .
pip3 install -r requirements/base.txt

Install the following packages in order to run the tests:

pip3 install -r requirements/py3.10/tests.txt

NOTE: Change py3.10 if needed with your Python version. There is support for py3.7, py3.8, py3.9 and py3.10.

ACCT

After installation gcp Idem Provider execution and state modules will be accessible to the pop hub. In order to use them we need to set up our credentials.

Create a new file called credentials.yaml and populate it with profiles. The default profile will be used automatically by idem unless you specify one with –acct-profile=profile_name on the cli.

acct backends provide alternate methods for storing profiles.

The gcp provider uses the gcp acct plugin for authentication. A profile needs to specify the authentication parameters for gcp.

credentials.yaml

gcp:
  default:
    username: my_user
    password: my_good_password
    endpoint_url: https://console.gcp.com/api

Now encrypt the credentials file and add the encryption key and encrypted file path to the ENVIRONMENT.

The acct command should be available as it is a requisite of idem and idem_gcp. Encrypt the the credential file.

acct encrypt credentials.yaml

output:

-A9ZkiCSOjWYG_lbGmmkVh4jKLFDyOFH4e4S1HNtNwI=

Add these to your environment:

export ACCT_KEY="-A9ZkiCSOjWYG_lbGmmkVh4jKLFDyOFH4e4S1HNtNwI="
export ACCT_FILE=$PWD/credentials.yaml.fernet

USAGE

A profile can be specified for use with a specific state. If no profile is specified, the profile called “default”, if one exists, will be used:

ensure_user_exists:
  gcp.user.present:
    - acct_profile: my-staging-env
    - name: a_user_name
    - kwarg1: val1

It can also be specified from the command line when executing states.

idem state --acct-profile my-staging-env my_state.sls

It can also be specified from the command line when calling an exec module directly.

idem exec --acct-profile my-staging-env gcp.user.list

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idem_gcp-0.14.0.tar.gz (175.8 kB view details)

Uploaded Source

Built Distribution

idem_gcp-0.14.0-py3-none-any.whl (263.3 kB view details)

Uploaded Python 3

File details

Details for the file idem_gcp-0.14.0.tar.gz.

File metadata

  • Download URL: idem_gcp-0.14.0.tar.gz
  • Upload date:
  • Size: 175.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

File hashes

Hashes for idem_gcp-0.14.0.tar.gz
Algorithm Hash digest
SHA256 ee0df671311fc608d0f579661e4d1d055e3f35fcf23c6910317db136ab4f8ac9
MD5 ed53903057faf3d6bae805575bf196ac
BLAKE2b-256 5d09650175a7129475a28b7f4a9b442f0c10bd26c1e1b67f36f9fbf4a2a7cb1f

See more details on using hashes here.

File details

Details for the file idem_gcp-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: idem_gcp-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 263.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

File hashes

Hashes for idem_gcp-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8175a50c0da373dd4cffb2ee58c0912922e38ff2a986683262c7096f309f9bf
MD5 651472bcf6b75bb2ae711fbb33929850
BLAKE2b-256 088ea1a68735a37fe84f49cc905fbbf1c7a280f9baed5dff73ed6100166b5e2a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page