From 38c8a9b7d720f912908ed27288dfdcc9149a344b Mon Sep 17 00:00:00 2001 From: Danny Seymour Date: Wed, 27 Feb 2019 12:23:46 -0800 Subject: [PATCH] Clean up suggestions from code review --- CHANGELOG.md | 1 - README.md | 4 ++-- docs/upgrading_to_project_factory_v2.0.md | 20 +++++++++----------- modules/app_engine/main.tf | 2 +- modules/app_engine/outputs.tf | 10 +++++----- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b01fade..d60b06e5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,6 @@ Extending the adopted spec, each change should have a link to its corresponding ## [1.1.0] - 2019-02-22 ### ADDED -- Added separate App Engine module. [#134] - Preconditions script checks billing account format. [#117] - Add project_services submodule. [#133] diff --git a/README.md b/README.md index 45d7911d6..1d30728db 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ access, Service Accounts, and API enablement to follow best practices. To include G Suite integration for creating groups and adding Service Accounts into groups, use the [gsuite_enabled module][gsuite-enabled-module]. -## Version +## Upgrading -Current version is 2.0. Upgrade guides: +The current version is 2.X. The following guides are available to assist with upgrades: - [0.X -> 1.0](./docs/upgrading_to_project_factory_v1.0.md) - [1.X -> 2.0](./docs/upgrading_to_project_factory_v2.0.md) diff --git a/docs/upgrading_to_project_factory_v2.0.md b/docs/upgrading_to_project_factory_v2.0.md index 94bd4962b..719f5f211 100644 --- a/docs/upgrading_to_project_factory_v2.0.md +++ b/docs/upgrading_to_project_factory_v2.0.md @@ -4,19 +4,14 @@ The v2.0 release of Project Factory is a backwards incompatible release. It only ## Migration Instructions -### App Engine +### App Engine Argument Changes -These steps are only required if you are currently using the `app_engine` argument. - -#### App Engine Argument Changes - -The old version of project factory used a single field for configuring App Engine (`app_engine`): +Version 1.X of Project Factory used the `app_engine` map variable to configure App Engine: ```hcl /// @file main.tf - module "project-factory" { - ... + # ... app_engine { location_id = "${var.region}" auth_domain = "${var.domain}" @@ -30,10 +25,13 @@ module "project-factory" { } ``` -The new version of project factory uses a new module named `app_engine`. It accepts +Version 2.X of Project Factory uses a new module named `app_engine`: ```hcl /// @file main.tf +module "project-factory" { + # ... +} module "app-engine" { source = "terraform-google-modules/project-factory/google//modules/app_engine" @@ -51,12 +49,12 @@ module "app-engine" { } ``` -#### App Engine State Import +### App Engine State Import The new implementation uses the `google_app_engine_application` resource which needs to be imported into the current state (make sure to replace `$YOUR_PROJECT_ID`): ```sh -terraform import module.app-engine.google_app_engine_application.app $YOUR_PROJECT_ID +terraform import module.app-engine.google_app_engine_application.main $YOUR_PROJECT_ID ``` After importing, run `terraform` `plan` and `apply`. diff --git a/modules/app_engine/main.tf b/modules/app_engine/main.tf index 338c018be..8eb480e2a 100644 --- a/modules/app_engine/main.tf +++ b/modules/app_engine/main.tf @@ -14,7 +14,7 @@ * limitations under the License. */ -resource "google_app_engine_application" "app" { +resource "google_app_engine_application" "main" { project = "${var.project_id}" location_id = "${var.location_id}" auth_domain = "${var.auth_domain}" diff --git a/modules/app_engine/outputs.tf b/modules/app_engine/outputs.tf index 74b31ff2c..8bb007c1d 100644 --- a/modules/app_engine/outputs.tf +++ b/modules/app_engine/outputs.tf @@ -16,25 +16,25 @@ output "name" { description = "Unique name of the app, usually apps/{PROJECT_ID}." - value = "${google_app_engine_application.app.name}" + value = "${google_app_engine_application.main.name}" } output "url_dispatch_rule" { description = "A list of dispatch rule blocks. Each block has a domain, path, and service field." - value = "${google_app_engine_application.app.url_dispatch_rule}" + value = "${google_app_engine_application.main.url_dispatch_rule}" } output "code_bucket" { description = "The GCS bucket code is being stored in for this app." - value = "${google_app_engine_application.app.code_bucket}" + value = "${google_app_engine_application.main.code_bucket}" } output "default_hostname" { description = "The default hostname for this app." - value = "${google_app_engine_application.app.default_hostname}" + value = "${google_app_engine_application.main.default_hostname}" } output "default_bucket" { description = "The GCS bucket content is being stored in for this app." - value = "${google_app_engine_application.app.default_bucket}" + value = "${google_app_engine_application.main.default_bucket}" }