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.
This project uses projen and jsii to compile the construct to Typescript, Python, Go and .Net (Java upon request).
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.
For other languages examples, checkout this construct on ConstructHub.
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
Built Distribution
Hashes for cdktf_gke_auth-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24cda308697a0457838bf880721fba53bd7350a21b079d97a004d96e9fcd9af8 |
|
MD5 | c0a8a38b16e77d4ab9dea1471bc2da85 |
|
BLAKE2b-256 | d001672652b9888baf88ae522a6547261d972a0b957c438897e217967e0d20b1 |