Created
November 4, 2019 12:17
-
-
Save amitaymolko/1aef98288f665644548c33f4e00a7312 to your computer and use it in GitHub Desktop.
aws-node iam annotation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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