Class AwsIotMqttConnectionConfigBuilder

Builder functions to create a MqttConnectionConfig which can then be used to create a MqttClientConnection, configured for use with AWS IoT.

Hierarchy

  • AwsIotMqttConnectionConfigBuilder

Methods

  • Returns the configured MqttConnectionConfig. On the first invocation of this function, the TLS context is cached and re-used on all subsequent calls to build().

    Returns MqttConnectionConfig

    The configured MqttConnectionConfig

  • Overrides the default system trust store.

    Parameters

    • Optional ca_dirpath: string

      Only used on Unix-style systems where all trust anchors are stored in a directory (e.g. /etc/ssl/certs).

    • Optional ca_filepath: string

      Single file containing all trust CAs, in PEM format

    Returns AwsIotMqttConnectionConfigBuilder

  • Determines whether or not the service should try to resume prior subscriptions, if it has any

    Parameters

    • clean_session: boolean

      true if the session should drop prior subscriptions when this client connects, false to resume the session

    Returns AwsIotMqttConnectionConfigBuilder

  • Configures AWS credentials (usually from Cognito) for this connection

    Parameters

    • aws_region: string

      The service region to connect to

    • aws_access_id: string

      IAM Access ID

    • aws_secret_key: string

      IAM Secret Key

    • Optional aws_sts_token: string

      STS token from Cognito (optional)

    Returns AwsIotMqttConnectionConfigBuilder

  • Sets the custom authorizer settings. This function will modify the username, port, and TLS options.

    Parameters

    • username: string

      The username to use with the custom authorizer. If an empty string is passed, it will check to see if a username has already been set (via WithUsername function). If no username is set then no username will be passed with the MQTT connection.

    • authorizer_name: string

      The name of the custom authorizer. If an empty string is passed, then 'x-amz-customauthorizer-name' will not be added with the MQTT connection. It is strongly recommended to URL-encode this value; the SDK will not do so for you.

    • authorizer_signature: string

      The signature of the custom authorizer. If an empty string is passed, then 'x-amz-customauthorizer-signature' will not be added with the MQTT connection. The signature must be based on the private key associated with the custom authorizer. The signature must be base64 encoded. Required if the custom authorizer has signing enabled.

    • password: string

      The password to use with the custom authorizer. If null is passed, then no password will be set.

    • Optional token_key_name: string

      Key used to extract the custom authorizer token from MQTT username query-string properties. Required if the custom authorizer has signing enabled. It is strongly suggested to URL-encode this value; the SDK will not do so for you.

    • Optional token_value: string

      An opaque token value. Required if the custom authorizer has signing enabled. This value must be signed by the private key associated with the custom authorizer and the result placed in the token_signature argument.

    Returns AwsIotMqttConnectionConfigBuilder

  • Create a new builder with mTLS using a certificate in a Windows certificate store.

    NOTE: This configuration only works on Windows devices.

    Parameters

    • certificate_path: string

      Path to certificate in a Windows certificate store. The path must use backslashes and end with the certificate's thumbprint. Example: CurrentUser\MY\A11F8A9B5DF5B98BA3508FBCA575D09570E0D2C6

    Returns AwsIotMqttConnectionConfigBuilder

Generated using TypeDoc