drone-cache icon indicating copy to clipboard operation
drone-cache copied to clipboard

Enable Assume Role from Drone Pipeline Step

Open hec-hi opened this issue 1 year ago • 8 comments

In my DroneCI Pipeline, I am able to use drone-cache when providing IAM User credentials directly as environment variables. Example:

steps:
  - name: restore-cache
    image: meltwater/drone-cache
    environment:
      AWS_ACCESS_KEY_ID:
        from_secret: <DRONE_SECRET_AWS_ACCESS_KEY_ID>
      AWS_SECRET_ACCESS_KEY:
        from_secret: <DRONE_SECRET_AWS_SECRET_ACCESS_KEY>
    settings:
      <SETTINGS>

Due to compliance reasons, I would like to assume a role instead:

steps:
  - name: restore-cache
    image: meltwater/drone-cache
    environment:
      AWS_ASSUME_ROLE_ARN:
        from_secret: <DRONE_SECRET_ROLE_ARN>
    settings:
      <SETTINGS>

I see something in that direction was already implemented in https://github.com/meltwater/drone-cache/issues/142 , but setting the environment variable AWS_ASSUME_ROLE_ARN did not seem to work out-of-the-box for me. I get EmptyStaticCreds: static credentials are empty. Maybe this is already implemented, and I am just missing something 😄

Thanks in advance!

hec-hi avatar Jun 26 '23 14:06 hec-hi