Skip to content

Latest commit

 

History

History
1206 lines (744 loc) · 41.5 KB

API.md

File metadata and controls

1206 lines (744 loc) · 41.5 KB

API Reference

Constructs

OpenSearchCustomResource

Initializers

import { OpenSearchCustomResource } from 'opensearch-rest-resources'

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

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
getStringAfterResourceCreation This function converts a string to a token that has an implicit dependency between this resource and a consumer of the string.

toString
public toString(): string

Returns a string representation of this construct.

getStringAfterResourceCreation
public getStringAfterResourceCreation(str: string): string

This function converts a string to a token that has an implicit dependency between this resource and a consumer of the string.

strRequired
  • Type: string

any string.


Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { OpenSearchCustomResource } from 'opensearch-rest-resources'

OpenSearchCustomResource.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.

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

The tree node.


OpenSearchRole

Initializers

import { OpenSearchRole } from 'opensearch-rest-resources'

new OpenSearchRole(scope: Construct, id: string, props: OpenSearchRoleProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props OpenSearchRoleProps 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 { OpenSearchRole } from 'opensearch-rest-resources'

OpenSearchRole.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.
roleName string The name of this role.

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

The tree node.


roleNameRequired
public readonly roleName: string;
  • Type: string

The name of this role.


OpenSearchRoleMapping

Initializers

import { OpenSearchRoleMapping } from 'opensearch-rest-resources'

new OpenSearchRoleMapping(scope: Construct, id: string, props: OpenSearchRoleMappingProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props OpenSearchRoleMappingProps 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 { OpenSearchRoleMapping } from 'opensearch-rest-resources'

OpenSearchRoleMapping.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.
roleName string The name of the OpenSearch role this mapping is created for.

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

The tree node.


roleNameRequired
public readonly roleName: string;
  • Type: string

The name of the OpenSearch role this mapping is created for.


OpenSearchUser

Initializers

import { OpenSearchUser } from 'opensearch-rest-resources'

new OpenSearchUser(scope: Construct, id: string, props: OpenSearchUserProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props OpenSearchUserProps 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 { OpenSearchUser } from 'opensearch-rest-resources'

OpenSearchUser.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.
userName string The name of this user.

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

The tree node.


userNameRequired
public readonly userName: string;
  • Type: string

The name of this user.


Structs

IndexPermissions

Initializer

import { IndexPermissions } from 'opensearch-rest-resources'

const indexPermissions: IndexPermissions = { ... }

Properties

Name Type Description
allowedActions string[] https://opensearch.org/docs/latest/security/access-control/default-action-groups/.
dls string No description.
fls string[] No description.
indexPatterns string[] No description.
maskedFields string[] No description.

allowedActionsOptional
public readonly allowedActions: string[];
  • Type: string[]

https://opensearch.org/docs/latest/security/access-control/default-action-groups/.


dlsOptional
public readonly dls: string;
  • Type: string

flsOptional
public readonly fls: string[];
  • Type: string[]

indexPatternsOptional
public readonly indexPatterns: string[];
  • Type: string[]

maskedFieldsOptional
public readonly maskedFields: string[];
  • Type: string[]

OpenSearchCustomResourceProps

Initializer

import { OpenSearchCustomResourceProps } from 'opensearch-rest-resources'

const openSearchCustomResourceProps: OpenSearchCustomResourceProps = { ... }

Properties

Name Type Description
domain aws-cdk-lib.aws_opensearchservice.Domain The OpenSearch domain you want to create a resource in.
payloadJson string A payload in JSON string to send with a request on create/update event.
restEndpoint string A REST endpoint to call from the custom resource handler.
removalPolicy aws-cdk-lib.RemovalPolicy Policy to apply when the resource is removed from the stack.
vpc aws-cdk-lib.aws_ec2.IVpc The VPC your OpenSearch domain is in.

domainRequired
public readonly domain: Domain;
  • Type: aws-cdk-lib.aws_opensearchservice.Domain

The OpenSearch domain you want to create a resource in.


payloadJsonRequired
public readonly payloadJson: string;
  • Type: string

A payload in JSON string to send with a request on create/update event.


restEndpointRequired
public readonly restEndpoint: string;
  • Type: string

A REST endpoint to call from the custom resource handler.

It sends PUT request on a create/update event and DELETE request on a delete event.


Example

_plugins/_security/api/roles/roleName
removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy
  • Default: RemovalPolicy.DESTROY

Policy to apply when the resource is removed from the stack.


vpcOptional
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc
  • Default: Assumes your Domain is not deployed within a VPC

The VPC your OpenSearch domain is in.


OpenSearchRoleMappingProps

Initializer

import { OpenSearchRoleMappingProps } from 'opensearch-rest-resources'

const openSearchRoleMappingProps: OpenSearchRoleMappingProps = { ... }

Properties

Name Type Description
domain aws-cdk-lib.aws_opensearchservice.Domain The OpenSearch domain you want to create a resource in.
removalPolicy aws-cdk-lib.RemovalPolicy Policy to apply when the resource is removed from the stack.
vpc aws-cdk-lib.aws_ec2.IVpc The VPC your OpenSearch domain is in.
payload RoleMappingPayload See https://opensearch.org/docs/latest/security/access-control/api/#create-role-mapping for the details.
roleName string The role you create a role mapping for.

domainRequired
public readonly domain: Domain;
  • Type: aws-cdk-lib.aws_opensearchservice.Domain

The OpenSearch domain you want to create a resource in.


removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy
  • Default: RemovalPolicy.DESTROY

Policy to apply when the resource is removed from the stack.


vpcOptional
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc
  • Default: Assumes your Domain is not deployed within a VPC

The VPC your OpenSearch domain is in.


payloadRequired
public readonly payload: RoleMappingPayload;

See https://opensearch.org/docs/latest/security/access-control/api/#create-role-mapping for the details.


roleNameRequired
public readonly roleName: string;
  • Type: string

The role you create a role mapping for.

Create a role by {@link OpenSearchRole} class, or use a predefined role.


OpenSearchRoleProps

Initializer

import { OpenSearchRoleProps } from 'opensearch-rest-resources'

const openSearchRoleProps: OpenSearchRoleProps = { ... }

Properties

Name Type Description
domain aws-cdk-lib.aws_opensearchservice.Domain The OpenSearch domain you want to create a resource in.
removalPolicy aws-cdk-lib.RemovalPolicy Policy to apply when the resource is removed from the stack.
vpc aws-cdk-lib.aws_ec2.IVpc The VPC your OpenSearch domain is in.
payload RolePayload See https://opensearch.org/docs/latest/security/access-control/api/#create-role for the details.
roleName string The name of this role.

domainRequired
public readonly domain: Domain;
  • Type: aws-cdk-lib.aws_opensearchservice.Domain

The OpenSearch domain you want to create a resource in.


removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy
  • Default: RemovalPolicy.DESTROY

Policy to apply when the resource is removed from the stack.


vpcOptional
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc
  • Default: Assumes your Domain is not deployed within a VPC

The VPC your OpenSearch domain is in.


payloadRequired
public readonly payload: RolePayload;

See https://opensearch.org/docs/latest/security/access-control/api/#create-role for the details.


roleNameRequired
public readonly roleName: string;
  • Type: string

The name of this role.


OpenSearchUserProps

Initializer

import { OpenSearchUserProps } from 'opensearch-rest-resources'

const openSearchUserProps: OpenSearchUserProps = { ... }

Properties

Name Type Description
domain aws-cdk-lib.aws_opensearchservice.Domain The OpenSearch domain you want to create a resource in.
removalPolicy aws-cdk-lib.RemovalPolicy Policy to apply when the resource is removed from the stack.
vpc aws-cdk-lib.aws_ec2.IVpc The VPC your OpenSearch domain is in.
payload UserPayload See https://opensearch.org/docs/latest/security/access-control/api/#create-user for the details.
userName string The name of this user.

domainRequired
public readonly domain: Domain;
  • Type: aws-cdk-lib.aws_opensearchservice.Domain

The OpenSearch domain you want to create a resource in.


removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy
  • Default: RemovalPolicy.DESTROY

Policy to apply when the resource is removed from the stack.


vpcOptional
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc
  • Default: Assumes your Domain is not deployed within a VPC

The VPC your OpenSearch domain is in.


payloadRequired
public readonly payload: UserPayload;

See https://opensearch.org/docs/latest/security/access-control/api/#create-user for the details.


userNameRequired
public readonly userName: string;
  • Type: string

The name of this user.


ResourcePropsBase

Initializer

import { ResourcePropsBase } from 'opensearch-rest-resources'

const resourcePropsBase: ResourcePropsBase = { ... }

Properties

Name Type Description
domain aws-cdk-lib.aws_opensearchservice.Domain The OpenSearch domain you want to create a resource in.
removalPolicy aws-cdk-lib.RemovalPolicy Policy to apply when the resource is removed from the stack.
vpc aws-cdk-lib.aws_ec2.IVpc The VPC your OpenSearch domain is in.

domainRequired
public readonly domain: Domain;
  • Type: aws-cdk-lib.aws_opensearchservice.Domain

The OpenSearch domain you want to create a resource in.


removalPolicyOptional
public readonly removalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy
  • Default: RemovalPolicy.DESTROY

Policy to apply when the resource is removed from the stack.


vpcOptional
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc
  • Default: Assumes your Domain is not deployed within a VPC

The VPC your OpenSearch domain is in.


RoleMappingPayload

Initializer

import { RoleMappingPayload } from 'opensearch-rest-resources'

const roleMappingPayload: RoleMappingPayload = { ... }

Properties

Name Type Description
backendRoles string[] No description.
hosts string[] No description.
users string[] No description.

backendRolesOptional
public readonly backendRoles: string[];
  • Type: string[]

hostsOptional
public readonly hosts: string[];
  • Type: string[]

usersOptional
public readonly users: string[];
  • Type: string[]

RolePayload

Initializer

import { RolePayload } from 'opensearch-rest-resources'

const rolePayload: RolePayload = { ... }

Properties

Name Type Description
clusterPermissions string[] No description.
indexPermissions IndexPermissions[] No description.
tenantPermissions TenantPermissions[] No description.

clusterPermissionsOptional
public readonly clusterPermissions: string[];
  • Type: string[]

indexPermissionsOptional
public readonly indexPermissions: IndexPermissions[];

tenantPermissionsOptional
public readonly tenantPermissions: TenantPermissions[];

TenantPermissions

Initializer

import { TenantPermissions } from 'opensearch-rest-resources'

const tenantPermissions: TenantPermissions = { ... }

Properties

Name Type Description
allowedActions string[] No description.
tenantPatterns string[] No description.

allowedActionsOptional
public readonly allowedActions: string[];
  • Type: string[]

tenantPatternsOptional
public readonly tenantPatterns: string[];
  • Type: string[]

UserPayload

Initializer

import { UserPayload } from 'opensearch-rest-resources'

const userPayload: UserPayload = { ... }

Properties

Name Type Description
attributes {[ key: string ]: string} No description.
backendRoles string[] No description.
hash string No description.
opendistroSecurityRoles string[] No description.
password string No description.

attributesOptional
public readonly attributes: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

backendRolesOptional
public readonly backendRoles: string[];
  • Type: string[]

hashOptional
public readonly hash: string;
  • Type: string

opendistroSecurityRolesOptional
public readonly opendistroSecurityRoles: string[];
  • Type: string[]

passwordOptional
public readonly password: string;
  • Type: string