Data not push to S3 bucket
Hi, I have deployed this code with command: sam build --use-container and sam deploy --guided and get TrackingPixelProcessingAPIURL, but when i wget url: <TrackingPixelProcessingAPIURL>?userid=aws_user&thirdpartyname=example.hightrafficwebsite.com data not push to kinesis firehose and S3 not have any data Thanks
Error: An error occurred (AccessDeniedException) when calling the PutRecords operation: User: ...
This error probably means that the lambda function execution role does not have the right IAM permissions to interact with Kinesis Data Firehose, maybe because the KinesisFirehoseARN or KinesisFirehoseStreamName parameters provided during the deployment had some error.
To troubleshoot: Go to the lambda functiona. In the Permissions section open the link you have in the Execution role and ensure that there are 2 Permissions Policies:
- The AWSLambdaBasicExecutionrole AWS managed policy
- A TrackingPixelProcessingRolePolicy custom inline policy with the following definition:
{ "Statement": [ { "Action": [ "firehose:PutRecord" ], "Resource": "<your Kinesis Firehose Delivery stream arn here>", "Effect": "Allow", "Sid": "FirehosePutRecord" } ] }
Thankl, I resolved it:
- Attach role [AmazonKinesisFirehoseFullAccess]
- Change code python kinesis_client = boto3.client('firehose') => kinesis_client = boto3.client('firehose', region_name='us-west-1')