aws-annoying 0.8.0__tar.gz → 0.8.1__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 (127) hide show
  1. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.github/workflows/ci.yaml +4 -4
  2. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.github/workflows/release.yaml +5 -4
  3. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.vscode/extensions.json +0 -5
  4. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.vscode/settings.json +0 -8
  5. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/Makefile +2 -2
  6. aws_annoying-0.8.1/PKG-INFO +91 -0
  7. aws_annoying-0.8.1/README.md +73 -0
  8. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/pyproject.toml +8 -5
  9. aws_annoying-0.8.1/tests/cli/ecs/snapshots/test_task_definition_lifecycle/test_delete/stdout.txt +19 -0
  10. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/ecs/test_task_definition_lifecycle.py +60 -21
  11. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/test_load_variables.py +2 -1
  12. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/uv.lock +52 -47
  13. aws_annoying-0.8.0/PKG-INFO +0 -86
  14. aws_annoying-0.8.0/README.md +0 -51
  15. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.devcontainer/.env.example +0 -0
  16. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.devcontainer/Dockerfile +0 -0
  17. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.devcontainer/devcontainer.json +0 -0
  18. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.devcontainer/docker-compose.devcontainer.yaml +0 -0
  19. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.devcontainer/onCreateCommand.sh +0 -0
  20. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.devcontainer/postAttachCommand.sh +0 -0
  21. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.editorconfig +0 -0
  22. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.gitattributes +0 -0
  23. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.github/dependabot.yaml +0 -0
  24. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.gitignore +0 -0
  25. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.pre-commit-config.yaml +0 -0
  26. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.python-version +0 -0
  27. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/.vscode/launch.json +0 -0
  28. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/LICENSE +0 -0
  29. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/__init__.py +0 -0
  30. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/__init__.py +0 -0
  31. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/app.py +0 -0
  32. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/ecs/__init__.py +0 -0
  33. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/ecs/_app.py +0 -0
  34. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/ecs/task_definition_lifecycle.py +0 -0
  35. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/ecs/wait_for_deployment.py +0 -0
  36. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/load_variables.py +0 -0
  37. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/logging_handler.py +0 -0
  38. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/main.py +0 -0
  39. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/mfa/__init__.py +0 -0
  40. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/mfa/_app.py +0 -0
  41. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/mfa/configure.py +0 -0
  42. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/session_manager/__init__.py +0 -0
  43. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/session_manager/_app.py +0 -0
  44. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/session_manager/_common.py +0 -0
  45. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/session_manager/install.py +0 -0
  46. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/session_manager/port_forward.py +0 -0
  47. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/session_manager/start.py +0 -0
  48. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/cli/session_manager/stop.py +0 -0
  49. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/ecs/__init__.py +0 -0
  50. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/ecs/check.py +0 -0
  51. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/ecs/common.py +0 -0
  52. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/ecs/errors.py +0 -0
  53. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/ecs/wait_for.py +0 -0
  54. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/mfa_config.py +0 -0
  55. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/session_manager/__init__.py +0 -0
  56. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/session_manager/errors.py +0 -0
  57. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/session_manager/session_manager.py +0 -0
  58. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/session_manager/shortcuts.py +0 -0
  59. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/utils/__init__.py +0 -0
  60. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/utils/debugger.py +0 -0
  61. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/utils/downloader.py +0 -0
  62. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/utils/ec2.py +0 -0
  63. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/utils/platform.py +0 -0
  64. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/utils/timeout.py +0 -0
  65. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/aws_annoying/variable_loader.py +0 -0
  66. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/console/ecs-exec/README.md +0 -0
  67. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/console/ecs-exec/ecs-console.png +0 -0
  68. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/console/ecs-exec/ecs-exec.user.js +0 -0
  69. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/console/ecs-exec/session-manager.png +0 -0
  70. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/examples/dbeaver/README.md +0 -0
  71. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/examples/dbeaver/after-disconnect.png +0 -0
  72. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/examples/dbeaver/before-connect.png +0 -0
  73. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/examples/dbeaver/new-connection.png +0 -0
  74. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/examples/dbeaver/test-connection.png +0 -0
  75. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/__init__.py +0 -0
  76. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/_helpers.py +0 -0
  77. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/__init__.py +0 -0
  78. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/_helpers/__init__.py +0 -0
  79. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/_helpers/boto3.py +0 -0
  80. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/_helpers/command_builder.py +0 -0
  81. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/_helpers/invoke.py +0 -0
  82. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/_helpers/scripts/printenv.py +0 -0
  83. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/_helpers/string_.py +0 -0
  84. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/ecs/__init__.py +0 -0
  85. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/ecs/snapshots/test_task_definition_lifecycle/test_basic/stdout.txt +0 -0
  86. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/ecs/snapshots/test_task_definition_lifecycle/test_dry_run/stdout.txt +0 -0
  87. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/ecs/test_wait_for_deployment.py +0 -0
  88. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/mfa/__init__.py +0 -0
  89. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/mfa/snapshots/test_configure/test_basic/persist/aws_config.ini +0 -0
  90. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/mfa/snapshots/test_configure/test_basic/persist/stdout.txt +0 -0
  91. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/mfa/snapshots/test_configure/test_basic/skip_persist/stdout.txt +0 -0
  92. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/mfa/snapshots/test_configure/test_dry_run/stdout.txt +0 -0
  93. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/mfa/snapshots/test_configure/test_load_existing_config/aws_config.ini +0 -0
  94. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/mfa/snapshots/test_configure/test_load_existing_config/stdout.txt +0 -0
  95. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/mfa/test_configure.py +0 -0
  96. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/session_manager/__init__.py +0 -0
  97. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/session_manager/test_install.py +0 -0
  98. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/session_manager/test_port_forward.py +0 -0
  99. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/session_manager/test_start.py +0 -0
  100. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/session_manager/test_stop.py +0 -0
  101. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/snapshots/test_load_variables/test_basic/stdout.txt +0 -0
  102. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/snapshots/test_load_variables/test_env_prefix/stdout.txt +0 -0
  103. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/snapshots/test_load_variables/test_nothing/stdout.txt +0 -0
  104. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/snapshots/test_load_variables/test_overwrite_env/stdout.txt +0 -0
  105. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/snapshots/test_load_variables/test_replace_quiet/stdout.txt +0 -0
  106. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/snapshots/test_load_variables/test_resource_not_found/ssm/stdout.txt +0 -0
  107. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/snapshots/test_load_variables/test_unsupported_resource/stdout.txt +0 -0
  108. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/test_app.py +0 -0
  109. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/test_logging_handler.py +0 -0
  110. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/cli/test_main.py +0 -0
  111. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/conftest.py +0 -0
  112. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/ecs/__init__.py +0 -0
  113. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/ecs/test_check.py +0 -0
  114. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/ecs/test_common.py +0 -0
  115. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/ecs/test_errors.py +0 -0
  116. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/ecs/test_wait_for.py +0 -0
  117. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/session_manager/__init__.py +0 -0
  118. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/session_manager/test_errors.py +0 -0
  119. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/session_manager/test_session_manager.py +0 -0
  120. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/session_manager/test_shortcuts.py +0 -0
  121. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/test_mfa_config.py +0 -0
  122. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/test_variable_loader.py +0 -0
  123. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/utils/__init__.py +0 -0
  124. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/utils/test_downloader.py +0 -0
  125. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/utils/test_ec2.py +0 -0
  126. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/utils/test_platform.py +0 -0
  127. {aws_annoying-0.8.0 → aws_annoying-0.8.1}/tests/utils/test_timeout.py +0 -0
@@ -17,7 +17,7 @@ jobs:
17
17
  runs-on: ubuntu-latest
18
18
  steps:
19
19
  - name: Checkout
20
- uses: actions/checkout@v4
20
+ uses: actions/checkout@v5
21
21
 
22
22
  - name: Set up uv
23
23
  uses: astral-sh/setup-uv@v6
@@ -26,7 +26,7 @@ jobs:
26
26
  enable-cache: true
27
27
 
28
28
  - name: Install deps
29
- run: uv sync --all-extras
29
+ run: uv sync
30
30
 
31
31
  - uses: pre-commit/action@v3.0.1
32
32
  env:
@@ -49,7 +49,7 @@ jobs:
49
49
 
50
50
  steps:
51
51
  - name: Checkout
52
- uses: actions/checkout@v4
52
+ uses: actions/checkout@v5
53
53
 
54
54
  - name: Set up uv
55
55
  uses: astral-sh/setup-uv@v6
@@ -61,7 +61,7 @@ jobs:
61
61
  run: uv python pin "${{ matrix.python-version }}"
62
62
 
63
63
  - name: Install deps
64
- run: uv sync --all-extras
64
+ run: uv sync
65
65
 
66
66
  - name: Run tests (Ubuntu)
67
67
  if: ${{ matrix.os == 'ubuntu-latest' }}
@@ -4,7 +4,8 @@ on:
4
4
  push:
5
5
  tags: [v*]
6
6
 
7
- permissions: read-all
7
+ env:
8
+ UV_FROZEN: 1
8
9
 
9
10
  jobs:
10
11
  release:
@@ -14,7 +15,7 @@ jobs:
14
15
  contents: write
15
16
  steps:
16
17
  - name: Checkout
17
- uses: actions/checkout@v4
18
+ uses: actions/checkout@v5
18
19
 
19
20
  - name: Set up uv
20
21
  uses: astral-sh/setup-uv@v6
@@ -23,7 +24,7 @@ jobs:
23
24
  enable-cache: true
24
25
 
25
26
  - name: Install deps
26
- run: uv sync --frozen --all-extras
27
+ run: uv sync
27
28
 
28
29
  - name: Build package
29
30
  run: uv build
@@ -50,7 +51,7 @@ jobs:
50
51
  environment: pypi
51
52
  steps:
52
53
  - name: Retrieve release distributions
53
- uses: actions/download-artifact@v4
54
+ uses: actions/download-artifact@v5
54
55
  with:
55
56
  name: release-dists
56
57
  path: dist/
@@ -2,16 +2,11 @@
2
2
  "recommendations": [
3
3
  "ms-python.python",
4
4
  "ms-python.vscode-pylance",
5
- "ldez.ignore-files",
6
- "gruntfuggly.todo-tree",
7
- "redhat.vscode-yaml",
8
- "tamasfe.even-better-toml",
9
5
  "streetsidesoftware.code-spell-checker",
10
6
  "editorconfig.editorconfig",
11
7
  "visualstudioexptteam.vscodeintellicode",
12
8
  "charliermarsh.ruff",
13
9
  "ms-python.mypy-type-checker",
14
- "njpwerner.autodocstring",
15
10
  "ms-python.debugpy"
16
11
  ]
17
12
  }
@@ -6,7 +6,6 @@
6
6
  "editor.defaultFormatter": "charliermarsh.ruff",
7
7
  "editor.formatOnSave": true
8
8
  },
9
- "autoDocstring.docstringFormat": "google-notypes",
10
9
  "cSpell.words": [
11
10
  "Deregistering",
12
11
  "localstack",
@@ -17,13 +16,6 @@
17
16
  ],
18
17
  "editor.formatOnSave": true,
19
18
  "files.eol": "\n",
20
- "files.exclude": {
21
- ".mypy_cache": true,
22
- ".pytest_cache": true,
23
- ".ruff_cache": true,
24
- ".venv": true,
25
- "**/__pycache__": true
26
- },
27
19
  "files.insertFinalNewline": true,
28
20
  "json.format.enable": true,
29
21
  "mypy-type-checker.path": [
@@ -19,12 +19,12 @@ help: Makefile ## Show help
19
19
  # =============================================================================
20
20
  install: ## Install the app locally
21
21
  uv python install
22
- uv sync --frozen --all-extras
22
+ uv sync --frozen
23
23
  pre-commit install --install-hooks
24
24
  .PHONY: install
25
25
 
26
26
  update: ## Update deps and tools
27
- uv sync --upgrade --all-extras
27
+ uv sync --upgrade
28
28
  pre-commit autoupdate
29
29
  .PHONY: update
30
30
 
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: aws-annoying
3
+ Version: 0.8.1
4
+ Summary: Utils to handle some annoying AWS tasks.
5
+ Project-URL: Homepage, https://github.com/lasuillard/aws-annoying
6
+ Project-URL: Repository, https://github.com/lasuillard/aws-annoying.git
7
+ Project-URL: Issues, https://github.com/lasuillard/aws-annoying/issues
8
+ Author-email: Yuchan Lee <lasuillard@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Requires-Python: <4.0,>=3.9
12
+ Requires-Dist: boto3<2,>=1
13
+ Requires-Dist: pydantic<3,>=2
14
+ Requires-Dist: requests<3,>=2
15
+ Requires-Dist: tqdm<5,>=4
16
+ Requires-Dist: typer<1,>=0
17
+ Description-Content-Type: text/markdown
18
+
19
+ # aws-annoying
20
+
21
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
22
+ [![CI](https://github.com/lasuillard/aws-annoying/actions/workflows/ci.yaml/badge.svg)](https://github.com/lasuillard/aws-annoying/actions/workflows/ci.yaml)
23
+ [![codecov](https://codecov.io/gh/lasuillard/aws-annoying/graph/badge.svg?token=gbcHMVVz2k)](https://codecov.io/gh/lasuillard/aws-annoying)
24
+ [![PyPI - Version](https://img.shields.io/pypi/v/aws-annoying)](https://pypi.org/project/aws-annoying/)
25
+
26
+ Utils to handle some annoying AWS tasks.
27
+
28
+ ## ❓ About
29
+
30
+ This project aims to provide a set of utilities and examples to help with some annoying tasks when working with AWS.
31
+
32
+ Major directories of the project:
33
+
34
+ - **aws_annoying** Python package containing CLI and utility functions.
35
+ - **console** Utilities to help working with AWS Console.
36
+ - **examples** Examples of how to use the package.
37
+
38
+ ## 🚀 Installation
39
+
40
+ It is recommended to use [pipx](https://pipx.pypa.io/stable/) to install `aws-annoying` CLI:
41
+
42
+ ```bash
43
+ $ pipx install aws-annoying
44
+ $ aws-annoying --help
45
+
46
+ Usage: aws-annoying [OPTIONS] COMMAND [ARGS]...
47
+
48
+ ...
49
+ ```
50
+
51
+ As the package also provides some utility functions, you can install `aws-annoying` via pip, if you are going to use those utils.
52
+
53
+ ## 💡 Usage
54
+
55
+ Below are brief explanation of available commands. For more detailed information about commands, please refer to the CLI help.
56
+
57
+ ### `ecs task-definition-lifecycle`
58
+
59
+ Expire and delete ECS task definitions based on criteria.
60
+
61
+ ### `ecs wait-for-deployment`
62
+
63
+ Wait for ECS deployment to start, complete or fail, and stabilize.
64
+
65
+ ### `load-variables`
66
+
67
+ Wrapper command to run command with variables from various AWS resources (SSM Parameter Store, Secrets Manager, etc.) injected as environment variables.
68
+
69
+ ### `mfa configure`
70
+
71
+ Configure AWS profile or refresh session for MFA.
72
+
73
+ ### `session-manager install`
74
+
75
+ Install AWS Session Manager plugin.
76
+
77
+ ### `session-manager port-forward`
78
+
79
+ Start a port forwarding session using AWS Session Manager.
80
+
81
+ ### `session-manager start`
82
+
83
+ Start new session via Session Manager.
84
+
85
+ ### `session-manager stop`
86
+
87
+ Stop running port forwarding session for PID file.
88
+
89
+ ## 💖 Contributing
90
+
91
+ Any feedback, suggestions or contributions are welcome! Feel free to open an issue or a pull request.
@@ -0,0 +1,73 @@
1
+ # aws-annoying
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![CI](https://github.com/lasuillard/aws-annoying/actions/workflows/ci.yaml/badge.svg)](https://github.com/lasuillard/aws-annoying/actions/workflows/ci.yaml)
5
+ [![codecov](https://codecov.io/gh/lasuillard/aws-annoying/graph/badge.svg?token=gbcHMVVz2k)](https://codecov.io/gh/lasuillard/aws-annoying)
6
+ [![PyPI - Version](https://img.shields.io/pypi/v/aws-annoying)](https://pypi.org/project/aws-annoying/)
7
+
8
+ Utils to handle some annoying AWS tasks.
9
+
10
+ ## ❓ About
11
+
12
+ This project aims to provide a set of utilities and examples to help with some annoying tasks when working with AWS.
13
+
14
+ Major directories of the project:
15
+
16
+ - **aws_annoying** Python package containing CLI and utility functions.
17
+ - **console** Utilities to help working with AWS Console.
18
+ - **examples** Examples of how to use the package.
19
+
20
+ ## 🚀 Installation
21
+
22
+ It is recommended to use [pipx](https://pipx.pypa.io/stable/) to install `aws-annoying` CLI:
23
+
24
+ ```bash
25
+ $ pipx install aws-annoying
26
+ $ aws-annoying --help
27
+
28
+ Usage: aws-annoying [OPTIONS] COMMAND [ARGS]...
29
+
30
+ ...
31
+ ```
32
+
33
+ As the package also provides some utility functions, you can install `aws-annoying` via pip, if you are going to use those utils.
34
+
35
+ ## 💡 Usage
36
+
37
+ Below are brief explanation of available commands. For more detailed information about commands, please refer to the CLI help.
38
+
39
+ ### `ecs task-definition-lifecycle`
40
+
41
+ Expire and delete ECS task definitions based on criteria.
42
+
43
+ ### `ecs wait-for-deployment`
44
+
45
+ Wait for ECS deployment to start, complete or fail, and stabilize.
46
+
47
+ ### `load-variables`
48
+
49
+ Wrapper command to run command with variables from various AWS resources (SSM Parameter Store, Secrets Manager, etc.) injected as environment variables.
50
+
51
+ ### `mfa configure`
52
+
53
+ Configure AWS profile or refresh session for MFA.
54
+
55
+ ### `session-manager install`
56
+
57
+ Install AWS Session Manager plugin.
58
+
59
+ ### `session-manager port-forward`
60
+
61
+ Start a port forwarding session using AWS Session Manager.
62
+
63
+ ### `session-manager start`
64
+
65
+ Start new session via Session Manager.
66
+
67
+ ### `session-manager stop`
68
+
69
+ Stop running port forwarding session for PID file.
70
+
71
+ ## 💖 Contributing
72
+
73
+ Any feedback, suggestions or contributions are welcome! Feel free to open an issue or a pull request.
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "aws-annoying"
3
3
  description = "Utils to handle some annoying AWS tasks."
4
- version = "0.8.0"
4
+ version = "0.8.1"
5
5
  authors = [{ name = "Yuchan Lee", email = "lasuillard@gmail.com" }]
6
6
  readme = "README.md"
7
7
  license = "MIT"
@@ -17,7 +17,7 @@ dependencies = [
17
17
  [project.scripts]
18
18
  "aws-annoying" = "aws_annoying.cli.main:entrypoint"
19
19
 
20
- [project.optional-dependencies]
20
+ [dependency-groups]
21
21
  dev = [
22
22
  "boto3-stubs[ecs,secretsmanager,ssm,sts,ec2]>=1.37.1",
23
23
  "mypy>=1.15,<1.17",
@@ -26,12 +26,12 @@ dev = [
26
26
  ]
27
27
  test = [
28
28
  "coverage>=7.6,<7.9",
29
- "moto[secretsmanager,server,ssm,ecs]~=5.1.1",
30
- "pytest~=8.3.2",
29
+ "moto[secretsmanager,server,ssm,ecs]~=5.1.8",
30
+ "pytest>=8.3.2,<8.5.0",
31
31
  "pytest-cov>=6.0,<6.2",
32
32
  "pytest-env~=1.1.1",
33
33
  "pytest-snapshot>=0.9.0",
34
- "pytest-sugar~=1.0.0",
34
+ "pytest-sugar>=1.0,<1.2",
35
35
  "pytest-xdist>=3.6.1",
36
36
  "testcontainers[localstack]>=4.9.2",
37
37
  "toml>=0.10.2",
@@ -47,6 +47,9 @@ Issues = "https://github.com/lasuillard/aws-annoying/issues"
47
47
  requires = ["hatchling"]
48
48
  build-backend = "hatchling.build"
49
49
 
50
+ [tool.uv]
51
+ default-groups = ["dev", "test"]
52
+
50
53
  [tool.hatch.build.targets.wheel]
51
54
  packages = ["aws_annoying"]
52
55
 
@@ -0,0 +1,19 @@
1
+ ⚠️ Deregistering 15 task definitions...
2
+ ⚠️ Deregistered task definition 'my-task:1'
3
+ ⚠️ Deregistered task definition 'my-task:2'
4
+ ⚠️ Deregistered task definition 'my-task:3'
5
+ ⚠️ Deregistered task definition 'my-task:4'
6
+ ⚠️ Deregistered task definition 'my-task:5'
7
+ ⚠️ Deregistered task definition 'my-task:6'
8
+ ⚠️ Deregistered task definition 'my-task:7'
9
+ ⚠️ Deregistered task definition 'my-task:8'
10
+ ⚠️ Deregistered task definition 'my-task:9'
11
+ ⚠️ Deregistered task definition 'my-task:10'
12
+ ⚠️ Deregistered task definition 'my-task:11'
13
+ ⚠️ Deregistered task definition 'my-task:12'
14
+ ⚠️ Deregistered task definition 'my-task:13'
15
+ ⚠️ Deregistered task definition 'my-task:14'
16
+ ⚠️ Deregistered task definition 'my-task:15'
17
+ ⚠️ Deleting 15 task definitions in chunks of size 10...
18
+ ⚠️ Deleted 10 task definitions in 0-th batch.
19
+ ⚠️ Deleted 5 task definitions in 1-th batch.
@@ -50,28 +50,70 @@ def test_basic(snapshot: Snapshot) -> None:
50
50
  family,
51
51
  "--keep-latest",
52
52
  str(keep_latest),
53
- # ? `delete_task_definitions` not implemented in moto yet
54
- # "--delete",
55
53
  ],
56
54
  )
57
- task_definitions = [
58
- ecs.describe_task_definition(taskDefinition=f"{family}:{i}")["taskDefinition"]
59
- for i in range(1, num_task_defs + 1)
60
- ]
61
55
 
62
56
  # Assert
63
57
  assert result.exit_code == 0
64
58
  snapshot.assert_match(normalize_console_output(result.stdout), "stdout.txt")
65
59
 
66
- # ?: Moto (v5.1.1) `ecs.list_task_definitions` does not handle `status` filter properly
67
- # ?: + sorting also does not work (current behavior is ASC)
68
- assert [td["revision"] for td in task_definitions if td["status"] == "INACTIVE"] == list(
69
- range(1, num_task_defs - keep_latest + 1), # 1..15
70
- )
71
- assert [td["revision"] for td in task_definitions if td["status"] == "ACTIVE"] == list(
72
- range(num_task_defs - keep_latest + 1, num_task_defs + 1), # 16..25
60
+ active_task_definitions = ecs.list_task_definitions(familyPrefix=family, status="ACTIVE")
61
+ assert active_task_definitions["taskDefinitionArns"] == [
62
+ f"arn:aws:ecs:us-east-1:123456789012:task-definition/{family}:{i}" for i in range(16, 26)
63
+ ]
64
+
65
+ inactive_task_definitions = ecs.list_task_definitions(familyPrefix=family, status="INACTIVE")
66
+ assert inactive_task_definitions["taskDefinitionArns"] == [
67
+ f"arn:aws:ecs:us-east-1:123456789012:task-definition/{family}:{i}" for i in range(1, 16)
68
+ ]
69
+
70
+
71
+ def test_delete(snapshot: Snapshot) -> None:
72
+ """The command should deregister the oldest task definitions."""
73
+ # Arrange
74
+ ecs = boto3.client("ecs")
75
+ family = "my-task"
76
+ num_task_defs = 25
77
+ for i in range(1, num_task_defs + 1):
78
+ ecs.register_task_definition(
79
+ family=family,
80
+ containerDefinitions=[
81
+ {
82
+ "name": "my-container",
83
+ "image": f"my-image:{i}",
84
+ "cpu": 0,
85
+ "memory": 0,
86
+ },
87
+ ],
88
+ )
89
+
90
+ # Act
91
+ keep_latest = 10
92
+ result = runner.invoke(
93
+ app,
94
+ [
95
+ "ecs",
96
+ "task-definition-lifecycle",
97
+ "--family",
98
+ family,
99
+ "--keep-latest",
100
+ str(keep_latest),
101
+ "--delete",
102
+ ],
73
103
  )
74
104
 
105
+ # Assert
106
+ assert result.exit_code == 0
107
+ snapshot.assert_match(normalize_console_output(result.stdout), "stdout.txt")
108
+
109
+ active_task_definitions = ecs.list_task_definitions(familyPrefix=family, status="ACTIVE")
110
+ assert active_task_definitions["taskDefinitionArns"] == [
111
+ f"arn:aws:ecs:us-east-1:123456789012:task-definition/{family}:{i}" for i in range(16, 26)
112
+ ]
113
+
114
+ inactive_task_definitions = ecs.list_task_definitions(familyPrefix=family, status="INACTIVE")
115
+ assert inactive_task_definitions["taskDefinitionArns"] == []
116
+
75
117
 
76
118
  def test_dry_run(snapshot: Snapshot) -> None:
77
119
  """If `--dry-run` option given, the command should not perform any changes."""
@@ -107,16 +149,13 @@ def test_dry_run(snapshot: Snapshot) -> None:
107
149
  "--delete",
108
150
  ],
109
151
  )
110
- task_definitions = [
111
- ecs.describe_task_definition(taskDefinition=f"{family}:{i}")["taskDefinition"]
112
- for i in range(1, num_task_defs + 1)
113
- ]
114
152
 
115
153
  # Assert
116
154
  assert result.exit_code == 0
117
155
  snapshot.assert_match(normalize_console_output(result.stdout), "stdout.txt")
118
156
 
119
- # ?: Moto (v5.1.1) `ecs.list_task_definitions` does not handle `status` filter properly
120
- # ?: + sorting also does not work (current behavior is ASC)
121
- assert [td["revision"] for td in task_definitions if td["status"] == "INACTIVE"] == []
122
- assert len([td["revision"] for td in task_definitions if td["status"] == "ACTIVE"]) == num_task_defs
157
+ active_task_definitions = ecs.list_task_definitions(familyPrefix=family, status="ACTIVE")
158
+ assert len(active_task_definitions["taskDefinitionArns"]) == 25
159
+
160
+ inactive_task_definitions = ecs.list_task_definitions(familyPrefix=family, status="INACTIVE")
161
+ assert len(inactive_task_definitions["taskDefinitionArns"]) == 0
@@ -221,7 +221,8 @@ def test_unsupported_resource(snapshot: Snapshot) -> None:
221
221
  @pytest.mark.parametrize(
222
222
  argnames="arn",
223
223
  argvalues=[
224
- # TODO(lasuillard): Moto Secrets Manager does not respond with error for non-existing resources
224
+ # TODO(lasuillard): `batch_get_secret_value` does not raise an error if secret does not exist.
225
+ # Consider implementing new flag for strict mode (e.g. `--if-not-exists={error,ignore}`)
225
226
  # "arn:aws:secretsmanager:us-east-1:123456789012:secret:unknown-secret", # noqa: ERA001
226
227
  "arn:aws:ssm:us-east-1:123456789012:parameter/unknown-parameter",
227
228
  ],