Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing GH Actions #827

Merged
merged 9 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- run: pip install mkdocs-material
- run: npm install
- run: npx typedoc --out docs/api lib/index.ts
- run: mkdocs gh-deploy
- run: mkdocs gh-deploy --force
elamaran11 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions lib/builders/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./observability-builder";
export * from "./windows-builder";

66 changes: 34 additions & 32 deletions lib/builders/observability-builder.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import * as blueprints from '../../lib';
import { BlueprintBuilder } from '../../lib/stacks';
import * as addons from '../../lib/addons';
import * as utils from "../utils";
import * as spi from '../../lib/spi';
import { NestedStack, NestedStackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';

export class ObservabilityBuilder extends blueprints.BlueprintBuilder {
export class ObservabilityBuilder extends BlueprintBuilder {

/**
* This method helps you prepare a blueprint for setting up observability
* returning an array of blueprint addons for AWS native services
*/
public enableNativePatternAddOns(): ObservabilityBuilder {
return this.addOns(
new blueprints.addons.AwsLoadBalancerControllerAddOn(),
new blueprints.addons.CertManagerAddOn(),
new blueprints.addons.ContainerInsightsAddOn(),
new blueprints.addons.CoreDnsAddOn(),
new blueprints.addons.KubeProxyAddOn(),
new blueprints.addons.KubeStateMetricsAddOn(),
new blueprints.addons.MetricsServerAddOn(),
new blueprints.addons.PrometheusNodeExporterAddOn());
new addons.AwsLoadBalancerControllerAddOn(),
new addons.CertManagerAddOn(),
new addons.ContainerInsightsAddOn(),
new addons.CoreDnsAddOn(),
new addons.KubeProxyAddOn(),
new addons.KubeStateMetricsAddOn(),
new addons.MetricsServerAddOn(),
new addons.PrometheusNodeExporterAddOn());
}

/**
Expand All @@ -28,14 +30,14 @@ export class ObservabilityBuilder extends blueprints.BlueprintBuilder {
*/
public enableMixedPatternAddOns(): ObservabilityBuilder {
return this.addOns(
new blueprints.addons.AwsLoadBalancerControllerAddOn(),
new blueprints.addons.AdotCollectorAddOn(),
new blueprints.addons.CertManagerAddOn(),
new blueprints.addons.CoreDnsAddOn(),
new blueprints.addons.KubeProxyAddOn(),
new blueprints.addons.KubeStateMetricsAddOn(),
new blueprints.addons.MetricsServerAddOn(),
new blueprints.addons.PrometheusNodeExporterAddOn());
new addons.AwsLoadBalancerControllerAddOn(),
new addons.AdotCollectorAddOn(),
new addons.CertManagerAddOn(),
new addons.CoreDnsAddOn(),
new addons.KubeProxyAddOn(),
new addons.KubeStateMetricsAddOn(),
new addons.MetricsServerAddOn(),
new addons.PrometheusNodeExporterAddOn());
}

/**
Expand All @@ -44,19 +46,19 @@ export class ObservabilityBuilder extends blueprints.BlueprintBuilder {
*/
public enableOpenSourcePatternAddOns(ampPrometheusEndpoint: string): ObservabilityBuilder {
return this.addOns(
new blueprints.addons.AwsLoadBalancerControllerAddOn(),
new blueprints.addons.AdotCollectorAddOn(),
new blueprints.addons.AmpAddOn({
new addons.AwsLoadBalancerControllerAddOn(),
new addons.AdotCollectorAddOn(),
new addons.AmpAddOn({
ampPrometheusEndpoint: ampPrometheusEndpoint,
}),
new blueprints.addons.CertManagerAddOn(),
new blueprints.addons.CoreDnsAddOn(),
new blueprints.addons.ExternalsSecretsAddOn(),
new blueprints.addons.GrafanaOperatorAddon(),
new blueprints.addons.KubeProxyAddOn(),
new blueprints.addons.KubeStateMetricsAddOn(),
new blueprints.addons.MetricsServerAddOn(),
new blueprints.addons.PrometheusNodeExporterAddOn());
new addons.CertManagerAddOn(),
new addons.CoreDnsAddOn(),
new addons.ExternalsSecretsAddOn(),
new addons.GrafanaOperatorAddon(),
new addons.KubeProxyAddOn(),
new addons.KubeStateMetricsAddOn(),
new addons.MetricsServerAddOn(),
new addons.PrometheusNodeExporterAddOn());
}

/**
Expand All @@ -66,7 +68,7 @@ export class ObservabilityBuilder extends blueprints.BlueprintBuilder {
public static builder(): ObservabilityBuilder {
const builder = new ObservabilityBuilder();
builder.addOns(
new blueprints.NestedStackAddOn({
new addons.NestedStackAddOn({
id: "usage-tracking-addon",
builder: UsageTrackingAddOn.builder(),
}));
Expand All @@ -77,11 +79,11 @@ export class ObservabilityBuilder extends blueprints.BlueprintBuilder {
/**
* Nested stack that is used as tracker for Observability Accelerator
*/
export class UsageTrackingAddOn extends NestedStack {
class UsageTrackingAddOn extends NestedStack {

static readonly USAGE_ID = "qs-1u9l12gj7";

public static builder(): blueprints.NestedStackBuilder {
public static builder(): spi.NestedStackBuilder {
return {
build(scope: Construct, id: string, props: NestedStackProps) {
return new UsageTrackingAddOn(scope, id, props);
Expand Down
28 changes: 16 additions & 12 deletions lib/builders/windows-builder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as blueprints from '../../lib';
import { BlueprintBuilder } from '../../lib/stacks';
import * as addons from '../../lib/addons';
import * as utils from "../utils";
import * as spi from '../../lib/spi';
import * as clusterproviders from '../../lib/cluster-providers';
import * as resourceproviders from '../../lib/resource-providers';
import { NestedStack, NestedStackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as eks from "aws-cdk-lib/aws-eks";
Expand Down Expand Up @@ -96,7 +100,7 @@ const defaultOptions: WindowsOptions = {
kubernetesVersion: eks.KubernetesVersion.of("1.27"),
instanceClass: ec2.InstanceClass.M5,
instanceSize: ec2.InstanceSize.XLARGE4,
nodeRole: blueprints.getNamedResource("node-role") as iam.Role,
nodeRole: resourceproviders.getNamedResource("node-role") as iam.Role,
windowsAmiType: NodegroupAmiType.WINDOWS_FULL_2022_X86_64,
desiredNodeSize: 2,
minNodeSize: 2,
Expand Down Expand Up @@ -127,7 +131,7 @@ const defaultOptions: WindowsOptions = {
* 2. A non-windows nodegroup for standard software.
* 3. A windows nodegroup to schedule windows workloads
*/
export class WindowsBuilder extends blueprints.BlueprintBuilder {
export class WindowsBuilder extends BlueprintBuilder {

/**
* This method helps you prepare a blueprint for setting up windows nodes with
Expand All @@ -139,10 +143,10 @@ export class WindowsBuilder extends blueprints.BlueprintBuilder {

builder
.clusterProvider(
new blueprints.GenericClusterProvider({
new clusterproviders.GenericClusterProvider({
version: mergedOptions.kubernetesVersion,
tags: mergedOptions.clusterProviderTags,
role: blueprints.getResource(context => {
role: resourceproviders.getResource(context => {
return new iam.Role(context.scope, 'ClusterRole', {
assumedBy: new iam.ServicePrincipal("eks.amazonaws.com"),
managedPolicies: [
Expand All @@ -158,7 +162,7 @@ export class WindowsBuilder extends blueprints.BlueprintBuilder {
})
)
.addOns(
new blueprints.NestedStackAddOn({
new addons.NestedStackAddOn({
id: "usage-tracking-addon",
builder: UsageTrackingAddOn.builder(),
})
Expand All @@ -170,11 +174,11 @@ export class WindowsBuilder extends blueprints.BlueprintBuilder {
/**
* Nested stack that is used as tracker for Windows Accelerator
*/
export class UsageTrackingAddOn extends NestedStack {
class UsageTrackingAddOn extends NestedStack {

static readonly USAGE_ID = "qs-1ubotj5kl";

public static builder(): blueprints.NestedStackBuilder {
public static builder(): spi.NestedStackBuilder {
return {
build(scope: Construct, id: string, props: NestedStackProps) {
return new UsageTrackingAddOn(scope, id, props);
Expand All @@ -192,7 +196,7 @@ export class UsageTrackingAddOn extends NestedStack {
* @param: options: WindowsOptions
* @returns: blueprints.ManagedNodeGroup
*/
function addGenericNodeGroup(options: WindowsOptions): blueprints.ManagedNodeGroup {
function addGenericNodeGroup(options: WindowsOptions): clusterproviders.ManagedNodeGroup {

return {
id: "mng-linux",
Expand All @@ -215,8 +219,8 @@ function addGenericNodeGroup(options: WindowsOptions): blueprints.ManagedNodeGro
* @param options: WindowsOptions
* @returns: blueprints.ManagedNodeGroup
*/
function addWindowsNodeGroup(options: WindowsOptions): blueprints.ManagedNodeGroup {
const result : blueprints.ManagedNodeGroup = {
function addWindowsNodeGroup(options: WindowsOptions): clusterproviders.ManagedNodeGroup {
const result : clusterproviders.ManagedNodeGroup = {
id: "mng-windows",
amiType: options.windowsAmiType,
instanceTypes: [new ec2.InstanceType(`${options.instanceClass}.${options.instanceSize}`)],
Expand All @@ -230,7 +234,7 @@ function addWindowsNodeGroup(options: WindowsOptions): blueprints.ManagedNodeGro
};

if(options.noScheduleForWindowsNodes) {
blueprints.utils.setPath(result, "taints", [
utils.setPath(result, "taints", [
{
key: "os",
value: "windows",
Expand Down
3 changes: 3 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
export * from './addons';
export * as addons from './addons';

export * from './builders';
export * as builders from './builders';

export * from './stacks';
export * as stacks from './stacks';

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-quickstart/eks-blueprints",
"version": "1.11.0",
"version": "1.11.1",
"license": "Apache-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down