Python package to automate deploiment of the infrastructures
Project description
iac-bootstrap
iac-bootstrap is a package to make fast deployments of infrastructure,
on cloud providers, like AWS, with IAC tools like Ansible and Terraform.
The full documentation is available on Readthedocs.
installation
To install the package.
pip install --user iac_bootstrap==1.0.4
There is a quickstart you should follow to build your own customized infrastructure.
If you want to test our example to get an idea of how it works, you can follow our simple usage, described below.
Simple usage
iac-bootstrap automates terraform initialization and deployment, although generating necessary files for ansible and launch playbooks.
You can use the available example, and define your own group
and env
values,
or use the example with "mygroup" and "myenv" already available.
cd examples/infra-base
ssh-keygen -f configs/mygroup/myenv/ssh/id_rsa
This generates the tfstate configuration
python -m iac_bootstrap.infra_bootstrap --account mygroup-myenv
This launches the terraform layers to build the infrastructure (vpc and autoscaling group)
python -m iac_bootstrap.infra_builder_terraform --account mygroup-myenv
This installs the Ansible role and launches the playbook, to install nginx
ansible-galaxy install wescale.nginx -p ./ansible/roles/external/
export ANSIBLE_CONFIG="$PWD/mygroup-myenv-ansible.cfg"
python -m iac_bootstrap.install_nginx --group mygroup --env myenv
.. Then you can destroy the infra when you have finished
python -m iac_bootstrap.infra_builder_terraform --account mygroup-myenv --action destroy
aws s3 rm s3://mygroup-myenv-eu-west-1-tfstate --recursive
python -m iac_bootstrap.infra_bootstrap --account mygroup-myenv --action destroy
Features
Here are features for infra_builder_terraform script:
Builder Terraform Script:
optional arguments:
-h, --help show this help message and exit
--account ACCOUNT account <group>-<env>
--action ACTION plan apply or destroy
--region REGION eu-west-1 by default
--layer LAYER terraform layer
--ignore ignore layer
--provider PROVIDER cloud provider , by default aws
--approve APPROVE Auto-approve option ,set 'yes' to enable it
Here are features for infra_bootstrap script :
Boot Strap script
optional arguments:
-h, --help show this help message and exit
--provider PROVIDER provider aws
--account ACCOUNT account <group>-<env>
--action ACTION plan apply or destroy
--region REGION eu-west-1 by default
--approve APPROVE Auto-approve option ,set 'yes' to enable it
license
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
Built Distribution
Hashes for iac_bootstrap-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b171e9ecb02cd3637d507aa627e4fe4e3901e09701620d1d44340d89624cc71f |
|
MD5 | cd0083ea2d51473fe58d07767019e28c |
|
BLAKE2b-256 | d1b85764b85dba92a23889548b907ff7a5f3b992beb904e9f60341a6eb2fee18 |