Skip to content

IAM Role credentials can expire between unload / load into Redshift #200

@cmkimerer

Description

@cmkimerer

Note: This is likely superseded by #199, but I'll file in case this fix needs to be carried over, or #199 doesn't land in the next release.

When using RedshiftWriter.saveToRedshift() the credentials are fetched early in the function, if the unloadData call takes a significant amount of time (

val manifestUrl = unloadData(sqlContext, data, tempDir)
) it's possible that the credentials fetched have expired by the time doRedshiftLoad has run.

Ideally, the result returned from loadFromUri would return an instance of the InstanceProfileCredentialsProvider and getCredentials() would be called each time it was needed. This would handle the fact that the credentials can expire and would re-fetch when necessary. Obviously this change will break all other usages of fetching credentials right now, so perhaps an internal "credential wrapper" should be created to either return a wrapped BasicAWSCredentials when getCredentials() is called, or call through to the InstanceProfileCredentialsProvider.getCredentials() if that case is hit.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions