Skip to content

Commit

Permalink
chore: fixes for issues reported by tflint (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb authored Nov 16, 2022
1 parent 086210b commit 4362586
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 32 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ determining that location is as follows:
| group\_email | The email of the G Suite group with group\_name |
| project\_bucket\_self\_link | Project's bucket selfLink |
| project\_bucket\_url | Project's bucket url |
| project\_id | n/a |
| project\_name | n/a |
| project\_number | n/a |
| project\_id | ID of the project |
| project\_name | Name of the project |
| project\_number | Numeric identifier for the project |
| service\_account\_display\_name | The display name of the default service account |
| service\_account\_email | The email of the default service account |
| service\_account\_id | The id of the default service account |
Expand Down
1 change: 0 additions & 1 deletion examples/app_engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Expected variables:
|------|-------------|------|---------|:--------:|
| billing\_account | The ID of the billing account to associate this project with | `string` | n/a | yes |
| folder\_id | The ID of a folder to host this project. | `string` | `""` | no |
| location\_id | The location to serve the app from. | `string` | `"us-east4"` | no |
| org\_id | The organization ID. | `string` | n/a | yes |

## Outputs
Expand Down
4 changes: 0 additions & 4 deletions examples/app_engine/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,3 @@ variable "billing_account" {
type = string
}

variable "location_id" {
description = "The location to serve the app from."
default = "us-east4"
}
1 change: 0 additions & 1 deletion examples/essential_contacts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This example illustrates how to use the essential_contacts submodule to assign e
| billing\_account | Billing account ID. | `string` | n/a | yes |
| folder\_id | The ID of a folder to host this project. | `string` | n/a | yes |
| org\_id | The organization ID. | `string` | n/a | yes |
| project\_id | The GCP project to create Essential Contacts in | `string` | n/a | yes |
| random\_string\_for\_testing | A random string of characters to be appended to resource names to ensure uniqueness | `string` | n/a | yes |

## Outputs
Expand Down
5 changes: 0 additions & 5 deletions examples/essential_contacts/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
* limitations under the License.
*/

variable "project_id" {
type = string
description = "The GCP project to create Essential Contacts in"
}

variable "org_id" {
type = string
description = "The organization ID."
Expand Down
4 changes: 4 additions & 0 deletions modules/app_engine/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@

variable "project_id" {
description = "The project to enable app engine on."
type = string
}

variable "location_id" {
description = "The location to serve the app from."
default = ""
type = string
}

variable "auth_domain" {
description = "The domain to authenticate users with when using App Engine's User API."
default = ""
type = string
}

variable "serving_status" {
description = "The serving status of the app."
default = "SERVING"
type = string
}

variable "feature_settings" {
Expand Down
11 changes: 7 additions & 4 deletions modules/core_project_factory/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
*/

output "project_name" {
value = google_project.main.name
description = "Name of the project"
value = google_project.main.name
}

output "project_id" {
value = module.project_services.project_id
description = "ID of the project"
value = module.project_services.project_id
depends_on = [
module.project_services,
google_project.main,
Expand All @@ -29,8 +31,9 @@ output "project_id" {
}

output "project_number" {
value = google_project.main.number
depends_on = [module.project_services]
description = "Numeric identifier for the project"
value = google_project.main.number
depends_on = [module.project_services]
}

output "service_account_id" {
Expand Down
4 changes: 4 additions & 0 deletions modules/core_project_factory/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ terraform {
source = "hashicorp/random"
version = ">= 2.2"
}
time = {
source = "hashicorp/time"
version = ">= 0.5"
}
}
}
2 changes: 1 addition & 1 deletion modules/essential_contacts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ See [examples/essential_contacts](./examples/essential_contacts) for a full exam
|------|-------------|------|---------|:--------:|
| essential\_contacts | A mapping of users or groups to be assigned as Essential Contacts to the project, specifying a notification category | `map(list(string))` | `{}` | no |
| language\_tag | Language code to be used for essential contacts notifiactions | `string` | n/a | yes |
| project\_id | The GCP project you want to send Essential Contacts notifications for | `any` | n/a | yes |
| project\_id | The GCP project you want to send Essential Contacts notifications for | `string` | n/a | yes |

## Outputs

Expand Down
1 change: 1 addition & 0 deletions modules/essential_contacts/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

variable "project_id" {
description = "The GCP project you want to send Essential Contacts notifications for"
type = string
}

variable "essential_contacts" {
Expand Down
12 changes: 6 additions & 6 deletions modules/gsuite_enabled/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The roles granted are specifically:
| activate\_apis | The list of apis to activate within the project | `list(string)` | <pre>[<br> "compute.googleapis.com"<br>]</pre> | no |
| api\_sa\_group | A G Suite group to place the Google APIs Service Account for the project in | `string` | `""` | no |
| auto\_create\_network | Create the default network | `bool` | `false` | no |
| billing\_account | The ID of the billing account to associate this project with | `any` | n/a | yes |
| billing\_account | The ID of the billing account to associate this project with | `string` | n/a | yes |
| bucket\_location | The location for a GCS bucket to create (optional) | `string` | `""` | no |
| bucket\_name | A name for a GCS bucket to create (in the bucket\_project project), useful for Terraform state (optional) | `string` | `""` | no |
| bucket\_project | A project to create a GCS bucket (bucket\_name) in, useful for Terraform state (optional) | `string` | `""` | no |
Expand All @@ -84,8 +84,8 @@ The roles granted are specifically:
| group\_role | The role to give the controlling group (group\_name) over the project (defaults to project editor) | `string` | `"roles/editor"` | no |
| labels | Map of labels for project | `map(string)` | `{}` | no |
| lien | Add a lien on the project to prevent accidental deletion | `bool` | `false` | no |
| name | The name for the project | `any` | n/a | yes |
| org\_id | The organization ID. | `any` | n/a | yes |
| name | The name for the project | `string` | n/a | yes |
| org\_id | The organization ID. | `string` | n/a | yes |
| project\_id | The ID to give the project. If not provided, the `name` will be used. | `string` | `""` | no |
| project\_sa\_name | Default service account name for the project. | `string` | `"project-service-account"` | no |
| random\_project\_id | Adds a suffix of 4 random characters to the `project_id` | `bool` | `false` | no |
Expand All @@ -105,9 +105,9 @@ The roles granted are specifically:
| group\_name | The group\_name of the G Suite group |
| project\_bucket\_self\_link | Project's bucket selfLink |
| project\_bucket\_url | Project's bucket url |
| project\_id | n/a |
| project\_name | n/a |
| project\_number | n/a |
| project\_id | ID of the project |
| project\_name | Name of the project |
| project\_number | Numeric identifier for the project |
| service\_account\_display\_name | The display name of the default service account |
| service\_account\_email | The email of the default service account |
| service\_account\_id | The id of the default service account |
Expand Down
9 changes: 6 additions & 3 deletions modules/gsuite_enabled/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
*/

output "project_name" {
value = module.project-factory.project_name
description = "Name of the project"
value = module.project-factory.project_name
}

output "project_id" {
value = module.project-factory.project_id
description = "ID of the project"
value = module.project-factory.project_id
}

output "project_number" {
value = module.project-factory.project_number
description = "Numeric identifier for the project"
value = module.project-factory.project_number
}

output "domain" {
Expand Down
17 changes: 17 additions & 0 deletions modules/gsuite_enabled/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,47 @@ variable "random_project_id" {

variable "org_id" {
description = "The organization ID."
type = string
}

variable "domain" {
description = "The domain name (optional)."
default = ""
type = string
}

variable "name" {
description = "The name for the project"
type = string
}

variable "project_id" {
description = "The ID to give the project. If not provided, the `name` will be used."
default = ""
type = string
}

variable "shared_vpc" {
description = "The ID of the host project which hosts the shared VPC"
default = ""
type = string
}

variable "billing_account" {
description = "The ID of the billing account to associate this project with"
type = string
}

variable "folder_id" {
description = "The ID of a folder to host this project"
default = ""
type = string
}

variable "group_name" {
description = "A group to control the project by being assigned group_role - defaults to $${project_name}-editors"
default = ""
type = string
}

variable "create_group" {
Expand All @@ -72,11 +80,13 @@ variable "create_group" {
variable "group_role" {
description = "The role to give the controlling group (group_name) over the project (defaults to project editor)"
default = "roles/editor"
type = string
}

variable "sa_group" {
description = "A G Suite group to place the default Service Account for the project in"
default = ""
type = string
}

variable "create_project_sa" {
Expand All @@ -94,6 +104,7 @@ variable "project_sa_name" {
variable "sa_role" {
description = "A role to give the default Service Account for the project (defaults to none)"
default = ""
type = string
}

variable "activate_apis" {
Expand All @@ -105,11 +116,13 @@ variable "activate_apis" {
variable "usage_bucket_name" {
description = "Name of a GCS bucket to store GCE usage reports in (optional)"
default = ""
type = string
}

variable "usage_bucket_prefix" {
description = "Prefix in the GCS bucket to store GCE usage reports in (optional)"
default = ""
type = string
}

variable "shared_vpc_subnets" {
Expand All @@ -127,16 +140,19 @@ variable "labels" {
variable "bucket_project" {
description = "A project to create a GCS bucket (bucket_name) in, useful for Terraform state (optional)"
default = ""
type = string
}

variable "bucket_name" {
description = "A name for a GCS bucket to create (in the bucket_project project), useful for Terraform state (optional)"
default = ""
type = string
}

variable "bucket_location" {
description = "The location for a GCS bucket to create (optional)"
default = ""
type = string
}

variable "bucket_versioning" {
Expand All @@ -148,6 +164,7 @@ variable "bucket_versioning" {
variable "api_sa_group" {
description = "A G Suite group to place the Google APIs Service Account for the project in"
default = ""
type = string
}

variable "auto_create_network" {
Expand Down
2 changes: 1 addition & 1 deletion modules/project_services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ See [examples/project_services](./examples/project_services) for a full example
| disable\_dependent\_services | Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed. https://www.terraform.io/docs/providers/google/r/google_project_service.html#disable_dependent_services | `bool` | `true` | no |
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed. https://www.terraform.io/docs/providers/google/r/google_project_service.html#disable_on_destroy | `bool` | `true` | no |
| enable\_apis | Whether to actually enable the APIs. If false, this module is a no-op. | `bool` | `true` | no |
| project\_id | The GCP project you want to enable APIs on | `any` | n/a | yes |
| project\_id | The GCP project you want to enable APIs on | `string` | n/a | yes |

## Outputs

Expand Down
2 changes: 2 additions & 0 deletions modules/project_services/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

variable "project_id" {
description = "The GCP project you want to enable APIs on"
type = string
}

variable "enable_apis" {
description = "Whether to actually enable the APIs. If false, this module is a no-op."
type = bool
default = true
}

Expand Down
1 change: 1 addition & 0 deletions modules/svpc_service_project/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ variable "project_sa_name" {
variable "sa_role" {
description = "A role to give the default Service Account for the project (defaults to none)"
default = ""
type = string
}

variable "activate_apis" {
Expand Down
9 changes: 6 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
*/

output "project_name" {
value = module.project-factory.project_name
description = "Name of the project"
value = module.project-factory.project_name
}

output "project_id" {
value = module.project-factory.project_id
description = "ID of the project"
value = module.project-factory.project_id
}

output "project_number" {
value = module.project-factory.project_number
description = "Numeric identifier for the project"
value = module.project-factory.project_number
}

output "domain" {
Expand Down

0 comments on commit 4362586

Please sign in to comment.