ds_provider_aws_py_lib.linked_service

File: __init__.py Region: ds_provider_aws_py_lib/linked_service

AWS Linked Service

This module implements a linked service for AWS (for example, S3) and provides a boto3 session.

Example

>>> linked_service = AWSLinkedService(
...     id=UUID("00000000-0000-0000-0000-000000000000"),
...     name="test-name",
...     version="1.0.0",
...     settings=AWSLinkedServiceSettings(
...         account_id="your_account_id",
...         access_key_id="your_access",
...         access_key_secret="your_secret",
...         region="us-west-2",
...     ),
... )
>>> linked_service.test_connection()

Submodules

Classes

AWSLinkedService

The class is used to connect with AWS services.

AWSLinkedServiceSettings

The object containing the AWS linked service settings.

Package Contents

class ds_provider_aws_py_lib.linked_service.AWSLinkedService[source]

Bases: ds_resource_plugin_py_lib.common.resource.linked_service.LinkedService[AWSLinkedServiceSettingsType], Generic[AWSLinkedServiceSettingsType]

The class is used to connect with AWS services.

settings: AWSLinkedServiceSettingsType
_connection: boto3.Session | None = None
property type: ds_provider_aws_py_lib.enums.ResourceType

Get the type of the linked service.

Returns:

ResourceType

property connection: boto3.Session

Get the connection to AWS.

Returns:

The established boto3 session.

Return type:

boto3.Session

connect() None[source]

Create a boto3 session using the provided AWS credentials and verify the account ID if specified.

Raises:

AuthorizationError – If the AWS account ID does not match the expected value.

test_connection() tuple[bool, str][source]

Test the connection to AWS by creating the session.

Returns:

A tuple containing a boolean indicating success and a message.

Return type:

tuple[bool, str]

close() None[source]

boto3 sessions do not require explicit closing.

class ds_provider_aws_py_lib.linked_service.AWSLinkedServiceSettings[source]

Bases: ds_resource_plugin_py_lib.common.resource.linked_service.LinkedServiceSettings

The object containing the AWS linked service settings.

account_id: str

The AWS account ID.

access_key_id: str

The AWS access key ID.

access_key_secret: str

The AWS access key secret.

region: str = 'eu-north-1'

The AWS region.