Skip to content

Commit

Permalink
fix: Availability Zone AZs Data Source to filter Local Zones (#1995)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigobersa authored Aug 12, 2024
1 parent 717b7d8 commit db4ca4a
Show file tree
Hide file tree
Showing 29 changed files with 194 additions and 29 deletions.
8 changes: 7 additions & 1 deletion patterns/agones-game-controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ provider "helm" {
}
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
8 changes: 7 additions & 1 deletion patterns/aws-vpc-cni-network-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ provider "helm" {
}
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
8 changes: 7 additions & 1 deletion patterns/blue-green-upgrade/environment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ locals {
}
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
Expand Down
2 changes: 1 addition & 1 deletion patterns/blue-green-upgrade/modules/eks_cluster/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Required for public ECR where Karpenter artifacts are hosted
provider "aws" {
region = "us-east-1"
alias = "virginia"
alias = "ecr"
}

locals {
Expand Down
1 change: 0 additions & 1 deletion patterns/bottlerocket/addons.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ module "eks_blueprints_addons" {
karpenter = {
repository_username = data.aws_ecrpublic_authorization_token.token.user_name
repository_password = data.aws_ecrpublic_authorization_token.token.password
version = "v0.36"
}

enable_bottlerocket_update_operator = true
Expand Down
8 changes: 7 additions & 1 deletion patterns/bottlerocket/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
################################################################################
# Providers
################################################################################
data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

data "aws_caller_identity" "current" {}

Expand Down
9 changes: 8 additions & 1 deletion patterns/ecr-pull-through-cache/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ provider "helm" {
################################################################################

data "aws_caller_identity" "current" {}
data "aws_availability_zones" "available" {}

data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
9 changes: 8 additions & 1 deletion patterns/external-secrets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ provider "kubectl" {
}
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

data "aws_caller_identity" "current" {}

locals {
Expand Down
8 changes: 7 additions & 1 deletion patterns/fargate-serverless/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ provider "helm" {
}
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
8 changes: 7 additions & 1 deletion patterns/fully-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ provider "aws" {
region = local.region
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
10 changes: 9 additions & 1 deletion patterns/gitops/getting-started-argocd/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
provider "aws" {
region = local.region
}

data "aws_caller_identity" "current" {}
data "aws_availability_zones" "available" {}

data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

provider "helm" {
kubernetes {
Expand Down
10 changes: 9 additions & 1 deletion patterns/gitops/multi-cluster-hub-spoke-argocd/hub/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
provider "aws" {
region = local.region
}

data "aws_caller_identity" "current" {}
data "aws_availability_zones" "available" {}

data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

provider "helm" {
kubernetes {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
provider "aws" {
region = local.region
}

data "aws_caller_identity" "current" {}
data "aws_availability_zones" "available" {}

data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

data "terraform_remote_state" "cluster_hub" {
backend = "local"
Expand Down
8 changes: 7 additions & 1 deletion patterns/ipv6-eks-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ provider "aws" {
region = local.region
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
8 changes: 7 additions & 1 deletion patterns/istio/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ provider "helm" {
}
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
2 changes: 1 addition & 1 deletion patterns/karpenter-mng/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ data "aws_ecrpublic_authorization_token" "token" {
}

data "aws_availability_zones" "available" {
#Do not include local zones
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
Expand Down
8 changes: 7 additions & 1 deletion patterns/karpenter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ data "aws_ecrpublic_authorization_token" "token" {
provider = aws.ecr
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = "ex-${basename(path.cwd)}"
Expand Down
9 changes: 8 additions & 1 deletion patterns/kubecost/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ provider "helm" {
}
}

data "aws_availability_zones" "available" {}
data "aws_caller_identity" "current" {}

data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
region = "us-west-2"
Expand Down
8 changes: 7 additions & 1 deletion patterns/ml-capacity-block/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ provider "helm" {
# Common data/locals
################################################################################

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
9 changes: 8 additions & 1 deletion patterns/multi-tenancy-with-teams/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ data "aws_eks_cluster_auth" "this" {
}

data "aws_caller_identity" "current" {}
data "aws_availability_zones" "available" {}

data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
8 changes: 7 additions & 1 deletion patterns/nvidia-gpu-efa/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ provider "helm" {
# Common data/locals
################################################################################

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
8 changes: 7 additions & 1 deletion patterns/private-public-ingress/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ provider "helm" {
}
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
8 changes: 7 additions & 1 deletion patterns/privatelink-access/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ provider "aws" {
region = local.region
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
8 changes: 7 additions & 1 deletion patterns/sso-iam-identity-center/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ provider "kubernetes" {
}
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = "sso-${basename(path.cwd)}"
Expand Down
8 changes: 7 additions & 1 deletion patterns/sso-okta/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ provider "aws" {
region = local.region
}

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
9 changes: 8 additions & 1 deletion patterns/stateful/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ provider "helm" {
}

data "aws_caller_identity" "current" {}
data "aws_availability_zones" "available" {}

data "aws_availability_zones" "available" {
# Do not include local zones
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}

locals {
name = basename(path.cwd)
Expand Down
Loading

0 comments on commit db4ca4a

Please sign in to comment.