Skip to content

Commit

Permalink
Support default network modes
Browse files Browse the repository at this point in the history
In the case of EC2 launch type instances with no custom
network modes specified, the response of describe-task-definition
does not include a networkMode key. In those cases, we can
skip the AWSVPC block entirely. This adds tolerance for the
absence of that key.
  • Loading branch information
rajadain committed Dec 18, 2023
1 parent 4d8381d commit 90b53c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add support for Django 3.2, 4.2, 5.0 [#33](https://github.com/azavea/django-ecsmanage/pull/33)

### Changed
- Support default network modes [#33](https://github.com/azavea/django-ecsmanage/pull/33)
- Upgrade CI to use newer GitHub Actions for `checkout` and `setup-python` [#33](https://github.com/azavea/django-ecsmanage/pull/33)

### Removed
Expand Down
2 changes: 1 addition & 1 deletion ecsmanage/management/commands/ecsmanage.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def run_task(self, config, task_def_arn, security_group_id, subnet_id, cmd):

# Only the awsvpc network mode supports the networkConfiguration
# input value.
if task_def["networkMode"] == "awsvpc":
if task_def.get("networkMode") == "awsvpc":
kwargs["networkConfiguration"] = {
"awsvpcConfiguration": {
"subnets": [subnet_id],
Expand Down

0 comments on commit 90b53c8

Please sign in to comment.