Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TriggerAuthentication : AWS Secret Manager should allow to pass "Secret key" as one of the parameter under secrets #5940

Open
Tejasvihuded opened this issue Jul 2, 2024 · 6 comments
Labels
feature All issues for new features that have been committed to good first issue Good for newcomers help wanted Looking for support from community

Comments

@Tejasvihuded
Copy link

Tejasvihuded commented Jul 2, 2024

Report

There is no way I can pass "Secret key" under "awsSecretManager.secrets" section. When we actually create secret in AWS secret Manager it will have "Secret name" under which we will have "Key/Value" pairs.
For Example:

"Secret name" can be "keda-int" under which we will have "Key/Value" pairs ,something like.

Secret key | Secret value

userName | dummyuser
password | dummypass

For for above if I want to create "TriggerAuthentication",I want new parameter to pass {aws-secret-key},else there is no way we can say which Secret Key to use for each parameter

apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
  name: sample
spec:
    podIdentity:             
      provider: aws               
    region: us-east-2                                                 
    secrets:                                                              
    - parameter: userName
      name: keda-int
      *key: {aws-secret-key}*
    - parameter: password
      name: keda-int   
      *key: {aws-secret-key}*

Expected Behavior

Need new "key" parameter under secrets section

Actual Behavior

There is no way we can pass "Secret Key" today under "Secret Name"

Steps to Reproduce the Problem

NA

Logs from KEDA operator

NA

KEDA Version

2.13.0

Kubernetes Version

1.28

Platform

Amazon Web Services

Scaler Details

postgresql

Anything else?

No response

@Tejasvihuded Tejasvihuded added the bug Something isn't working label Jul 2, 2024
@nrichardson-akasa
Copy link

This would be very helpful for me as well. We store username, password, and host in the AWS secret. Being able to pull all of them from one secret as opposed to having to create multiple secrets for each parameter would be great!

@JorTurFer
Copy link
Member

Is it possible to have multiple secrets within the same AWS secret? It's an interesting feature tbh, are you willing to contribute with it?

@JorTurFer JorTurFer added help wanted Looking for support from community good first issue Good for newcomers feature All issues for new features that have been committed to and removed bug Something isn't working labels Aug 2, 2024
@nrichardson-akasa
Copy link

@JorTurFer I've opened a preliminary PR with the changes I think are needed. I am not a Go developer, so I may be missing something. Also, I have not added any tests as the existing test did not seem to attempt to pull a secret. Open to comments/concerns!
#6031

@JorTurFer
Copy link
Member

The PR is quite good. You can't test that part with unit tests as it depends on the AWS package but you can include an e2e test for it. You could extend the current e2e tests to cover this new feature. There are currently 2 e2e tests covering this service:

They do exactly the same, one using credentials and the other one using podIdentity. I think that just extending one of them could be enough (but if you are willing, updating both will keep them aligned xD)

@nrichardson-akasa
Copy link

Sounds good! I'll update my PR on Monday to include some tests then.

@nrichardson-akasa
Copy link

@JorTurFer I've went ahead and added 2 E2E tests (one for each file). Can you kick off the E2E tests? Once confirmed working, I will make a separate PR for the documentation changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature All issues for new features that have been committed to good first issue Good for newcomers help wanted Looking for support from community
Projects
None yet
Development

No branches or pull requests

3 participants