clear-skies-aws 1.9.14__tar.gz → 1.9.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/PKG-INFO +1 -1
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/pyproject.toml +1 -1
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/action_aws.py +20 -6
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/step_function.py +5 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/step_function_test.py +30 -4
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/LICENSE +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/README.md +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/assume_role.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/assume_role_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/ses.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/ses_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/sns.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/sns_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/sqs.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/sqs_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/backends/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/backends/dynamo_db_backend.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/backends/dynamo_db_backend_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/backends/sqs_backend.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/backends/sqs_backend_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/__pycache__/aws_http_api_gateway.cpython-38.pyc +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/__pycache__/aws_lambda_api_gateway.cpython-38.pyc +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/__pycache__/aws_lambda_elb.cpython-38.pyc +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/cli.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/cli_websocket_mock.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_api_gateway.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_api_gateway_web_socket.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_elb.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_http_gateway.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_invocation.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_sns.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_sqs_standard_partial_batch.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_sqs_standard_partial_batch_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/wsgi.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/di/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/di/standard_dependencies.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/handlers/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/handlers/secrets_manager_rotation.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/handlers/simple_body_routing.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/__pycache__/aws_http_api_gateway.cpython-38.pyc +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/__pycache__/aws_lambda_api_gateway.cpython-38.pyc +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/__pycache__/aws_lambda_api_gateway_test.cpython-38.pyc +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/__pycache__/aws_lambda_elb.cpython-38.pyc +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/cli_websocket_mock.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_api_gateway.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_api_gateway_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_api_gateway_web_socket.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_elb.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_http_gateway.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_invocation.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_sns.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_sqs_standard.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/mocks/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/mocks/actions/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/mocks/actions/ses.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/mocks/actions/sns.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/mocks/actions/sqs.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/mocks/actions/step_function.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/additional_configs/__init__.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/additional_configs/iam_db_auth.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/additional_configs/iam_db_auth_with_ssm.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/additional_configs/mysql_connection_dynamic_producer_via_ssh_cert_bastion.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/additional_configs/mysql_connection_dynamic_producer_via_ssm_bastion.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/akeyless_with_ssm_cache.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/parameter_store.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/parameter_store_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/secrets_manager.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/secrets_manager_test.py +0 -0
- {clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/web_socket_connection_model.py +0 -0
|
@@ -62,9 +62,10 @@ class ActionAws(ABC):
|
|
|
62
62
|
self._logging.exception(f"Failed to retrieve client for {self._name}")
|
|
63
63
|
raise e
|
|
64
64
|
|
|
65
|
-
def _getClient(self) -> boto3.client:
|
|
65
|
+
def _getClient(self, region=None) -> boto3.client:
|
|
66
66
|
"""Retrieve the boto3 client."""
|
|
67
|
-
|
|
67
|
+
can_cache = not region
|
|
68
|
+
if self._client and can_cache:
|
|
68
69
|
return self._client
|
|
69
70
|
|
|
70
71
|
if self.assume_role:
|
|
@@ -72,12 +73,25 @@ class ActionAws(ABC):
|
|
|
72
73
|
else:
|
|
73
74
|
boto3 = self.boto3
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
if not region:
|
|
77
|
+
region = self.default_region()
|
|
76
78
|
if region:
|
|
77
|
-
|
|
79
|
+
client = boto3.client(self._name, region_name=region)
|
|
78
80
|
else:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
client = boto3.client(self._name)
|
|
82
|
+
|
|
83
|
+
if can_cache:
|
|
84
|
+
self._client = client
|
|
85
|
+
return client
|
|
86
|
+
|
|
87
|
+
def default_region(self):
|
|
88
|
+
region = self.environment.get('AWS_REGION', silent=True)
|
|
89
|
+
if region:
|
|
90
|
+
return region
|
|
91
|
+
region = self.environment.get('DEFAULT_AWS_REGION', silent=True)
|
|
92
|
+
if region:
|
|
93
|
+
return region
|
|
94
|
+
return None
|
|
81
95
|
|
|
82
96
|
def _execute_action(self, client: boto3.client, model: Models) -> None:
|
|
83
97
|
"""Run the action."""
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/step_function.py
RENAMED
|
@@ -45,6 +45,11 @@ class StepFunction(ActionAws):
|
|
|
45
45
|
|
|
46
46
|
def _execute_action(self, client: ModuleType, model: Models) -> None:
|
|
47
47
|
"""Send a notification as configured."""
|
|
48
|
+
arn = self.get_arn(model)
|
|
49
|
+
default_region = self.default_region()
|
|
50
|
+
arn_region = arn.split(':')[3]
|
|
51
|
+
if default_region and default_region != arn_region:
|
|
52
|
+
client = self._getClient(region=arn_region)
|
|
48
53
|
response = client.start_execution(
|
|
49
54
|
stateMachineArn=self.get_arn(model),
|
|
50
55
|
input=self.get_message_body(model),
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/step_function_test.py
RENAMED
|
@@ -30,7 +30,7 @@ class StepFunctionTest(unittest.TestCase):
|
|
|
30
30
|
self.boto3.client = MagicMock(return_value=self.step_function)
|
|
31
31
|
self.when = None
|
|
32
32
|
self.environment = MagicMock()
|
|
33
|
-
self.environment.get = MagicMock(return_value='us-east-
|
|
33
|
+
self.environment.get = MagicMock(return_value='us-east-2')
|
|
34
34
|
|
|
35
35
|
def always(self, model):
|
|
36
36
|
self.when = model
|
|
@@ -43,14 +43,14 @@ class StepFunctionTest(unittest.TestCase):
|
|
|
43
43
|
def test_execute(self):
|
|
44
44
|
step_function = StepFunction(self.environment, self.boto3, self.di)
|
|
45
45
|
step_function.configure(
|
|
46
|
-
arn='aws::arn
|
|
46
|
+
arn='aws::arn:us-east-2:step/asdf-er',
|
|
47
47
|
when=self.always,
|
|
48
48
|
column_to_store_execution_arn="execution_arn",
|
|
49
49
|
)
|
|
50
50
|
step_function(self.user)
|
|
51
51
|
self.step_function.start_execution.assert_has_calls([
|
|
52
52
|
call(
|
|
53
|
-
stateMachineArn='aws::arn
|
|
53
|
+
stateMachineArn='aws::arn:us-east-2:step/asdf-er',
|
|
54
54
|
input=json.dumps({
|
|
55
55
|
"id": self.user.id,
|
|
56
56
|
"email": self.user.email,
|
|
@@ -61,10 +61,36 @@ class StepFunctionTest(unittest.TestCase):
|
|
|
61
61
|
self.assertEqual(id(self.user), id(self.when))
|
|
62
62
|
self.assertEqual("aws:arn:execution", self.user.execution_arn)
|
|
63
63
|
|
|
64
|
+
def test_region_switch(self):
|
|
65
|
+
self.boto3.client.side_effect = [self.step_function, self.step_function]
|
|
66
|
+
step_function = StepFunction(self.environment, self.boto3, self.di)
|
|
67
|
+
step_function.configure(
|
|
68
|
+
arn='aws::arn:eu-west-1:step/asdf-er',
|
|
69
|
+
when=self.always,
|
|
70
|
+
column_to_store_execution_arn="execution_arn",
|
|
71
|
+
)
|
|
72
|
+
step_function(self.user)
|
|
73
|
+
self.step_function.start_execution.assert_has_calls([
|
|
74
|
+
call(
|
|
75
|
+
stateMachineArn='aws::arn:eu-west-1:step/asdf-er',
|
|
76
|
+
input=json.dumps({
|
|
77
|
+
"id": self.user.id,
|
|
78
|
+
"email": self.user.email,
|
|
79
|
+
"execution_arn": None,
|
|
80
|
+
}),
|
|
81
|
+
),
|
|
82
|
+
])
|
|
83
|
+
self.assertEqual(id(self.user), id(self.when))
|
|
84
|
+
self.assertEqual("aws:arn:execution", self.user.execution_arn)
|
|
85
|
+
self.boto3.client.assert_has_calls([
|
|
86
|
+
call("stepfunctions", region_name="us-east-2"),
|
|
87
|
+
call("stepfunctions", region_name="eu-west-1"),
|
|
88
|
+
])
|
|
89
|
+
|
|
64
90
|
def test_not_now(self):
|
|
65
91
|
step_function = StepFunction(self.environment, self.boto3, self.di)
|
|
66
92
|
step_function.configure(
|
|
67
|
-
arn='arn
|
|
93
|
+
arn='aws::arn:us-east-2:step-function/asdf-er',
|
|
68
94
|
when=self.never,
|
|
69
95
|
)
|
|
70
96
|
user = self.users.model({
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/actions/assume_role_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/backends/dynamo_db_backend.py
RENAMED
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/backends/sqs_backend.py
RENAMED
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/backends/sqs_backend_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/cli_websocket_mock.py
RENAMED
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_api_gateway.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_http_gateway.py
RENAMED
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/contexts/lambda_invocation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/di/standard_dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/handlers/simple_body_routing.py
RENAMED
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_elb.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/input_outputs/lambda_sns.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/mocks/actions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/mocks/actions/step_function.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/parameter_store.py
RENAMED
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/parameter_store_test.py
RENAMED
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/secrets_manager.py
RENAMED
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/secrets/secrets_manager_test.py
RENAMED
|
File without changes
|
{clear_skies_aws-1.9.14 → clear_skies_aws-1.9.15}/src/clearskies_aws/web_socket_connection_model.py
RENAMED
|
File without changes
|