From bf6d804c9e591fb8d3173b4f10a89bdd5bc425c9 Mon Sep 17 00:00:00 2001 From: shapirov Date: Mon, 28 Aug 2023 15:04:41 -0400 Subject: [PATCH] fixed code snippets to create helm and non-helm addons --- docs/extensibility.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/extensibility.md b/docs/extensibility.md index 512221ed5..64767fc6a 100644 --- a/docs/extensibility.md +++ b/docs/extensibility.md @@ -61,16 +61,15 @@ Deployment of arbitrary kubernetes manifests can leverage the following construc ```typescript import { KubernetesManifest } from "aws-cdk-lib/aws-eks"; -import { ClusterAddOn, ClusterInfo } from "../../spi"; -import { loadYaml, readYamlDocument } from "../../utils/yaml-utils"; +import * as blueprints from "@aws-quickstart/eks-blueprints"; -export class MyNonHelmAddOn implements ClusterAddOn { - deploy(clusterInfo: ClusterInfo): void { +export class MyNonHelmAddOn implements blueprints.ClusterAddOn { + deploy(clusterInfo: blueprints.ClusterInfo): void { const cluster = clusterInfo.cluster; // Apply manifest - const doc = readYamlDocument(__dirname + '/my-product.yaml'); + const doc = blueprints.utils.readYamlDocument(__dirname + '/my-product.yaml'); // ... apply any substitutions for dynamic values - const manifest = docArray.split("---").map(e => loadYaml(e)); + const manifest = doc.split("---").map(e => blueprints.utils.loadYaml(e)); new KubernetesManifest(cluster.stack, "myproduct-manifest", { cluster, manifest, @@ -92,17 +91,15 @@ Example: ```typescript import { Construct } from "constructs"; -import { ClusterInfo } from "../../spi"; -import { dependable } from "../../utils"; -import { HelmAddOn, HelmAddOnUserProps } from "../helm-addon"; +import * as blueprints from "@aws-quickstart/eks-blueprints"; -export class MyProductAddOn extends HelmAddOn { +export class MyProductAddOn extends blueprints.HelmAddOn { readonly options: MyProductAddOnProps; // extends HelmAddOnUserProps ... - @dependable('AwsLoadBalancerControllerAddOn') // depends on AwsLoadBalancerController + @@blueprints.utils.dependable('AwsLoadBalancerControllerAddOn') // depends on AwsLoadBalancerController deploy(clusterInfo: ClusterInfo): Promise { ... }