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

Fix/datastore vars optional #70

Merged
merged 3 commits into from
Feb 14, 2025
Merged

Conversation

sophie-daintta
Copy link
Collaborator

@sophie-daintta sophie-daintta commented Feb 14, 2025

Context

Update datastore variables to optional to allow for automatic boto3 credentials:

  • All datastore variable made optional apart from bucket name.

Guidance to review

Declared but empty environment variables cause empty string inputs which errors on datastore port input, should this be accounted for explicitly?

Checklist:

  • My code follows the style guidelines of this project
  • New and existing unit tests pass locally with my changes

@sophie-daintta sophie-daintta marked this pull request as ready for review February 14, 2025 10:18
Copy link
Collaborator

@wpfl-dbt wpfl-dbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use a different approach: keep those attributes as mandatory, but configure the default AWS environment variable names as custom fallback environment variable names. Pydantic documentation.

You'd do something like:

class MatchboxDatastoreSettings(BaseSettings):
    ...
    access_key_id: SecretStr = Field(..., env=["MB__DATASTORE__ACCESS_KEY_ID", "AWS_ACCESS_KEY_ID"])

You might have some trouble with how it plays with the MB__ suffix structure is the only thing.

I also don't know about how these creds are set in ECS. Would this work?

Copy link
Collaborator

@wpfl-dbt wpfl-dbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed, let's go for it.

@sophie-daintta sophie-daintta merged commit 8ccf377 into main Feb 14, 2025
6 checks passed
@sophie-daintta sophie-daintta deleted the fix/datastore-vars-optional branch February 14, 2025 15:52
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

Successfully merging this pull request may close these issues.

2 participants