{"id":20251593,"url":"https://github.com/jawehrung/aws_helpers","last_synced_at":"2026-01-27T10:08:28.303Z","repository":{"id":261318474,"uuid":"883949967","full_name":"jawehrung/aws_helpers","owner":"jawehrung","description":"Simple Aws Helpers ","archived":false,"fork":false,"pushed_at":"2024-11-07T21:38:11.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-22T08:51:19.554Z","etag":null,"topics":["aws","aws-apigateway","aws-autoscaling","aws-cloudformation","aws-cloudwatch","aws-dynamodb","aws-ec2","aws-iam","aws-lambda","aws-rds","aws-route53","aws-s3","aws-secrets-manager","aws-snapshot","aws-sns","aws-sqs","aws-step-functions","aws-vpc","boto3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jawehrung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-05T21:35:35.000Z","updated_at":"2024-11-12T06:09:46.000Z","dependencies_parsed_at":"2024-11-14T11:45:29.610Z","dependency_job_id":null,"html_url":"https://github.com/jawehrung/aws_helpers","commit_stats":null,"previous_names":["jawehrung/aws_helpers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jawehrung/aws_helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawehrung%2Faws_helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawehrung%2Faws_helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawehrung%2Faws_helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawehrung%2Faws_helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jawehrung","download_url":"https://codeload.github.com/jawehrung/aws_helpers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawehrung%2Faws_helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28811498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-apigateway","aws-autoscaling","aws-cloudformation","aws-cloudwatch","aws-dynamodb","aws-ec2","aws-iam","aws-lambda","aws-rds","aws-route53","aws-s3","aws-secrets-manager","aws-snapshot","aws-sns","aws-sqs","aws-step-functions","aws-vpc","boto3"],"created_at":"2024-11-14T10:11:05.348Z","updated_at":"2026-01-27T10:08:28.299Z","avatar_url":"https://github.com/jawehrung.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple AWS Helpers \r\n![Language Python](https://img.shields.io/badge/%20Language-python-blue.svg)\r\n\r\nCe projet contient un ensemble de fonctions utilitaires pour interagir avec divers services AWS en utilisant Boto3. \r\n\r\nLes fonctions sont organisées par service.\r\n\r\n## Contenu\r\n\r\n- [Installation](#installation)\r\n- [Utilisation](#utilisation)\r\n- [Fonctionnalités](#fonctionnalités)\r\n  - [Gestion Générique AWS (Boto3 Client \u0026 Resource)](#gestion-générique-aws-boto3-client--resource)\r\n  - [Gestion des EC2 Instances](#gestion-des-ec2-instances)\r\n  - [Gestion des Lambdas](#gestion-des-lambdas)\r\n  - [Gestion de CloudFormation](#gestion-de-cloudformation)\r\n  - [Gestion de DynamoDB](#gestion-de-dynamodb)\r\n  - [Gestion de CloudWatch Logs](#gestion-de-cloudwatch-logs)\r\n  - [Gestion des Groupes Auto Scaling](#gestion-des-groupes-auto-scaling)\r\n  - [Gestion des Snapshots EBS](#gestion-des-snapshots-ebs)\r\n  - [Gestion des RDS Instances](#gestion-des-rds-instances)\r\n  - [Gestion des VPC](#gestion-des-vpc)\r\n  - [Gestion des Rôles IAM](#gestion-des-rôles-iam)\r\n  - [Gestion des SNS](#gestion-des-sns)\r\n  - [Gestion des SQS](#gestion-des-sqs)\r\n  - [Gestion des CloudWatch Alarms](#gestion-des-cloudwatch-alarms)\r\n  - [Gestion des Route 53](#gestion-des-route-53)\r\n  - [Gestion des API Gateway](#gestion-des-api-gateway)\r\n  - [Gestion des Step Functions](#gestion-des-step-functions)\r\n  - [Gestion de S3](#gestion-de-s3)\r\n  - [Gestion des Secrets Manager](#gestion-des-secrets-manager)\r\n\r\n    \r\n## Installation\r\n\r\nPour utiliser ces fonctions, vous devez installer Boto3. Vous pouvez l'installer via pip :\r\n\r\n```sh\r\npip install boto3\r\n```\r\n\r\n## Utilisation\r\n\r\nImportez les fonctions nécessaires dans votre script Python :\r\n\r\n```python\r\nfrom aws_helpers import create_session, get_boto3_client, start_ec2_instance\r\n```\r\n\r\n## Fonctionnalités\r\n\r\n### Gestion Générique AWS (Boto3 Client \u0026 Resource)\r\n\r\n- `create_session(profile_name=None)`: Crée une session boto3 avec un profil AWS donné.\r\n- `get_boto3_client(service_name, region_name=REGION)`: Initialise et retourne un client boto3 pour un service AWS donné.\r\n- `get_boto3_resource(service_name, region_name=REGION)`: Initialise et retourne une ressource boto3 pour un service AWS donné.\r\n- `safe_boto3_call(client_method, *args, **kwargs)`: Enveloppe un appel boto3 et gère les erreurs de manière propre.\r\n\r\n### Gestion des EC2 Instances\r\n\r\n- `start_ec2_instance(instance_id)`: Démarre une instance EC2 donnée.\r\n- `stop_ec2_instance(instance_id)`: Arrête une instance EC2 donnée.\r\n- `get_ec2_instance_status(instance_id)`: Retourne l'état d'une instance EC2 donnée.\r\n\r\n### Gestion des Lambdas\r\n\r\n- `deploy_lambda(lambda_name, zip_file_path, role_arn, handler, runtime='python3.8')`: Déploie une fonction Lambda avec un fichier ZIP.\r\n- `invoke_lambda(lambda_name, payload)`: Invoque une fonction Lambda avec un payload.\r\n- `add_lambda_permission(lambda_name, statement_id, action, principal, source_arn)`: Ajoute une permission à une fonction Lambda.\r\n- `delete_lambda(lambda_name)`: Supprime une fonction Lambda.\r\n\r\n### Gestion de CloudFormation\r\n\r\n- `deploy_cloudformation_stack(stack_name, template_body, parameters)`: Déploie un stack CloudFormation.\r\n- `get_cloudformation_stack_status(stack_name)`: Retourne le statut d'un stack CloudFormation donné.\r\n\r\n### Gestion de DynamoDB\r\n\r\n- `get_dynamodb_item(table_name, key)`: Récupère un élément d'une table DynamoDB.\r\n- `put_dynamodb_item(table_name, item)`: Ajoute ou met à jour un élément dans une table DynamoDB.\r\n- `delete_dynamodb_item(table_name, key)`: Supprime un élément d'une table DynamoDB.\r\n- `update_dynamodb_item(table_name, key, attribute_updates)`: Met à jour un élément d'une table DynamoDB.\r\n- `list_dynamodb_table(table_name)`: Scanne une table DynamoDB et retourne tous les éléments.\r\n\r\n### Gestion de CloudWatch Logs\r\n\r\n- `log_to_cloudwatch(log_group, log_stream, message)`: Envoie un log à un groupe et un flux de logs CloudWatch.\r\n\r\n### Gestion des Groupes Auto Scaling\r\n\r\n- `list_auto_scaling_groups()`: Liste tous les groupes Auto Scaling.\r\n- `update_auto_scaling_group_capacity(group_name, min_size, max_size, desired_capacity)`: Met à jour la capacité minimale, maximale et souhaitée d'un groupe Auto Scaling.\r\n- `scale_auto_scaling_group(group_name, desired_capacity)`: Ajuste manuellement la capacité souhaitée d'un groupe Auto Scaling.\r\n- `get_auto_scaling_group_instances(group_name)`: Récupère les instances associées à un groupe Auto Scaling.\r\n\r\n### Gestion des Snapshots EBS\r\n\r\n- `create_ebs_snapshot(volume_id, description='Snapshot created via boto3')`: Crée un snapshot d'un volume EBS donné.\r\n- `list_ebs_snapshots(volume_id=None, owner_id='self')`: Liste tous les snapshots pour un volume EBS donné ou pour tous les volumes de l'utilisateur.\r\n- `delete_ebs_snapshot(snapshot_id)`: Supprime un snapshot EBS donné.\r\n- `create_volume_from_snapshot(snapshot_id, availability_zone, volume_type='gp2', size=None)`: Crée un nouveau volume EBS à partir d'un snapshot.\r\n\r\n### Gestion des RDS Instances\r\n\r\n- `create_rds_instance(db_instance_identifier, db_instance_class, engine, master_username, master_user_password, db_name)`: Crée une instance RDS avec les paramètres spécifiés.\r\n\r\n### Gestion des VPC\r\n\r\n- `create_vpc(cidr_block)`: Crée un VPC avec un bloc CIDR spécifié.\r\n- `create_subnet(vpc_id, cidr_block, availability_zone)`: Crée un sous-réseau dans un VPC spécifié.\r\n- `create_internet_gateway(vpc_id)`: Crée une passerelle Internet pour un VPC donné.\r\n\r\n### Gestion des Rôles IAM\r\n\r\n- `create_iam_role(role_name, assume_role_policy_document, description='')`: Crée un rôle IAM avec une politique d'approbation spécifiée.\r\n- `delete_iam_role(role_name)`: Supprime un rôle IAM.\r\n- `attach_policy_to_role(role_name, policy_arn)`: Attache une politique gérée à un rôle IAM.\r\n- `create_policy(policy_name, policy_document, description='')`: Crée une politique gérée IAM avec un document de politique spécifié.\r\n- `delete_policy(policy_arn)`: Supprime une politique gérée IAM.\r\n\r\n### Gestion des SNS\r\n\r\n- `create_sns_topic(topic_name)`: Crée un sujet SNS.\r\n- `subscribe_email_to_topic(topic_arn, email_address)`: Abonne une adresse e-mail à un sujet SNS.\r\n- `publish_to_sns_topic(topic_arn, message, subject=None)`: Publie un message sur un sujet SNS.\r\n\r\n### Gestion des SQS\r\n\r\n- `create_sqs_queue(queue_name)`: Crée une file d'attente SQS.\r\n- `send_message_to_sqs(queue_url, message_body)`: Envoie un message à une file d'attente SQS.\r\n- `receive_messages_from_sqs(queue_url, max_number_of_messages=1)`: Reçoit des messages d'une file d'attente SQS.\r\n- `delete_message_from_sqs(queue_url, receipt_handle)`: Supprime un message d'une file d'attente SQS.\r\n\r\n### Gestion des CloudWatch Alarms\r\n\r\n- `create_cloudwatch_alarm(alarm_name, metric_name, namespace, statistic, period, evaluation_periods, threshold, comparison_operator, actions_enabled=True, alarm_actions=None)`: Crée une alarme CloudWatch.\r\n\r\n### Gestion des Route 53\r\n\r\n- `create_route53_hosted_zone(domain_name)`: Crée une zone hébergée Route 53.\r\n- `create_route53_record(hosted_zone_id, record_name, record_type, record_value)`: Crée un enregistrement DNS dans une zone hébergée Route 53.\r\n- `get_route53_hosted_zone_id(domain_name)`: Récupère l'ID d'une zone hébergée Route 53.\r\n- `delete_route53_hosted_zone(hosted_zone_id)`: Supprime une zone hébergée Route 53.\r\n\r\n### Gestion des API Gateway\r\n\r\n- `create_api_gateway(api_name, api_key_source='HEADER', description='')`: Crée une API Gateway.\r\n- `create_api_gateway_resource(api_id, parent_id, path_part)`: Crée une ressource pour une API Gateway.\r\n- `create_api_gateway_method_response(api_id, resource_id, http_method, status_code)`: Crée une réponse de méthode pour une API Gateway.\r\n- `create_api_gateway_method(api_id, resource_id, http_method, authorization_type='NONE')`: Crée une méthode HTTP pour une ressource d'une API Gateway.\r\n- `create_api_gateway_integration(api_id, resource_id, http_method, integration_type, uri, integration_http_method='POST')`: Crée une intégration pour une méthode d'une API Gateway.\r\n- `create_api_gateway_integration_response(api_id, resource_id, http_method, status_code, selection_pattern)`: Crée une réponse d'intégration pour une API Gateway.\r\n- `create_api_gateway_deployment(api_id, stage_name)`: Déploie une API Gateway.\r\n- `create_api_gateway_usage_plan(usage_plan_name, api_stages, throttle_settings=None, quota_settings=None)`: Crée un plan d'utilisation API Gateway.\r\n- `create_api_gateway_api_key(api_key_name, description='')`: Crée une clé API Gateway.\r\n- `create_api_gateway_usage_plan_key(usage_plan_id, key_id, key_type)`: Ajoute une clé à un plan d'utilisation API Gateway.\r\n\r\n### Gestion des Step Functions\r\n\r\n- `create_step_function(state_machine_name, definition)`: Crée une machine à états Step Functions.\r\n- `start_step_function_execution(state_machine_arn, input)`: Démarre l'exécution d'une machine à états Step Functions.\r\n- `get_step_function_execution_status(execution_arn)`: Récupère le statut d'une exécution de machine à états Step Functions.\r\n\r\n### Gestion de S3\r\n\r\n- `upload_file_to_s3(bucket_name, file_path, object_name=None)`: Téléverse un fichier vers un bucket S3.\r\n- `download_file_from_s3(bucket_name, object_name, file_path)`: Télécharge un fichier depuis un bucket S3.\r\n- `list_s3_bucket_objects(bucket_name, prefix='')`: Liste les objets dans un bucket S3, optionnellement filtré par un préfixe.\r\n- `delete_s3_bucket_object(bucket_name, object_name)`: Supprime un objet d'un bucket S3.\r\n- `create_s3_bucket(bucket_name)`: Crée un bucket S3.\r\n- `delete_s3_bucket(bucket_name)`: Supprime un bucket S3.\r\n\r\n### Gestion des Secrets Manager\r\n\r\n- `get_secret(secret_name)`: Récupère un secret depuis AWS Secrets Manager.\r\n- `put_secret(secret_name, secret_value)`: Crée ou met à jour un secret dans AWS Secrets Manager.\r\n- `delete_secret(secret_name)`: Supprime un secret d'AWS Secrets Manager.\r\n\r\n## Liens vers la documentation AWS\r\n\r\n- [Documentation Boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html)\r\n- [AWS EC2 API Reference](https://docs.aws.amazon.com/ec2/index.html)\r\n- [AWS Lambda API Reference](https://docs.aws.amazon.com/lambda/index.html)\r\n- [AWS CloudFormation API Reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/Welcome.html)\r\n- [AWS DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/Welcome.html)\r\n\r\n \r\n \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjawehrung%2Faws_helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjawehrung%2Faws_helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjawehrung%2Faws_helpers/lists"}