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 installThen install like normal:
$ yarn installBecause of how Terraform works, we have to format / generate code that goes back into git source. So, make sure to periodically run:
$ yarn buildto 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 pathin 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 buildOnly 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-terraformuser hasAdminpermission. - Make sure you have at least one git-tagged version of the form
vX.X.X. - Log in to GitHub as the user
formidable-terraformin the 1passwordIndividual Contributor ICvault.- 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 GitHuband click thePUBLISH MODULEbutton.
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