Giter Site home page Giter Site logo

mozreview-infra's Introduction

Mozilla DevServices AWS Account Initialization

https://mozreview.signin.aws.amazon.com/console

A Terraform configuration to set up a new AWS account.

  • Creates an S3 bucket and enables (local) Cloudtrail and bucket logging
  • Configures the IAM password policy
  • Creates an (empty) group for administrators
  • Creates a policy to require Multifactor Authentication
  • Attaches MFA and AdministratorAccess policies to admin group
  • Creates an S3 bucket for remote state, with SNS-to-email notifications

Helper scripts for working with MFA can be found at https://github.com/klibby/aws_mfa_scripts.git

Input Variables

  • account_id - AWS Account ID
  • profile - AWS profile to use for credentials
  • bucket - S3 bucket name for Cloudtrail logs
  • region - AWS region (default: us-west-2)

Variables should be provided either on the command line e.g. terraform apply -var 'account_id=XXXXXXXXXXX' -var 'profile=YYYYYYYYY'

or by creating a terraform.tfvars file, e.g.:

account_id="XXXXXXXXXXXX"
profile="YYYYYYYYY"

Usage

  • Connect the cloudtrail module: terraform get -update=true
  • Create terraform.tfvars file, or add vars on command line (see above)
  • Generate an execution plan: terraform plan
  • Apply the plan: terraform apply

Note: applying the plan may return the following error while adding the S3 bucket policy:

Error parsing JSON: invalid character '$' looking for beginning of value

If this occurrs, you will need to manually apply the policy first, and then continue:

terraform plan
terraform apply --target module.cloudtrail.template_file.logging_bucket_policy
terraform plan
terraform apply

Authors

Created by Kendall Libby

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.