Skip to content

A Terraform module that produces a "view" of an SEA-based AWS Organization, along with "extended" metadata extracted from account-level tags.

License

Notifications You must be signed in to change notification settings

BCDevOps/terraform-aws-sea-organization-info-extended

Repository files navigation

License

SEA Organization Info Module Extended Remix Edition

This repo provides a way to easily extract information about the accounts within an AWS Organzation that follows the SEA conventions.

Third-Party Products/Libraries used and the licenses they are covered by

Project Status

  • Development
  • Production/Maintenance

Documentation

You're looking at it!

This module is likely to be most useful - at least in its current state - as a standalone command-line "query" utility, rather than something to be used by other Terraform configuration. This is becuase it is slow and also creates local resrouces so may "pollute" other state files.

Getting Started

  • acquire/set a suitable AWS credential in your shell (or use AWS_PROFILE beofre terraform commands) that can read account organizations and tags.
  • on the first use, run terraform init
  • check setup via terraform plan
  • generate the account data via terraform apply

Following apply, the account data is available as a Terraform output called "workload_accounts" (for basic compatiblity with the closely-related module at bcdevops/terraform-aws-sea-organization-info). It can be viewed using terraform output -json workload_accounts.

Creating a CSV report of accounts

The output can be massaged into a csv form using:

terraform output -json workload_accounts | jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' > accounts_info.csv

Creating an input file for the billing utility

An input file in a form usable with our billing report utility can be created using the following:

terraform output -json billing_report_input > billing_report_input.json 

The contents of billing_report_input.json can be provided to the billing utility and it will create corresponding reports.

Getting Help or Reporting an Issue

To report bugs/issues/feature requests, please file an issue.

How to Contribute

If you would like to contribute, please see our CONTRIBUTING guidelines.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

Copyright 2018 Province of British Columbia

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A Terraform module that produces a "view" of an SEA-based AWS Organization, along with "extended" metadata extracted from account-level tags.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages