Skip to content

Latest commit

 

History

History
322 lines (199 loc) · 9.35 KB

API.md

File metadata and controls

322 lines (199 loc) · 9.35 KB

API Reference

Constructs

Hasura

A Kubernetes Hasura instance.

Initializers

import { Hasura } from 'cdk8s-hasura'

new Hasura(scope: Construct, id: string, props: HasuraProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props HasuraProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Hasura } from 'cdk8s-hasura'

Hasura.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
config cdk8s-plus-28.ConfigMap No description.
deployment cdk8s-plus-28.Deployment No description.
secret cdk8s-plus-28.Secret No description.
service cdk8s-plus-28.Service No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


configRequired
public readonly config: ConfigMap;
  • Type: cdk8s-plus-28.ConfigMap

deploymentRequired
public readonly deployment: Deployment;
  • Type: cdk8s-plus-28.Deployment

secretRequired
public readonly secret: Secret;
  • Type: cdk8s-plus-28.Secret

serviceRequired
public readonly service: Service;
  • Type: cdk8s-plus-28.Service

Structs

HasuraProps

Initializer

import { HasuraProps } from 'cdk8s-hasura'

const hasuraProps: HasuraProps = { ... }

Properties

Name Type Description
adminSecret string Secret passphrase used to authenticate the admin user with the Hasura instance.
database string The name of the Postgres Database.
host string The host of the Postgres database.
postgresPassword cdk8s-plus-28.EnvValue Env variable for the Postgres password.
postgresUsername cdk8s-plus-28.EnvValue Env variable for the Postgres username.
enableConsole boolean Enable the web UI for Hasura.
image string No description.
labels {[ key: string ]: string} Labels to apply to all Hasura resources.
logLevel string Log level for Hasura.
namespace string Namespace to apply to all Hasura resources.

adminSecretRequired
public readonly adminSecret: string;
  • Type: string

Secret passphrase used to authenticate the admin user with the Hasura instance.


databaseRequired
public readonly database: string;
  • Type: string

The name of the Postgres Database.


hostRequired
public readonly host: string;
  • Type: string

The host of the Postgres database.


postgresPasswordRequired
public readonly postgresPassword: EnvValue;
  • Type: cdk8s-plus-28.EnvValue

Env variable for the Postgres password.


postgresUsernameRequired
public readonly postgresUsername: EnvValue;
  • Type: cdk8s-plus-28.EnvValue

Env variable for the Postgres username.


enableConsoleOptional
public readonly enableConsole: boolean;
  • Type: boolean
  • Default: true

Enable the web UI for Hasura.


imageOptional
public readonly image: string;
  • Type: string
  • Default: 'hasura/graphql-engine:latest'

labelsOptional
public readonly labels: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: { app: "hasura" }

Labels to apply to all Hasura resources.


logLevelOptional
public readonly logLevel: string;
  • Type: string
  • Default: info

Log level for Hasura.

Possible values are: "debug", "info", "warn", "error".


namespaceOptional
public readonly namespace: string;
  • Type: string
  • Default: undefined (will be assigned to the 'default' namespace)

Namespace to apply to all Hasura resources.

The Postgres instance must be created in this namespace so that they may connect.