Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: minor updates for lint #694

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions anthos-bm-apigee/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ locals {
}

module "install_abm_on_gce" {
source = "../anthos-bm-gcp-terraform"
project_id = var.project_id
credentials_file = var.credentials_file
region = var.region
zone = var.zone
gcp_login_accounts = var.gcp_login_accounts
gce_vm_service_account = var.gce_vm_service_account
username = var.username
mode = var.mode
resources_path = local.abm_on_gce_resources
as_sub_module = true
abm_cluster_id = "apigee-cluster"
machine_type = "n1-standard-8"
source = "../anthos-bm-gcp-terraform"
project_id = var.project_id
credentials_file = var.credentials_file
region = var.region
zone = var.zone
gcp_login_accounts = var.gcp_login_accounts
username = var.username
mode = var.mode
resources_path = local.abm_on_gce_resources
as_sub_module = true
abm_cluster_id = "apigee-cluster"
machine_type = "n1-standard-8"
instance_count = {
"controlplane" : 1
"worker" : 3
Expand Down
6 changes: 0 additions & 6 deletions anthos-bm-apigee/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ variable "gcp_login_accounts" {
default = []
}

variable "gce_vm_service_account" {
description = "Service Account to use for GCE instances"
type = string
default = ""
}

variable "mode" {
description = <<EOF
Indication of the execution mode. By default the terraform execution will end
Expand Down
2 changes: 0 additions & 2 deletions anthos-bm-gcp-terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ module "configure_controlplane_lb" {
]
type = "controlplanelb"
project = var.project_id
region = var.region
zone = var.zone
name_prefix = "${var.abm_cluster_id}-cp"
ip_name = "${var.abm_cluster_id}-cp-public-ip"
Expand All @@ -242,7 +241,6 @@ module "configure_ingress_lb" {
]
type = "ingresslb"
project = var.project_id
region = var.region
zone = var.zone
name_prefix = "${var.abm_cluster_id}-ing"
ip_name = "${var.abm_cluster_id}-ing-public-ip"
Expand Down
5 changes: 0 additions & 5 deletions anthos-bm-gcp-terraform/modules/loadbalancer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ variable "project" {
type = string
}

variable "region" {
description = "Google Cloud Region in which the loadbalancer resources should be provisioned"
type = string
}

variable "zone" {
description = "Zone within the selected Google Cloud Region that is to be used"
type = string
Expand Down
4 changes: 2 additions & 2 deletions anthos-bm-gcp-terraform/modules/vm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ output "vm_info" {
for vm_details in group : [
for detail in vm_details.instances_details : {
hostname = detail.name
internalIp = detail.network_interface.0.network_ip
externalIp = detail.network_interface.0.access_config.0.nat_ip
internalIp = detail.network_interface[0].network_ip
externalIp = detail.network_interface[0].access_config[0].nat_ip
}
]
]
Expand Down
12 changes: 0 additions & 12 deletions anthos-bm-gcp-terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ variable "tags" {
default = ["http-server", "https-server"]
}

variable "access_scopes" {
description = "The IAM access scopes associated to the Compute Engine VM Service Accounts"
type = set(string)
default = ["cloud-platform"]
}

variable "anthos_service_account_name" {
description = "Name given to the Service account that will be used by the Anthos cluster components"
type = string
Expand Down Expand Up @@ -173,12 +167,6 @@ variable "abm_cluster_id" {
default = "cluster1"
}

variable "gce_vm_service_account" {
description = "Service Account to use for GCE instances"
type = string
default = ""
}

variable "gcp_login_accounts" {
description = "GCP account email addresses that must be allowed to login to the cluster using Google Cloud Identity."
type = list(string)
Expand Down
3 changes: 1 addition & 2 deletions anthos-multi-cloud/AWS/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ module "iam" {

module "vpc" {
source = "./modules/vpc"
aws_region = var.aws_region
vpc_cidr_block = var.vpc_cidr_block
anthos_prefix = local.name_prefix
subnet_availability_zones = var.subnet_availability_zones
public_subnet_cidr_block = var.public_subnet_cidr_block
cp_private_subnet_cidr_blocks = var.cp_private_subnet_cidr_blocks
np_private_subnet_cidr_blocks = var.np_private_subnet_cidr_blocks
}

module "gcp_data" {
Expand Down Expand Up @@ -86,6 +84,7 @@ module "anthos_cluster" {
}
module "create_vars" {
source = "terraform-google-modules/gcloud/google"
version = "~> 3.4"
platform = "linux"
create_cmd_entrypoint = "./modules/scripts/create_vars.sh"
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}\""
Expand Down
4 changes: 2 additions & 2 deletions anthos-multi-cloud/AWS/modules/kms/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ data "aws_iam_policy_document" "root_volume_encryption_policy_document" {
condition {
test = "StringEquals"
variable = "kms:CallerAccount"
values = ["${data.aws_caller_identity.current.account_id}"]
values = [data.aws_caller_identity.current.account_id]
}
condition {
test = "StringEquals"
Expand Down Expand Up @@ -109,7 +109,7 @@ data "aws_iam_policy_document" "root_volume_encryption_policy_document" {
condition {
test = "StringEquals"
variable = "kms:CallerAccount"
values = ["${data.aws_caller_identity.current.account_id}"]
values = [data.aws_caller_identity.current.account_id]
}
condition {
test = "StringEquals"
Expand Down
16 changes: 0 additions & 16 deletions anthos-multi-cloud/AWS/modules/vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,18 @@ variable "vpc_cidr_block" {
description = "CIDR block to use for VPC"
type = string
}
variable "aws_region" {
description = "AWS Region to use for VPC"
type = string
}

variable "anthos_prefix" {
description = "Anthos naming prefix"
type = string
}

variable "public_subnet_cidr_blocks" {
description = "CIDR blocks to use for public subnets"
type = list(string)
default = []
}

variable "cp_private_subnet_cidr_blocks" {
description = "CIDR blocks to use for control plane private subnets"
type = list(string)
default = []
}

variable "np_private_subnet_cidr_blocks" {
description = "CIDR blocks to use for node pool private subnets"
type = list(string)
default = []
}

variable "subnet_availability_zones" {
description = "Availability zones to create subnets in"
type = list(string)
Expand Down
1 change: 1 addition & 0 deletions anthos-multi-cloud/AWS/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ terraform {
version = ">= 4.14.0"
}
}
required_version = ">= 0.13"
}

provider "aws" {
Expand Down
8 changes: 0 additions & 8 deletions anthos-multi-cloud/AWS/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ variable "cp_private_subnet_cidr_blocks" {
]
}

variable "np_private_subnet_cidr_blocks" {
description = "CIDR block to use for node pool private subnets"
type = list(string)
default = [
"10.0.4.0/24"
]
}

#Refer to this page for information on public subnets
#https://cloud.google.com/anthos/clusters/docs/multi-cloud/aws/how-to/create-aws-vpc#create-sample-vpc

Expand Down
11 changes: 5 additions & 6 deletions anthos-multi-cloud/Azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ module "aad_app" {
module "cluster_vnet" {
source = "./modules/cluster-vnet"

name = "${local.name_prefix}-vnet-rg"
region = var.azure_region
aad_app_name = "${local.name_prefix}-app"
sp_obj_id = module.aad_app.aad_app_sp_obj_id
subscription_id = module.aad_app.subscription_id
name = "${local.name_prefix}-vnet-rg"
region = var.azure_region
aad_app_name = "${local.name_prefix}-app"
sp_obj_id = module.aad_app.aad_app_sp_obj_id
depends_on = [
module.aad_app
]
Expand Down Expand Up @@ -79,7 +78,6 @@ module "anthos_cluster" {
resource_group_id = module.cluster_rg.resource_group_id
subnet_id = module.cluster_vnet.subnet_id
ssh_public_key = tls_private_key.anthos_ssh_key.public_key_openssh
project_number = module.gcp_data.project_number
virtual_network_id = module.cluster_vnet.vnet_id
tenant_id = module.aad_app.tenant_id
control_plane_instance_type = var.control_plane_instance_type
Expand All @@ -93,6 +91,7 @@ module "anthos_cluster" {

module "create_vars" {
source = "terraform-google-modules/gcloud/google"
version = "~> 3.4"
platform = "linux"
create_cmd_entrypoint = "./modules/scripts/create_vars.sh"
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}\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

variable "project_number" {
}
variable "location" {
}
variable "azure_region" {
Expand Down
7 changes: 4 additions & 3 deletions anthos-multi-cloud/Azure/modules/cluster-rg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
terraform {
required_version = ">= 0.12.23"
required_providers {
azurerm = "=2.94.0"
azurerm = {
source = "hashicorp/azurerm"
version = "=2.94.0"
}
}
}

data "azurerm_subscription" "current" {
}
data "azurerm_client_config" "current" {
}
#Create an Azure resource group
Expand Down
4 changes: 0 additions & 4 deletions anthos-multi-cloud/Azure/modules/cluster-vnet/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,3 @@ variable "sp_obj_id" {
description = "app service principal object id"
type = string
}
variable "subscription_id" {
description = "subscription_id "
type = string
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,3 @@ variable "admin_user_emails" {
type = list(string)
}

variable "primary_apis" {
description = "List of primary Google Cloud APIs to be enabled for this deployment"
type = list(string)
default = [
"cloudresourcemanager.googleapis.com",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,3 @@ variable "admin_user_emails" {
type = list(string)
}

variable "primary_apis" {
description = "List of primary Google Cloud APIs to be enabled for this deployment"
type = list(string)
default = [
"cloudresourcemanager.googleapis.com",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,3 @@ variable "lb_address_pools" {
type = list(object({ name = string, addresses = list(string) }))
}

variable "primary_apis" {
description = "List of primary Google Cloud APIs to be enabled for this deployment"
type = list(string)
default = [
"cloudresourcemanager.googleapis.com",
]
}
Loading