cdktf-gke-auth
Project description
cdktf-gke-auth
Easily authenticate against a Google Kubernetes Engine (GKE) within your CDK for Terraform stack. Without the need to
resort to Google's terraform GKE auth module. You can avoid running cdktf get
as pre-synth step.
Example usage (Typescript)
Install the construct with: yarn install cdktf-gke-auth
.
import { GoogleProvider } from "@cdktf/provider-google/lib/provider";
import { TerraformOutput, TerraformStack } from "cdktf";
import { Construct } from "constructs";
import { GKEAuth } from 'cdktf-gke-auth';
export class MyKubeStack extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
new GoogleProvider(this, "google-provider", {});
const auth = new GKEAuth(this, "gke-auth", {
clusterName: "my-cluster",
location: "europe-west1",
projectId: "my-project",
});
// init the Kubernetes provider like so:
// new KubernetesProvider(this, "kubernetes", {
// ...auth.authCredentials
// });
// Or a helm provider like so:
// new HelmProvider(this, "helm", {
// kubernetes: auth.authCredentials,
// });
}
}
The GKEAuth
instance expose host
, clusterCaCertificate
, clusterCaCertificatePEM
, and token
you can use to authenticate using
any of the kubernetes popular cdktf providers.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdktf-gke-auth-1.0.1.tar.gz
(30.2 kB
view hashes)
Built Distribution
Close
Hashes for cdktf_gke_auth-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b3c05408f5933363dc5a65be3a4f539a9512712334dc01c7cdc846173776f99 |
|
MD5 | d54652e8e63b1c2c9b10778ae39af34f |
|
BLAKE2b-256 | f04669147e71038c89726bf3d29944e3aedea3e96321821d2944988abd25f5a2 |