Skip to content

Commit 05b3399

Browse files
committed
Update README and package name
1 parent b06a238 commit 05b3399

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
A sample helper Python library for AWS AppConfig which makes rolling configuration updates out easier.
44

5-
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aws-appconfig-helper) ![PyPI version](https://badge.fury.io/py/aws-appconfig-helper.svg) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5+
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sample-helper-aws-appconfig) ![PyPI version](https://badge.fury.io/py/sample-helper-aws-appconfig.svg) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
66

77
## Features
88

99
* Configurable update interval: you can ask the library to update your configuration as often as needed, but it will only call the AWS AppConfig API at the configured interval (in seconds).
1010
* Uses best practices for updates: the API is called with the version of the last received configuration, which results in a lower charge for the API call if no new configuration has been deployed. Automatically generates a client ID if you do not specify one.
1111
* Flexible: Can automatically fetch the current configuration on initialisation, every time the configuration is read by your code, or on demand. You can override the caching interval if needed.
12-
* Handles YAML, JSON and plain text configurations, stored in any supported AppConfig store.
12+
* Handles YAML, JSON and plain text configurations, stored in any supported AppConfig store. Any other content type is returned unprocessed as the Python `bytes` type.
1313
* Supports AWS Lambda, Amazon EC2 instances and on-premises use.
1414

1515
## Installation
1616

1717
```bash
18-
pip install aws-appconfig-helper
18+
pip install sample-helper-aws-appconfig
1919
```
2020

2121
## Example
@@ -28,7 +28,7 @@ appconfig = AppConfigHelper(
2828
"MyAppConfigApp",
2929
"MyAppConfigEnvironment",
3030
"MyAppConfigProfile",
31-
30 # minimum interval between update checks
31+
45 # minimum interval between update checks
3232
)
3333

3434
app = FastAPI()
@@ -61,7 +61,7 @@ AWS AppConfig needs clients to specify a unique client ID to allow deployment st
6161

6262
The configuration from AWS AppConfig is available as the `config` property. Before accessing it, you should call `update_config()`, unless you specified fetch_on_init or fetch_on_read during initialisation. If you want to force a config fetch, even if the number of seconds specified have not yet passed, call `update_config(True)`.
6363

64-
`update_config()` returns `True` if a new version of the configuration was received. If no attempt was made to fetch it, or the configuration received was the same as current one, it returns `False`. It will raise `ValueError` if the received configuration data could not be processed (e.g. invalid JSON, unknown type). If needed, the inner exception for JSON or YAML parsing is available as `__context__` on the raised exception.
64+
`update_config()` returns `True` if a new version of the configuration was received. If no attempt was made to fetch it, or the configuration received was the same as current one, it returns `False`. It will raise `ValueError` if the received configuration data could not be processed (e.g. invalid JSON). If needed, the inner exception for JSON or YAML parsing is available as `__context__` on the raised exception.
6565

6666
To read the values in your configuration, access the `config` property. For JSON and YAML configurations, this will contain the structure of your data. For plain text configurations, this will be a simple string.
6767

@@ -88,17 +88,9 @@ you would see the following when using the library:
8888

8989
You can check which version of the configuration was last received by examining the `config_version` property. Note that this value is opaque and depends on the service being used to store the configuration data. For example, if Amazon S3 is being used, then the version will be the version identifier of the object, not an integer.
9090

91-
### Creating a Lambda layer
92-
93-
To create a Lambda layer containing the library, follow these steps:
94-
95-
1. In a temporary directory, `mkdir python`
96-
1. Install the library in the python directory: `pip install -t python aws-appconfig-helper`
97-
1. Create a zip file containing the installed library: `zip -r layer.zip python`
98-
1. Upload the zip file as a Lambda layer (e.g. via the AWS Console)
99-
100-
You can now specify the layer in your function configuration to have it included.
91+
### Use in AWS Lambda
10192

93+
AWS AppConfig is best used in Lambda by taking advantage of [Lambda Extensions](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions.html)
10294
## Security
10395

10496
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
long_description = f.read()
1212

1313
setup(
14-
name="aws_appconfig_helper",
14+
name="sample-helper-aws-appconfig",
1515
version=about["VERSION"],
16-
description="AWS AppConfig Helper",
16+
description="Sample Helper for AWS AppConfig",
1717
author="Amazon Web Services",
18+
url="https://github.com/aws-samples/sample-python-helper-aws-appconfig",
1819
packages=find_packages(),
1920
install_requires=["boto3 >= 1.10.27", "pyyaml"],
2021
python_requires=">=3.6",

0 commit comments

Comments
 (0)