- Mais recentes
- Mais votos
- Mais comentários
Hi Ethan, thanks for reaching out!
When setting up an Input Transformer in the console, the reserved variables won't populate in the Input Transformer set-up window when clicking Generate Output
to test a Transformer. However, these variables will populate after creating the Transformer, saving the rule, and passing an event that triggers the rule. For example, here's the output of an event using the same Input Transformer from the documentation utilizing the reserved variables:
{
"instance": "i-68b59f5e3e8m74d47",
"state": "stopped",
"ruleArn": "arn:aws:events:us-west-1:123456789012:rule/InputTransformerTest",
"ruleName": "InputTransformerTest",
"originalEvent": {
"id": "79bb5757-adab-984d-crr1-71af1f67d7894",
"account": "123456789012",
"detailType": "EC2 Instance State-change Notification",
"time": 1652796616000,
"source": "aws.ec2",
"region": "us-west-1",
"resources": ["arn:aws:ec2:us-west-1:123456789012:instance/i-68b59f5e3e8m74d47"],
"version": "0"
}
}
As for utilizing Input Transformers when sending events to another event bus, you are correct that this is not supported. When sending events to another event bus, the entire event must be passed as is. As workarounds, you can either:
-
Send the full event to the target event bus as is, and place the desired Input Transfomer on a rule in the target event bus.
-
Send the event data to a Lambda function target, and have the Lambda function parse and format the event, and perform the PutEvents API to send the transformed event data to the target event bus.
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há um ano
Neither of these workarounds resolves my use case, which is that i need to add a parameter to the event based on the rule that is passing it to the target event bus. This is easily done with apiDestinations by adding a header, but no obvious way to do it for an eventbus destination. I see that it could possibly be done via lambda in the origin account, but that is not a possibility in my use case (I dont have the option to deploy lambdas in the origin account). Any ideas?