Aws connection
AWSConnector
AWSConnector - Connects to AWS using Credentials File or IAM Role
Source code in common/aws_connection/aws_connector.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
__create_boto_3_session(profile_name)
staticmethod
__create_boto_3_session :param profile_name: :return:
Source code in common/aws_connection/aws_connector.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
get_aws_client_for_service_name(profile_name, service_name)
staticmethod
get_aws_client_for_service_name - Connects to AWS to retrieve the relevant Client :param profile_name: The Config Profile (Environment Name in Credentials file) :param service_name: The AWS Service name to get the Client for :return: Service client instance
Source code in common/aws_connection/aws_connector.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
get_aws_resource_for_service_name(profile_name, service_name)
staticmethod
Connects to AWS to retrieve the relevant Resource (More functionality then Client) :param profile_name: The Config Profile (Environment Name in Credentials file) :param service_name: The AWS Service name to get the Client for :return: Service client instance
Source code in common/aws_connection/aws_connector.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
get_aws_session(profile_name)
staticmethod
get_aws_session - Connects to AWS to retrieve an AWS Session :param profile_name: The Config Profile (Environment Name in Credentials file) :return: boto3 Session
Source code in common/aws_connection/aws_connector.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
AWSSecretsManagerConnector
AWSSecretsManagerConnector - This class handles the AWS Secrets Manager connection
Source code in common/aws_connection/aws_secrets_manager_connector.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
__get_secrets_manager_dict_for_secret_name(aws_env, secret_name)
staticmethod
__get_secrets_manager_dict_for_secret_name :param aws_env: The environment to open the dict for :param secret_name: The Secret to Retrieve to from AWS secrets manager (usually project name) :return: python Dictionary with the key/value pairs stored in AWS Secrets Manager
Source code in common/aws_connection/aws_secrets_manager_connector.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
__get_secrets_path_from_secret_name(aws_env, secret_name)
staticmethod
__get_secrets_path_from_secret_name - Extracts the full secret path based on the Environment
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aws_env |
str
|
Env |
required |
secret_name |
str
|
Secret Name |
required |
Returns:
Type | Description |
---|---|
str
|
str: The full secret path |
Source code in common/aws_connection/aws_secrets_manager_connector.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
get_secret_value_for_secret_key(aws_env, secret_name, secret_key)
staticmethod
get_secret_value_for_secret_key - Gets a Secret Value from AWS Secrets Manager for the Provided Key :param aws_env: The environment to get the secret for :param secret_name: The Secret Name stored in Secrets Manager :param secret_key: The Secret Key To retrieve it's value from AWS :return: str: The Secret Value
Source code in common/aws_connection/aws_secrets_manager_connector.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
get_secret_values_dict_for_secret_key_properties(env, secret_key, secret_name, db_properties_set=None)
staticmethod
get_config_dict - Returns the config dict of the properties from the properties dict :param env: The environment to open the dict for :param secret_key: The Secret Key :param secret_name: The Secret to Retrieve to from AWS secrets manager (usually project name) :param db_properties_set: The set of the properties to get secrets values for :return: dict The secrets dict for the requested property
Source code in common/aws_connection/aws_secrets_manager_connector.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|