pip_services3_aws.connect.AwsConnectionResolver module

class pip_services3_aws.connect.AwsConnectionResolver.AwsConnectionResolver

Bases: pip_services3_commons.config.IConfigurable.IConfigurable, pip_services3_commons.refer.IReferenceable.IReferenceable

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 connection

  • :credential-store::*:1.0 (optional) Credential stores to resolve credentials

See ConnectionParams (in the Pip.Services components package), IDiscovery (in the Pip.Services components package)

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

connection_resolver = AwsConnectionResolver()
connection_resolver.configure(config)
connection_resolver.set_references(references)

connection_params = connection_resolver.resolve("123")
configure(config: pip_services3_commons.config.ConfigParams.ConfigParams)

Configures component by passing configuration parameters.

Parameters

config – configuration parameters to be set.

resolve(correlation_id: str) pip_services3_aws.connect.AwsConnectionParams.AwsConnectionParams

Resolves connection and credential parameters and generates a single AWSConnectionParams value.

Parameters

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

Returns

AWSConnectionParams value or error.

set_references(references: pip_services3_commons.refer.IReferences.IReferences)

Sets references to dependent components.

Parameters

references – references to locate the component dependencies.