Skip to content

Commit

Permalink
fix(main): renaming eks_cluster resource to main
Browse files Browse the repository at this point in the history
  • Loading branch information
msfidelis committed Mar 8, 2024
1 parent c434e22 commit 7f3a5e7
Show file tree
Hide file tree
Showing 24 changed files with 60 additions and 60 deletions.
6 changes: 3 additions & 3 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ No modules.
| [aws_eks_addon.coredns](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.csi_driver](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.kubeproxy](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_cluster.eks_cluster](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_cluster) | resource |
| [aws_eks_cluster.main](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_cluster) | resource |
| [aws_eks_node_group.cluster](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_node_group) | resource |
| [aws_iam_openid_connect_provider.eks](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_openid_connect_provider) | resource |
| [aws_iam_policy.aws_load_balancer_controller_policy](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_policy) | resource |
Expand All @@ -42,7 +42,7 @@ No modules.
| [aws_iam_policy_attachment.csi_driver](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_policy_attachment) | resource |
| [aws_iam_role.alb_controller](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.cluster_autoscaler_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.eks_cluster_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.main_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.eks_nodes_roles](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.cloudwatch](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_iam_role_policy_attachment.cni](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
Expand Down Expand Up @@ -112,7 +112,7 @@ No modules.
| [aws_iam_policy_document.cluster_autoscaler_policy](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.cluster_autoscaler_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.csi_driver](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.eks_cluster_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.main_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.eks_nodes_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [tls_certificate.eks](https://registry.terraform.io/providers/tls/latest/docs/data-sources/certificate) | data source |

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ No modules.
| [aws_eks_addon.coredns](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.csi_driver](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.kubeproxy](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_cluster.eks_cluster](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_cluster) | resource |
| [aws_eks_cluster.main](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_cluster) | resource |
| [aws_eks_node_group.cluster](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_node_group) | resource |
| [aws_grafana_workspace.grafana](https://registry.terraform.io/providers/aws/latest/docs/resources/grafana_workspace) | resource |
| [aws_iam_instance_profile.nodes](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_instance_profile) | resource |
Expand All @@ -103,7 +103,7 @@ No modules.
| [aws_iam_role.alb_controller](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.aws_node_termination_handler_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.cluster_autoscaler_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.eks_cluster_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.main_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.eks_nodes_roles](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.grafana](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.karpenter_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
Expand Down Expand Up @@ -200,7 +200,7 @@ No modules.
| [aws_iam_policy_document.cluster_autoscaler_policy](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.cluster_autoscaler_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.csi_driver](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.eks_cluster_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.main_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.eks_nodes_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.karpenter_policy](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.karpenter_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
Expand Down
6 changes: 3 additions & 3 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
| [aws_eks_addon.cni](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.coredns](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.kubeproxy](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_cluster.eks_cluster](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_cluster) | resource |
| [aws_eks_cluster.main](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_cluster) | resource |
| [aws_eks_node_group.cluster](https://registry.terraform.io/providers/aws/latest/docs/resources/eks_node_group) | resource |
| [aws_iam_openid_connect_provider.eks](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_openid_connect_provider) | resource |
| [aws_iam_policy.aws_load_balancer_controller_policy](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_policy) | resource |
Expand All @@ -36,7 +36,7 @@
| [aws_iam_policy_attachment.cluster_autoscaler](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_policy_attachment) | resource |
| [aws_iam_role.alb_controller](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.cluster_autoscaler_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.eks_cluster_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.main_role](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role.eks_nodes_roles](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.cloudwatch](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_iam_role_policy_attachment.cni](https://registry.terraform.io/providers/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
Expand Down Expand Up @@ -105,7 +105,7 @@
| [aws_iam_policy_document.aws_load_balancer_controller_policy](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.cluster_autoscaler_policy](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.cluster_autoscaler_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.eks_cluster_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.main_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.eks_nodes_role](https://registry.terraform.io/providers/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [tls_certificate.eks](https://registry.terraform.io/providers/tls/latest/docs/data-sources/certificate) | data source |

Expand Down
8 changes: 4 additions & 4 deletions addons.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_eks_addon" "cni" {
cluster_name = aws_eks_cluster.eks_cluster.name
cluster_name = aws_eks_cluster.main.name
addon_name = "vpc-cni"

addon_version = var.addon_cni_version
Expand All @@ -12,7 +12,7 @@ resource "aws_eks_addon" "cni" {
}

resource "aws_eks_addon" "coredns" {
cluster_name = aws_eks_cluster.eks_cluster.name
cluster_name = aws_eks_cluster.main.name
addon_name = "coredns"

addon_version = var.addon_coredns_version
Expand All @@ -25,7 +25,7 @@ resource "aws_eks_addon" "coredns" {
}

resource "aws_eks_addon" "kubeproxy" {
cluster_name = aws_eks_cluster.eks_cluster.name
cluster_name = aws_eks_cluster.main.name
addon_name = "kube-proxy"

addon_version = var.addon_kubeproxy_version
Expand All @@ -37,7 +37,7 @@ resource "aws_eks_addon" "kubeproxy" {
}

resource "aws_eks_addon" "csi_driver" {
cluster_name = aws_eks_cluster.eks_cluster.name
cluster_name = aws_eks_cluster.main.name
addon_name = "aws-ebs-csi-driver"

addon_version = var.addon_csi_version
Expand Down
2 changes: 1 addition & 1 deletion aws-auth-config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ YAML
}

depends_on = [
aws_eks_cluster.eks_cluster
aws_eks_cluster.main
]
}
2 changes: 1 addition & 1 deletion data.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "aws_eks_cluster_auth" "default" {
name = aws_eks_cluster.eks_cluster.id
name = aws_eks_cluster.main.id
}

data "aws_caller_identity" "current" {}
Expand Down
6 changes: 3 additions & 3 deletions eks.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

resource "aws_eks_cluster" "eks_cluster" {
resource "aws_eks_cluster" "main" {

name = var.cluster_name
version = var.k8s_version
Expand Down Expand Up @@ -74,7 +74,7 @@ resource "aws_security_group_rule" "nodeport_cluster" {
description = "nodeport"
protocol = "tcp"

security_group_id = aws_eks_cluster.eks_cluster.vpc_config[0].cluster_security_group_id
security_group_id = aws_eks_cluster.main.vpc_config[0].cluster_security_group_id
type = "ingress"
}

Expand All @@ -85,6 +85,6 @@ resource "aws_security_group_rule" "nodeport_cluster_udp" {
description = "nodeport"
protocol = "udp"

security_group_id = aws_eks_cluster.eks_cluster.vpc_config[0].cluster_security_group_id
security_group_id = aws_eks_cluster.main.vpc_config[0].cluster_security_group_id
type = "ingress"
}
2 changes: 1 addition & 1 deletion helm_alb_ingress_controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "helm_release" "alb_ingress_controller" {
}

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand Down
6 changes: 3 additions & 3 deletions helm_argo_rollouts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ resource "helm_release" "argo_rollouts" {


depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand All @@ -63,7 +63,7 @@ spec:
YAML

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand Down Expand Up @@ -97,7 +97,7 @@ spec:
YAML

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand Down
2 changes: 1 addition & 1 deletion helm_chaos_mesh.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "helm_release" "chaos_mesh" {
create_namespace = true

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand Down
2 changes: 1 addition & 1 deletion helm_cluster_autoscaler.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "helm_release" "cluster_autoscaler" {
}

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand Down
2 changes: 1 addition & 1 deletion helm_descheduler.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resource "helm_release" "descheduler" {
}

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand Down
16 changes: 8 additions & 8 deletions helm_istio.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "helm_release" "istio_base" {
version = "1.20.2"

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.alb_ingress_controller
Expand All @@ -27,7 +27,7 @@ resource "helm_release" "istiod" {
version = "1.20.2"

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base
Expand Down Expand Up @@ -136,7 +136,7 @@ resource "helm_release" "istio_ingress" {
}

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand All @@ -161,7 +161,7 @@ YAML


depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand All @@ -185,7 +185,7 @@ spec:
YAML

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand Down Expand Up @@ -245,7 +245,7 @@ resource "helm_release" "kiali-server" {


depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand Down Expand Up @@ -273,7 +273,7 @@ spec:
YAML

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand Down Expand Up @@ -306,7 +306,7 @@ spec:
YAML

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand Down
6 changes: 3 additions & 3 deletions helm_jaeger.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "helm_release" "jaeger" {
create_namespace = true

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand All @@ -35,7 +35,7 @@ spec:
YAML

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand Down Expand Up @@ -69,7 +69,7 @@ spec:
YAML

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth,
helm_release.istio_base,
Expand Down
10 changes: 5 additions & 5 deletions helm_karpenter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "helm_release" "karpenter" {

set {
name = "clusterEndpoint"
value = aws_eks_cluster.eks_cluster.endpoint
value = aws_eks_cluster.main.endpoint
}

set {
Expand All @@ -29,7 +29,7 @@ resource "helm_release" "karpenter" {
}

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
kubernetes_config_map.aws-auth,
aws_eks_node_group.cluster
]
Expand Down Expand Up @@ -78,16 +78,16 @@ resource "aws_launch_template" "karpenter" {
update_default_version = true

vpc_security_group_ids = [
aws_eks_cluster.eks_cluster.vpc_config[0].cluster_security_group_id
aws_eks_cluster.main.vpc_config[0].cluster_security_group_id
]

user_data = base64encode(templatefile(
"${path.module}/helm/karpenter/templates/user-data.sh.tpl",
{
CLUSTER_NAME = var.cluster_name,
CLUSTER_ID = var.cluster_name,
APISERVER_ENDPOINT = aws_eks_cluster.eks_cluster.endpoint,
B64_CLUSTER_CA = aws_eks_cluster.eks_cluster.certificate_authority.0.data
APISERVER_ENDPOINT = aws_eks_cluster.main.endpoint,
B64_CLUSTER_CA = aws_eks_cluster.main.certificate_authority.0.data
}
))

Expand Down
2 changes: 1 addition & 1 deletion helm_keda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "helm_release" "keda" {
}

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand Down
2 changes: 1 addition & 1 deletion helm_kube_state_metrics.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "helm_release" "kube_state_metrics" {
}

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand Down
4 changes: 2 additions & 2 deletions helm_managed_prometheus.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
# }

# depends_on = [
# aws_eks_cluster.eks_cluster,
# aws_eks_cluster.main,
# aws_eks_node_group.cluster,
# kubernetes_config_map.aws-auth
# ]
Expand Down Expand Up @@ -129,7 +129,7 @@ resource "helm_release" "managed_prometheus" {


depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand Down
2 changes: 1 addition & 1 deletion helm_metrics_server.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "helm_release" "metrics_server" {
}

depends_on = [
aws_eks_cluster.eks_cluster,
aws_eks_cluster.main,
aws_eks_node_group.cluster,
kubernetes_config_map.aws-auth
]
Expand Down
Loading

0 comments on commit 7f3a5e7

Please sign in to comment.