Skip to content

Commit b437e29

Browse files
authored
fix: tflint fixes (#909)
1 parent 4b4f8d8 commit b437e29

File tree

80 files changed

+206
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+206
-424
lines changed

0-bootstrap/cb.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ locals {
2222

2323
cicd_project_id = module.tf_source.cloudbuild_project_id
2424

25+
bucket_self_link_prefix = "https://www.googleapis.com/storage/v1/b/"
2526
default_state_bucket_self_link = "${local.bucket_self_link_prefix}${module.seed_bootstrap.gcs_bucket_tfstate}"
2627
gcp_projects_state_bucket_self_link = module.gcp_projects_state_bucket.bucket.self_link
2728

0-bootstrap/groups.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ data "google_organization" "org" {
3333
}
3434

3535
module "required_group" {
36-
for_each = local.required_groups_to_create
3736
source = "terraform-google-modules/group/google"
3837
version = "~> 0.4"
38+
for_each = local.required_groups_to_create
3939

4040
id = each.value
4141
display_name = each.key
@@ -45,9 +45,9 @@ module "required_group" {
4545
}
4646

4747
module "optional_group" {
48-
for_each = local.optional_groups_to_create
4948
source = "terraform-google-modules/group/google"
5049
version = "~> 0.4"
50+
for_each = local.optional_groups_to_create
5151

5252
id = each.value
5353
display_name = each.key

0-bootstrap/jenkins.tf.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ locals {
2121
}
2222

2323
module "jenkins_bootstrap" {
24-
source = "./modules/jenkins-agent"
24+
source = "./modules/jenkins-agent"
25+
2526
org_id = var.org_id
2627
folder_id = google_folder.bootstrap.id
2728
billing_account = var.billing_account

0-bootstrap/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ locals {
3333
org_admins_org_iam_permissions = var.org_policy_admin_role == true ? [
3434
"roles/orgpolicy.policyAdmin", "roles/resourcemanager.organizationAdmin", "roles/billing.user"
3535
] : ["roles/resourcemanager.organizationAdmin", "roles/billing.user"]
36-
bucket_self_link_prefix = "https://www.googleapis.com/storage/v1/b/"
37-
group_org_admins = var.groups.create_groups ? var.groups.required_groups.group_org_admins : var.group_org_admins
38-
group_billing_admins = var.groups.create_groups ? var.groups.required_groups.group_billing_admins : var.group_billing_admins
36+
group_org_admins = var.groups.create_groups ? var.groups.required_groups.group_org_admins : var.group_org_admins
37+
group_billing_admins = var.groups.create_groups ? var.groups.required_groups.group_billing_admins : var.group_billing_admins
3938
}
4039

4140
resource "google_folder" "bootstrap" {

0-bootstrap/modules/cb-private-pool/vpn_ha.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ module "vpn_ha_cb_to_onprem" {
3131
version = "~> 2.3"
3232
count = var.vpn_configuration.enable_vpn ? 1 : 0
3333

34-
3534
project_id = var.project_id
3635
region = var.private_worker_pool.region
3736
network = local.peered_network_id

0-bootstrap/modules/jenkins-agent/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ module "jenkins_bootstrap" {
6161
| jenkins\_agent\_gce\_name | Jenkins Agent GCE Instance name. | `string` | `"jenkins-agent-01"` | no |
6262
| jenkins\_agent\_gce\_private\_ip\_address | The private IP Address of the Jenkins Agent. This IP Address must be in the CIDR range of `jenkins_agent_gce_subnetwork_cidr_range` and be reachable through the VPN that exists between on-prem (Jenkins Controller) and GCP (CICD Project, where the Jenkins Agent is located). | `string` | n/a | yes |
6363
| jenkins\_agent\_gce\_ssh\_pub\_key | SSH public key needed by the Jenkins Agent GCE Instance. The Jenkins Controller holds the SSH private key. The correct format is `'ssh-rsa [KEY_VALUE] [USERNAME]'` | `string` | n/a | yes |
64-
| jenkins\_agent\_gce\_ssh\_user | Jenkins Agent GCE Instance SSH username. | `string` | `"jenkins"` | no |
6564
| jenkins\_agent\_gce\_subnetwork\_cidr\_range | The subnetwork to which the Jenkins Agent will be connected to (in CIDR range 0.0.0.0/0) | `string` | n/a | yes |
6665
| jenkins\_agent\_sa\_email | Email for Jenkins Agent service account. | `string` | `"jenkins-agent-gce"` | no |
6766
| jenkins\_controller\_subnetwork\_cidr\_range | A list of CIDR IP ranges of the Jenkins Controller in the form ['0.0.0.0/0']. Usually only one IP in the form '0.0.0.0/32'. Needed to create a FW rule that allows communication with the Jenkins Agent GCE Instance. | `list(string)` | n/a | yes |

0-bootstrap/modules/jenkins-agent/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ resource "random_id" "suffix" {
2929
CICD project
3030
*******************************************/
3131
module "cicd_project" {
32-
source = "terraform-google-modules/project-factory/google"
33-
version = "~> 14.0"
32+
source = "terraform-google-modules/project-factory/google"
33+
version = "~> 14.0"
34+
3435
name = local.cicd_project_name
3536
random_project_id = true
3637
random_project_id_length = 4

0-bootstrap/modules/jenkins-agent/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ variable "jenkins_agent_gce_private_ip_address" {
6464
type = string
6565
}
6666

67-
variable "jenkins_agent_gce_ssh_user" {
68-
description = "Jenkins Agent GCE Instance SSH username."
69-
type = string
70-
default = "jenkins"
71-
}
72-
7367
variable "jenkins_agent_gce_ssh_pub_key" {
7468
description = "SSH public key needed by the Jenkins Agent GCE Instance. The Jenkins Controller holds the SSH private key. The correct format is `'ssh-rsa [KEY_VALUE] [USERNAME]'`"
7569
type = string

0-bootstrap/modules/jenkins-agent/vpn_ha.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
*/
1616

1717
module "vpn_ha_agent_to_onprem" {
18-
source = "terraform-google-modules/vpn/google//modules/vpn_ha"
19-
version = "~> 2.0"
18+
source = "terraform-google-modules/vpn/google//modules/vpn_ha"
19+
version = "~> 2.0"
20+
2021
project_id = module.cicd_project.project_id
2122
region = var.default_region
2223
network = google_compute_network.jenkins_agents.name

1-org/envs/shared/org_policy.tf

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ locals {
2020
policy_for = local.parent_folder != "" ? "folder" : "organization"
2121

2222
essential_contacts_domains_to_allow = concat(
23-
[for domain in var.essential_contacts_domains_to_allow : "${domain}" if can(regex("^@.*$", domain)) == true],
23+
[for domain in var.essential_contacts_domains_to_allow : domain if can(regex("^@.*$", domain)) == true],
2424
[for domain in var.essential_contacts_domains_to_allow : "@${domain}" if can(regex("^@.*$", domain)) == false]
2525
)
2626

@@ -46,9 +46,10 @@ locals {
4646
}
4747

4848
module "organization_policies_type_boolean" {
49-
for_each = local.boolean_type_organization_policies
50-
source = "terraform-google-modules/org-policy/google"
51-
version = "~> 5.1"
49+
source = "terraform-google-modules/org-policy/google"
50+
version = "~> 5.1"
51+
for_each = local.boolean_type_organization_policies
52+
5253
organization_id = local.organization_id
5354
folder_id = local.folder_id
5455
policy_for = local.policy_for
@@ -62,8 +63,9 @@ module "organization_policies_type_boolean" {
6263
*******************************************/
6364

6465
module "org_vm_external_ip_access" {
65-
source = "terraform-google-modules/org-policy/google"
66-
version = "~> 5.1"
66+
source = "terraform-google-modules/org-policy/google"
67+
version = "~> 5.1"
68+
6769
organization_id = local.organization_id
6870
folder_id = local.folder_id
6971
policy_for = local.policy_for
@@ -73,8 +75,9 @@ module "org_vm_external_ip_access" {
7375
}
7476

7577
module "restrict_protocol_fowarding" {
76-
source = "terraform-google-modules/org-policy/google"
77-
version = "~> 5.1"
78+
source = "terraform-google-modules/org-policy/google"
79+
version = "~> 5.1"
80+
7881
organization_id = local.organization_id
7982
folder_id = local.folder_id
8083
policy_for = local.policy_for
@@ -89,8 +92,9 @@ module "restrict_protocol_fowarding" {
8992
*******************************************/
9093

9194
module "org_domain_restricted_sharing" {
92-
source = "terraform-google-modules/org-policy/google//modules/domain_restricted_sharing"
93-
version = "~> 5.1"
95+
source = "terraform-google-modules/org-policy/google//modules/domain_restricted_sharing"
96+
version = "~> 5.1"
97+
9498
organization_id = local.organization_id
9599
folder_id = local.folder_id
96100
policy_for = local.policy_for
@@ -102,8 +106,9 @@ module "org_domain_restricted_sharing" {
102106
*******************************************/
103107

104108
module "domain_restricted_contacts" {
105-
source = "terraform-google-modules/org-policy/google"
106-
version = "~> 5.1"
109+
source = "terraform-google-modules/org-policy/google"
110+
version = "~> 5.1"
111+
107112
organization_id = local.organization_id
108113
folder_id = local.folder_id
109114
policy_for = local.policy_for

0 commit comments

Comments
 (0)