Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AwsConnectionParams

Contains connection parameters to authenticate against Amazon Web Services (AWS) and connect to specific AWS resource.

The class is able to compose and parse AWS resource ARNs.

Configuration parameters

  • access_id: application access id
  • client_id: alternative to access_id
  • access_key: application secret key
  • client_key: alternative to access_key
  • secret_key: alternative to access_key

In addition to standard parameters CredentialParams may contain any number of custom parameters

see

AwsConnectionResolver

Example

let connection = AwsConnectionParams.fromTuples(
    "region", "us-east-1",
    "access_id", "XXXXXXXXXXXXXXX",
    "secret_key", "XXXXXXXXXXXXXXX",
    "service", "s3",
    "bucket", "mybucket"
);

let region = connection.getRegion();                     // Result: "us-east-1"
let accessId = connection.getAccessId();                 // Result: "XXXXXXXXXXXXXXX"
let secretKey = connection.getAccessKey();               // Result: "XXXXXXXXXXXXXXX"
let pin = connection.getAsNullableString("bucket");      // Result: "mybucket"

Hierarchy

Index

Constructors

constructor

  • Creates an new instance of the connection parameters.

    Parameters

    • Default value values: any = null

      (optional) an object to be converted into key-value pairs to initialize this connection.

    Returns AwsConnectionParams

Methods

getAccessId

  • getAccessId(): string
  • Gets the AWS access id.

    Returns string

    the AWS access id.

getAccessKey

  • getAccessKey(): string
  • Gets the AWS client key.

    Returns string

    the AWS client key.

getAccount

  • getAccount(): string
  • Gets the AWS account id.

    Returns string

    the AWS account id.

getArn

  • getArn(): string
  • Gets the AWS resource ARN. If the ARN is not defined it automatically generates it from other properties.

    Returns string

    the AWS resource ARN.

getPartition

  • getPartition(): string
  • Gets the AWS partition name.

    Returns string

    the AWS partition name.

getRegion

  • getRegion(): string
  • Gets the AWS region.

    Returns string

    the AWS region.

getResource

  • getResource(): string
  • Gets the AWS resource id.

    Returns string

    the AWS resource id.

getResourceType

  • getResourceType(): string
  • Gets the AWS resource type.

    Returns string

    the AWS resource type.

getService

  • getService(): string
  • Gets the AWS service name.

    Returns string

    the AWS service name.

setAccessId

  • setAccessId(value: string): void
  • Sets the AWS access id.

    Parameters

    • value: string

      the AWS access id.

    Returns void

setAccessKey

  • setAccessKey(value: string): void
  • Sets the AWS client key.

    Parameters

    • value: string

      a new AWS client key.

    Returns void

setAccount

  • setAccount(value: string): void
  • Sets the AWS account id.

    Parameters

    • value: string

      the AWS account id.

    Returns void

setArn

  • setArn(value: string): void
  • Sets the AWS resource ARN. When it sets the value, it automatically parses the ARN and sets individual parameters.

    Parameters

    • value: string

      a new AWS resource ARN.

    Returns void

setPartition

  • setPartition(value: string): void
  • Sets the AWS partition name.

    Parameters

    • value: string

      a new AWS partition name.

    Returns void

setRegion

  • setRegion(value: string): void
  • Sets the AWS region.

    Parameters

    • value: string

      a new AWS region.

    Returns void

setResource

  • setResource(value: string): void
  • Sets the AWS resource id.

    Parameters

    • value: string

      a new AWS resource id.

    Returns void

setResourceType

  • setResourceType(value: string): void
  • Sets the AWS resource type.

    Parameters

    • value: string

      a new AWS resource type.

    Returns void

setService

  • setService(value: string): void
  • Sets the AWS service name.

    Parameters

    • value: string

      a new AWS service name.

    Returns void

validate

  • validate(correlationId: string): ConfigException
  • Validates this connection parameters

    Parameters

    • correlationId: string

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

    Returns ConfigException

    a ConfigException or null if validation passed successfully.

Static fromConfig

  • Retrieves AwsConnectionParams from configuration parameters. The values are retrieves from "connection" and "credential" sections.

    see

    mergeConfigs

    Parameters

    • config: ConfigParams

      configuration parameters

    Returns AwsConnectionParams

    the generated AwsConnectionParams object.

Static fromString

  • Creates a new AwsConnectionParams object filled with key-value pairs serialized as a string.

    Parameters

    • line: string

      a string with serialized key-value pairs as "key1=value1;key2=value2;..." Example: "Key1=123;Key2=ABC;Key3=2016-09-16T00:00:00.00Z"

    Returns AwsConnectionParams

    a new AwsConnectionParams object.

Static mergeConfigs

  • Retrieves AwsConnectionParams from multiple configuration parameters. The values are retrieves from "connection" and "credential" sections.

    see

    fromConfig

    Parameters

    • Rest ...configs: ConfigParams[]

      a list with configuration parameters

    Returns AwsConnectionParams

    the generated AwsConnectionParams object.

Generated using TypeDoc