Skip to content

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

License

Notifications You must be signed in to change notification settings

awslabs/amazon-ecs-intellisense-schema

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. To update api.json and docs.json for a specific Go SDK version Run ./update.sh SCHEMA_VERSION GO_SDK_VERSION
  3. Update the schema_version and sdk_go_version values in src/version.py file accordingly.
  4. Run python3 src/main.py
    NOTE: If you run into ModuleNotFoundError: No module named 'src'. Then, run export PYTHONPATH="${PYTHONPATH}:/path/to/src/"
  5. 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

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •