# aws-sleek-transformer

> Sleek Marketplace validator is solution provide pre-launch validations of the partner software on compatibility with Sleek guidelines, covering static and dynamic (deployment/runtime) aspects.

Latest version **0.0.3** (published 2024-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install aws-sleek-transformer
pnpm add aws-sleek-transformer
yarn add aws-sleek-transformer
bun add aws-sleek-transformer
```

Provides the command `aws-sleek-transformer`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2024-02-12 |
| First published | 2024-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18.0.0 |
| Dependencies | 13 |
| Unpacked size | 64.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Elamaran Shanmugam @elamaras |
| Maintainers | mangalak, elamaran11 |
| Keywords | oclif |

## Links

- npm: https://www.npmjs.com/package/aws-sleek-transformer
- Repository: https://github.com/aws-samples/addons-transformer-for-amazon-eks
- Issues: https://github.com/aws-samples/addons-transformer-for-amazon-eks/issues
- npm.io page: https://npm.io/package/aws-sleek-transformer

## Dependencies (13)

- [ajv](https://npm.io/package/ajv.md) ^8.12.0
- [shx](https://npm.io/package/shx.md) ^0.3.4
- [oclif](https://npm.io/package/oclif.md) ^4.0.3
- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [@types/ajv](https://npm.io/package/@types/ajv.md) ^1.0.0
- [@oclif/core](https://npm.io/package/@oclif/core.md) ^3
- [json-schema](https://npm.io/package/json-schema.md) ^0.4.0
- [@octokit/core](https://npm.io/package/@octokit/core.md) ^5.0.2
- [@types/js-yaml](https://npm.io/package/@types/js-yaml.md) ^4.0.9
- [@inquirer/select](https://npm.io/package/@inquirer/select.md) ^1.3.1
- [@inquirer/prompts](https://npm.io/package/@inquirer/prompts.md) ^3.3.0
- [@oclif/plugin-help](https://npm.io/package/@oclif/plugin-help.md) ^5
- [@aws-sdk/client-sts](https://npm.io/package/@aws-sdk/client-sts.md) ^3.462.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2024-02-12
- 0.0.2 — 2024-02-12
- 0.1.1 — 2024-01-24

## README

Addons Transformer CLI for Amazon EKS
=====================================

<!-- toc -->

<!-- tocstop -->

## Introduction

Sleek Marketplace validator is solution provide pre-launch validations of the partner software on compatibility with 
Sleek guidelines, covering static and dynamic (deployment/runtime) aspects. 

## Pre-requisites
To implement this solution, you need the following prerequisites:

* The [AWS Command Line Interface](http://aws.amazon.com/cli) (AWS CLI) [installed](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). The AWS CLI is a unified tool to manage your AWS services.
* AWS CLI default profile should be configured to access your AWS Account.
* [Node](https://nodejs.org/en/download/current/) version 18.12.1 or later.
* [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) version 8.19.2 or later.
* [Helm CLI](https://helm.sh/docs/intro/install/) to interact with helm charts.

## Features
This npm module does the following features:

### Helm chart validation
It grabs the following form the command line parameters or an input file the chart URL, pull it and performs static 
validations:
 - Finding occurrences of unsupported `.Capabilities`
 - Templates creating `helm.sh/hook`
 - Use of `.Release.Service`
 - Use of helm lookup function (TODO)
 - Dependencies external to the main chart
 - Errors running `helm lint` see [lint command](#helm-lint-command) bellow )
 - Errors running `helm template...` (see [template command](#helm-template-command) bellow )

If the chart is not in a public registry, login on it in advance is necessary, for example, for login on ECR:

```shell
export AWS_ACCOUNT=<Registry account> 
export AWS_REGION=<Registry region>
export CHART_NAME=<Helm chart name>
export ECR_HELM_REPOSITORY=${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/${CHART_NAME}
aws ecr get-login-password --region  eu-west-1 | helm registry login --username AWS --password-stdin ${ECR_HELM_REPOSITORY%%/*}
```

#### Helm lint command
```shell
helm lint --strict --with-subcharts $CHART_LOCATION
```


#### Helm template command
```shell
helm template $CHART_NAME $CHART_LOCATION
 --set k8version=$KUBERNETES_VERSION
 --kube-version $KUBERNETES_VERSION
 --namespace $ADDON_NAMESPACE
 --include-crds
 --no-hooks
```

### Request submission for onboarding the add-on to the program

It creates a GitHub issue in the onboarding repository for starting the process. As input, it takes the path to a `yaml`
template that should contain the vendor, product and the add-on required information. The json-schema for its creation
can be found in this repo [schema](./schema/onboarding.schema.json) and an example in the [doc/examples](./doc/examples/onboarding.example.yaml)
directory.

For validation the template, it supports the flag `--dry-run` that prevents the issue creation.

As it will run locally `aws-sleek-transformer validate` passing the file as input, it needs to be able to download the
chart. 

## Installation
<!-- usage -->
```sh-session
$ npm install -g aws-sleek-transformer
$ aws-sleek-transformer COMMAND
running command...
$ aws-sleek-transformer (--version)
aws-sleek-transformer/0.0.3 darwin-arm64 node-v20.8.0
$ aws-sleek-transformer --help [COMMAND]
USAGE
  $ aws-sleek-transformer COMMAND
...
```
<!-- usagestop -->
## Commands
<!-- commands -->
* [`aws-sleek-transformer create-issue FILE`](#aws-sleek-transformer-create-issue-file)
* [`aws-sleek-transformer submit`](#aws-sleek-transformer-submit)
* [`aws-sleek-transformer validate [HELMURL]`](#aws-sleek-transformer-validate-helmurl)

## `aws-sleek-transformer create-issue FILE`

Creates a Github Issue based in the input file

```
USAGE
  $ aws-sleek-transformer create-issue FILE [-d] [--file <value>]

ARGUMENTS
  FILE  Path to add-on input file

FLAGS
  -d, --dryRun        Runs all checks without creating the issue
      --file=<value>  Path to add-on input file

DESCRIPTION
  Creates a Github Issue based in the input file


  This creates a Github Issue on the Sleek repository.

  It will validate the input file to match the schema


EXAMPLES
  $ aws-sleek-transformer create-issue filename
```

_See code: [src/commands/create-issue.ts](https://github.com/aws-samples/addons-transformer-for-amazon-eks/blob/v0.0.3/src/commands/create-issue.ts)_

## `aws-sleek-transformer submit`

Submit the addon to the AWS marketplace

```
USAGE
  $ aws-sleek-transformer submit

DESCRIPTION
  Submit the addon to the AWS marketplace


  Sends the selected addon, version to the marketplace for final submission and upload it to Project Sleek.

  It reads from the addons stored in the config: ~/.sleek/config.json and presents them as options to the user to
  submit.

  The CLI requires the configure command to be run before hand to ensure there are correct configurations for each of
  the addons.

  This command requires the following:
  * Addon Name - as used in the configure command
  * Addon Version - as used in the configure command

  If no flags are provided, the CLI will launch an interactive menu which let's you select which addon to submit to
  the marketplace.


EXAMPLES
  $ aws-sleek-transformer submit
```

_See code: [src/commands/submit.ts](https://github.com/aws-samples/addons-transformer-for-amazon-eks/blob/v0.0.3/src/commands/submit.ts)_

## `aws-sleek-transformer validate [HELMURL]`

Validates the addon after pulling it from the helm repository.

```
USAGE
  $ aws-sleek-transformer validate [HELMURL] [-r <value> | [-f <value> | --helmUrl <value>] | ] [-p <value> | 
    | ] [-v <value> | ] [--addonName <value>] [-n <value>] [--k8sVersions <value>] [--skipHooks] [--skipReleaseService]

ARGUMENTS
  HELMURL  Fully qualified Helm URL of the addon

FLAGS
  -f, --file=<value>            Path to add-on input file
  -n, --addonNamespace=<value>  Add-on namespace
  -p, --protocol=<value>        Protocol of the helm hosting to use
  -r, --helmRepo=<value>        Helm repo of the addon
  -v, --version=<value>         Version of the addon to validate
      --addonName=<value>       Name of the addon
      --helmUrl=<value>         Fully qualified URL of the Repo
      --k8sVersions=<value>     Comma separated list of supported kubernetes versions
      --skipHooks               Skip helm hooks validation
      --skipReleaseService      Skip .Release.Service occurrences

DESCRIPTION
  Validates the addon after pulling it from the helm repository.


  This performs pre-launch validations of the partner software on compatibility with Sleek guidelines, covering static
  and dynamic (deployment/runtime) aspects.

  Runs the static analysis to find occurrences of:
  * .Capabilities
  * helm.sh/hook
  * external helm dependencies

  It will perform a static validation on the device and then give you the option to submit it to the marketplace for
  runtime and further validation before it can be included in the EKS Console marketplace.

  The command can accept two different formats of inputs:
  * Fully qualified Helm URL to download
  * Deconstructed URL that requires Protocol, Repo, and Version to pull


EXAMPLES
  $ aws-sleek-transformer validate
```

_See code: [src/commands/validate.ts](https://github.com/aws-samples/addons-transformer-for-amazon-eks/blob/v0.0.3/src/commands/validate.ts)_
<!-- commandsstop -->

### create-issue

`aws-sleek-transformer create-issue FILE`

Creates a Github Issue based in the input file

```
USAGE
  $ aws-sleek-transformer create-issue FILE [-d] [--file <value>]

ARGUMENTS
  FILE  Path to add-on input file

FLAGS
  -d, --dryRun        Runs all checks without creating the issue
      --file=<value>  Path to add-on input file

DESCRIPTION
  Creates a Github Issue based in the input file


  This creates a Github Issue on the Sleek repository.

  It will validate the input file to match the schema


EXAMPLES
  $ aws-sleek-transformer create-issue filename
```

_See code: [src/commands/create-issue.ts](https://github.com/aws-samples/addons-transformer-for-amazon-eks/blob/v0.0.1/src/commands/create-issue.ts)_

---
_Source: https://npm.io/package/aws-sleek-transformer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
