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

SSOSYNC_REGION environment variable is not respected when deployed as Lambda function #170

Closed
anggras opened this issue Feb 8, 2024 · 5 comments

Comments

@anggras
Copy link

anggras commented Feb 8, 2024

Describe the bug
When deployed as a Lambda function with SSOSYNC_REGION environment variable set to the arn of a Secret Manager Secret, ssosync still expects value from SSOSyncRegion Secret.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy ssosync version 2.1.2 as a Lambda function
  2. Configure environment variables SSOSYNC_GOOGLE_CREDENTIALS, SSOSYNC_GOOGLE_ADMIN, SSOSYNC_SCIM_ENDPOINT, SSOSYNC_SCIM_ACCESS_TOKEN, SSOSYNC_REGION, and SSOSYNC_IDENTITY_STORE_ID to the arns of the respective Secrets (non default Secret values).
  3. The following error will be asserted

level=fatal msg="cannot read config: ResourceNotFoundException: Secrets Manager can't find the specified secret."

  1. Create a Secret Manager Secret named SSOSyncRegion
  2. Function runs successfully

Expected behavior
ssosync should respect the SSOSYNC_REGION environment variable and fetch the secret value from the specified arn.

Additional context
n/a

@ChrisPates
Copy link
Contributor

ChrisPates commented Feb 8, 2024 via email

@anggras
Copy link
Author

anggras commented Feb 8, 2024

Hi @ChrisPates,

I renamed the binary to bootstrap, compressed to zip and uploaded it to a Lambda function.

Anggra

@ChrisPates
Copy link
Contributor

Apologies for the delay, I have reproduced the behavior in my test environment. Having reviewed the code it may well apply to all secrets, I'm going to perform further testing and the look at implementing a fix.

@anggras
Copy link
Author

anggras commented Mar 1, 2024

No worries @ChrisPates , just created a PR with what I did for my internal use

@ChrisPates
Copy link
Contributor

Thank you for sharing on closer inspection actually there is a broader issue with the Lambda Env Vars being ignored. I have a build I'm testing currently but it should address your original issue and some previously unidentified ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants