Skip to content

mnkartik/aws-infrastructure

 
 

Repository files navigation

Build Status

aws-infrastructure

Collection of resources to manage AWS infrastructure

AWS Conda Environment

Install Anaconda o Miniconda

conda env create -f conda-env.yml
source activate aws-infrastructure

The env contain also aws cli

After installing a new package update the env file:

conda env export -n aws-infrastructure > conda-env.yml

AWS Profiles

To manage different profiles create a file ~/.aws/credentials with this content:

[default]
aws_access_key_id=foo
aws_secret_access_key=bar

[nicor88]
aws_access_key_id=foo2
aws_secret_access_key=bar2

In setup this env variables, to work with a specific profile:

import os
os.environ["AWS_PROFILE"] = "nicor88"
os.environ["AWS_DEFAULT_REGION"] = "eu-west-1"

Handle profiles in boto3

To use a specific profile in boto3 use:

session = boto3.Session(profile_name='nicor88-aws')
s3_client = session.client('s3')

About

AWS infrastructure: Cloudformation, Terraform...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.9%
  • Shell 4.1%
  • Other 1.0%