Skip to content

Commit 083e792

Browse files
authored
fix: minor updates for lint (#694)
1 parent 393d625 commit 083e792

File tree

18 files changed

+27
-104
lines changed

18 files changed

+27
-104
lines changed

anthos-bm-apigee/main.tf

+12-13
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@ locals {
2323
}
2424

2525
module "install_abm_on_gce" {
26-
source = "../anthos-bm-gcp-terraform"
27-
project_id = var.project_id
28-
credentials_file = var.credentials_file
29-
region = var.region
30-
zone = var.zone
31-
gcp_login_accounts = var.gcp_login_accounts
32-
gce_vm_service_account = var.gce_vm_service_account
33-
username = var.username
34-
mode = var.mode
35-
resources_path = local.abm_on_gce_resources
36-
as_sub_module = true
37-
abm_cluster_id = "apigee-cluster"
38-
machine_type = "n1-standard-8"
26+
source = "../anthos-bm-gcp-terraform"
27+
project_id = var.project_id
28+
credentials_file = var.credentials_file
29+
region = var.region
30+
zone = var.zone
31+
gcp_login_accounts = var.gcp_login_accounts
32+
username = var.username
33+
mode = var.mode
34+
resources_path = local.abm_on_gce_resources
35+
as_sub_module = true
36+
abm_cluster_id = "apigee-cluster"
37+
machine_type = "n1-standard-8"
3938
instance_count = {
4039
"controlplane" : 1
4140
"worker" : 3

anthos-bm-apigee/variables.tf

-6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ variable "gcp_login_accounts" {
5252
default = []
5353
}
5454

55-
variable "gce_vm_service_account" {
56-
description = "Service Account to use for GCE instances"
57-
type = string
58-
default = ""
59-
}
60-
6155
variable "mode" {
6256
description = <<EOF
6357
Indication of the execution mode. By default the terraform execution will end

anthos-bm-gcp-terraform/main.tf

-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ module "configure_controlplane_lb" {
215215
]
216216
type = "controlplanelb"
217217
project = var.project_id
218-
region = var.region
219218
zone = var.zone
220219
name_prefix = "${var.abm_cluster_id}-cp"
221220
ip_name = "${var.abm_cluster_id}-cp-public-ip"
@@ -242,7 +241,6 @@ module "configure_ingress_lb" {
242241
]
243242
type = "ingresslb"
244243
project = var.project_id
245-
region = var.region
246244
zone = var.zone
247245
name_prefix = "${var.abm_cluster_id}-ing"
248246
ip_name = "${var.abm_cluster_id}-ing-public-ip"

anthos-bm-gcp-terraform/modules/loadbalancer/variables.tf

-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ variable "project" {
3333
type = string
3434
}
3535

36-
variable "region" {
37-
description = "Google Cloud Region in which the loadbalancer resources should be provisioned"
38-
type = string
39-
}
40-
4136
variable "zone" {
4237
description = "Zone within the selected Google Cloud Region that is to be used"
4338
type = string

anthos-bm-gcp-terraform/modules/vm/outputs.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ output "vm_info" {
2525
for vm_details in group : [
2626
for detail in vm_details.instances_details : {
2727
hostname = detail.name
28-
internalIp = detail.network_interface.0.network_ip
29-
externalIp = detail.network_interface.0.access_config.0.nat_ip
28+
internalIp = detail.network_interface[0].network_ip
29+
externalIp = detail.network_interface[0].access_config[0].nat_ip
3030
}
3131
]
3232
]

anthos-bm-gcp-terraform/variables.tf

-12
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ variable "tags" {
125125
default = ["http-server", "https-server"]
126126
}
127127

128-
variable "access_scopes" {
129-
description = "The IAM access scopes associated to the Compute Engine VM Service Accounts"
130-
type = set(string)
131-
default = ["cloud-platform"]
132-
}
133-
134128
variable "anthos_service_account_name" {
135129
description = "Name given to the Service account that will be used by the Anthos cluster components"
136130
type = string
@@ -173,12 +167,6 @@ variable "abm_cluster_id" {
173167
default = "cluster1"
174168
}
175169

176-
variable "gce_vm_service_account" {
177-
description = "Service Account to use for GCE instances"
178-
type = string
179-
default = ""
180-
}
181-
182170
variable "gcp_login_accounts" {
183171
description = "GCP account email addresses that must be allowed to login to the cluster using Google Cloud Identity."
184172
type = list(string)

anthos-multi-cloud/AWS/main.tf

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ module "iam" {
4444

4545
module "vpc" {
4646
source = "./modules/vpc"
47-
aws_region = var.aws_region
4847
vpc_cidr_block = var.vpc_cidr_block
4948
anthos_prefix = local.name_prefix
5049
subnet_availability_zones = var.subnet_availability_zones
5150
public_subnet_cidr_block = var.public_subnet_cidr_block
5251
cp_private_subnet_cidr_blocks = var.cp_private_subnet_cidr_blocks
53-
np_private_subnet_cidr_blocks = var.np_private_subnet_cidr_blocks
5452
}
5553

5654
module "gcp_data" {
@@ -86,6 +84,7 @@ module "anthos_cluster" {
8684
}
8785
module "create_vars" {
8886
source = "terraform-google-modules/gcloud/google"
87+
version = "~> 3.4"
8988
platform = "linux"
9089
create_cmd_entrypoint = "./modules/scripts/create_vars.sh"
9190
create_cmd_body = "\"${local.name_prefix}\" \"${var.gcp_location}\" \"${var.aws_region}\" \"${var.cluster_version}\" \"${module.kms.database_encryption_kms_key_arn}\" \"${module.iam.cp_instance_profile_id}\" \"${module.iam.api_role_arn}\" \"${module.vpc.aws_cp_subnet_id_1},${module.vpc.aws_cp_subnet_id_2},${module.vpc.aws_cp_subnet_id_3}\" \"${module.vpc.aws_vpc_id}\" \"${var.gcp_project_id}\" \"${var.pod_address_cidr_blocks}\" \"${var.service_address_cidr_blocks}\" \"${module.iam.np_instance_profile_id}\" \"${var.node_pool_instance_type}\" \"${module.kms.node_pool_config_encryption_kms_key_arn}\" \"${module.kms.node_pool_root_volume_encryption_kms_key_arn}\""

anthos-multi-cloud/AWS/modules/kms/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ data "aws_iam_policy_document" "root_volume_encryption_policy_document" {
8181
condition {
8282
test = "StringEquals"
8383
variable = "kms:CallerAccount"
84-
values = ["${data.aws_caller_identity.current.account_id}"]
84+
values = [data.aws_caller_identity.current.account_id]
8585
}
8686
condition {
8787
test = "StringEquals"
@@ -109,7 +109,7 @@ data "aws_iam_policy_document" "root_volume_encryption_policy_document" {
109109
condition {
110110
test = "StringEquals"
111111
variable = "kms:CallerAccount"
112-
values = ["${data.aws_caller_identity.current.account_id}"]
112+
values = [data.aws_caller_identity.current.account_id]
113113
}
114114
condition {
115115
test = "StringEquals"

anthos-multi-cloud/AWS/modules/vpc/variables.tf

-16
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,18 @@ variable "vpc_cidr_block" {
1818
description = "CIDR block to use for VPC"
1919
type = string
2020
}
21-
variable "aws_region" {
22-
description = "AWS Region to use for VPC"
23-
type = string
24-
}
2521

2622
variable "anthos_prefix" {
2723
description = "Anthos naming prefix"
2824
type = string
2925
}
3026

31-
variable "public_subnet_cidr_blocks" {
32-
description = "CIDR blocks to use for public subnets"
33-
type = list(string)
34-
default = []
35-
}
36-
3727
variable "cp_private_subnet_cidr_blocks" {
3828
description = "CIDR blocks to use for control plane private subnets"
3929
type = list(string)
4030
default = []
4131
}
4232

43-
variable "np_private_subnet_cidr_blocks" {
44-
description = "CIDR blocks to use for node pool private subnets"
45-
type = list(string)
46-
default = []
47-
}
48-
4933
variable "subnet_availability_zones" {
5034
description = "Availability zones to create subnets in"
5135
type = list(string)

anthos-multi-cloud/AWS/provider.tf

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ terraform {
2121
version = ">= 4.14.0"
2222
}
2323
}
24+
required_version = ">= 0.13"
2425
}
2526

2627
provider "aws" {

anthos-multi-cloud/AWS/variables.tf

-8
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ variable "cp_private_subnet_cidr_blocks" {
7272
]
7373
}
7474

75-
variable "np_private_subnet_cidr_blocks" {
76-
description = "CIDR block to use for node pool private subnets"
77-
type = list(string)
78-
default = [
79-
"10.0.4.0/24"
80-
]
81-
}
82-
8375
#Refer to this page for information on public subnets
8476
#https://cloud.google.com/anthos/clusters/docs/multi-cloud/aws/how-to/create-aws-vpc#create-sample-vpc
8577

anthos-multi-cloud/Azure/main.tf

+5-6
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ module "aad_app" {
4242
module "cluster_vnet" {
4343
source = "./modules/cluster-vnet"
4444

45-
name = "${local.name_prefix}-vnet-rg"
46-
region = var.azure_region
47-
aad_app_name = "${local.name_prefix}-app"
48-
sp_obj_id = module.aad_app.aad_app_sp_obj_id
49-
subscription_id = module.aad_app.subscription_id
45+
name = "${local.name_prefix}-vnet-rg"
46+
region = var.azure_region
47+
aad_app_name = "${local.name_prefix}-app"
48+
sp_obj_id = module.aad_app.aad_app_sp_obj_id
5049
depends_on = [
5150
module.aad_app
5251
]
@@ -79,7 +78,6 @@ module "anthos_cluster" {
7978
resource_group_id = module.cluster_rg.resource_group_id
8079
subnet_id = module.cluster_vnet.subnet_id
8180
ssh_public_key = tls_private_key.anthos_ssh_key.public_key_openssh
82-
project_number = module.gcp_data.project_number
8381
virtual_network_id = module.cluster_vnet.vnet_id
8482
tenant_id = module.aad_app.tenant_id
8583
control_plane_instance_type = var.control_plane_instance_type
@@ -93,6 +91,7 @@ module "anthos_cluster" {
9391

9492
module "create_vars" {
9593
source = "terraform-google-modules/gcloud/google"
94+
version = "~> 3.4"
9695
platform = "linux"
9796
create_cmd_entrypoint = "./modules/scripts/create_vars.sh"
9897
create_cmd_body = "\"${local.name_prefix}\" \"${var.gcp_location}\" \"${var.azure_region}\" \"${var.cluster_version}\" \"${tls_private_key.anthos_ssh_key.public_key_openssh}\" \"${module.cluster_vnet.subnet_id}\""

anthos-multi-cloud/Azure/modules/anthos_cluster/variables.tf

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "project_number" {
18-
}
1917
variable "location" {
2018
}
2119
variable "azure_region" {

anthos-multi-cloud/Azure/modules/cluster-rg/main.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
terraform {
1818
required_version = ">= 0.12.23"
1919
required_providers {
20-
azurerm = "=2.94.0"
20+
azurerm = {
21+
source = "hashicorp/azurerm"
22+
version = "=2.94.0"
23+
}
2124
}
2225
}
2326

24-
data "azurerm_subscription" "current" {
25-
}
2627
data "azurerm_client_config" "current" {
2728
}
2829
#Create an Azure resource group

anthos-multi-cloud/Azure/modules/cluster-vnet/variables.tf

-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,3 @@ variable "sp_obj_id" {
3232
description = "app service principal object id"
3333
type = string
3434
}
35-
variable "subscription_id" {
36-
description = "subscription_id "
37-
type = string
38-
}

anthos-onprem-terraform/abm_user_cluster_manuallb/variables.tf

-7
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,3 @@ variable "admin_user_emails" {
116116
type = list(string)
117117
}
118118

119-
variable "primary_apis" {
120-
description = "List of primary Google Cloud APIs to be enabled for this deployment"
121-
type = list(string)
122-
default = [
123-
"cloudresourcemanager.googleapis.com",
124-
]
125-
}

anthos-onprem-terraform/abm_user_cluster_metallb/variables.tf

-7
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,3 @@ variable "admin_user_emails" {
126126
type = list(string)
127127
}
128128

129-
variable "primary_apis" {
130-
description = "List of primary Google Cloud APIs to be enabled for this deployment"
131-
type = list(string)
132-
default = [
133-
"cloudresourcemanager.googleapis.com",
134-
]
135-
}

anthos-onprem-terraform/avmw_user_cluster_metallb/variables.tf

-7
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,3 @@ variable "lb_address_pools" {
120120
type = list(object({ name = string, addresses = list(string) }))
121121
}
122122

123-
variable "primary_apis" {
124-
description = "List of primary Google Cloud APIs to be enabled for this deployment"
125-
type = list(string)
126-
default = [
127-
"cloudresourcemanager.googleapis.com",
128-
]
129-
}

0 commit comments

Comments
 (0)