apx-aws-lambda 0.3.3__tar.gz → 0.3.4__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.
Files changed (32) hide show
  1. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/PKG-INFO +4 -4
  2. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/README.md +2 -2
  3. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/plugin.py +15 -2
  4. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/shell.py +6 -18
  5. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda.egg-info/PKG-INFO +4 -4
  6. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda.egg-info/requires.txt +1 -1
  7. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/pyproject.toml +2 -2
  8. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/tests/test_targets.py +4 -10
  9. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/LICENSE +0 -0
  10. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/__init__.py +0 -0
  11. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/cli.py +0 -0
  12. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/lambda_.py +0 -0
  13. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/cookiecutter.json +0 -0
  14. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/hooks/post_gen_project.py +0 -0
  15. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/.github/workflows/deploy.yml +0 -0
  16. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/DEPLOY.md +0 -0
  17. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/_lang/python/Makefile +0 -0
  18. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/_lang/python/lambda_handler.py +0 -0
  19. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/_lang/python/tools/lambda_requirements.py +0 -0
  20. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/requirements/policy.json +0 -0
  21. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/requirements/trust.json +0 -0
  22. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/samconfig.toml +0 -0
  23. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/cloud/aws/lambda/{{cookiecutter.project_slug}}/template.yaml +0 -0
  24. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/overlays/index.json +0 -0
  25. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/proxy.py +0 -0
  26. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda/tools.py +0 -0
  27. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda.egg-info/SOURCES.txt +0 -0
  28. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda.egg-info/dependency_links.txt +0 -0
  29. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda.egg-info/entry_points.txt +0 -0
  30. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/apx_aws_lambda.egg-info/top_level.txt +0 -0
  31. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/setup.cfg +0 -0
  32. {apx_aws_lambda-0.3.3 → apx_aws_lambda-0.3.4}/tests/test_proxy.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apx-aws-lambda
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: AWS Lambda for Action Platform: the aws/lambda deploy target (SAM) with its overlay, and tools to read stacks and functions.
5
5
  Author-email: Action Platform <cloud@actionplatform.io>
6
6
  License-Expression: Apache-2.0
7
7
  Requires-Python: >=3.11
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
- Requires-Dist: action-platform>=0.17
10
+ Requires-Dist: action-platform>=0.17.9
11
11
  Requires-Dist: awscli>=1.34
12
12
  Requires-Dist: aws-sam-cli>=1.120
13
13
  Provides-Extra: dev
@@ -71,7 +71,7 @@ The target looks for credentials in this order:
71
71
 
72
72
  | Under `[deploy]` | How | Who decides what the app may do |
73
73
  |---|---|---|
74
- | `proxy_url` + `app` — or the organization's proxy url set on the platform (Settings → Integrations → AWS), which every deploy job carries as `AP_AWS_LAMBDA_PROXY_URL` with `AP_APP` | the deploy proxy in your account exchanges a platform token for the app's deploy-role credentials | the proxy's grants, in your account |
74
+ | `proxy_url` + `app` — or the organization's proxy url set on the platform (Plugins → AWS Lambda), which every deploy job carries as `AP_AWS_LAMBDA_PROXY_URL` with `AP_APP` | the deploy proxy in your account exchanges a platform token for the app's deploy-role credentials | the proxy's grants, in your account |
75
75
  | `role_arn` | `sts assume-role-with-web-identity` with a platform token | the role's trust and permission policies |
76
76
  | neither | the AWS CLI's own chain: SSO, profile, instance role | whatever that identity may do |
77
77
 
@@ -101,7 +101,7 @@ action-platform aws-lambda proxy show $P acme/shop/orders
101
101
 
102
102
  `create` makes the app's two roles and grants deploy to the app itself; `grant` replaces the list of subject prefixes that may deploy — `org:acme` means anyone in the organization, `org:acme:project:shop` any app of the project, the full subject only deploys the platform runs for that app.
103
103
 
104
- **3. Tell the platform (or the repository) where it is.** On the hosted platform, Settings → Integrations → **AWS** keeps the proxy url for the whole organization; every deploy job then carries it, together with the app's `org/project/app`, so the repository needs nothing beyond `target = "aws/lambda"`. From a machine, or to override per repository:
104
+ **3. Tell the platform (or the repository) where it is.** On the hosted platform, **Plugins** → **AWS Lambda** → **Configure** keeps the proxy url for the whole organization; every deploy job then carries it, together with the app's `org/project/app`, so the repository needs nothing beyond `target = "aws/lambda"`. From a machine, or to override per repository:
105
105
 
106
106
  ```toml
107
107
  [deploy]
@@ -51,7 +51,7 @@ The target looks for credentials in this order:
51
51
 
52
52
  | Under `[deploy]` | How | Who decides what the app may do |
53
53
  |---|---|---|
54
- | `proxy_url` + `app` — or the organization's proxy url set on the platform (Settings → Integrations → AWS), which every deploy job carries as `AP_AWS_LAMBDA_PROXY_URL` with `AP_APP` | the deploy proxy in your account exchanges a platform token for the app's deploy-role credentials | the proxy's grants, in your account |
54
+ | `proxy_url` + `app` — or the organization's proxy url set on the platform (Plugins → AWS Lambda), which every deploy job carries as `AP_AWS_LAMBDA_PROXY_URL` with `AP_APP` | the deploy proxy in your account exchanges a platform token for the app's deploy-role credentials | the proxy's grants, in your account |
55
55
  | `role_arn` | `sts assume-role-with-web-identity` with a platform token | the role's trust and permission policies |
56
56
  | neither | the AWS CLI's own chain: SSO, profile, instance role | whatever that identity may do |
57
57
 
@@ -81,7 +81,7 @@ action-platform aws-lambda proxy show $P acme/shop/orders
81
81
 
82
82
  `create` makes the app's two roles and grants deploy to the app itself; `grant` replaces the list of subject prefixes that may deploy — `org:acme` means anyone in the organization, `org:acme:project:shop` any app of the project, the full subject only deploys the platform runs for that app.
83
83
 
84
- **3. Tell the platform (or the repository) where it is.** On the hosted platform, Settings → Integrations → **AWS** keeps the proxy url for the whole organization; every deploy job then carries it, together with the app's `org/project/app`, so the repository needs nothing beyond `target = "aws/lambda"`. From a machine, or to override per repository:
84
+ **3. Tell the platform (or the repository) where it is.** On the hosted platform, **Plugins** → **AWS Lambda** → **Configure** keeps the proxy url for the whole organization; every deploy job then carries it, together with the app's `org/project/app`, so the repository needs nothing beyond `target = "aws/lambda"`. From a machine, or to override per repository:
85
85
 
86
86
  ```toml
87
87
  [deploy]
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  from pathlib import Path
6
6
 
7
- from action_platform.abc import Plugin, Surface
7
+ from action_platform.abc import Option, Plugin, Surface
8
8
 
9
9
  from apx_aws_lambda import cli
10
10
  from apx_aws_lambda.tools import register_tools
@@ -12,15 +12,28 @@ from apx_aws_lambda.tools import register_tools
12
12
 
13
13
  class AwsLambdaPlugin(Plugin):
14
14
  slug = "aws-lambda"
15
+ name = "AWS Lambda"
15
16
  description = (
16
17
  "Deploy to AWS Lambda with SAM; read CloudFormation stacks and functions"
17
18
  )
18
- min_core = "0.17"
19
+ min_core = "0.17.9"
19
20
  needs = [
20
21
  "tool: aws, sam (bundled as Python packages when not on PATH)",
21
22
  "env: AWS_REGION; credentials from proxy_url (the deploy proxy in your account, no keys), role_arn (OIDC, no keys) or the AWS CLI chain (SSO, profile, instance role)",
22
23
  "net: *.amazonaws.com, the proxy url when set",
23
24
  ]
25
+ options = [
26
+ Option(
27
+ "proxy_url",
28
+ "Deploy proxy URL",
29
+ "url",
30
+ help=(
31
+ "The deploy proxy installed in your AWS account: it decides which app may deploy and hands the worker short-lived credentials, so the platform never holds an access key. "
32
+ "Install it once with proxy/deploy.sh <platform url> <organization> from this repository; the Function URL it prints goes here."
33
+ ),
34
+ required=True,
35
+ ),
36
+ ]
24
37
 
25
38
  @property
26
39
  def overlays(self) -> Path:
@@ -12,7 +12,6 @@ from pathlib import Path
12
12
  from typing import Any
13
13
 
14
14
  from action_platform.core.exception import DeployError
15
- from action_platform.settings import settings
16
15
 
17
16
  MODULES = {"aws": "awscli", "sam": "samcli"}
18
17
 
@@ -32,23 +31,12 @@ def require(tool: str, hint: str) -> list[str]:
32
31
  raise DeployError(f"{tool} is not installed: {hint}")
33
32
 
34
33
 
35
- def module_env(args: list[str], env: dict[str, str] | None) -> dict[str, str] | None:
36
- """`python -m awscli` in a child process must see the plugins volume the parent added with `site.addsitedir`; PYTHONPATH carries it over."""
37
- if args[:1] != [sys.executable] or settings.PLUGINS_DIR is None:
38
- if env is None:
39
- return {**os.environ, "SAM_CLI_TELEMETRY": "0"}
34
+ def module_env(env: dict[str, str] | None) -> dict[str, str]:
35
+ """The child's environment: the caller's, or the process's, with SAM's telemetry off."""
36
+ if env is None:
37
+ return {**os.environ, "SAM_CLI_TELEMETRY": "0"}
40
38
 
41
- return {"SAM_CLI_TELEMETRY": "0", **env}
42
-
43
- merged = dict(env if env is not None else os.environ)
44
- merged.setdefault("SAM_CLI_TELEMETRY", "0")
45
- current = merged.get("PYTHONPATH", "")
46
- plugins = str(settings.PLUGINS_DIR)
47
-
48
- if plugins not in current.split(os.pathsep):
49
- merged["PYTHONPATH"] = os.pathsep.join(p for p in (plugins, current) if p)
50
-
51
- return merged
39
+ return {"SAM_CLI_TELEMETRY": "0", **env}
52
40
 
53
41
 
54
42
  def run(
@@ -57,7 +45,7 @@ def run(
57
45
  result = subprocess.run(
58
46
  args,
59
47
  cwd=cwd,
60
- env=module_env(args, env),
48
+ env=module_env(env),
61
49
  capture_output=True,
62
50
  text=True,
63
51
  check=False,
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apx-aws-lambda
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: AWS Lambda for Action Platform: the aws/lambda deploy target (SAM) with its overlay, and tools to read stacks and functions.
5
5
  Author-email: Action Platform <cloud@actionplatform.io>
6
6
  License-Expression: Apache-2.0
7
7
  Requires-Python: >=3.11
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
- Requires-Dist: action-platform>=0.17
10
+ Requires-Dist: action-platform>=0.17.9
11
11
  Requires-Dist: awscli>=1.34
12
12
  Requires-Dist: aws-sam-cli>=1.120
13
13
  Provides-Extra: dev
@@ -71,7 +71,7 @@ The target looks for credentials in this order:
71
71
 
72
72
  | Under `[deploy]` | How | Who decides what the app may do |
73
73
  |---|---|---|
74
- | `proxy_url` + `app` — or the organization's proxy url set on the platform (Settings → Integrations → AWS), which every deploy job carries as `AP_AWS_LAMBDA_PROXY_URL` with `AP_APP` | the deploy proxy in your account exchanges a platform token for the app's deploy-role credentials | the proxy's grants, in your account |
74
+ | `proxy_url` + `app` — or the organization's proxy url set on the platform (Plugins → AWS Lambda), which every deploy job carries as `AP_AWS_LAMBDA_PROXY_URL` with `AP_APP` | the deploy proxy in your account exchanges a platform token for the app's deploy-role credentials | the proxy's grants, in your account |
75
75
  | `role_arn` | `sts assume-role-with-web-identity` with a platform token | the role's trust and permission policies |
76
76
  | neither | the AWS CLI's own chain: SSO, profile, instance role | whatever that identity may do |
77
77
 
@@ -101,7 +101,7 @@ action-platform aws-lambda proxy show $P acme/shop/orders
101
101
 
102
102
  `create` makes the app's two roles and grants deploy to the app itself; `grant` replaces the list of subject prefixes that may deploy — `org:acme` means anyone in the organization, `org:acme:project:shop` any app of the project, the full subject only deploys the platform runs for that app.
103
103
 
104
- **3. Tell the platform (or the repository) where it is.** On the hosted platform, Settings → Integrations → **AWS** keeps the proxy url for the whole organization; every deploy job then carries it, together with the app's `org/project/app`, so the repository needs nothing beyond `target = "aws/lambda"`. From a machine, or to override per repository:
104
+ **3. Tell the platform (or the repository) where it is.** On the hosted platform, **Plugins** → **AWS Lambda** → **Configure** keeps the proxy url for the whole organization; every deploy job then carries it, together with the app's `org/project/app`, so the repository needs nothing beyond `target = "aws/lambda"`. From a machine, or to override per repository:
105
105
 
106
106
  ```toml
107
107
  [deploy]
@@ -1,4 +1,4 @@
1
- action-platform>=0.17
1
+ action-platform>=0.17.9
2
2
  awscli>=1.34
3
3
  aws-sam-cli>=1.120
4
4
 
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "apx-aws-lambda"
3
- version = "0.3.3"
3
+ version = "0.3.4"
4
4
  description = "AWS Lambda for Action Platform: the aws/lambda deploy target (SAM) with its overlay, and tools to read stacks and functions."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
7
7
  requires-python = ">=3.11"
8
8
  authors = [{ name = "Action Platform", email = "cloud@actionplatform.io" }]
9
- dependencies = ["action-platform>=0.17", "awscli>=1.34", "aws-sam-cli>=1.120"]
9
+ dependencies = ["action-platform>=0.17.9", "awscli>=1.34", "aws-sam-cli>=1.120"]
10
10
 
11
11
  [project.optional-dependencies]
12
12
  dev = ["pytest>=8", "ruff>=0.6", "action-platform[mcp]", "boto3>=1.34", "cryptography>=42"]
@@ -1,7 +1,6 @@
1
1
  """The target drives `aws` and `sam`; here both are fakes, so what is asserted is the sequence and the answers."""
2
2
 
3
3
  import json
4
- import sys
5
4
  import unittest
6
5
  from pathlib import Path
7
6
  from tempfile import TemporaryDirectory
@@ -11,7 +10,6 @@ from action_platform.core.context import Context
11
10
  from action_platform.core.exception import DeployError
12
11
  from action_platform.core.scaffold.templates import Matrix, with_plugin_clouds
13
12
  from action_platform.plugins import Loaded, Plugins, PluginState, registry
14
- from action_platform.settings import settings
15
13
 
16
14
  from apx_aws_lambda import AwsLambdaPlugin, shell
17
15
  from apx_aws_lambda.lambda_ import LambdaTarget
@@ -196,11 +194,7 @@ class AssumeRoleTest(unittest.TestCase):
196
194
 
197
195
 
198
196
  class ModuleEnvTest(unittest.TestCase):
199
- def test_the_plugins_volume_reaches_a_python_m_child(self):
200
- with mock.patch.object(settings, "PLUGINS_DIR", Path("/data/plugins")):
201
- env = shell.module_env([sys.executable, "-m", "awscli"], {"PATH": "/bin"})
202
- same = shell.module_env(["/usr/bin/aws"], {"PATH": "/bin"})
203
-
204
- self.assertEqual(env["PYTHONPATH"], "/data/plugins")
205
- self.assertEqual(env["PATH"], "/bin")
206
- self.assertEqual(same, {"PATH": "/bin", "SAM_CLI_TELEMETRY": "0"})
197
+ def test_the_child_gets_the_given_env_with_telemetry_off(self):
198
+ env = shell.module_env({"PATH": "/bin"})
199
+
200
+ self.assertEqual(env, {"PATH": "/bin", "SAM_CLI_TELEMETRY": "0"})
File without changes
File without changes