Why didn't I receive any messages from SQS after creating a rule schedule and sending a target to SQS by AWS SDK?

0

You can take a look my sample code here

 const rule = await this.eventBridge
      .putRule({
        Name: payload.name,
        // EventBusName: 'eventbustest',
        ScheduleExpression: payload.expression,
        Description: payload.description,
        State: 'ENABLED',
      })
      .promise();
    const target = await this.eventBridge
      .putTargets({
        Rule: payload.name,
        Targets: [
          {
            Arn: payload.sqsTarget.arn,
            Id: payload.sqsTarget.id,
            Input: JSON.stringify({ test: 1 }),
          },
        ],
      })
      .promise();

I tried create rule using code then it's not working for SQS side but when I tried create on console then it's working

Ceck
gefragt vor 9 Monaten210 Aufrufe
1 Antwort
1
Akzeptierte Antwort

Hi,

please make sure that the SQS access policy and IAM policy allow EventBridge to write messages to the queue. Additionally, check that the ARNs match your resources.

Here is more information: https://repost.aws/knowledge-center/sqs-queue-access-permissions

profile pictureAWS
EXPERTE
beantwortet vor 9 Monaten
  • thank you, i used Account with Administrator Access, I missed for SQS access policy. I tried to reconfigure and it's working for now.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen