Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Infra: Upgrade project to terraform 0.12 #66

Merged
merged 12 commits into from
Jan 16, 2020
Merged

Conversation

ryan-roemer
Copy link
Member

@ryan-roemer ryan-roemer commented Jan 14, 2020

Work

  • Take our terraform0.12 branch to master as the official release.
  • Add hints for terraform-aws-serverless development against this project.
  • Add a full script for yarn _dev:on|off helpers for easy local development of terraform-aws-serverless
  • Update to terraform-aws-serverless@1.0.0

Testing

  • Full tf init / apply verifies no changes originally against Kevin's deploy.
  • Did tf apply an IAM change needed for newer serverless
  • Developer lambda deploy succeeded.
# Service update
$ STAGE=sandbox aws-vault exec USER.NAME --no-session -- \
  yarn tf:service:init --reconfigure && \
  STAGE=sandbox aws-vault exec USER.NAME --no-session -- \
  yarn tf:service:apply

# Lambda / serverless
$ STAGE=sandbox aws-vault exec USER.NAME-developer --no-session -- \
  yarn lambda:deploy

Tasks

Notes

Running yarn _dev:off then git diff produces this (showing how we disable the "development mode" against terraform-aws-serverless):

diff --git a/terraform/main.tf b/terraform/main.tf
index 7ed599b..027a538 100644
--- a/terraform/main.tf
+++ b/terraform/main.tf
@@ -41,8 +41,8 @@ JSON
 # Base `serverless` IAM support
 ###############################################################################
 module "serverless" {
-  source = "../../terraform-aws-serverless"
-  # version = "0.8.8"
+  source = "FormidableLabs/serverless/aws"
+  version = "0.8.8"
 
   region       = var.region
   service_name = var.service_name
@@ -77,8 +77,8 @@ module "serverless" {
 # OPTION(xray): Add X-ray support to lambda execution roles.
 ###############################################################################
 module "serverless_xray" {
-  source = "../../terraform-aws-serverless//modules/xray"
-  # version = "0.8.8"
+  source = "FormidableLabs/serverless/aws//modules/xray"
+  version = "0.8.8"
 
   # Same variables as for `serverless` module.
   region       = var.region
@@ -216,8 +216,8 @@ STACK
 
 # OPTION(vpc): Add in IAM permissions to humans + lambda execution role.
 module "serverless_vpc" {
-  source = "../../terraform-aws-serverless//modules/vpc"
-  # version = "0.8.8"
+  source = "FormidableLabs/serverless/aws//modules/vpc"
+  version = "0.8.8"
 
   # Same variables as for `serverless` module.
   region       = var.region
@@ -287,8 +287,8 @@ STACK
 
 # OPTION(canary): Add serverless-plugin-canary-deployments to lambda execution roles.
 module "serverless_canary" {
-  source = "../../terraform-aws-serverless//modules/canary"
-  # version = "0.8.8"
+  source = "FormidableLabs/serverless/aws//modules/canary"
+  version = "0.8.8"
 
   # Same variables as for `serverless` module.
   region       = var.region

@ryan-roemer ryan-roemer changed the title [WIP] Infra: Upgrade project to terraform 0.12 Infra: Upgrade project to terraform 0.12 Jan 15, 2020
Copy link
Contributor

@kevinmstephens kevinmstephens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran through the test steps and everything looks good. Nice work! 🚢

}

# OPTION(vpc): Add in IAM permissions to humans + lambda execution role.
module "serverless_vpc" {
source = "FormidableLabs/serverless/aws//modules/vpc"
version = "0.8.8"
version = "1.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@ryan-roemer ryan-roemer merged commit 1571d1b into master Jan 16, 2020
@ryan-roemer ryan-roemer deleted the feature/tf-12-upgrade branch January 16, 2020 03:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants