A Terraform Module for Managing AWS Access Objects
Go to file
Matt Trachier 1a79f1aa71
Merge pull request #3 from matttrach/remove-type
Don't use type in description
2023-08-25 16:10:45 -05:00
.github adding workflows, codeowners, using terratest to generate obects for testing, add verions.tf 2023-08-11 15:07:41 -05:00
examples adding workflows, codeowners, using terratest to generate obects for testing, add verions.tf 2023-08-11 15:07:41 -05:00
modules don't use type in description 2023-08-25 16:10:00 -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 initial 2023-07-10 10:45:06 -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 initial 2023-07-10 10:45:06 -05:00
outputs.tf fix nix flake, add security_group_name which matches the tag rather than the attribute 2023-08-25 11:42:28 -05:00
terraform.md initial 2023-07-10 10:45:06 -05:00
variables.tf initial 2023-07-10 10:45:06 -05:00
versions.tf add http version constraint 2023-08-25 16:00:06 -05:00

README.md

AWS Access Module

This is Alpha; a work in progress, please wait until a version 1 is released to use.

This module provides the basic necessities for connecting to EC2 servers.

This is a "Core Module", it shouldn't contain any nested "independent modules". Please see terraform.md for more information.

Requirements

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.

Nix

These modules use Nix the OS agnostic package manager to install and manage local package dependencies, install Nix and source the .envrc to enter the environment. The .envrc will load a Nix development environment (a Nix shell), using the flake.nix file. You can easily add or remove dependencies by updating that file, the flake.lock is a lock file to cache dependencies. After loading the Nix shell, Nix will source the .envrc, setting all of the environment variables as necessary. Nix is an optional way to quickly use the same environment that we use to develop and test, you can also download and install the dependencies on your local machine.

Local State

The specific use case for the exaple mmodules here is temporary infrastructure for testing purposes. With that in mind it is not expected that the user will 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

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. Our .gitignore should prevent committing any override.tf that you create.