# logistics-wms-infrastructure ## How to use? 1. [Install Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) 2. Clone this repository ### commands: Inside the project folder run `terraform workspace list` you see list exist workspaces in terraform, usally have only **default** In our project, default is equals dev workspace. To see varibles available for modification, look the file `variable.tf`. In this files exist all variables to project and your possible typing. - ##### Ex: ``` variable "labels" { description = "key and value of all labels used for the entire pubsub" type = map(string) default = { domain = "logistics", tribe = "logistics", squad = "wms", project = "driverpayment" } } ``` In this exemple is possible add more labels on list, `name` for exemple, important the value meets the typing which is `string`. This values show pubsub's labels on GCP. ``` variable "labels" { description = "key and value of all labels used for the entire pubsub" type = map(string) default = { name = "driver-paymente" domain = "logistics", tribe = "logistics", squad = "wms", project = "driverpayment" } } ``` #### Develop: If you want to run terraform in **dev**, just enter the project folder you want and run the commands: `terraform init` - this will install terraform dependencies. `terraform plan` - this will create terraform plan execution, use this plan for revision your changes. `terraform apply` - this will apply changes plan in GCP **dev** . > In case something wrong use `terraform destroy`, this command destroy all changes includes in your plan #### Production: For production the first command should be for set **prod** on terraform workspace, do this using `terraform workspace new prod` Done that, you can repeat the same [dev](#develop) instructions, **only with more responsibility** To come back for **dev** use `terraform workspace select dev`