github-action icon indicating copy to clipboard operation
github-action copied to clipboard

AWS authentication for aws-machine-image datasource

Open lukasmrtvy opened this issue 3 years ago • 2 comments

Seems its not possible to set AWS authentication for https://docs.renovatebot.com/modules/datasource/#aws-machine-image-datasource

jobs:
  renovate:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/[email protected]
      - name: Self-hosted Renovate
        uses: renovatebot/[email protected]
        with:
          configurationFile: renovate/config.js
          token: ${{ secrets.RENOVATE_TOKEN }}
        env:
          LOG_LEVEL: debug
          RENOVATE_CUSTOM_ENV_VARIABLES: '[{"AWS_ACCESS_KEY_ID":"${{secrets.RENOVATE_IAM_USER_ID}}","AWS_SECRET_ACCESS_KEY":"${{secrets.RENOVATE_IAM_USER_SECRET}}","AWS_DEFAULT_REGION":"us-east-1"}]'
          AWS_ACCESS_KEY_ID: "${{secrets.RENOVATE_IAM_USER_ID}}"
          AWS_SECRET_ACCESS_KEY: "${{secrets.RENOVATE_IAM_USER_SECRET}}"
          AWS_DEFAULT_REGION: "us-east-1"

In both cases, RENOVATE_CUSTOM_ENV_VARIABLES, and static ENVs are failing to ( config is properly massaged ):

DEBUG: Datasource unknown error (repository=apify/guesswhat)
       "datasource": "aws-machine-image",
       "packageName": "[{\"Name\":\"owner-id\",\"Values\":[\"125523088429\"]},{\"Name\":\"name\",\"Values\":[\"fedora-coreos-*.3.*-x86_64\"]}]\r",
       "err": {
         "message": "Region is missing",
         "stack": "Error: Region is missing\n    at default (/usr/src/app/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/config.js:10:15)\n    at /usr/src/app/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromStatic.js:6:83\n    at /usr/src/app/node_modules/@aws-sdk/property-provider/dist-cjs/chain.js:11:28"
       }

Thanks

lukasmrtvy avatar Sep 06 '22 20:09 lukasmrtvy

Related to https://github.com/renovatebot/github-action/issues/585, AWS_* env variables are not passed to renovate image.

lukasmrtvy avatar Sep 07 '22 09:09 lukasmrtvy

I have added a comment on #585, I don't know if it will solve your use case. You may be able to make with work by adding in a host rule for AWS?

thomascrowley avatar Oct 04 '22 08:10 thomascrowley

Duplicate of #585

viceice avatar Jan 04 '23 11:01 viceice