Skip to main content

JSON Composer

Project description

jose5

JSON Composer

The fifth José in Aplazame

Example

The following file, dev.json ...

{
    "__extends": "./base.json",
    "__variables": {
        "ENVIRONMENT": "dev",
        "tfstate": {
            "with": {
                "stuff": 42
            }
        }
    },
    "environment": [
        {
            "name": "LOG_LEVEL",
            "value": "DEBUG"
        },
        {
            "name": "EXTRA_DEVELOPMENT_PARAM",
            "value": 20
        },
        {
            "name": "TFSTATE_STUFF",
            "value": "${tfstate.with.stuff}"
        }
    ],
    "secrets": [
        {
            "name": "SECRET_KEY",
            "valueFrom": "${PARAM_BASE_PATH}/SECRET_KEY"
        }
    ],
    "mergemap": {
        "b": "dev",
        "c": "dev"
    }
}

... with base.json

{
    "__variables": {
        "PARAM_BASE_PATH": "/app/${ENVIRONMENT}"
    },
    "environment": [
        {
            "name": "ENVIRONMENT",
            "value": "${ENVIRONMENT}"
        },
        {
            "name": "LOG_LEVEL",
            "value": "INFO"
        }
    ],
    "mergemap": {
        "a": "base",
        "b": "base"
    }
}

... produces this result

{
  "environment": [
    {
      "name": "ENVIRONMENT",
      "value": "dev"
    },
    {
      "name": "LOG_LEVEL",
      "value": "DEBUG"
    },
    {
      "name": "EXTRA_DEVELOPMENT_PARAM",
      "value": 20
    },
    {
      "name": "TFSTATE_STUFF",
      "value": 42
    }
  ],
  "mergemap": {
    "a": "base",
    "b": "dev",
    "c": "dev"
  },
  "secrets": [
    {
      "name": "SECRET_KEY",
      "valueFrom": "/app/dev/SECRET_KEY"
    }
  ]
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jose5-0.3.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

jose5-0.3.0-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page