All Projects → katapultcloud → ansible_fetch_terraform_backend_outputs

katapultcloud / ansible_fetch_terraform_backend_outputs

Licence: GPL-3.0 license
Ansible module that pulls output dictionary from Terraform tfstate files from s3 backend.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ansible fetch terraform backend outputs

great-migration
Copy objects from Rackspace to S3
Stars: ✭ 15 (-44.44%)
Mutual labels:  s3
terraform-aws-frontend
Collection of Terraform modules for frontend app deployment on AWS.
Stars: ✭ 31 (+14.81%)
Mutual labels:  s3
ansible-modules-bitwarden
Bitwarden integrations for Ansible
Stars: ✭ 92 (+240.74%)
Mutual labels:  ansible-modules
terraform-aws-s3-object
Terraform module which creates S3 object resources on AWS
Stars: ✭ 15 (-44.44%)
Mutual labels:  s3
terraform-remote-state
A Terraform module that configures an s3 bucket for use with Terraform's remote state feature
Stars: ✭ 21 (-22.22%)
Mutual labels:  s3
crux.land
crux.land is a free registry service meant for hosting small (≤ 20kB) single deno scripts.
Stars: ✭ 50 (+85.19%)
Mutual labels:  s3
poto
multi cloud storage to image gallery + image proxy + file api - 350 LOC.
Stars: ✭ 20 (-25.93%)
Mutual labels:  s3
aws-utils
This repository provides utilities which are used at MiQ.
Stars: ✭ 20 (-25.93%)
Mutual labels:  s3
hyperblock
[DEPRECATED] A theoretically-infinitely-scalable Skyblock plugin.
Stars: ✭ 16 (-40.74%)
Mutual labels:  s3
fss3
FSS3 is an S3 filesystem abstraction layer for Golang
Stars: ✭ 52 (+92.59%)
Mutual labels:  s3
aws-s3-bucket-purger
A program that will purge any AWS S3 Bucket of objects and versions quickly
Stars: ✭ 18 (-33.33%)
Mutual labels:  s3
serverless-s3bucket-sync
Serverless Plugin to sync local folders with an S3 bucket
Stars: ✭ 24 (-11.11%)
Mutual labels:  s3
s3rename
Tool to mass-rename S3 keys
Stars: ✭ 16 (-40.74%)
Mutual labels:  s3
minback-postgres
A container which provides the ability to backup a PostgreSQL database to Minio on demand
Stars: ✭ 18 (-33.33%)
Mutual labels:  s3
s3storage
Simple rails plugin that makes it easy to store uploaded files on Amazon S3
Stars: ✭ 15 (-44.44%)
Mutual labels:  s3
cachegrand
cachegrand is an open-source fast, scalable and secure Key-Value store, also fully compatible with Redis protocol, designed from the ground up to take advantage of modern hardware vertical scalability, able to provide better performance and a larger cache at lower cost, without losing focus on distributed systems.
Stars: ✭ 87 (+222.22%)
Mutual labels:  s3
ovirt-ansible-collection
Ansible collection with official oVirt modules and roles
Stars: ✭ 53 (+96.3%)
Mutual labels:  ansible-modules
terraform-provider-minio
Terraform provider for managing minio S3 buckets and IAM Users
Stars: ✭ 123 (+355.56%)
Mutual labels:  s3
gozeit
GoZeit
Stars: ✭ 19 (-29.63%)
Mutual labels:  s3
cantor
Data abstraction, storage, discovery, and serving system
Stars: ✭ 25 (-7.41%)
Mutual labels:  s3

ansible_fetch_terraform_backend_outputs

Ansible module that fetches output dictionary from Terraform tfstate file from s3 backend.

Requirements

  • boto3
  • json

Module Options

  • bucket - Name of the s3 bucket where Terraform state is stored. Required.
  • object - Name of the s3 object where Terraform state is stored. Required.
  • aws_profile - Name of the aws profile to be used. Default "default".
  • aws_access_key - AWS access key to be used for bucket access. If declared aws_profile option is ignored and aws_secret_access_key option is required. Default "".
  • aws_secret_access_key - AWS secret access key to be used for bucket access. If declared aws_profile option is ignored and aws_access_key option is required. Default "".
  • aws_region - ID of AWS region to connect to s3 bucket from. Default "us-east-1".

Examples

The following play fetches Terraform outputs from arn:aws:s3:::terraform-state-repository/ireland/katapult_cloud_networking.tfstate using default AWS profile in ~/.aws/credentials.

---
- hosts: localhost
  become: false
  tasks:
    - name: fetch Terraform networking outputs from Ireland region
      fetch_terraform_backend_outputs:
        bucket: "terraform-state-repository"
        object: "ireland/katapult_cloud_networking.tfstate"
      register: vpc_networking

    - name: set vpc id
      set_fact:
        vpc_id: "{{ vpc_networking.vars.katapult_cloud_vpc_id }}"
...

The following play fetches Terraform outputs from arn:aws:s3:::terraform-state-repository/ireland/katapult_cloud_networking.tfstate using AWS access and secret access keys.

---
- hosts: localhost
  become: false
  tasks:
    - name: fetch Terraform networking outputs from Ireland region
      fetch_terraform_backend_outputs:
        bucket: "terraform-state-repository"
        object: "ireland/katapult_cloud_networking.tfstate"
        aws_access_key: AAABBBTTGSSSS45
        aws_secret_access_key: jbd63ij2bdft/812ebud1f2623m2837rmmqj
      register: vpc_networking

    - name: set vpc id
      set_fact:
        vpc_id: "{{ vpc_networking.vars.katapult_cloud_vpc_id }}"
...

Recommendations

Utilize profile or access keys with minimal privileges to AWS resources. If possible utilize credentials with read only access to the Terraform state bucket.

License

GPL-v3

Author Information

Stefan Roman ([email protected])

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].