In github, you can click the Raw button and you can get the file's url. Does CodeCommit have that feature?
3 Answers
Unfortunately and unbelievably, I think the answer is still, NO. The Web UI (AWS Console Code-commit) allows you to navigate to any file, view it, and even edit it, but it doesn't allow you to view the raw (and ultimately) download it. So frustrating. This would be a simple feature for them to add via their GetFile API.
CodeCommit repos are protected by IAM credentials, so you're not going to get a direct public URL to the file.
However, if you want to download the content of a specific file, you can use the AWS SDK or CLI. Here's an example using the CLI:
aws codecommit get-file \
--repository-name my-project \
--file-path path/to/file.json \
--query fileContent \
--output text \
| base64 -d
You can get the raw contents of blobs in a CodeCommit repository using the GetBlob API (http://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetBlob.html). Your request needs to be authenticated using appropriate AWS credentials (access key, secret key).
There is currently no way to provide a permanent, public URL for the blob.