Skip to content

Commit b73c74d

Browse files
authored
Merge pull request #831 from aws-quickstart/task/fix-extensibility-code-snippets
fixed code snippets to create helm and non-helm addons
2 parents d03b06d + bf6d804 commit b73c74d

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

docs/extensibility.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,15 @@ Deployment of arbitrary kubernetes manifests can leverage the following construc
6161

6262
```typescript
6363
import { KubernetesManifest } from "aws-cdk-lib/aws-eks";
64-
import { ClusterAddOn, ClusterInfo } from "../../spi";
65-
import { loadYaml, readYamlDocument } from "../../utils/yaml-utils";
64+
import * as blueprints from "@aws-quickstart/eks-blueprints";
6665

67-
export class MyNonHelmAddOn implements ClusterAddOn {
68-
deploy(clusterInfo: ClusterInfo): void {
66+
export class MyNonHelmAddOn implements blueprints.ClusterAddOn {
67+
deploy(clusterInfo: blueprints.ClusterInfo): void {
6968
const cluster = clusterInfo.cluster;
7069
// Apply manifest
71-
const doc = readYamlDocument(__dirname + '/my-product.yaml');
70+
const doc = blueprints.utils.readYamlDocument(__dirname + '/my-product.yaml');
7271
// ... apply any substitutions for dynamic values
73-
const manifest = docArray.split("---").map(e => loadYaml(e));
72+
const manifest = doc.split("---").map(e => blueprints.utils.loadYaml(e));
7473
new KubernetesManifest(cluster.stack, "myproduct-manifest", {
7574
cluster,
7675
manifest,
@@ -92,17 +91,15 @@ Example:
9291

9392
```typescript
9493
import { Construct } from "constructs";
95-
import { ClusterInfo } from "../../spi";
96-
import { dependable } from "../../utils";
97-
import { HelmAddOn, HelmAddOnUserProps } from "../helm-addon";
94+
import * as blueprints from "@aws-quickstart/eks-blueprints";
9895

99-
export class MyProductAddOn extends HelmAddOn {
96+
export class MyProductAddOn extends blueprints.HelmAddOn {
10097

10198
readonly options: MyProductAddOnProps; // extends HelmAddOnUserProps
10299

103100
...
104101

105-
@dependable('AwsLoadBalancerControllerAddOn') // depends on AwsLoadBalancerController
102+
@@blueprints.utils.dependable('AwsLoadBalancerControllerAddOn') // depends on AwsLoadBalancerController
106103
deploy(clusterInfo: ClusterInfo): Promise<Construct> {
107104
...
108105
}

0 commit comments

Comments
 (0)