Skip to content

Instantly share code, notes, and snippets.

@amitaymolko
Created November 4, 2019 12:17
Show Gist options
  • Save amitaymolko/1aef98288f665644548c33f4e00a7312 to your computer and use it in GitHub Desktop.
Save amitaymolko/1aef98288f665644548c33f4e00a7312 to your computer and use it in GitHub Desktop.
aws-node iam annotation
resource "null_resource" "aws-node-iam" {
provisioner "local-exec" {
command = "aws eks --region ${var.region} update-kubeconfig --name ${var.cluster_name} && kubectl annotate sa aws-node -n kube-system eks.amazonaws.com/role-arn=${aws_iam_role.cni-role.arn}"
}
provisioner "local-exec" {
when = "destroy"
command = "aws eks --region ${var.region} update-kubeconfig --name ${var.cluster_name} && kubectl annotate sa aws-node -n kube-system eks.amazonaws.com/role-arn-"
}
depends_on = [
"spotinst_ocean_aws.eks" # or eks cluster or autoscale group
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment