-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp2This is a standard priority issueThis is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
I used AWS sdk v3 to delete eventbridge Rule Target & Rule, the response returned with both httpStatusCode 200. But the rule does not removed.
I used this aws lambda function to invoke :
import {
RemoveTargetsCommand,
EventBridgeClient,
DeleteRuleCommand
} from "@aws-sdk/client-eventbridge";
export const handler = async (event, context) => {
try {
// after delete an webhook, delete the rule target in event bridge
const eventbridgeConfig = {};
const client = new EventBridgeClient(eventbridgeConfig);
const removeTargetsParams = {
EventBusName: "lam",
Force: true,
Ids: [`my-id`], // required
Rule: "my-rule", // required
};
const command = new RemoveTargetsCommand(removeTargetsParams);
const response = await client.send(command);
if (response.$metadata.httpStatusCode === 200) {
// after the api destination is deleted, delete the rule in event bridge
const deleteRuleParams = {
EventBusName: process.env.EVENTBUS_NAME || 'default',
Force: true,
Name: "my-rule", // required
};
const deleterulecommand = new DeleteRuleCommand(deleteRuleParams);
const response = await client.send(deleterulecommand);
}
} catch (err) {
console.error(err);
}
};
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
"@aws-sdk/[email protected]"
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
20.16.0
Reproduction Steps
use the lambda function above and test it with the id target rule & rule name
Observed Behavior
returned both success with delete target & rule :
{
'$metadata': {
httpStatusCode: 200,
requestId: '20ab194e-93ae-4db9-b08b-80ca7195f59e',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
FailedEntries: [],
FailedEntryCount: 0
}
But no rule was deleted. I checked in the AWS Dashboard Console
Expected Behavior
EventBridge Rule deleted
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp2This is a standard priority issueThis is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.