Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AwsConnectionResolver

Helper class to retrieve AWS connection and credential parameters, validate them and compose a AwsConnectionParams value.

Configuration parameters

  • connections:
    • discovery_key: (optional) a key to retrieve the connection from IDiscovery
    • region: (optional) AWS region
    • partition: (optional) AWS partition
    • service: (optional) AWS service
    • resource_type: (optional) AWS resource type
    • resource: (optional) AWS resource id
    • arn: (optional) AWS resource ARN
  • credentials:
    • store_key: (optional) a key to retrieve the credentials from ICredentialStore
    • access_id: AWS access/client id
    • access_key: AWS access/client id

References

  • *:discovery:*:*:1.0 (optional) IDiscovery services to resolve connections
  • *:credential-store:*:*:1.0 (optional) Credential stores to resolve credentials
see

ConnectionParams (in the Pip.Services components package)

see

IDiscovery (in the Pip.Services components package)

Example

let config = ConfigParams.fromTuples(
    "connection.region", "us-east1",
    "connection.service", "s3",
    "connection.bucket", "mybucket",
    "credential.access_id", "XXXXXXXXXX",
    "credential.access_key", "XXXXXXXXXX"
);

let connectionResolver = new AwsConnectionResolver();
connectionResolver.configure(config);
connectionResolver.setReferences(references);

connectionResolver.resolve("123", (err, connection) => {
    // Now use connection...
});

Hierarchy

  • AwsConnectionResolver

Implements

  • any
  • any

Index

Properties

Protected _connectionResolver

_connectionResolver: ConnectionResolver = new ConnectionResolver()

The connection resolver.

Protected _credentialResolver

_credentialResolver: CredentialResolver = new CredentialResolver()

The credential resolver.

Methods

configure

  • configure(config: ConfigParams): void
  • Configures component by passing configuration parameters.

    Parameters

    • config: ConfigParams

      configuration parameters to be set.

    Returns void

resolve

  • resolve(correlationId: string, callback: function): void
  • Resolves connection and credental parameters and generates a single AWSConnectionParams value.

    see

    IDiscovery (in the Pip.Services components package)

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • callback: function

      callback function that receives AWSConnectionParams value or error.

    Returns void

setReferences

  • setReferences(references: IReferences): void
  • Sets references to dependent components.

    Parameters

    • references: IReferences

      references to locate the component dependencies.

    Returns void

Generated using TypeDoc