Skip to main content

Apache 2.0 License Gitpod ready-to-code npm version PyPI version Build badge Release badge

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.

Metadata

Release files for cdktf-gke-auth 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdktf-gke-auth 1.1.1
File Size Uploaded
cdktf-gke-auth-1.1.1.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cdktf-gke-auth 1.1.1
File Interpreter ABI Platform
cdktf_gke_auth-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 61.2 kB

Release files / cdktf-gke-auth-1.1.1.tar.gz

Download URL cdktf-gke-auth-1.1.1.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0b955c8843732f00216047afb2da56238a79be19555e550e720c39ac8ef04132
BLAKE2b-256 checksum
How to use checksums
cee72b8b8623b693c1f4131963ebe217478ec43d9915821ffd46eaf8901dc93e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / cdktf_gke_auth-1.1.1-py3-none-any.whl

Download URL cdktf_gke_auth-1.1.1-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba36874a68ba7775a18ef24c53b99f58be3e0c780ff9822822f641d7130c30fb
BLAKE2b-256 checksum
How to use checksums
da368194d6c1d064252e4097f9a44e065020a4ca9fe99200ca966e5405617aa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page