Questions tagged with Amazon EventBridge

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

How to use if-then-else and loop construct in input transformer in EventBridge?

Is there a way to define **if-then-else** and **looping** constructs using JSONPath, while defining the configuring the "input path" for EventBridge Input Transformer? E.g. For the following input ``` { "category": { "name": "Nike Shoes", "level": 2, "translation": null, "ancestors": { "edges": [ { "node": { "name": "Shoes", "slug": "shoes", "level": 0 } }, { "node": { "name": "Running Shoes", "slug": "running-shoes", "level": 1 } } ] } } } ``` I need the output to be ``` { "categories.lvl0": "Shoes", "categories.lvl1": "Shoes > Running shoes", "categories.lvl2": "Shoes > Running shoes > Nike shoes", } ``` The following is the python logic for the output I wish to achieve ```python if node["category"]["level"] != 0: category_hierarchy = list(map(lambda x: x["node"]["name"], node["category"]["ancestors"]["edges"])) category_hierarchy.append(new_item["categoryName"]) for i in range(len(category_hierarchy)): new_item[f'categories.lvl{i}'] = " > ".join(category_hierarchy[0:i+1]) ``` if the level of the main category ("Nike shoes" here) is not equal to 0, then I want to loop through its ancestors and define variables of the form `categories.lvl(n)` with the logic defined in column 2 below, to get the values defined in column 3 | Variable | Logic | Value required | | --------- | ------ | ------------------ | | category.lvl0 | ancestor category with level 0 | Shoes | | category.lvl1 | ancestor category with level 0 > ancestor category with level 1 | Shoes> Running shoes | | category.lvl2 | ancestor category with level 0 > ancestor category with level 1 > main category (with level 0) | Shoes> Running shoes > Nike shoes| I could frame the following JSONPath construct for now, which in plain English, represents: "if the category level is 0, then proceed to output names of the ancestor categories" JSONPath - `$..edges[?(@.level!=0)]..name` Output ``` [ "Shoes", "Running shoes" ] ``` However, I am not sure how to proceed further.
0
answers
0
votes
76
views
satvik
asked 6 months ago

No further functionality after "eventType": "INITIATED" message while implementing Amazon Connect high-volume outbound communications

I have just created Campaign in Connect with Contact flow, Then IAM policies, EventBridge and Pinpoint stuff with Creation of Segments & Journeys and in return i got the first event as "eventType": "INITIATED" with Type "VOICE". But then it stuck and nothing happen, it should dial a number using outbound queue as mention in the [Documentation](https://aws.amazon.com/blogs/contact-center/make-predictive-and-progressive-calls-using-amazon-connect-high-volume-outbound-communications/#:~:text=Under%20%E2%80%9COutbound%20call%20configuration%E2%80%9D%2C%20choose%20any%20phone%20number%20for,button%20at%20the%20top%2Dright.) as below: ``` { "version": "0", "id": "35af9eb2-5dda-fafc-48ce-78f223478a85", "detail-type": "Amazon Connect Contact Event", "source": "aws.connect", "account": "XXX92XXX3XXX", "time": "2022-05-31T08:21:52Z", "region": "us-east-1", "resources": [ "arn:aws:connect:us-east-1:XXX92XXX3XXX:instance/8XXXXXX9-1XXa-4XXf-bXXf-3XXXXXXXXX4", "arn:aws:connect:us-east-1:XXX92XXX3XXX:instance/8XXXXXX9-1XXa-4XXf-bXXf-3XXXXXXXXX4/contact/7b552ed3-b276-42ea-9837-31f8622f4fde" ], "detail": { "initiationTimestamp": "2022-05-31T08:21:52.769Z", "contactId": "7b552ed3-b276-42ea-9837-31f8622f4fde", "channel": "VOICE", "instanceArn": "arn:aws:connect:us-east-1:XXX92XXX3XXX:instance/8XXXXXX9-1XXa-4XXf-bXXf-3XXXXXXXXX4", "initiationMethod": "API", "eventType": "INITIATED", "campaign": { "campaignId": "8b00b16f-b083-4a00-ae86-58332f524b2b" } } } ``` In the end after the time ends it closed the journey with message "Message Not Sent". It should dial an outbound number at numbers added through segment and than return the events but somehow it doesn't working. In CSV segment file what format we have to used for phone number? e.g. General! when we add E.164 phone in CSV file and saved it, it throw an alert `"some features in your workbook might be lost if you save it as csv UTF-8 (comma delimited)"`. May be its changing the format.
1
answers
0
votes
59
views
asked 6 months ago

Eventbridge Input Transformer example doesnt work

I am trying to setup an eventbridge input transformer, and am following the example instructions on this page: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html I need to use reserved variables, so I am testing by trying to use the input template with the description: > Including reserved variables in JSON Here is my Input Template: ``` { "instance" : <instance>, "state": <state>, "ruleArn" : <aws.events.rule-arn>, "ruleName" : <aws.events.rule-name>, "originalEvent" : <aws.events.event> } ``` According to the docs, `Generate Output` is supposed to result in: ``` { "instance" : "i-0123456789", "state": "RUNNING", "ruleArn" : "arn:aws:events:us-east-2:123456789012:rule/example", "ruleName" : "example", "originalEvent" : { ... // commented for brevity } } ``` but instead I am getting: ``` { "instance" : i-0123456789, "state": RUNNING, "ruleArn" : <aws.events.rule-arn>, "ruleName" : <aws.events.rule-name>, "originalEvent" : <aws.events.event> } ``` Is this broken, or am I missing something? I also need to transform the input before being sent to an `EventBridge event bus` in another account as a Target, but when I select that as the target, the ability to configure the target input as an Input Transformer disappears from the `Additional Settings` section. Is this not supported? It is obviously a critical use case to be able to filter data before it crosses account boundaries.
1
answers
0
votes
645
views
Ethan
asked 7 months ago

Unable to create new OpsItems from EventBridge when using Input Transformer for deduplication and adding category and severity values

Apologize to all for the duplicate post. I created my login under the wrong account when I initially posted this question. I’m able to generate a new OpsItem for any EC2, SecurityGroup, or VPC configuration change using an EventBridge rule with the following event pattern. { "source": "aws.config", "detail-type": "Config Configuration Item Change", "detail": { "messageType": "ConfigurationItemChangeNotification", "configurationItem": { "resourceType": "AWS::EC2::Instance", "AWS::EC2::SecurityGroup", "AWS::EC2::VPC" } } } The rule and target work great when using Matched event for the Input but I noticed that launching one EC2 using the AWS wizard creates at least three OpsItems, one for each resourceType. Therefore I’d like to implement a deduplication string to cut down on the number of OpsItems generated to one if possible and I’d also like to attach a category and severity to the new OpsItem. I’m trying to use an Input Transformer as recommended by the AWS documentation but even the most simplest of Input Transformers when applied prevent any new OpsItems from being generated. When I've tested, I've also ensured that all previous OpsItems were resolved. Can anyone tell me what might be blocking the creation of any new OpsItems when using this Input Transformer configuration? Here’s what I have configured now. Input path { "awsAccountId": "$.detail.configurationItem.awsAccountId", "awsRegion": "$.detail.configurationItem.awsRegion", "configurationItemCaptureTime": "$.detail.configurationItem.configurationItemCaptureTime", "detail-type": "$.detail-type", "messageType": "$.detail.messageType", "notificationCreationTime": "$.detail.notificationCreationTime", "region": "$.region", "resourceId": "$.detail.configurationItem.resourceId", "resourceType": "$.detail.configurationItem.resourceType", "resources": "$.resources", "source": "$.source", "time": "$.time" } Input template { "awsAccountId": "<awsAccountId>", "awsRegion": "<awsRegion>", "configurationItemCaptureTime": "<configurationItemCaptureTime>", "resourceId": "<resourceId>", "resourceType": "<resourceType>", "title": "Template under ConfigDrift-EC2-Dedup4", "description": "Configuration Drift Detected.", "category": "Security", "severity": "3", "origination": "EventBridge Rule - ConfigDrift-EC2-Dedup", "detail-type": "<detail-type>", "source": "<source>", "time": "<time>", "region": "<region>", "resources": "<resources>", "messageType": "<messageType>", "notificationCreationTime": "<notificationCreationTime>", "operationalData": { "/aws/dedup": { "type": "SearchableString", "value": "{\"dedupString\":\"ConfigurationItemChangeNotification\"}" } } } Output when using the AWS supplied Sample event called “Config Configuration Item Change” { "awsAccountId": "123456789012", "awsRegion": "us-east-1", "configurationItemCaptureTime": "2022-03-16T01:10:50.837Z", "resourceId": "fs-01f0d526165b57f95", "resourceType": "AWS::EFS::FileSystem", "title": "Template under ConfigDrift-EC2-Dedup4", "description": "Configuration Drift Detected.", "category": "Security", "severity": "3", "origination": "EventBridge Rule - ConfigDrift-EC2-Dedup", "detail-type": "Config Configuration Item Change", "source": "aws.config", "time": "2022-03-16T01:10:51Z", "region": "us-east-1", "resources": "arn:aws:elasticfilesystem:us-east-1:123456789012:file-system/fs-01f0d526165b57f95", "messageType": "ConfigurationItemChangeNotification", "notificationCreationTime": "2022-03-16T01:10:51.976Z", "operationalData": { "/aws/dedup": { "type": "SearchableString", "value": "{"dedupString":"ConfigurationItemChangeNotification"}" } } }
1
answers
0
votes
119
views
asked 7 months ago

Unable to create new OpsItems from EventBridge when using Input Transformer for deduplication and adding category and severity values

I’m able to generate a new OpsItem for any EC2, SecurityGroup, or VPC configuration change using an EventBridge rule with the following event pattern. { "source": ["aws.config"], "detail-type": ["Config Configuration Item Change"], "detail": { "messageType": ["ConfigurationItemChangeNotification"], "configurationItem": { "resourceType": ["AWS::EC2::Instance", "AWS::EC2::SecurityGroup", "AWS::EC2::VPC"] } } } The rule and target work great when using Matched event for the Input but I noticed that launching one EC2 using the AWS wizard creates at least three OpsItems, one for each resourceType. Therefore I’d like to implement a deduplication string to cut down on the number of OpsItems generated to one if possible and I’d also like to attach a category and severity to the new OpsItem. I’m trying to use an Input Transformer as recommended by the AWS documentation but even the most simplest of Input Transformers when applied prevent any new OpsItems from being generated. When I've tested, I've also ensured that all previous OpsItems were resolved. Can anyone tell me what might be blocking the creation of any new OpsItems when using this Input Transformer configuration? Here’s what I have configured now. Input path { "awsAccountId": "$.detail.configurationItem.awsAccountId", "awsRegion": "$.detail.configurationItem.awsRegion", "configurationItemCaptureTime": "$.detail.configurationItem.configurationItemCaptureTime", "detail-type": "$.detail-type", "messageType": "$.detail.messageType", "notificationCreationTime": "$.detail.notificationCreationTime", "region": "$.region", "resourceId": "$.detail.configurationItem.resourceId", "resourceType": "$.detail.configurationItem.resourceType", "resources": "$.resources", "source": "$.source", "time": "$.time" } Input template { "awsAccountId": "<awsAccountId>", "awsRegion": "<awsRegion>", "configurationItemCaptureTime": "<configurationItemCaptureTime>", "resourceId": "<resourceId>", "resourceType": "<resourceType>", "title": "Template under ConfigDrift-EC2-Dedup4", "description": "Configuration Drift Detected.", "category": "Security", "severity": "3", "origination": "EventBridge Rule - ConfigDrift-EC2-Dedup", "detail-type": "<detail-type>", "source": "<source>", "time": "<time>", "region": "<region>", "resources": "<resources>", "messageType": "<messageType>", "notificationCreationTime": "<notificationCreationTime>", "operationalData": { "/aws/dedup": { "type": "SearchableString", "value": "{\"dedupString\":\"ConfigurationItemChangeNotification\"}" } } } Output when using the AWS supplied Sample event called “Config Configuration Item Change” { "awsAccountId": "123456789012", "awsRegion": "us-east-1", "configurationItemCaptureTime": "2022-03-16T01:10:50.837Z", "resourceId": "fs-01f0d526165b57f95", "resourceType": "AWS::EFS::FileSystem", "title": "Template under ConfigDrift-EC2-Dedup4", "description": "Configuration Drift Detected.", "category": "Security", "severity": "3", "origination": "EventBridge Rule - ConfigDrift-EC2-Dedup", "detail-type": "Config Configuration Item Change", "source": "aws.config", "time": "2022-03-16T01:10:51Z", "region": "us-east-1", "resources": "arn:aws:elasticfilesystem:us-east-1:123456789012:file-system/fs-01f0d526165b57f95", "messageType": "ConfigurationItemChangeNotification", "notificationCreationTime": "2022-03-16T01:10:51.976Z", "operationalData": { "/aws/dedup": { "type": "SearchableString", "value": "{"dedupString":"ConfigurationItemChangeNotification"}" } } }
0
answers
0
votes
23
views
asked 7 months ago