Skip to content

Commit

Permalink
Clean up suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
thefirstofthe300 committed Mar 5, 2019
1 parent f2891dc commit 38c8a9b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 9 additions & 11 deletions docs/upgrading_to_project_factory_v2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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"
Expand All @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion modules/app_engine/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
10 changes: 5 additions & 5 deletions modules/app_engine/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

0 comments on commit 38c8a9b

Please sign in to comment.