Coder Social home page Coder Social logo

boyney123 / eventbridge-transformer Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 1.0 1.38 MB

Online tool to quickly build input templates and paths for Amazon EventBridge

Home Page: https://eventbridge-transformer.vercel.app

License: MIT License

TypeScript 96.83% JavaScript 2.05% CSS 1.12%
aws developer-tool eventbridge serverless

eventbridge-transformer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thim81

eventbridge-transformer's Issues

Use brackets for array index instead of dots.

Hi, I recently used your tool to generate an input transformer (great tool btw). However I had trouble because the index for items in an array is wrapped in '.' as opposed to '[]'. For example, take the following event - with a 'findings' array:

{
    "version": "0",
    "id": "8e5622f9-d81c-4d81-612a-9319e7ee2506",
    "detail-type": "Security Hub Findings - Imported",
    "source": "aws.securityhub",
    "account": "123456789012",
    "time": "2019-04-11T21:52:17Z",
    "region": "us-west-2",
    "detail": {
        "findings": [
            {
                "SchemaVersion": "2018-10-08",
                "CompanyName": "AWS",
                "FirstObservedAt": "2022-08-10T10:36:01.841Z",
                "LastObservedAt": "2022-10-20T23:33:15.790Z",
                "CreatedAt": "2022-08-10T10:36:01.841Z",
                "UpdatedAt": "2022-10-20T23:33:13.854Z",
                "Severity": {
                    "Product": 40,
                    "Label": "MEDIUM",
                    "Normalized": 40,
                    "Original": "MEDIUM"
                }
            }
        ]
    }
}

The Input Path specified for the 'SchemaVersion' is specified as:

{
    "SchemaVersion": "$.detail.findings.0.SchemaVersion"
}

However, while this works in the AWS console - and produces the desired output, the output was missing from the content received via email from the SNS topic. AWS support pointed me to their documentation, which highlighted that the index should be referenced with square brackets:

{
    "SchemaVersion": "$.detail.findings[0].SchemaVersion"
}

https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html#eb-transform-input-examples

This is also defined in the JSONPath README:

https://github.com/json-path/JsonPath

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.