# Amazon S3 Cache plugin with AWS Credentials File

**URL:** https://drone.discourse.group/t/amazon-s3-cache-plugin-with-aws-credentials-file/7821
**Category:** Drone Support
**Created:** [August 18, 2020, 5:54pm UTC](https://drone.discourse.group/t/amazon-s3-cache-plugin-with-aws-credentials-file/7821 "2020-08-18T17:54:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kirbyjs](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kirbyjs/32/6202_2.png) [@kirbyjs](https://drone.discourse.group/u/kirbyjs)
#### Post date: [August 18, 2020, 5:54pm UTC](https://drone.discourse.group/t/amazon-s3-cache-plugin-with-aws-credentials-file/7821/1 "2020-08-18T17:54:21Z")

</div>

The [drone-s3-cache plugin](https://github.com/drone-plugins/drone-s3-cache/) does not work with the aws credentials file or so it seems anyway.

The default expected behavior should be that the aws sdk (this case the aws sdk in go) should try to resolve aws credentials from `~/.aws/credentials`. But I’m still getting access denied.

I have verified that it’s not a credentials issue because it works with [drone-cache plugin](https://github.com/meltwater/drone-cache). But I would rather use the drone-s3-cache plugin because it supports flushing cache.

I also tried setting the env variable `HOME` to `/root` so that aws will look in `/root/.aws/` for the credentials file, but that didn’t work.

Here’s the drone config:

```auto
- name: restore_cache
  image: plugins/s3-cache
  settings:
    debug: true
    mount:
    - /root/.m2
    region: us-east-1
    restore: true
    root: my_s3_bucket
  environment:
    HOME: /root
  volumes:
  - name: aws_creds
    path: /root/.aws
  - name: m2
    path: /root/.m2
  depends_on:
  - get_aws_credentials

```

`get_aws_credentials` is the step that populates `/root/.aws` with the aws credentials file.

The `debug` option is also not showing anything that is useful.

---

<div class="post-metadata">

### Author: ![ashwilliams1](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ashwilliams1/32/5549_2.png) [@ashwilliams1](https://drone.discourse.group/u/ashwilliams1)
#### Post date: [August 18, 2020, 6:39pm UTC](https://drone.discourse.group/t/amazon-s3-cache-plugin-with-aws-credentials-file/7821/2 "2020-08-18T18:39:12Z")

</div>

the S3 plugin currently supports access keys (aws\_access\_key\_id) and IAM and would need to be enhanced to support additional authentication mechanisms. This plugin is community maintained and I’m not sure if the maintainers monitor discourse for issues, so I would recommend creating an issue at [https://github.com/drone-plugins/drone-s3-cache/issues](https://github.com/drone-plugins/drone-s3-cache/issues)

I checked the relevant code to verify how auth works and this is what I see:

> <https://github.com/drone-plugins/drone-s3-cache/blob/master/storage/s3/s3.go#L45:L55>

---

<div class="post-metadata">

### Author: ![kirbyjs](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kirbyjs/32/6202_2.png) [@kirbyjs](https://drone.discourse.group/u/kirbyjs)
#### Post date: [August 18, 2020, 7:14pm UTC](https://drone.discourse.group/t/amazon-s3-cache-plugin-with-aws-credentials-file/7821/3 "2020-08-18T19:14:04Z")

</div>

Here’s the issue if anyone’s interested: [https://github.com/drone-plugins/drone-s3-cache/issues/62](https://github.com/drone-plugins/drone-s3-cache/issues/62)
