Parameter Store
When working with ParameterStoreBaseSettings
, you can work with parameters living in the same account and region, or with multiple accounts / regions.
Simplest way
The simplest way you can work with ParameterStoreBaseSettings
is to leaving it all to boto3 and create your fields with the same name as your parameters:
In this case, pydantic-settings-aws
will leave to boto3 to try to identify how he can connect to AWS, and then will look for the parameters with name mongodb_host
and mongodb_db_name
.
We don't shadow pydantic and boto3 errors
In the above case, if for some reason mongodb_host is None
, it will raise a pydantic's ValidationError
.
Specifying the name of the parameter
For almost all cases, your parameter's name will be different from your field name.
To deal with these cases, you must use Annotated
and add the name of your parameter:
Multiple accounts and regions
If you need to work with multiple accounts or regions, you can use Annotated
and specify a dict
: