You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run the following within a Lambda@Edge
const { defaultProvider } = require("@aws-sdk/credential-provider-node");
try {
console.log('getServerSideProps: getting credentials using defaultProvider...');
const credentials = await defaultProvider()();
console.log('getServerSideProps: got credentials from defaultProvider', credentials);
} catch (e) {
console.log('getServerSideProps: Failed to load credentials with defaultProvider', e);
}
My expectation is that a set of credentials will get generated based on the IAM Execution Role that is attached to the Lambda@Edge. Unfortunately, it falls in to the catch with a TimeoutError.
If I run the same code in a regular Lambda and it works and credentials are logged.
Questions:
Is my expectation wrong? Isn't the aws_sdk supposed to be able to get credentials from the IAM Execution Role?
Is there additional configuration needed to have IAM based credentials work in Lambda@Edge?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to run the following within a Lambda@Edge
My expectation is that a set of credentials will get generated based on the IAM Execution Role that is attached to the Lambda@Edge. Unfortunately, it falls in to the
catch
with aTimeoutError
.If I run the same code in a regular Lambda and it works and credentials are logged.
Questions:
Beta Was this translation helpful? Give feedback.
All reactions