Skip to content

djgoku/amazon-ecs-intellisense-schema

 
 

Repository files navigation

Amazon ECS IntelliSense Schema

This package is to provide an intelligent code completion (IntelliSense) experience for users when writing an Amazon ECS task definition in their Visual Studio Code or JetBrains IDEs. It does so by parsing the Amazon ECS model files from the AWS SDK for Go. With these files, the package generates a JSON schema file that provides code completion, documentation lookup, and error checking. Instructions to build and enable IntelliSense are down below.

What does an integration look like?

Here is a VSCode setup integration example:
intellisense

How do I set it up?

VS Code

  1. Configure your IDE settings by going to CodePreferencesSettings
  2. In the search bar, type in settings.json
  3. Click on Edit in settings.json
  4. Check to see if json.schemas is already added
    1. If you see json.schemas, then just append this code to the json.schemas array
      {
        "fileMatch": [
          "*ecs-task-def.json"
        ],
        "url": "https://ecs-intellisense.s3-us-west-2.amazonaws.com/task-definition/schema.json"
      }
    2. Otherwise, create it:
      "json.schemas": [{
        "fileMatch": [
          "*ecs-task-def.json"
        ],
        "url": "https://ecs-intellisense.s3-us-west-2.amazonaws.com/task-definition/schema.json"
      }]

Example

vscode

JetBrains

  1. Go to FilePreferencesLanguages & FrameworksSchemas and DTDsJSON Schema Mappings
  2. Select the + sign at the top to add new mapping
  3. Enter this URL inside Schema file or URL: https://ecs-intellisense.s3-us-west-2.amazonaws.com/task-definition/schema.json
  4. Select JSON schema version 7 for Schema version
    jetbrains-1
  5. Add file matching by selecting the + button at the bottom
    jetbrains-2
  6. Select Add File Path Pattern
  7. For file path pattern type in *ecs-task-def.json
    jetbrains-3

How to run this tool?

  1. Install dependencies with pip install -r requirements.txt
  2. Run python3 src/main.py
    NOTE: If you run into ModuleNotFoundError: No module named 'src'. Then, run export PYTHONPATH="${PYTHONPATH}:/path/to/src/"
  3. The schema should be generated under ./src/model/schema/

License

This library is licensed under the Apache 2.0 License.

About

Generates a JSON schema file that provides intellisense (documentation lookup, code completion, and syntax validation) for ECS task definition parameters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.1%
  • Shell 2.7%
  • Dockerfile 1.2%