A Terraform Module for Managing AWS Access Objects
Go to file
Matt Trachier e410cfdb2e
Merge pull request #8 from matttrach/add-new-vpc-sg-type
new "project" type for access within a vpc
2023-09-28 00:17:55 -05:00
.github remove plan from e2e 2023-08-29 12:42:54 -05:00
examples add the option to set the availability zone when generating a subnet and test 2023-09-26 17:05:24 -05:00
modules add vpc_cidr to locals 2023-09-27 19:07:47 -05:00
tests adding workflows, codeowners, using terratest to generate obects for testing, add verions.tf 2023-08-11 15:07:41 -05:00
.aliases initial 2023-07-10 10:45:06 -05:00
.envrc fix nix flake, add security_group_name which matches the tag rather than the attribute 2023-08-25 11:42:28 -05:00
.functions initial 2023-07-10 10:45:06 -05:00
.gitignore initial 2023-07-10 10:45:06 -05:00
.rcs initial 2023-07-10 10:45:06 -05:00
.variables initial 2023-07-10 10:45:06 -05:00
README.md add descriptions to the outputs and update the README 2023-08-28 17:00:12 -05:00
flake.lock adding workflows, codeowners, using terratest to generate obects for testing, add verions.tf 2023-08-11 15:07:41 -05:00
flake.nix initial 2023-07-10 10:45:06 -05:00
main.tf use vpc.vpc 2023-09-27 19:04:58 -05:00
outputs.tf add descriptions to the outputs and update the README 2023-08-28 17:00:12 -05:00
terraform.md initial 2023-07-10 10:45:06 -05:00
variables.tf add the option to set the availability zone when generating a subnet and test 2023-09-26 17:05:24 -05:00
versions.tf add http version constraint 2023-08-25 16:00:06 -05:00

README.md

Terraform AWS Access

WARNING! This is a work in progress and not ready to be used.

This is an "Independent" module, please see terraform.md for more information.

AWS Access

The first step to using the AWS modules is having an AWS account, here is a document describing this process. You will need an API access key id and API secret key, you can get the API keys following this tutorial. The Terraform AWS provider uses the AWS Go SDK, which allows the use of either environment variables or config files for authentication. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-settings You do not need the AWS cli to generate the files, just place them in the proper place and Terraform will find and read them. We use environment variables to configure the AWS provider and load them by sourcing an RC file.

export AWS_ACCESS_KEY_ID='ABC123'
export AWS_SECRET_ACCESS_KEY='abc123'
export AWS_REGION='us-west-1'

These help the tests set you as the owner on the testing infra and generate the proper key. The .envrc file sources .rcs file which assumes a local file at path ~/.config/aws/default/rc exists with the above information.

Examples

Local State

The specific use case for the example modules is temporary infrastructure for testing purposes. With that in mind, it is not expected that we manage the resources as a team, therefore the state files are all stored locally. If you would like to store the state files remotely, add a terraform backend file (*.name.tfbackend) to your implementation module. https://www.terraform.io/language/settings/backends/configuration#file

Development and Testing

Paradigms and Expectations

Please make sure to read terraform.md to understand the paradigms and expectations that this module has for development.

Environment

It is important to us that all collaborators have the ability to develop in similar environments, so we use tools which enable this as much as possible. These tools are not necessary, but they can make it much simpler to collaborate.

  • I use nix that I have installed using their recommended script
  • I use direnv that I have installed using brew.
  • I simply use direnv allow to enter the environment
  • I navigate to the tests directory and run go test -v -timeout=5m -parallel=10
  • To run an individual test I nvaigate to the tests directory and run go test -v -timeout=5m -run <test function name>
    • eg. go test -v -timeout=5m -run TestBasic
  • I use override.tf files to change the values of examples to personalized data so that I can run them

Our continuous integration tests in the GitHub ubuntu-latest runner, which has many different things installed.

Override Tests

You may want to test this code with slightly different parameters for your environment. Check out Terraform override files as a clean way to modify the inputs without accidentally committing any personalized code.