sparse-intern-71089
08/25/2020, 9:15 PMbright-policeman-55860
08/25/2020, 9:19 PMbillowy-army-68599
endpoint
and certificateAuthority
outputs and place them in a json string manuallybright-policeman-55860
08/25/2020, 9:21 PMcluster = aws.eks.Cluster(...)
kubeconfig = pulumi.Output.all(cluster.endpoint, cluster.certificate_authority["data"], cluster.name).apply(lambda vars: inspect.cleandoc(f"""
apiVersion: v1
clusters:
- cluster:
server: {vars[0]}
certificate-authority-data: {vars[1]}
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: aws
name: aws
current-context: aws
kind: Config
preferences: {{}}
users:
- name: aws
user:
exec:
apiVersion: <http://client.authentication.k8s.io/v1alpha1|client.authentication.k8s.io/v1alpha1>
command: aws
args:
- eks
- get-token
- --cluster-name
- {vars[2]}
- --role
- {self.assume_role}
"""))
bright-policeman-55860
08/25/2020, 9:21 PMmany-psychiatrist-74327
08/25/2020, 9:21 PMmany-psychiatrist-74327
08/25/2020, 9:31 PM