I now have the following error
“Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1”
I apologize for the confusion. It seems that the AWS credentials are not being passed correctly. To fix this issue, please update your code to use the AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
environment variables. Here’s the updated code snippet: import AWS from "aws-sdk"; const s3 = new AWS.S3({ accessKeyId: process.env.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, region: "your-region", // Replace with the appropriate AWS region }); const params = { Bucket: "your-bucket-name", // Replace with your S3 bucket name Key: "your-s3-key", // Replace with the S3 key of the uploaded file Tagging: { TagSet: [ { Key: "your-tag-key", // Replace with your desired tag key Value: "your-tag-value", // Replace with your desired tag value }, ], }, }; await s3.putObjectTagging(params).promise();
Make sure you’ve set the AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
environment variables in your Pipedream account. If you still encounter any issues or need further assistance, please let me know.
I still have the following error message
CredentialsError
Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
DETAILS
Timestamp
10/09/2023, 09:58:21Duration
9146ms
I apologize for the inconvenience. Let’s double-check your environment variables to ensure they are set correctly. Please follow these steps: 1. Go to your Pipedream account settings by visiting https://pipedream.com/settings/account. 2. Click on the “Environment Variables” tab. 3. Make sure you have both AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
environment variables set with the correct values. If the environment variables are set correctly and you still encounter the issue, please try the following code snippet: ```
import AWS from “aws-sdk”; const s3 = new AWS.S3({ credentials: { accessKeyId: process.env.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, }, region: “your-region”, // Replace with the appropriate AWS region }); const params = { Bucket: “your-bucket-name”, // Replace with your S3 bucket name Key: “your-s3-key”, // Replace with the S3 key of the uploaded file Tagging: { TagSet: [ { Key: “your-tag-key”, // Replace with your desired tag key Value: “your-tag-value”, // Replace with your desired tag value }, ], }, }; await s3.putObjectTagging(params).promise();
Thanks it works now - I didn’t know about the evironment variable, I though these informations were managed in the “Account” section
I’m glad it’s working now! Yes, environment variables are managed in the “Environment Variables” tab within your Pipedream account settings. They allow you to securely store sensitive information like API keys and credentials, which can be accessed within your workflows. If you have any more questions or need further assistance, feel free to ask!