Thanks for contributing!
We develop this project using terraform
and yarn
/ Node.js for convenience. Make sure you have both installed. For tfenv
, here's some tips:
# Get tfenv
# **Note**: `tfenv` conflicts with Homebrew `terraform`, which must be uninstalled first
$ brew install tfenv
$ tfenv install
Then install like normal:
$ yarn install
Because of how Terraform works, we have to format / generate code that goes back into git source. So, make sure to periodically run:
$ yarn build
to update the built files.
The root project variables.tf
are copied programmatically to all submodules (modules/*/variables.tf
) and will overwrite any modifications. If you need to change / add to this file, be careful, and do it in the root variables.tf
.
We test out this project using a simple reference app that consumes it: aws-lambda-serverless-reference. When making changes, make sure to check out that project, make changes to the source
of the serverless*
modules like:
--- a/terraform/main.tf
+++ b/terraform/main.tf
@@ -12,7 +12,7 @@ terraform {
# Base `serverless` IAM support.
module "serverless" {
- source = "FormidableLabs/serverless/aws" # NORMAL from registry
+ source = "../../terraform-aws-serverless" # CHANGE to relative path
in every place that uses the FormidableLabs/serverless/aws
module.
Before you go ahead and submit a PR, make sure that you have done the following:
$ yarn run build
Only for Formidable employees and for the very first release/integration only.
For the very first release, we need to integrate this project repository with the Terraform registry:
- In our repository, make sure the
formidable-terraform
user hasAdmin
permission. - Make sure you have at least one git-tagged version of the form
vX.X.X
. - Log in to GitHub as the user
formidable-terraform
in the 1passwordIndividual Contributor IC
vault.- DO NOT USE YOUR PERSONAL GITHUB CREDENTIALS: The Terraform registry requires permissions to all orgs that you have access to that are above and beyond what we're comfortable with.
- Navigate to https://registry.terraform.io/github/create
- Select this project by name for the field
Select Repository on GitHub
and click thePUBLISH MODULE
button.
Only for project administrators.
We need to publish a tagged version to GitHub, which then causes Terraform to do a release:
- Update
CHANGELOG.md
, following format for previous versions - Commit as "Changes for version NUMBER"
- Run
npm version patch
(orminor|major|VERSION
) to run tests and lint, build published directories, then updatepackage.json
+ add a git tag. - Run
git push && git push --tags