Saravanan666/pypi-org huggingface dataset:
Package: aws-sessions-switcher
aws-sessions-switcher: Manage multiple aws sessions and switch between them seamlesslyWorking with multiple AWS Accounts from the command like can sometimes be difficult if you have to switch between
multiple projects or between environments of the same project.aws-sessions-switcheris a tool I developed to help myself to make switching between accounts / roles across projects easier.
I don't see why such a tool cannot be of help to someone like me and hence decided to make it available to everyone who
might be interested.I hope it helps someone someday!If you have any suggestions or want to contribute to this tool, you are very welcome !PS: This is a work in progress, and there is definitely a LOT to improve / optimize.Installation:pipinstallaws-sessions-switcherBasic setupSetup 1: Configure a projectaws-sessions-switcherconfigureType the details about your AWS Environment, the role you would like to assume, project name etc...
You can configure additional projects by executingaws-sessions-switcher projects addcommandSetup 2: Update your AWS Credentials fileThe previous command will tell you under what profile name your AWS credentials must be placed, in the default~/.aws/credentialsfileSetup 3: Now see all the assumptions you can makeRunningaws-sessions-switcheroraws-sessions-switcher -lwill tell you how to assume the different roles that you have configured using this tool!Some Example commandscommanddescriptionaws-sessions-switcher configureSets up the toolaws-sessions-switcher resetDeletes the configuration file created by this toolaws-sessions-switcher -lList all the assumptions that can be madeaws-sessions-switcher projectsLists all the configured projectsaws-sessions-switcher environmentsLists all environments for all projectsaws-sessions-switcher environments -n ABCDLists only the environments configured for the project named ABCDaws-sessions-switcher sessionsLists all the sessions you have created using this toolaws-sessions-switcher sessions switchGives the ability to switch between multiple sessionsaws-sessions-switcher projects addAdd an additional projectaws-sessions-switcher projects delete -n ABCDDeletes the configuration of the project named ABCDaws-sessions-switcher environments add -n ABCDTODO:aws-sessions-switcher environment delete -n ABCD -e devTODO:aws-sessions-switcher my\_project dev adminAttempts to assume 'admin' role on the 'dev' environment of the project named 'my_project'Sample OutputsConfiguring your first projectAll the assumptions you can makeAssuming a role from one of the configured projectsAll the active sessionsSwitching between active sessions
Package: aws-sfn-builder
AWS Step Functions State Machine builder.The primary motivation for this was the amount of boilerplate (Next,End) required to compose a valid
state machine definition, but soon one got carried away.Python 3.6+ only.Installationpipinstallaws-sfn-builderGenerate State Machine Definition from Simple Descriptionfromaws_sfn_builderimportMachineMachine.parse(["a",[["b-10","b-11"],["b-20"],],"c",]).to_json()This will generate:{"StartAt":"a","States":{"a":{"Type":"Task","Next":"d3d52323-137d-4228-9956-d3b77cc43a92"},"d3d52323-137d-4228-9956-d3b77cc43a92":{"Type":"Parallel","Next":"c","Branches":[{"StartAt":"b-10","States":{"b-10":{"Type":"Task","Next":"b-11"},"b-11":{"Type":"Task","End":true}}},{"StartAt":"b-20","States":{"b-20":{"Type":"Task","End":true}}}]},"c":{"Type":"Task","End":true}}}Parse Existing State Machine Definition# TODO load state_machine_json_dictstate_machine=Machine.parse(state_machine_json_dict)Compile State Machine# TODO initialise state_machinestate_machine.compile()Test Your State MachineWork in progress.# TODO initialise state_machinerunner=Runner()@runner.resource_provider("arn:aws:lambda:us-east-1:123456789012:function:Foo")deffoo(input):return"foo-result"final_state,output=runner.run(state_machine)
Package: aws-sg-backup
AWS Security Group BackupAWS Security Group Backup is a tiny library that allows to backup and restore AWS security groups. It may be useful
if you want to delete security groups that are not used, but you want to have a backup in case you need to restore them.If security group references other security groups, then they will be also backed up.
On restore, if some referenced security group is not found, then it will be restored.Library doesn't restore security group IDs, so you need to update your environment to use new security group IDs.Installationpip install aws-sg-backupRequired IAM permissionsTo use this library, you need to have the following IAM permissions:ec2:DescribeSecurityGroupsec2:CreateSecurityGroupec2:AuthorizeSecurityGroupIngressec2:AuthorizeSecurityGroupEgressec2:RevokeSecurityGroupEgresss3:PutObject`s3:GetObjectUsageLibrary provides two functions:backup_security_groupandrestore_security_group. Both functions take the following arguments:security_group_id- ID of the security group to backup or restorebackup_path- local file path or S3 bucket path (e.g. bucket_name/path/to/dir). Depends onbackup_targetargument.backup_target- backup target. Can be eitherBackup.S3orBackup.LOCAL. IfBackup.S3is specified,
backup will be created in S3 bucket. IfBackup.LOCALis specified, backup will be stored in the local file system.
Package: awssig
This library provides signature verification for requests made to an AWS
service. Typically, this is used to provide mock interfaces for AWS services
or to rewrite AWS requests through a proxy host.The current source tree can be found onGitHub.Documentation is available atdocs.ionosphere.io.Currently onlySigV4andSigV4S3(the S3 variant of SigV4) are supported.Example Usage>>> import awssig
>>> access_key = "AKIDEXAMPLE"
>>> secret_key = "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY"
>>> key_mapping = { access_key: secret_key }
>>> v = awssig.AWSSigV4Verifier(
...     request_method="GET",
...     uri_path="/",
...     query_string="a=foo&b=foo",
...     headers={
...         "date": ["Mon, 09 Sep 2011 23:36:00 GMT"],
...         "host": ["host.foo.com"],
...         "authorization": [(
...             "AWS4-HMAC-SHA256 "
...             "Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, "
...             "SignedHeaders=date;host, "
...             "Signature=0dc122f3b28b831ab48ba65cb47300de53fbe91b577fe113edac383730254a3b")],
...    },
...    body=b"",
...    region="us-east-1",
...    service="host",
...    key_mapping=key_mapping,
...    timestamp_mismatch=None)
>>> try:
...     v.verify()
...     print("ok")
... except awssig.InvalidSignatureError as e:
...     print("error: %s" % e)
ok
>>> v = awssig.AWSSigV4S3Verifier(
...     request_method="POST",
...     uri_path="/a//b/../c",
...     headers={
...         "date": ["Mon, 09 Sep 2011 23:36:00 GMT"],
...         "host": ["host.foo.com"],
...         "authorization": [(
...             "AWS4-HMAC-SHA256 "
...             "Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, "
...             "SignedHeaders=date;host, "
...             "Signature=6b8af5a1e94a59c511e47267ab0cbfa1783dc42861ab7f09e0dba62680da8b28")],
...         "x-amz-content-sha256": ["UNSIGNED-PAYLOAD"],
...    },
...    body=b"Hello world",
...    region="us-east-1",
...    service="host",
...    key_mapping=key_mapping,
...    timestamp_mismatch=None)
>>> try:
...     v.verify()
...     print("ok")
... except awssig.InvalidSignatureError as e:
...     print("error: %s" % e)
ok
Package: aws-signv4-apigateway
# aws-signv4-apigatewaySign your request to invoke Amazon API Gateway REST API Endpoint with Signature Version 4.Current limitation of this tool:
* Support receiving AWS credentials via OS environment variables only.
* Invoke Amazon API Gateway REST API inap-southeast-1region only.## Requirements[Python 3.X.X](https://www.python.org/downloads/)[Virtualenv](https://virtualenv.pypa.io/en/latest/) (Recommended)## InstallationThere are multiple ways to install this tool. This section will explain to you the options available:### Using install.shThe easiest way is to use [install.sh](install.sh). Just download [install.sh](install.sh) to your local machine, add executable permission, and run it!`bash $ curl-o~/Downloads/install-aws-signv4-apigatewayhttps://raw.githubusercontent.com/rafikurnia/aws-signv4-apigateway/master/install.sh$ chmod +x~/Downloads/install-aws-signv4-apigateway$~/Downloads/install-aws-signv4-apigateway`[install.sh](install.sh) will:
1. Find your Python3
2. Find your Virtualenv
3. Create a new directory at ~/.aws-signv4-apigateway
4. Create a new virtual environment at the directory
5. Install this tool to the virtual environment
6. Add ~/.aws-signv4-apigateway/bin to your PATH by modifying ~/.bashrc file### Using pipYou can usepipandvirtualenv. Create a new virtual environment, then activate the environment and use this command to install:`bash $ pip installaws-signv4-apigateway`Or you can do it withoutvirtualenv.sudomost likely be required:`bash $ sudo pip installaws-signv4-apigateway`## Getting StartedBefore using this tool, make sure you set AWS Credentials on your OS Environment Variables:
* AWS_ACCESS_KEY_ID
* AWS_SECRET_ACCESS_KEY
* AWS_SESSION_TOKEN (if you are using temporary credentials such as IAM Role)`bash $ export AWS_ACCESS_KEY_ID=your_access_key_id $ export AWS_SECRET_ACCESS_KEY=your_secret_access_key `After that, you can use this tool:`bash $aws-signv4-apigateway<rest-api-endpoint>`Or you can use it with tools to assume role like [awsudo](https://github.com/makethunder/awsudo):`bash $ awsudo-uPROFILE_NAME--aws-signv4-apigateway<rest-api-endpoint>`## Author[Rafi Kurnia Putra](https://github.com/rafikurnia)## LicenseApache 2 Licensed. See [LICENSE](LICENSE) for full details.
Package: aws-signv4-mqtt
aws_signv4_mqttFunctions to generate aws signature v4 to use with AWS IOT MQTTI created this because I couldn't find a library to easily generate signed urls that you can use with amazon's MQTT for IOT in python.
All the libraries I could find would be to generate headers for HTTP requests and it wouldn't work with wss for MQTT.Inspired by:https://gist.github.com/prestomation/24b959e51250a8723b9a5a4f70dcae08https://gist.github.com/kn9ts/4b5a9942b6afbfc2534f2f14c87b9b54Installingpipinstallaws-signv4-mqttHow to use useThere are two interfaces:aws_signv4_mqtt.generate_signv4_mqtt(iot_host,iot_region,access_key,secret_key,session_token=None)Basic interface to created the signed url.aws_signv4_mqtt.generate_signv4_mqtt_boto(iot_host,iot_region)Gets the credentials from your environment or iam role internally using boto3.Examplesimportaws_signv4_mqttprint(aws_signv4_mqtt.generate_signv4_mqtt('<your_iot>.iot.us-east-1.amazonaws.com','us-east-1','<aws_access_key>','<aws_secret>'))Prints something like:wss://<your_iot>.iot.us-east-1.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=%3Caws_access_key%3E%2F20190216%2Fus-east-1%2Fiotdevicegateway%2Faws4_request&X-Amz-Date=20190216T115653Z&X-Amz-SignedHeaders=host&X-Amz-Signature=92bfc2b5a77489c5786a820044bf6c8ccb3c2f9b40c1d6a5f016b4d9c8662a5eTesting your urlAfter you generate your url using AWS credentials with sufficient AWS IOT permissions, you can test it with any MQTT library.For instance, you could execute the javascript code below:varmqtt=require('mqtt')url='<your_signed_url>'port=443topic='<your_topic>'i=0varclient=mqtt.connect(url,{connectTimeout:5*1000,port:port,})client.on('connect',function(){client.subscribe(topic,function(err){if(!err){client.publish(topic,'Hello mqtt')}})})client.on('message',function(topic,message){console.log(message.toString())i=i+1client.publish(topic,'Hello mqtt '+String(i))})
Package: aws-simple-pipeline
AWS simple pipeline package is implemented for deploying a Continuous Deployment or Delivery system (CD) by AWS CodePipeline service.You can use this simple pipeline for deploying your personal solution in 2 environments: staging and production.It is part of theeducational repositoriesto learn how to write stardard code and common uses of the TDD, CI and CD.PrerequisitesYou have to install theAWS Cloud Development Kit(AWS CDK) for deploying the AWS simple pipeline:npminstall-gaws-cdk# for installing AWS CDKcdk--help# for printing its commandsAnd you need an AWS account, in this repository calledyour-account.InstallationThe package is not self-consistent. So you have to download the package by github and to install the requirements before to deploy on AWS:gitclonehttps://github.com/bilardi/aws-simple-pipelinecdaws-simple-pipeline/pip3install--upgrade-rrequirements.txtexportAWS_PROFILE=your-accountcdkdeployOr if you want to use this package into your code, you can install by python3-pip:pip3installaws_simple_pipelinepython3>>>importaws_simple_pipeline>>>help(aws_simple_pipeline)Read the documentation onreadthedocsforUsageDevelopmentChange LogSeeCHANGELOG.mdfor details.LicenseThis package is released under the MIT license.  SeeLICENSEfor details.
Package: awsslack
awsslackBasic view of how it would look in Slack (reality is much better with live progress-bar)my-slack-bot APP  12:02 AM
    ████████████████████ 100.0%
    00:02:12 - [Build: <project-name> BuildStatus=IN_PROGRESS!]
    00:02:17 - [Build's Phase: SUBMITTED PhaseStatus=SUCCEEDED]
    00:02:18 - [Build's Phase: QUEUED PhaseStatus=SUCCEEDED]
    00:02:48 - [Build's Phase: PROVISIONING PhaseStatus=SUCCEEDED]
    00:02:53 - [Build's Phase: DOWNLOAD_SOURCE PhaseStatus=SUCCEEDED]
    00:03:14 - [Build's Phase: INSTALL PhaseStatus=SUCCEEDED]
    00:03:19 - [Build's Phase: PRE_BUILD PhaseStatus=SUCCEEDED]
    00:05:00 - [Build's Phase: BUILD PhaseStatus=SUCCEEDED]
    00:05:31 - [Build's Phase: POST_BUILD PhaseStatus=SUCCEEDED]
    00:05:36 - [Build: <project-name> BuildStatus=SUCCEEDED!] (edited)Installation$pipinstallawsslackUsageConfigConfig file path is:~/.aws/.awsslack-config.yaml$awsslackconfig--auto-generateSee help:awsslack config --helpCodeBuildTrigger Codebuild project fordevenvironment:$awsslackcodebuild-P<project-name>-EdevSimilarly, forprodenvironment:$awsslackcodebuild-P<project-name>-EprodSee help:awsslack codebuild --helpCodeDeployTrigger CodeDeploy project fordevenvironment:$awsslackcodedeploy-P<project-name>-EdevSimilarly, forprodenvironment:$awsslackcodedeploy-P<project-name>-EprodNote: If--commitis not provided, will fetch latest Commit ID from--branch.See help:awsslack codedeploy --helpSlack AppTo create a new Slack app:Go tohttps://api.slack.com/apps?new_app=1click 'From scratch'enter 'App Name': 'awsslack'select workspaceclick 'Create App'click 'OAuth and Permissions'under scopes, 'Bot Token Scopes', click 'Add an OAuth Scope'add 'chat:write' scopeunder scopes, 'User Token Scopes', click 'Add an OAuth Scope'under 'OAuth Tokens for Your Workspace', click 'Install to Workspace'click 'Allow'copy 'Bot User OAuth Token'update the token in config file at path~/.aws/.awsslack-config.yamlAdd apps to your Slack workspaceGood to go. now 'awsslack' can push updates to slack
Package: aws-sm
aws-smA Python wrapper aroundAWS Secrets Managerusing Boto3.InstallationInstalling from PyPI is as easy as doing:$pipinstallaws-smUsagefromaws_smimportSecretsManagerAWS_ACCESS_KEY_ID=***************AWS_SECRET_ACCESS_KEY=***************secretsmanager=SecretsManager('us-east-1',AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)secrets=secretsmanager.get_secret_values('tutorials/MyFristTutorialSecret')USER_NAME=secretsmanager.get_secret_value('USER_NAME',secrets)PASSWORD=secretsmanager.get_secret_value('PASSWORD',secrets)This is sample code using aws-sm to getUSER_NAMEandPASSWORDfromtutorials/MyFristTutorialSecret.USER_NAMEandPASSWORDareSecret value.tutorials/MyFristTutorialSecretisSecret name.This is AWS Console of Secrets Manager.AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYare unnecessary when attaching the appropriate IAM Role. The default policy isSecretsManagerReadWrite.Set Up LoacallyMake sure you haveDocker Compose.$docker-composeupRun test$docker-composeexecappbash
root@d5d52d6765d9:/app#py.test-v
Package: aws-sms-service
AWS_SMS_ServiceIntroductionGetting StartedExampleContributorsLicenseIntroductionhis library is to help send sms using AWS sms serviceGetting StartedIn order to install, open the command prompt and type ✌️:pip install aws_sms_serviceExampleThe following directoryExampleshows a multiple example about how to use webhook_manager modulesContributorsThis project exists thanks to all the people who contribute. [Contribute].""LicenseThis library is licensed under the MIT License - see theLICENSE.mdfile for details.
Package: aws-snap
aws-snapCreate snapshots of AWS EC2 instance volumes.installationpip install aws-snapthis should install the CLI toolaws-snapandsnapitthe two are interchangableusagesnapit -h# show help and exitsnapit i-0d2bd932gf7de4c95# create snapshot of instance with ID i-0d2bd932gf7de4c95snapit i-0d2bd932gf7de4c95 i-67dfg98s0ijj6y2j0# snapshots of multiple instancessnapit i-0d2bd932gf7de4c95 -r us-west-1# specify a region other than the one set in your profilesnapit i-0d2bd932gf7de4c95 -s# stop the instance before snapping
Package: aws-snappy
SnappySnappy is a Python library that facilitates taking snapshots on EBS.There are two ways to take snapshots, you can either provide avolume idor an ec2instance id/instance ipv4/instance name. If you provide an ec2 detail, it will take a snapshot of the root volume of the instance.Getting StartedAssuming that you have Python and virtualenv installed, set up your environment and install the required dependencies using pip:pip install aws-snappyUsing SnappyAfter installing snappy, you need to import the main Snappy object and instantiate it to create a connection to AWS:from snappy.snappy import Snappy

snappy = Snappy(values)Here,instancesis your list of instances to take snapshots of. i.e. ['10.10.10.10', 'my_instance_name']
Instance can be indentified both by their private IP address or the instance name in the same list.
Snappy will break them apart and search them respectively.Available function for Snappy Objecttake_snapshots(tags_specifications)This function will take a snapshot of the root volume of the specified instances and return the output in a list in the following format:Parameterstags_specifications<optional>: A list of dictionaries containing the tags to be applied to the snapshots in the following format:[{
    "Key": "",
    "Value": ""
}]Output[
    {
        "SnapshotID": "",
        "InstanceName": "",
        "VolumeID": "",
    },
    .
    .
    .
]Running TestsYou can run the tests by following the steps below:Clone or download the project to a folder on your computer.Connect to AWS using AWS CLIRun the tests using the command./run_test.shLicenseCopyright Mervin Hemaraju
Package: aws-sns-message-validator
AWS SNS Message ValidatorPyPI:https://pypi.org/project/aws-sns-message-validator/MotivationAn HTTP endpoint for AWS SNS needs to validate the received messages before processing them which involves some non-trivial logic, especiallysignature verification. In terms of implementation, AWS does not offer any help with SNS message validation in their SDK for Python (issue) nor does it provide example code in the documentation (example code is only availablein Java). Therefore Python developers would need to invent their own wheels.To solve this problem, this repository offers an SNS message validator which is implemented according to the guide onthe official AWS documentation, and offersexample codeof how to use it to implement an HTTP endpoint for SNS.PrerequisitePython >= 3.6Installpip install aws-sns-message-validatorUsageRefer to the example codeflask_example.pyto see how to use this package in your SNS http endpoint. In order to quickly try out the example code, follow the steps below:Make sure you have Python>=3.6 installed. (Create a virtual environment if you want to.)Checkout this repo and install dev dependencies bypython3 -m pip install -r requirements.txtRunFLASK_APP=flask_example.py flask run --port=5000to start an http server.Usengrokto expose the local server to the public internet (./ngrok http -bind-tls=true localhost:5000). Now you should get a public endpoint (https://xxxxxxxx.ngrok.io) that can be set as a subscriber of an SNS topic.IssuesFeel free to create an issue if you found a bug or have a feature request.
Package: aws-sns-slack-subscriber
AWS SNS Slack SubscriberA library that creates a slack subscriber to your aws sns topic.RemarksThe project is written byLaimonas Sutkusand is owned byiDenfy. This is an open source
library intended to be used by anyone.iDenfyaims
to share its knowledge and educate market for better and more secure IT infrastructure.Related technologyThis project utilizes the following technology:AWS(Amazon Web Services).AWS CDK(Amazon Web Services Cloud Development Kit).AWS Lambda.AWS Sns.Slack.InstallThe project is built and uploaded to PyPi. Install it by using pip.pipinstallaws_sns_slack_subscriberOr directly install it through source../build.sh-icDescriptionWhen you have SNS Topics, you may subscribe to them with various ways. For example,
email subscription will send an email to a desired email address when a notification
is pushed to a SNS Topic. Most of the time email subscription is not ideal as it may
clutter your email box. Hence, there are other ways to subscribe to a SNS Topic. We
think the most convenient way to subscribe to SNS Topic is a Lambda Function integration
which sends callbacks to your specified Slack channel. This library project is about that.
It creates a "Slack subscription" with a help of Lambda.ExamplesCreate sns slack subscriber as any other lambda function:fromaws_sns_slack_subscriber.slack_subscriberimportSlackSubscriberlambda_function_slack_subscirber=SlackSubscriber(...)Release history2.2.0Force update 1.60.0 and add upper bound of 2.0.0.2.1.0URL and AWS CDK updates.1.1.1Completely refactor functionality. Add an explicit pipeline handler.
Rewrite everything on python.1.1.1Add js file to manifest.1.1.0Add ability to specify slack channel.1.0.0Initial commit.
Package: awsso
AWS CMD TOOLSetupaws cli install version 2.0+https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.htmlkubectl installhttps://kubernetes.io/docs/tasks/tools/terraform installhttps://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-clihelm installbrew install kubernetes-helmcopy or create symbol link of awstool to /usr/local/bin/awstooladd this line to~/.bashrceval "$(register-python-argcomplete awsso)"Then you use awsso to login aws, switch aws account, login ec2 instance, search or update secrets manager