-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
module "label" { | ||
source = "git::https://github.com/SweetOps/terraform-null-label.git?ref=tags/0.6.1" | ||
enabled = "${var.enabled}" | ||
namespace = "${var.namespace}" | ||
name = "${var.name}" | ||
stage = "${var.stage}" | ||
environment = "${var.environment}" | ||
delimiter = "${var.delimiter}" | ||
attributes = "${var.attributes}" | ||
context = "${var.context}" | ||
tags = "${var.tags}" | ||
source = "git::https://github.com/SweetOps/terraform-null-label.git?ref=tags/0.7.0" | ||
enabled = var.enabled | ||
namespace = var.namespace | ||
name = var.name | ||
stage = var.stage | ||
environment = var.environment | ||
delimiter = var.delimiter | ||
attributes = var.attributes | ||
tags = var.tags | ||
} | ||
|
||
resource "google_project" "default" { | ||
count = "${var.enabled == "true" ? 1 : 0}" | ||
name = "${module.label.id}" | ||
project_id = "${module.label.id}" | ||
labels = "${module.label.gcp_labels}" | ||
org_id = "${var.org_id}" | ||
folder_id = "${var.folder_id}" | ||
skip_delete = "${var.enable_deletion_protection}" | ||
auto_create_network = "${var.auto_create_network}" | ||
billing_account = "${var.billing_account_id}" | ||
count = var.enabled ? 1 : 0 | ||
name = module.label.id | ||
project_id = module.label.id | ||
labels = module.label.gcp_labels | ||
org_id = var.org_id | ||
folder_id = var.folder_id | ||
skip_delete = var.enable_deletion_protection | ||
auto_create_network = var.auto_create_network | ||
billing_account = var.billing_account_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
output "number" { | ||
value = "${join("", google_project.default.*.number)}" | ||
value = join("", google_project.default.*.number) | ||
description = "The numeric identifier of the project" | ||
} | ||
|
||
output "name" { | ||
value = "${join("", google_project.default.*.name)}" | ||
value = join("", google_project.default.*.name) | ||
description = "The project ID" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,77 @@ | ||
variable "namespace" { | ||
type = "string" | ||
type = string | ||
default = "" | ||
description = "Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp'" | ||
} | ||
|
||
variable "environment" { | ||
type = "string" | ||
type = string | ||
default = "" | ||
description = "Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT'" | ||
} | ||
|
||
variable "stage" { | ||
type = "string" | ||
type = string | ||
default = "" | ||
description = "Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release'" | ||
} | ||
|
||
variable "name" { | ||
type = "string" | ||
type = string | ||
default = "" | ||
description = "Solution name, e.g. 'app' or 'jenkins'" | ||
} | ||
|
||
variable "enabled" { | ||
type = "string" | ||
default = "true" | ||
type = bool | ||
default = true | ||
description = "Set to false to prevent the module from creating any resources" | ||
} | ||
|
||
variable "delimiter" { | ||
type = "string" | ||
type = string | ||
default = "-" | ||
description = "Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`" | ||
} | ||
|
||
variable "attributes" { | ||
type = "list" | ||
type = list(string) | ||
default = [] | ||
description = "Additional attributes (e.g. `1`)" | ||
} | ||
|
||
variable "tags" { | ||
type = "map" | ||
type = map(string) | ||
default = {} | ||
description = "Additional tags (e.g. `map('BusinessUnit','XYZ')`" | ||
} | ||
|
||
variable "context" { | ||
type = "map" | ||
default = {} | ||
description = "Default context to use for passing state between label invocations" | ||
} | ||
|
||
variable "org_id" { | ||
type = string | ||
default = "" | ||
description = "The numeric ID of the organization this project belongs to" | ||
} | ||
|
||
variable "folder_id" { | ||
type = string | ||
default = "" | ||
description = "The numeric ID of the folder this project should be created under" | ||
} | ||
|
||
variable "enable_deletion_protection" { | ||
default = "false" | ||
type = bool | ||
default = false | ||
description = "If true, the Terraform resource can be deleted without deleting the Project via the Google API." | ||
} | ||
|
||
variable "auto_create_network" { | ||
default = "true" | ||
type = bool | ||
default = true | ||
description = "Create the 'default' network automatically" | ||
} | ||
|
||
variable "billing_account_id" { | ||
description = "The alphanumeric ID of the billing account this project belongs to" | ||
type = string | ||
default = "" | ||
description = "The alphanumeric ID of the billing account this project belongs to" | ||
} |