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 Feb 27, 2019
1 parent efeaf11 commit c0ee5c5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,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
6 changes: 3 additions & 3 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 Expand Up @@ -370,4 +370,4 @@ versions][release-new-version].
[terraform-provider-google-beta]: https://github.com/terraform-providers/terraform-provider-google-beta
[terraform-provider-gsuite]: https://github.com/DeviaVir/terraform-provider-gsuite
[glossary]: /docs/GLOSSARY.md
[release-new-version]: https://www.terraform.io/docs/registry/modules/publish.html#releasing-new-versions
[release-new-version]: https://www.terraform.io/docs/registry/modules/publish.html#releasing-new-versions
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 c0ee5c5

Please sign in to comment.