Skip to content

Unable to create a triggers for lambda

0

I am trying to create trigger for a lambda function to use the event source mapping functionality. Though it shows enabled for some time, it goes to disabled after some time showing the below error.

Last processing result: PROBLEM: Certificate and/or private key must be in PEM format.

I did multiple checks and could see my key in secret manager is in proper format. For reference, please see the below picture.

Enter image description here

asked 8 months ago128 views
2 Answers
5

Below the checklist to locate the issue:

  • PEM blocks are complete and properly wrapped
  • No trailing whitespace or malformed headers
  • If encrypted, password is included and uses PBES1 algorithm (PBES2 is not supported)
  • Secrets Manager secret is in the same region as your Lambda function
  • Lambda has permission to access the secret (secretsmanager:GetSecretValue)
EXPERT
answered 8 months ago
  • Thanks for your response. Are there any set of commands which creates the key and secret in the exact format it is expected to have.? also, i am keeping the same content which i shared in my ticket under the secret manager key and encryption sections. Would that cause any issues.?

1

The error message "PROBLEM: Certificate and/or private key must be in PEM format" indicates that there's an issue with the certificate or private key format you're using for your Lambda trigger.

This specific error typically occurs when setting up an event source mapping with Apache Kafka. Even though your key might appear to be in the correct format in Secrets Manager, there could be a few issues:

  1. The certificate or private key might not be properly formatted in PEM format.
  2. The private key encryption might be using an algorithm that's not compatible. Specifically, the private key encryption should use a PBES1 algorithm.

To resolve this issue:

  1. Verify that both your certificate and key are in proper PEM format.
  2. Check that the private key encryption uses a PBES1 algorithm.
  3. Make sure there are no extra characters, line breaks, or formatting issues in your certificate or key.

If you're adding a trigger through the Lambda console, follow these steps:

  1. Open the Functions page of the Lambda console
  2. Select your function
  3. In the Function overview pane, choose "Add trigger"
  4. Select the AWS service you want to use to invoke your function
  5. Fill out the trigger configuration options carefully, ensuring all certificate and key information is correctly formatted

If the issue persists, you might need to regenerate your certificates and keys to ensure they meet the required format specifications.
Sources
Troubleshooting self-managed Apache Kafka event source mapping errors - AWS Lambda
Invoking Lambda with events from other AWS services - AWS Lambda

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.