Skip to content

Commit baa7d8c

Browse files
committed
removed terraform from overview diagram. fixed minor tipos
1 parent aa0b373 commit baa7d8c

2 files changed

Lines changed: 35 additions & 65 deletions

File tree

README.md

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

2-
# Getting started with “Fleet Events" reference solution
2+
# Getting started
33

4-
This document explains how to get started with Fleet Events. It provides step-by-step instructions and technical details to help you understand the components and deploy a working reference solution to your Google Cloud project. This solution can be beneficial for your near-real-time use cases.
4+
This document explains how to get started Fleet Events" reference solution. It provides step-by-step instructions and technical details to help you understand the components and deploy a working reference solution to your Google Cloud project.
55

6-
Fleet Events uses near-real-time events produced by Fleet Engine as a basis for generating custom events and handlers for your specific requirements. The reference solution in this repository includes code for creating fleet events and automated deployment using Terraform.
6+
This solution can be beneficial for your near-real-time use cases. It uses near-real-time events produced by Fleet Engine as a basis for generating custom events for your specific requirements. The reference solution in this repository includes code for creating fleet events and automated deployment using Terraform.
77

88
<!-- You can learn more about real time event processing concepts by referencing [this article](https://docs.google.com/document/d/15zeL34K2SfkHHVMpRD0tYdrDiYDy_WzvHEjlwgDI4X8/edit). -->
99

@@ -21,9 +21,9 @@ To adjust the configuration parameters, you need to have at least a high-level u
2121
The end state :
2222

2323
* There will be two projects, one for Fleet Engine, and one for the Fleet Events reference solution. Projects are separated so that each can be tied to respective billing accounts. (Example: Fleet Events: your GCP billing account. Fleet Engine: your Google Maps Platform Mobility billing account)
24-
* Logs from Fleet Engine project will be setup to flow into a Cloud Pub/Sub Topic “Fleet Engine Events” in “Fleet Events” project
25-
* A Cloud Function that subscribes to the “Fleet Engine Events” Topic will be deployed. This function will have the implementation unique to the use case.
26-
* A Pub/Sub topic “Custom Events” where generated events will be published.
24+
* Logs from Fleet Engine project will be setup to flow into a Cloud Pub/Sub Topic in “Fleet Events” project
25+
* A Cloud Function that processes messages from the Topic will be deployed. This function will have the implementation unique to the use case
26+
* A Pub/Sub topic where generated events will be published is deployed
2727

2828
<!-- Read this deep dive doc to learn more about how building blocks interact with each other and the security applied.
2929
Deep dive - Security settings -->
@@ -40,7 +40,7 @@ Note down the following information before getting started.
4040
* example) `my-fleetengine-project`
4141
* **Fleet Events project (project id)**: The project in which this reference solution will be deployed. This project can be pre-created or be generated as part of the automated provisioning. A clean developer sandbox project is highly recommended for safe experiments.
4242
* example) `my-fleetevents-project`
43-
* **Billing Account for Google Cloud**: This reference solution will make use of several Google Cloud services. Given you may have different billing arrangements between Google Maps Platform (GMP) and Google Cloud Platform (GCP), we highly recommend a separate billing account for GCP. The Fleet Events project above should be associated with this billing account.
43+
* **Billing Account for Google Cloud**: This reference solution will make use of several Google Cloud Platform services. Therefore, the Billing Account for GCP usage is required. You may have different billing arrangements between Google Maps Platform (GMP) and Google Cloud Platform (GCP), in which case the Fleet Events project above should be associated with the latter. If you are not sure, please reach out to your Google account manager or Google Maps Platform reseller.
4444
* example) `XXXXXX-XXXXXX-XXXXXX` (alphanumeric)
4545
* **Project Folder**: If your organization is adopting a folder structure to manage multiple Google Cloud projects, identify the folder and its id (number) under which the Fleet Events projects should reside.
4646
* example) `XXXXXXXXXXXX` (all digits)
@@ -59,9 +59,9 @@ Note down the following information before getting started.
5959

6060
#### Check permission to configure projects
6161

62-
Terraform will run under your Google account’s permissions. (you can also run terraform under service accounts. Links to resources for such setup will be linked later in this doc)
62+
Terraform will run under your Google account’s permissions. (you can also run terraform under service accounts. Resources to learn about such configuration will be linked later in this doc)
6363

64-
For testing, give your developer user account IAM role `roles/editor` in both your **Fleet Engine project** and **Fleet Event project**. This gives you most of the permissions required to quickly go through this solution. Additionally, there are a few additional IAM roles to add.
64+
For testing, give your developer user account IAM role `roles/editor` in both your **Fleet Engine project** and **Fleet Event project**. This gives you most of the permissions required to quickly go through this solution. Additionally, there are a few additionally required IAM roles.
6565

6666
**Fleet Engine** project
6767

@@ -124,26 +124,31 @@ cd fleet-events-reference-solutions
124124

125125
This git repo is structured as follows.
126126

127-
* [README.md](./README.md): this readme doc
127+
* [README.md](./README.md): this "Getting Started" guide
128128
* [cloud-functions/](./cloud-functions/): reference functions source code
129129
* [terraform/](./terraform/): deployment automation with terraform
130130
* [modules/](./terraform/modules/): folder holding multiple terraform modules
131-
* `<Module A>`:
131+
* [fleet_events](./terraform/modules/fleet-events/):
132132
* `README.md`: README for the module
133133
* `main.tf`: main code for the module
134134
* `variables.tf`: defines input parameters of the module
135135
* `outputs.tf`: defines outputs of the module
136136
* `*.tf`:
137137
* `examples/`: one or more example use of the module
138-
* `<Example 1>/`
138+
* `with_existing_project/`:
139139
* `README.md`: readme for the example
140-
* `main.tf`: code with module usage
140+
* `main.tf`: main terraform code showing use of the module
141141
* `*.tf`
142142
* `terraform.tfvars.sample`: sample config file
143-
* `<Example 2>/`
143+
* `with_new_project/`
144144
* ``
145-
* `<Module B>`
145+
* [fleet-events-function](./terraform/modules/fleet-events-function)
146146
* ``
147+
* [fleetengine-logging-config](./terraform/modules/fleetengine-logging-config)
148+
* ``
149+
* `tools` : utilities
150+
* `python`
151+
* `*.py` : utilities to validate the deployment
147152
* [diagrams/](./diagrams/): diagrams used in articles
148153
* `*.md`: additional documents
149154

@@ -162,7 +167,7 @@ Change the Terraform working directory to one of the examples.
162167
cd terraform/modules/fleet-events/examples/with_existing_project
163168
```
164169

165-
#### STEP 2 : create a terraform.tfvars file from example
170+
#### STEP 2 : create a `terraform.tfvars` file from example
166171

167172
This example is also a terraform module with input variables defined. These variables can be set in a configuration file `terraform.tfvars`. Make a copy of file `terraform.tfvars.sample` and edit it to match your environment. Your text editor of choice can be used. Example below is using `vi`` as the editor.
168173

@@ -189,7 +194,7 @@ The full set of variables that can be set can be referenced in the module’s [R
189194

190195
##### Naming rules
191196

192-
Google Cloud applies different naming restrictions depending on the service and resource. The “Fleet Events” deployment script will generate identifiers or labels so that they are easily recognizable by concatenating given resource names. However, concatenation can hit naming rule limits. The general guidance is to not make identifiers too long. Or, if such errors are observed, reconsider the name. Here are documented naming rules for a few of the major resources types :
197+
Google Cloud Platform applies different naming restrictions depending on the service and resource. The “Fleet Events” deployment script will generate identifiers or labels by concatenating given resource names so that they are easily recognizable. However, concatenation can hit naming rule limits. The general guidance is to not make identifiers too long. Or, if such errors are observed, reconsider the name and make it shorter. Here are documented naming rules for a few of the major resources types :
193198

194199
* [Service Accounts](https://cloud.google.com/iam/docs/service-accounts-create#:~:text=The%20ID%20must%20be%20between,you%20cannot%20change%20its%20name)
195200
* [Labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
@@ -199,15 +204,15 @@ Google Cloud applies different naming restrictions depending on the service and
199204

200205
#### STEP 3 : Initialize terraform
201206

202-
Initialize terraform before first run. Dependencies (modules, etc.) will be fetched.
207+
Initialize terraform before first run. Dependencies (modules, etc.) will be fetched to the working directory.
203208

204209
```shell
205210
terraform init
206211
```
207212

208213
#### STEP 4 : terraform plan
209214

210-
Let terraform compare current and idea state and come up with a plan.
215+
Let terraform compare current and ideal state and come up with a plan.
211216

212217
```shell
213218
terraform plan
@@ -221,7 +226,7 @@ If the plan is good to go, apply changes so that terraform can create and config
221226
terraform apply
222227
```
223228

224-
Learn more about each terraform commands [here](https://cloud.google.com/docs/terraform/basic-commands)
229+
Learn more about each terraform commands [here](https://cloud.google.com/docs/terraform/basic-commands).
225230

226231
#### STEP 6 : Verify your deployment
227232

@@ -254,7 +259,7 @@ python3 main.py --project_id "<gcp_project_id>" \
254259

255260
#### Starting over
256261

257-
When you need to change configuration, update the terraform.tfvar file and rerun terraform from the same folder. In case you want to start over or clean up the environment, de-provisioning can be done by simply running the following command.
262+
When you need to change configuration, update the `terraform.tfvar` file and rerun terraform from the same folder. In case you want to start over or clean up the environment, de-provisioning can be done by simply running the following command.
258263

259264
```shell
260265
terraform destroy
@@ -279,7 +284,7 @@ Run the following after a few minutes to confirm the state of the service.
279284
gcloud --project <PROJECT_FLEETEVENTS> services list --enabled
280285
```
281286

282-
Once confirmed, rerun terraform
287+
Once confirmed, rerun `terraform`
283288

284289
```shell
285290
# re-run terraform
@@ -313,7 +318,7 @@ This requires the current project state to be imported into terraform by running
313318
314319
* [https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/firestore_database](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/firestore_database)
315320
316-
As in the [bottom of this page](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/firestore_database#import), terraform import can be run in one of the supported forms.
321+
As in the [bottom of this page](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/firestore_database#import), `terraform import` can be run in one of the supported forms.
317322
318323
* `terraform import google_firestore_database.default projects/{{project}}/databases/{{name}}`
319324
* `terraform import google_firestore_database.default {{project}}/{{name}}`
@@ -322,7 +327,7 @@ As in the [bottom of this page](https://registry.terraform.io/providers/hashicor
322327
In the case of the error above:
323328
324329
* Database resources identifier within Terraform (as in the error message): `module.fleet-events-with-existing-project.module.fleet-events.google_firestore_database.database`
325-
* Database resource path: `<PROJECT_FLEETEVENTS>/(default)`. Note that Firestore database instance name is always “(default)
330+
* Database resource path: `<PROJECT_FLEETEVENTS>/(default)`. Note that Firestore database instance name defaults to `(default)`
326331
327332
Therefore, the import command can be run as follows:
328333
@@ -336,7 +341,7 @@ module.fleet-events-with-existing-project.module.fleet-events.google_firestore_d
336341
337342
If both identifiers are recognized, you will see a message like this.
338343
339-
```shell
344+
```text
340345
...
341346
module.fleet-events-with-existing-project.module.fleet-events.google_firestore_database.database: Import prepared!
342347
Prepared google_firestore_database for import
@@ -380,7 +385,7 @@ For developers considering wider adoption of terraform, below is a recommended r
380385
381386
## Limitations
382387
383-
[PubSub Triggers](https://firebase.google.com/docs/functions/pubsub-events?gen=2nd) delivers fleet logs to Cloud Functions. These triggers do not guarantee ordering. Out of order eventing can originate from:
388+
[PubSub Triggers](https://firebase.google.com/docs/functions/pubsub-events?gen=2nd) deliver fleet logs to Cloud Functions. These triggers do not guarantee ordering. Out of order eventing can originate from:
384389
385390
* Logs delivered out of order by Cloud Logging (if used)
386391
* Logs delivered out of order by PubSub (see [Cloud PubSub: Ordering Messages](https://cloud.google.com/pubsub/docs/ordering))

0 commit comments

Comments
 (0)