mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-17 23:13:46 +01:00
first commit
This commit is contained in:
58
data.tf
Normal file
58
data.tf
Normal file
@@ -0,0 +1,58 @@
|
||||
data "aws_region" "current" {}
|
||||
|
||||
data "aws_availability_zones" "available" {}
|
||||
|
||||
provider "http" {}
|
||||
|
||||
data "http" "workstation-external-ip" {
|
||||
url = "http://icanhazip.com"
|
||||
}
|
||||
|
||||
# Override with variable or hardcoded value if necessary
|
||||
locals {
|
||||
workstation_external_cidr = "${chomp(data.http.workstation-external-ip.body)}/32"
|
||||
|
||||
config_map_aws_auth = <<CONFIGMAPAWSAUTH
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: aws-auth
|
||||
namespace: kube-system
|
||||
data:
|
||||
mapRoles: |
|
||||
- rolearn: ${aws_iam_role.demo-node.arn}
|
||||
username: system:node:{{EC2PrivateDNSName}}
|
||||
groups:
|
||||
- system:bootstrappers
|
||||
- system:nodes
|
||||
CONFIGMAPAWSAUTH
|
||||
|
||||
kubeconfig = <<KUBECONFIG
|
||||
|
||||
|
||||
apiVersion: v1
|
||||
clusters:
|
||||
- cluster:
|
||||
server: ${aws_eks_cluster.demo.endpoint}
|
||||
certificate-authority-data: ${aws_eks_cluster.demo.certificate_authority.0.data}
|
||||
name: kubernetes
|
||||
contexts:
|
||||
- context:
|
||||
cluster: kubernetes
|
||||
user: aws
|
||||
name: aws
|
||||
current-context: aws
|
||||
kind: Config
|
||||
preferences: {}
|
||||
users:
|
||||
- name: aws
|
||||
user:
|
||||
exec:
|
||||
apiVersion: client.authentication.k8s.io/v1alpha1
|
||||
command: heptio-authenticator-aws
|
||||
args:
|
||||
- "token"
|
||||
- "-i"
|
||||
- "${var.cluster_name}"
|
||||
KUBECONFIG
|
||||
}
|
||||
Reference in New Issue
Block a user