AWSBaseSettings
You can use pydantic-settings-aws
to create your settings with data located both in Parameter Store and Secrets Manager.
SettingsConfigDict options
You need to inform at least the Secrets Manager name, if you are using it as a data source.
Parameter Store Settings
If you are not using secrets manager as a data source, check ParameterStoreBaseSettings.
Settings for boto3 client usage
Option | Required? | Description |
---|---|---|
ssm_client |
optional | An existing boto3 client for Parameter Store if you already have one |
secrets_client |
optional | An existing boto3 client for Secrets Manager if you already have one |
aws_region |
optional | The region your Parameter Store lives. Used only if you don't inform a client |
aws_profile |
optional | An existing aws configured profile. Used only if you don't inform a client |
aws_access_key_id |
optional | A valid Access Key Id. Used only if you don't inform a client |
aws_secret_access_key |
optional | A valid Secret Access Key Id. Used only if you don't inform a client |
aws_session_token |
optional | A valid Session Token. Used only if you don't inform a client |
Define which service you field is using with Annotated
When you are using AWSBaseSettings
you need to add at least a dict
with the AWS service you are using.
Single Secrets, multiple parameter store
At the moment you can only have one Secrets Manager source, but multiple parameter store.
Settings Order
First, AWSBaseSettings
will try to load your data from either Parameter Store or Secrets Manager.
If it can't find a value, AWSBaseSettings
will still try to get your information from Environment, dotenv files and secret files.
- AWS SSM and Secrets Manager
- Environment variables
- dotenv files
- secret files