Skip to content

Commit

Permalink
Fix for AKS recent provider change
Browse files Browse the repository at this point in the history
Remove deprecation warnings for AKS and EKS syntax : "${}"
  • Loading branch information
aLekSer committed Mar 2, 2020
1 parent 619867f commit 751ad23
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
33 changes: 21 additions & 12 deletions install/terraform/modules/aks/aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ provider "azuread" {
version = "=0.4.0"
}

provider "azurerm" {
version = "~> 2.0"
features {}
}

provider "random" {
version = "~> 2.2"
}

# Create Service Principal password
resource "azuread_service_principal_password" "aks" {
end_date = "2299-12-30T23:00:00Z" # Forever
Expand Down Expand Up @@ -45,23 +54,23 @@ resource "azurerm_resource_group" "test" {
}

resource "azurerm_kubernetes_cluster" "test" {
name = "${var.cluster_name}"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
name = var.cluster_name
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
dns_prefix = "agones"

kubernetes_version = "1.14.8"

default_node_pool {
name = "default"
node_count = 2
vm_size = "${var.machine_type}"
vm_size = var.machine_type
os_disk_size_gb = 30
enable_auto_scaling = false
}
service_principal {
client_id = "${var.client_id}"
client_secret = "${var.client_secret}"
client_id = var.client_id
client_secret = var.client_secret
}
tags = {
Environment = "Production"
Expand All @@ -70,8 +79,8 @@ resource "azurerm_kubernetes_cluster" "test" {

resource "azurerm_network_security_group" "test" {
name = "agonesSecurityGroup"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
}

resource "azurerm_network_security_rule" "gameserver" {
Expand All @@ -84,8 +93,8 @@ resource "azurerm_network_security_rule" "gameserver" {
destination_port_range = "7000-8000"
source_address_prefix = "*"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.test.name}"
network_security_group_name = "${azurerm_network_security_group.test.name}"
resource_group_name = azurerm_resource_group.test.name
network_security_group_name = azurerm_network_security_group.test.name
}

resource "azurerm_network_security_rule" "outbound" {
Expand All @@ -98,6 +107,6 @@ resource "azurerm_network_security_rule" "outbound" {
destination_port_range = "*"
source_address_prefix = "*"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.test.name}"
network_security_group_name = "${azurerm_network_security_group.test.name}"
resource_group_name = azurerm_resource_group.test.name
network_security_group_name = azurerm_network_security_group.test.name
}
14 changes: 7 additions & 7 deletions install/terraform/modules/eks/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,32 @@ module "vpc" {

module "eks" {
source = "git::github.com/terraform-aws-modules/terraform-aws-eks.git?ref=v7.0.1"
cluster_name = "${var.cluster_name}"
cluster_name = var.cluster_name
subnets = module.vpc.public_subnets
vpc_id = module.vpc.vpc_id
cluster_version = "1.13"

worker_groups_launch_template = [
{
name = "default"
instance_type = "${var.machine_type}"
asg_desired_capacity = "${var.node_count}"
asg_min_size = "${var.node_count}"
asg_max_size = "${var.node_count}"
instance_type = var.machine_type
asg_desired_capacity = var.node_count
asg_min_size = var.node_count
asg_max_size = var.node_count
additional_security_group_ids = [aws_security_group.worker_group_mgmt_one.id]
public_ip = true
},
// Node Pools with taints for metrics and system
{
name = "agones-system"
instance_type = "${var.machine_type}"
instance_type = var.machine_type
asg_desired_capacity = 1
kubelet_extra_args = "--node-labels=agones.dev/agones-system=true --register-with-taints=agones.dev/agones-system=true:NoExecute"
public_ip = true
},
{
name = "agones-metrics"
instance_type = "${var.machine_type}"
instance_type = var.machine_type
asg_desired_capacity = 1
kubelet_extra_args = "--node-labels=agones.dev/agones-metrics=true --register-with-taints=agones.dev/agones-metrics=true:NoExecute"
public_ip = true
Expand Down

0 comments on commit 751ad23

Please sign in to comment.