I am trying to allow access to a Kinesis video stream using Cognito Identity Pools, but get an AccessDeniedException
when calling GetDataEndpoint
.
IAM Role Policy Doc:
{
"Sid": "Stream",
"Effect": "Allow",
"Action": [
"kinesisvideoarchivedmedia:GetHLSStreamingSessionURL",
"kinesisvideo:GetDataEndpoint"
],
"Resource": "arn:aws:kinesisvideo:us-west-2:XXXXXXXXXXXX:stream/<stream-name>/<stream-id>"
}
I have tested the policy using the policy simulator, and it shows that the GetDataEndpoint
action is allowed on the stream, but when testing it in the browser the access denied exception occurs:
AccessDeniedException: User: arn:aws:sts::XXXXXXXXXXXX:assumed-role//CognitoIdentityCredentials is not authorized to perform: kinesisvideo:GetDataEndpoint on resource:
<resource-name>
This is how I'm getting the temporary credentials on the site:
AWS.config.region = 'us-west-2';AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: <identity-pool>,
});
AWS.config.credentials.get(function (err, data) {
if (!err) {
id = AWS.config.credentials.identityId;
accessKey = AWS.config.credentials.accessKeyId;
secretKey = AWS.config.credentials.secretAccessKey;
token = AWS.config.credentials.sessionToken;
}
});
I've tried using wildcards for the Kinesis video actions and the resource, but still get the same errors. Any advice would be appreciated.