Skip to content

Commit b0c1aea

Browse files
authored
Merge pull request #144 from thefirstofthe300/breakout-app-engine
Breakout app engine
2 parents a953e76 + 479b9bd commit b0c1aea

File tree

33 files changed

+358
-224
lines changed

33 files changed

+358
-224
lines changed

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
Extending the adopted spec, each change should have a link to its corresponding pull request appended.
88

9-
## [Unreleased]
9+
## [2.0.0] - 2019-03-05
10+
2.0.0 is a major backwards incompatible release. See the [upgrade guide](./docs/upgrading_to_project_factory_v2.0.md) for details.
11+
12+
### ADDED
13+
14+
- Added separate App Engine module. [#144]
15+
16+
### REMOVED
17+
18+
- Removed `app_engine` argument (config block).
1019

1120
## [1.2.0] - 2019-03-05
1221

@@ -69,7 +78,8 @@ Extending the adopted spec, each change should have a link to its corresponding
6978
### ADDED
7079
- This is the initial release of the Project Factory Module.
7180

72-
[Unreleased]: https://github.com/terraform-google-modules/terraform-google-project-factory/compare/v1.2.0...HEAD
81+
[Unreleased]: https://github.com/terraform-google-modules/terraform-google-project-factory/compare/v2.0.0...HEAD
82+
[2.0.0]: https://github.com/terraform-google-modules/terraform-google-project-factory/compare/v1.2.0...v2.0.0
7383
[1.2.0]: https://github.com/terraform-google-modules/terraform-google-project-factory/compare/v1.1.2...v1.2.0
7484
[1.1.2]: https://github.com/terraform-google-modules/terraform-google-project-factory/compare/v1.1.1...v1.1.2
7585
[1.1.1]: https://github.com/terraform-google-modules/terraform-google-project-factory/compare/v1.1.0...v1.1.1
@@ -83,6 +93,7 @@ Extending the adopted spec, each change should have a link to its corresponding
8393

8494
[#153]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/153
8595
[#147]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/147
96+
[#144]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/144
8697
[#143]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/143
8798
[#141]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/141
8899
[#133]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/133

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SHELL := /usr/bin/env bash
1818
# Docker build config variables
1919
CREDENTIALS_PATH ?= /cft/workdir/credentials.json
2020
DOCKER_ORG := gcr.io/cloud-foundation-cicd
21-
DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 0.11.10_216.0.0_1.19.1_0.1.10
21+
DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 0.11.11_235.0.0_1.19.1_0.1.10
2222
DOCKER_REPO_BASE_KITCHEN_TERRAFORM := ${DOCKER_ORG}/cft/kitchen-terraform:${DOCKER_TAG_BASE_KITCHEN_TERRAFORM}
2323

2424
all: check_shell check_python check_golang check_terraform check_docker check_base_files test_check_headers check_headers check_trailing_whitespace generate_docs ## Run all linters and update documentation

README.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ access, Service Accounts, and API enablement to follow best practices.
1010
To include G Suite integration for creating groups and adding Service Accounts into groups, use the
1111
[gsuite_enabled module][gsuite-enabled-module].
1212

13+
## Upgrading
14+
15+
The current version is 2.X. The following guides are available to assist with upgrades:
16+
17+
- [0.X -> 1.0](./docs/upgrading_to_project_factory_v1.0.md)
18+
- [1.X -> 2.0](./docs/upgrading_to_project_factory_v2.0.md)
19+
1320
## Usage
1421

1522
There are multiple examples included in the [examples](./examples/) folder but simple usage is as follows:
@@ -86,39 +93,37 @@ The roles granted are specifically:
8693
| Name | Description | Type | Default | Required |
8794
|------|-------------|:----:|:-----:|:-----:|
8895
| activate\_apis | The list of apis to activate within the project | list | `<list>` | no |
89-
| app\_engine | A map for app engine configuration | map | `<map>` | no |
90-
| auto\_create\_network | Create the default network | string | `false` | no |
91-
| billing\_account | The ID of the billing account to associate this project with | string | - | yes |
92-
| bucket\_name | A name for a GCS bucket to create (in the bucket_project project), useful for Terraform state (optional) | string | `` | no |
93-
| bucket\_project | A project to create a GCS bucket (bucket_name) in, useful for Terraform state (optional) | string | `` | no |
94-
| credentials\_path | Path to a Service Account credentials file with permissions documented in the readme | string | `` | no |
95-
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | string | `true` | no |
96-
| domain | The domain name (optional). | string | `` | no |
97-
| folder\_id | The ID of a folder to host this project | string | `` | no |
98-
| group\_name | A group to control the project by being assigned group_role (defaults to project editor) | string | `` | no |
99-
| group\_role | The role to give the controlling group (group_name) over the project (defaults to project editor) | string | `roles/editor` | no |
96+
| auto\_create\_network | Create the default network | string | `"false"` | no |
97+
| billing\_account | The ID of the billing account to associate this project with | string | n/a | yes |
98+
| bucket\_name | A name for a GCS bucket to create (in the bucket_project project), useful for Terraform state (optional) | string | `""` | no |
99+
| bucket\_project | A project to create a GCS bucket (bucket_name) in, useful for Terraform state (optional) | string | `""` | no |
100+
| credentials\_path | Path to a service account credentials file with rights to run the Project Factory. If this file is absent Terraform will fall back to Application Default Credentials. | string | `""` | no |
101+
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | string | `"true"` | no |
102+
| domain | The domain name (optional). | string | `""` | no |
103+
| folder\_id | The ID of a folder to host this project | string | `""` | no |
104+
| group\_name | A group to control the project by being assigned group_role (defaults to project editor) | string | `""` | no |
105+
| group\_role | The role to give the controlling group (group_name) over the project (defaults to project editor) | string | `"roles/editor"` | no |
100106
| labels | Map of labels for project | map | `<map>` | no |
101-
| lien | Add a lien on the project to prevent accidental deletion | string | `false` | no |
102-
| name | The name for the project | string | - | yes |
103-
| org\_id | The organization ID. | string | - | yes |
104-
| random\_project\_id | Enables project random id generation | string | `false` | no |
105-
| sa\_role | A role to give the default Service Account for the project (defaults to none) | string | `` | no |
106-
| shared\_vpc | The ID of the host project which hosts the shared VPC | string | `` | no |
107+
| lien | Add a lien on the project to prevent accidental deletion | string | `"false"` | no |
108+
| name | The name for the project | string | n/a | yes |
109+
| org\_id | The organization ID. | string | n/a | yes |
110+
| random\_project\_id | Enables project random id generation | string | `"false"` | no |
111+
| sa\_role | A role to give the default Service Account for the project (defaults to none) | string | `""` | no |
112+
| shared\_vpc | The ID of the host project which hosts the shared VPC | string | `""` | no |
107113
| shared\_vpc\_subnets | List of subnets fully qualified subnet IDs (ie. projects/$project_id/regions/$region/subnetworks/$subnet_id) | list | `<list>` | no |
108-
| usage\_bucket\_name | Name of a GCS bucket to store GCE usage reports in (optional) | string | `` | no |
109-
| usage\_bucket\_prefix | Prefix in the GCS bucket to store GCE usage reports in (optional) | string | `` | no |
114+
| usage\_bucket\_name | Name of a GCS bucket to store GCE usage reports in (optional) | string | `""` | no |
115+
| usage\_bucket\_prefix | Prefix in the GCS bucket to store GCE usage reports in (optional) | string | `""` | no |
110116

111117
## Outputs
112118

113119
| Name | Description |
114120
|------|-------------|
115-
| app\_engine\_enabled | Whether app engine is enabled |
116121
| domain | The organization's domain |
117122
| group\_email | The email of the GSuite group with group_name |
118123
| project\_bucket\_self\_link | Project's bucket selfLink |
119124
| project\_bucket\_url | Project's bucket url |
120-
| project\_id | - |
121-
| project\_number | - |
125+
| project\_id | |
126+
| project\_number | |
122127
| service\_account\_display\_name | The display name of the default service account |
123128
| service\_account\_email | The email of the default service account |
124129
| service\_account\_id | The id of the default service account |
@@ -405,4 +410,4 @@ versions][release-new-version].
405410
[terraform-provider-gsuite]: https://github.com/DeviaVir/terraform-provider-gsuite
406411
[glossary]: /docs/GLOSSARY.md
407412
[release-new-version]: https://www.terraform.io/docs/registry/modules/publish.html#releasing-new-versions
408-
[application-default-credentials]: https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application
413+
[application-default-credentials]: https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Upgrading to Project Factory v2.0 (from v1.X)
2+
3+
The v2.0 release of Project Factory is a backwards incompatible release. It only affects users who utilize the `app_engine` argument.
4+
5+
## Migration Instructions
6+
7+
### App Engine Argument Changes
8+
9+
Version 1.X of Project Factory used the `app_engine` map variable to configure App Engine:
10+
11+
```hcl
12+
/// @file main.tf
13+
module "project-factory" {
14+
# ...
15+
app_engine {
16+
location_id = "${var.region}"
17+
auth_domain = "${var.domain}"
18+
19+
feature_settings = [
20+
{
21+
split_health_checks = false
22+
},
23+
]
24+
}
25+
}
26+
```
27+
28+
Version 2.X of Project Factory uses a new module named `app_engine`:
29+
30+
```hcl
31+
/// @file main.tf
32+
module "project-factory" {
33+
# ...
34+
}
35+
36+
module "app-engine" {
37+
source = "terraform-google-modules/project-factory/google//modules/app_engine"
38+
version = "~> 2.0"
39+
40+
project = "${var.project_id}
41+
location_id = "${var.region}"
42+
auth_domain = "${var.domain}"
43+
44+
feature_settings = [
45+
{
46+
split_health_checks = true
47+
},
48+
]
49+
}
50+
```
51+
52+
### App Engine State Import
53+
54+
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`):
55+
56+
```sh
57+
terraform import module.app-engine.google_app_engine_application.main $YOUR_PROJECT_ID
58+
```
59+
60+
After importing, run `terraform` `plan` and `apply`.
61+

examples/app_engine/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Expected variables:
1818

1919
| Name | Description | Type | Default | Required |
2020
|------|-------------|:----:|:-----:|:-----:|
21-
| admin\_email | Admin user email on Gsuite | string | - | yes |
22-
| billing\_account | The ID of the billing account to associate this project with | string | - | yes |
23-
| organization\_id | The organization id for the associated services | string | - | yes |
21+
| admin\_email | Admin user email on Gsuite | string | n/a | yes |
22+
| billing\_account | The ID of the billing account to associate this project with | string | n/a | yes |
23+
| organization\_id | The organization id for the associated services | string | n/a | yes |
2424

2525
## Outputs
2626

examples/gke_shared_vpc/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ More information about GKE with Shared VPC can be found here: https://cloud.goog
2929

3030
| Name | Description | Type | Default | Required |
3131
|------|-------------|:----:|:-----:|:-----:|
32-
| billing\_account | billing account | string | - | yes |
33-
| credentials\_path | Path to a Service Account credentials file with permissions documented in the readme | string | - | yes |
34-
| org\_id | organization id | string | - | yes |
35-
| shared\_vpc | The ID of the host project which hosts the shared VPC | string | - | yes |
32+
| billing\_account | billing account | string | n/a | yes |
33+
| credentials\_path | Path to a Service Account credentials file with permissions documented in the readme | string | n/a | yes |
34+
| org\_id | organization id | string | n/a | yes |
35+
| shared\_vpc | The ID of the host project which hosts the shared VPC | string | n/a | yes |
3636
| shared\_vpc\_subnets | List of subnets fully qualified subnet IDs (ie. projects/$PROJECT_ID/regions/$REGION/subnetworks/$SUBNET_ID) | list | `<list>` | no |
3737

3838
[^]: (autogen_docs_end)

examples/group_project/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Expected variables:
2020

2121
| Name | Description | Type | Default | Required |
2222
|------|-------------|:----:|:-----:|:-----:|
23-
| admin\_email | Admin user email on Gsuite. This should be a user account, not a service account. | string | - | yes |
24-
| api\_sa\_group | An existing GSuite group email to place the Google APIs Service Account for the project in | string | - | yes |
25-
| billing\_account | The ID of the billing account to associate this project with | string | - | yes |
26-
| credentials\_file\_path | Service account json auth path | string | - | yes |
27-
| organization\_id | The organization id for the associated services | string | - | yes |
28-
| project\_group\_name | The name of a GSuite group to create for controlling the project | string | - | yes |
23+
| admin\_email | Admin user email on Gsuite. This should be a user account, not a service account. | string | n/a | yes |
24+
| api\_sa\_group | An existing GSuite group email to place the Google APIs Service Account for the project in | string | n/a | yes |
25+
| billing\_account | The ID of the billing account to associate this project with | string | n/a | yes |
26+
| credentials\_file\_path | Service account json auth path | string | n/a | yes |
27+
| organization\_id | The organization id for the associated services | string | n/a | yes |
28+
| project\_group\_name | The name of a GSuite group to create for controlling the project | string | n/a | yes |
2929

3030
## Outputs
3131

examples/project-hierarchy/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Expected variables:
2626

2727
| Name | Description | Type | Default | Required |
2828
|------|-------------|:----:|:-----:|:-----:|
29-
| admin\_email | Admin user email on Gsuite | string | - | yes |
30-
| billing\_account | The ID of the billing account to associate this project with | string | - | yes |
31-
| credentials\_path | Path to a Service Account credentials file with permissions documented in the readme | string | - | yes |
32-
| organization\_id | The organization id for the associated services | string | - | yes |
29+
| admin\_email | Admin user email on Gsuite | string | n/a | yes |
30+
| billing\_account | The ID of the billing account to associate this project with | string | n/a | yes |
31+
| credentials\_path | Path to a service account credentials file with rights to run the Project Factory. If this file is absent Terraform will fall back to Application Default Credentials. | string | `""` | no |
32+
| organization\_id | The organization id for the associated services | string | n/a | yes |
3333

3434
## Outputs
3535

examples/simple_project/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Expected variables:
1414

1515
| Name | Description | Type | Default | Required |
1616
|------|-------------|:----:|:-----:|:-----:|
17-
| billing\_account | The ID of the billing account to associate this project with | string | - | yes |
18-
| credentials\_path | Path to a Service Account credentials file with permissions documented in the readme | string | - | yes |
19-
| organization\_id | The organization id for the associated services | string | - | yes |
17+
| billing\_account | The ID of the billing account to associate this project with | string | n/a | yes |
18+
| credentials\_path | Path to a service account credentials file with rights to run the Project Factory. If this file is absent Terraform will fall back to Application Default Credentials. | string | `""` | no |
19+
| organization\_id | The organization id for the associated services | string | n/a | yes |
2020

2121
## Outputs
2222

main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,5 @@ module "project-factory" {
4848
bucket_project = "${var.bucket_project}"
4949
bucket_name = "${var.bucket_name}"
5050
auto_create_network = "${var.auto_create_network}"
51-
app_engine = "${var.app_engine}"
5251
disable_services_on_destroy = "${var.disable_services_on_destroy}"
5352
}

0 commit comments

Comments
 (0)