This package is designed to validate the operational status of Azure Virtual Machines (VMs). It provides comprehensive diagnostics on the health of an Azure VM by checking its power state, disk health, and network interface status.
Project description
fastapi_cloud_healthcheck_aws_s3bucket
A FastAPI-based health check module for monitoring the health of AWS S3 buckets using the fastapi_cloud_healthcheck
package.
Features
- Bucket Accessibility: Verifies if the S3 bucket exists and is accessible within the given AWS region.
- Object Operations: Performs test operations such as uploading, reading, and deleting objects within the bucket to ensure correct permissions.
- Bucket Policy Validation: Checks for the presence of an S3 bucket policy and its retrieval status.
- Automated Account Detection: Automatically retrieves the AWS Account ID for the health check metadata.
- Timezone Support: Logs the last checked timestamp in Indian Standard Time (IST).
Adding Health Checks
Here is a sample FastAPI application that integrates the S3 bucket health check:
from fastapi import FastAPI
from fastapi_cloud_healthcheck import HealthCheckFactory, healthCheckRoute
from fastapi_cloud_healthcheck_aws_s3bucket import HealthCheckS3Bucket
app = FastAPI()
# Create Health Check Factory
health_check_factory = HealthCheckFactory()
# Add the S3 Bucket Health Check
health_check_factory.add(
HealthCheckS3Bucket(
bucket_name="my-sample-bucket",
region="us-west-1"
)
)
# Add the health check route to FastAPI
app.add_api_route('/health', endpoint=healthCheckRoute(factory=health_check_factory))
# Start the FastAPI server using Uvicorn
if __name__ == "__main__":
import uvicorn
uvicorn.run("main:app", port=5000)
In the above example:
- We create a health check for the S3 bucket named
my-sample-bucket
in the regionus-west-1
. - The health check endpoint
/health
will expose detailed health information about the S3 bucket.
Health Check Process
The S3 Bucket Health Check performs the following operations:
-
Bucket Accessibility: Uses the
head_bucket
boto3 API to check if the bucket exists and is accessible. -
Test Object Operations:
- Upload: Uploads a temporary object to the bucket.
- Read: Retrieves and validates the content of the test object.
- Cleanup: Deletes the test object after validation.
-
Bucket Policy Check: Ensures the bucket policy is accessible by attempting to retrieve it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fastapi_cloud_healthcheck_azure_vm-0.1.0.tar.gz
.
File metadata
- Download URL: fastapi_cloud_healthcheck_azure_vm-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.20 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a00b8e8959fbd3429df2007e8607f626d95d4099590c49ba009fa99581945df |
|
MD5 | 16088bdf90e442085118b8ff346b8143 |
|
BLAKE2b-256 | 46cecdc3dcda9741ea07bae2cd5dc62e178236e20456e1e8e9561a45b1a35727 |
File details
Details for the file fastapi_cloud_healthcheck_azure_vm-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: fastapi_cloud_healthcheck_azure_vm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.20 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 750e3aa1b35aec9a378c8d422dd43e195f126fd93bfdf48ceff710c54886e72a |
|
MD5 | 3f8e4b49435bf9be369ac88ec709b290 |
|
BLAKE2b-256 | 2377c66a53f77abaaa75e4f2d8e77aced1d6d17018a081eb3a3bf1eb603b7970 |