{"id":19422070,"url":"https://github.com/azavea/django-ecsmanage","last_synced_at":"2025-06-24T09:37:25.681Z","repository":{"id":52419749,"uuid":"172998081","full_name":"azavea/django-ecsmanage","owner":"azavea","description":"Run any Django management command on an AWS Elastic Container Service (ECS) cluster.","archived":false,"fork":false,"pushed_at":"2024-04-15T15:54:35.000Z","size":78,"stargazers_count":24,"open_issues_count":2,"forks_count":2,"subscribers_count":7,"default_branch":"develop","last_synced_at":"2025-06-03T20:57:47.909Z","etag":null,"topics":["amazon-ecs","aws","aws-fargate","django","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azavea.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-27T22:08:27.000Z","updated_at":"2023-12-25T11:45:39.000Z","dependencies_parsed_at":"2024-11-10T13:35:05.634Z","dependency_job_id":"e09e4f98-7007-40b8-bd25-62aaaae9d0bd","html_url":"https://github.com/azavea/django-ecsmanage","commit_stats":{"total_commits":27,"total_committers":7,"mean_commits":3.857142857142857,"dds":0.6666666666666667,"last_synced_commit":"26438c4253292b75a970fef23248b62d9d447734"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/azavea/django-ecsmanage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azavea%2Fdjango-ecsmanage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azavea%2Fdjango-ecsmanage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azavea%2Fdjango-ecsmanage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azavea%2Fdjango-ecsmanage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azavea","download_url":"https://codeload.github.com/azavea/django-ecsmanage/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azavea%2Fdjango-ecsmanage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261644431,"owners_count":23189055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-ecs","aws","aws-fargate","django","hacktoberfest"],"created_at":"2024-11-10T13:32:07.146Z","updated_at":"2025-06-24T09:37:25.652Z","avatar_url":"https://github.com/azavea.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-ecsmanage\n================\n\n.. image:: https://github.com/azavea/django-ecsmanage/workflows/CI/badge.svg?branch=develop\n    :target: https://github.com/azavea/django-ecsmanage/actions?query=workflow%3ACI\n\nA Django app that provides a management command allowing you to run any\nother management command on an AWS Elastic Container Service (ECS)\ncluster.\n\nWith ``django-ecsmanage``, you can easily run migrations and other\none-off tasks on a remote cluster from the command line:\n\n::\n\n   $ django-admin ecsmanage migrate\n\nTable of Contents\n-----------------\n\n-  `Installation`_\n-  `Configuration`_\n\n   -  `Environments`_\n   -  `AWS Resources`_\n\n-  `Developing`_\n\nInstallation\n------------\n\nInstall from PyPi using pip:\n\n.. code:: bash\n\n   $ pip install django-ecsmanage\n\nUpdate ``INSTALLED_APPS`` in your Django settings to install the app:\n\n.. code:: python\n\n   INSTALLED_APPS = (\n       ...\n       'ecsmanage',\n   )\n\nConfiguration\n-------------\n\nSettings for the management command are kept in a single configuration\ndictionary in your Django settings named ``ECSMANAGE_ENVIRONMENTS``.\nEach entry in ``ECSMANAGE_ENVIRONMENTS`` should be a key-value pair\ncorresponding to a named environment (like ``default`` or\n``production``) and a set of AWS resources associated with that\nenvironment. For example:\n\n.. code:: python\n\n   ECSMANAGE_ENVIRONMENTS = {\n       'default': {\n           'TASK_DEFINITION_NAME': 'StagingAppCLI',\n           'CONTAINER_NAME': 'django',\n           'CLUSTER_NAME': 'ecsStagingCluster',\n           'LAUNCH_TYPE': 'FARGATE',\n           'PLATFORM_VERSION': '1.4.0',\n           'SECURITY_GROUP_TAGS': {\n               'Name': 'sgAppEcsService',\n               'Environment': 'Staging',\n               'Project': 'ProjectName'\n           },\n           'SUBNET_TAGS': {\n               'Name': 'PrivateSubnet',\n               'Environment': 'Staging',\n               'Project': 'ProjectName'\n           },\n           'ASSIGN_PUBLIC_IP': 'DISABLED',\n           'AWS_REGION': 'us-east-1',\n       },\n   }\n\nThis configuration defines a single environment, named ``default``, with\nassociated AWS ECS resources.\n\nEnvironments\n~~~~~~~~~~~~\n\nThe key name for an environment can be any string. You can use this name\nwith the ``--env`` flag when running the command to run a command on a\ndifferent environment. Take this ``ECSMANAGE_ENVIRONMENTS``\nconfiguration as an example:\n\n.. code:: python\n\n   ECSMANAGE_ENVIRONMENTS = {\n       'default': {\n           'TASK_DEFINITION_NAME': 'StagingAppCLI',\n           'CLUSTER_NAME': 'ecsStagingCluster',\n           'SECURITY_GROUP_TAGS': {\n               'Name': 'sgStagingAppEcsService',\n           },\n           'SUBNET_TAGS': {\n               'Name': 'StagingPrivateSubnet',\n           },\n       },\n       'production': {\n           'TASK_DEFINITION_NAME': 'ProductionAppCLI',\n           'CLUSTER_NAME': 'ecsProductionCluster',\n           'SECURITY_GROUP_TAGS': {\n               'Name': 'sgProductionAppEcsService',\n           },\n           'SUBNET_TAGS': {\n               'Name': 'ProductionPrivateSubnet',\n           },\n       },\n   }\n\nThis configuration defines two environments, ``default`` and\n``production``. Using the above settings, you could run production\nmigrations with the following command:\n\n.. code:: bash\n\n   $ django-admin ecsmanage --env production migrate\n\nIf the ``--env`` argument is not present, the command will default to\nthe environment named ``default``.\n\nAWS Resources\n~~~~~~~~~~~~~\n\nThe following environment configuration keys help the management command locate\nthe appropriate AWS resources for your cluster:\n\n+--------------------------+------------------------------------------------------------------+---------------+\n|           Key            |                           Description                            |    Default    |\n|                          |                                                                  |               |\n|                          |                                                                  |               |\n|                          |                                                                  |               |\n+==========================+==================================================================+===============+\n| ``TASK_DEFINITION_NAME`` | The name of your ECS task definition. The command                |               |\n|                          | will automatically retrieve the latest definition.               |               |\n+--------------------------+------------------------------------------------------------------+---------------+\n| ``CONTAINER_NAME``       | The name of the Django container in your ECS task definition.    | ``django``    |\n+--------------------------+------------------------------------------------------------------+---------------+\n| ``CLUSTER_NAME``         | The name of your ECS cluster.                                    |               |\n+--------------------------+------------------------------------------------------------------+---------------+\n| ``SECURITY_GROUP_TAGS``  | A dictionary of tags to use to identify a security               |               |\n|                          | group for your task.                                             |               |\n+--------------------------+------------------------------------------------------------------+---------------+\n| ``SUBNET_TAGS``          | A dictionary of tags to use to identify a subnet                 |               |\n|                          | for your task.                                                   |               |\n+--------------------------+------------------------------------------------------------------+---------------+\n| ``ASSIGN_PUBLIC_IP``     | Whether to automatically assign a public IP address to your      | ``DISABLED``  |\n|                          | task. Can be ``ENABLED`` or ``DISABLED``.                        |               |\n+--------------------------+------------------------------------------------------------------+---------------+\n| ``LAUNCH_TYPE``          | The ECS launch type for your task.                               | ``FARGATE``   |\n+--------------------------+------------------------------------------------------------------+---------------+\n| ``PLATFORM_VERSION``     | The Fargate platform version, if ``LAUNCH_TYPE`` is ``FARGATE``. | ``LATEST``    |\n+--------------------------+------------------------------------------------------------------+---------------+\n| ``AWS_REGION``           | The AWS region to run your task.                                 | ``us-east-1`` |\n+--------------------------+------------------------------------------------------------------+---------------+\n\nDeveloping\n----------\n\nLocal development is managed with Python virtual environments. Make sure\nthat you have Python 3.8+ and pip installed before starting.\n\nInstall the development package in a virtual environment:\n\n.. code:: bash\n\n   $ ./scripts/update\n\nRun the tests:\n\n.. code:: bash\n\n   $ ./scripts/test\n\n.. _Installation: #installation\n.. _Configuration: #configuration\n.. _Environments: #environments\n.. _AWS Resources: #aws-resources\n.. _Developing: #developing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazavea%2Fdjango-ecsmanage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazavea%2Fdjango-ecsmanage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazavea%2Fdjango-ecsmanage/lists"}