Saravanan666/pypi-org huggingface dataset:
Package: ec2instance
ec2instanceec2instance is the "docker run -it" of AWS EC2. It is a single command that very quickly launches an EC2 instance from
the CLI and takes care of the legwork to make it immediately usable for you.DemoInstallpip install ec2instanceUsageusage: ec2instance [-h] [-t INSTANCE_TYPE] [-i AMI_IDENTIFIER] [-f USER_DATA_FILENAME]
                   [--volume-size VOLUME_SIZE] [--profile PROFILE_NAME] [--region AWS_REGION]
                   [--non-interactive] [--show-data-path]

Quickly launch an EC2 instance for small tasks. The instance's lifecycle is tied to the process,
enabling easy Ctrl+C instance termination when done.

optional arguments:
  -h, --help            show this help message and exit
  -t INSTANCE_TYPE, --type INSTANCE_TYPE
                        EC2 instance type. (default: t3a.micro)
  -i AMI_IDENTIFIER, --ami AMI_IDENTIFIER
                        EC2 AMI id. You may also pass "ubuntu" as a shortcut to get the latest
                        Ubuntu LTS, or "amazonlinux" as a shortcut to get the latest Amazon Linux.
                        (default: ubuntu)
  -f USER_DATA_FILENAME, --user-data USER_DATA_FILENAME
                        EC2 "user data" script. Path to a shell script. AWS will upload and run
                        this script on the instance immediately after launch. (default:
                        ~/.config/ec2instance_cmd/user_data_scripts/default.sh)
  --volume-size VOLUME_SIZE
                        Root EBS volume size (GiB).
  --profile PROFILE_NAME
                        AWS credentials profile name to use.
  --region AWS_REGION   Specific AWS region to use.
  --non-interactive     By default a shell will be opened in the spawned instance, and the
                        instance will be terminated when the shell is closed. To instead output
                        ec2 metadata as json and then exit, specify --non-interactive.
  --show-data-path      Print out the path where ec2instance is storing local data and
                        configuration.

help & support:
  https://github.com/personalcomputer/ec2instance/issuesNotesBefore using ec2instance, you must configure AdministratorAccess-level AWS authentication credentials locally:1.)install awscli2.) Runaws configureand enter in your AWS access key. How to get an AWS access key is not in scope of this
guide.Upon running ec2instance for the first time, it will tell you it is automatically creating a tiny sandbox in your AWS
account to ensure that there are no possible conflicts or security concerns from using ec2instance. This sandbox
consists of generating a dedicated fresh VPC and SSH keypair, and these are persisted between invocations of
ec2instance. There is no AWS fee associated with these resources, and their auto-generated names are obvious and
logged to console. Feel free to delete them if you stop using ec2instance.
Package: ec2-instance-tools
ec2-instance-toolsThis repository contains helper scripts for use on EC2 Amazon Linux instances.sshec2Usage: sshec2 [flags] <NAME> [<command>]

Look up the private IP address of a running EC2 instance by its Name tag and ssh into it.

If <command> is supplied, run that shell command on the remote instance and exit.

If multiple instances have the same Name tag, print info about all found instances
and exit.


Options:
  -h, --help         show this help message and exit
  -t TAG, --tag=TAG  set TAG to check to find instances via this tag.
                     Default: Name.
  -v, --verbose      Make ssh print verbose debug messagesec2autonamerUsage: ec2autonamer [flags] [<instance-id>]

If an instance was launched from an autoscaling group, it will come up with no
Name: tag.  This script assigns an appropriate name tag to the instance.

If <instance-id> is not supplied, ec2autonamer will ask the EC2 instance metadata 
endpoint for the instance id.

The name will have one of the following patterns:

If this instance is an ECS container machine: ecs.{autoscalinggroup_name}.{zone-abbr}.{number},
where {zone-abbr} is the availability zone name of the instance minus the region name.

Otherwise: {autoscalinggroup_name}-{number}

In both cases, {number} will be chosen to be the lowest positive integer that
is not already taken by another instance in the autoscaling group.


Options:
  -h, --help  show this help message and exitIn order to run this on an instance, the instances IAM instance profile will need to have
the following rights:{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:CreateTags",
        "ec2:DeleteTags",
        "ec2:Describe*"
        "autoscaling:Describe*"
      ],
      "Resource": ["*"]
    }
  ]
}ec2whoamiUsage: whoami.py [flags]

Get this instance's name tag, and save it to /etc/aws-instance-name for use by other programs.
ec2whoami will ask the EC2 instance metadata endpoint for the instance id.


Options:
  -h, --help  show this help message and exitInstalling ec2-instance-toolsec2-instance-tools is a pure python package.  As such, it can be installed in the
usual python ways.  For the following instructions, either install it into your
global python install, or use a pythonvirtual environmentto install it
without polluting your global python environment.Install via pippip install ec2-instance-toolsInstall viasetup.pyDownload a release fromGithub, then:unzip ec2-instance-tools-0.4.0.zip
cd ec2-instance-tools-0.4.0
python setup.py installOr:git clone https://github.com/caltechads/ec2-instance-tools.git
cd ec2-instance-tools
python setup.py installUsing pyenv to install into a virtual environment (Recommended)If you use python and frequently need to install additional python modules,pyenvandpyenv-virtualenvare extremely useful.  They allow some very useful things:Manage your virtualenvs easily on a per-project basisProvide support for per-project Python versions.To installpyenvandpyenv-virtualenvand set up your environment for the
first time.
Package: ec2-manager
EC2 ManagerA python wrapper around a terraform ec2 deployment. It awaits instances till their done initializing and allows the user more control over updating or not updating particular instances.
It also streamlines project setup and deployments with GitHub workflows.DependenciesTerraformThe python package deploys a terraform module.AWS CLIBoto3 commands check the instance status and send it ssm commands.GitHubThe deployment updates based on a GitHub repo.DockerCentered around docker deployments, but it is not a requirement.PythonThe tool is written is python.InstallationYou can install this package with pip by running the command below.pipinstallec2-managerUsageHere is a basic example ofSetup your project and make sure to check it into GitHubec2-mangerinitThis will setup your repo with a template and a config that looks like this:config.yaml# globalstype:exampleaws_region:us-east-1vpc_name:"DefaultVPC"public_subnet_cidr:"172.31.0.0/20"# instance configurationsinstances:example-instance-1:instance_type:t4g.nanoupdate:Truevolume_size:8commands:start:"docker-composeup--detach"stop:"docker-composedown"envs:EXAMPLE:HelloWorldports:-protocol:tcpfrom_port:80to_port:80Add your secrets to your repo via the promptsec2-mangerset-secretsApply your changes to deploy, or use the workflow in the template to auto deploy on push.ec2-mangerapplyOverrideYou can subclass ec2-manager to script in any custom steps or additional remote commands.override.pyimportec2_managerclassCustomManager(ec2_manager.EC2Manager):defupdate(self):print('Override!!')self.create_instances()self.update_repos()self.stop()self.start()Then run ec2-manager with theoverride.pyin the working directory and it will use that class instead!
Package: ec2map
AWS Instance Mapping libraryThis library is intended to help using AWS EC2 instances in a more developer friendly manner.ec2mapwas developed byBST LABSas an open source generic infrastructure foundation for the cloud version of Python run-time within the scope of theCloud AI Operating System (CAIOS)project.InstallationTo use it in your projects you need to install it viapip3pip3installec2mapUsagefromec2instances.ec2_instance_mappingimportEc2RemoteShellMappingfromec2instances.ec2_instance_proxyimportEc2InstanceProxy,Ec2RemoteShellProxyLicenseMIT License, Copyright (c) 2021-2022 BST LABS. SeeLICENSEfile.
Package: ec2mc
A Python console script for managing Minecraft servers hosted on AWS EC2 On-Demand instances (cloud computing).
Functionality is included for automating later parts of the AWS account setup process.
Templates are provided for the simple creation of vanilla and modded Minecraft servers.For a guide on setting up your AWS account and creating a server, seeGetting Started.For a guide on managing and distributing IAM user access keys, seeManaging Users.For a comprehensive list and explanation of the available commands, seeCommands.For an explanation on what can be customized (and how), seeCustomization.For a breakdown of the costs of running a server, seeCosts.For a guide on removing everything from AWS, seeCleaning Up.
Package: ec2-meta-env
ec2-meta-envA simple wrapper script to manifest EC2 instance metadata as environment
variables.Installing ec2-meta-envInstallingec2-meta-envis as simple as:pip install ec2-meta-env --upgradeUsing ec2-meta-envTo include EC2 instance meta data in your application’s shell environment,
wrap your shell command with theec2-meta-envscript and specify the
environment variables you wish to use, e.g.:ec2-meta-env -e local-ipv4 /path/to/my/appIn the above example, the value oflocal-ipv4will be accessible in the shell
environment for/path/to/my/appunder the variable nameEC2_LOCAL_IPV4.
Environment variable names are formed by prepending the meta API path withEC2_, uppercasing, and replacing all dashes and forward slashes with
underscores.Other optionsA complete list of options can be found by running:ec2-meta-env --helpWhy ec2-meta-env?EC2 provides instance metadata viahttp://169.254.169.254/latest/meta-data/.
Sometimes it’s easier to use that information if it’s available via environment
variables, for example, if your application’s running inside a Docker container
on Amazon’s Elastic Container Service (ECS). This project makes it possible to
do that without calling the EC2 instance meta data API manually.Thanks and I hope you find ec2-meta-env helpful!~Tobias McNulty
Package: ec2-namer
AboutStartup script - Modifies tags, hostname and public DNS routes based on EC2 some tagsTag your ec2 instance with the following :‘group’: ‘compute’ / ‘webserver’‘number’: ‘0001’‘zone’: ‘my-dns.com’‘environment’: ‘dev’ / ‘prod’If another machine is found with same tags, the number tag will be incremented (or updated with non existing one at least).
You can then duplicate an instance with its tags, and these tags will be updated to make the host unique (hostname and DNS route pointing to it).And a public route in the form of {group}-{number}.{env}.{zone}. For example : webserver-0001.dev.my_dns.comInternal hostname will also be set to {group}-{number}.{env} like webserver-0001.dev.Works on linux and windows (but needs a reboot once in windows after changing hostname).Project url :https://github.com/ronhanson/ec2-namerUsageAdd “python3 ec2-rename” at startup.CompatibilityThis libraries are used most on Linux and Windows systems.This libraries are compatibles with Python 3.4+.Mainly tested on 3.6.Author & LicenceCopyright (c) 2010-2015 Ronan DelacroixThis program is released under MIT Licence. Feel free to use it or part of it anywhere you want.
Package: ec2ools
ec2oolsec2oolsis a cli of useful tools to use on an ec2 instance to aid in management and automation.
Some examples of functionality are:
- Am I the oldest instance in an ASG (IE: to determine a master node)
- Attach an elastic-ip to myself by alloc-id
- Place myself into/out-of standby in my ASG & detach/attach from/to LB for deployments (IE: Codedeploy)
- etc…2019-08-29
The cli is still in development and only a few functions are currently released.
My intentions are to start work on some of these tools in the not to distant future.Utilities to manage ec2 instances and asg’sFree software: MIT licenseDocumentation:https://ec2ools.readthedocs.io.History0.1.0 (2019-05-26)First release on PyPI.
Package: ec2-proxy
EC2 ProxyThis package provides the ability to use Amazon AWS as a proxy with ever-changing IP.Free software: Apache Software License 2.0Documentation:https://ec2-proxy.readthedocs.io.Install a Proxy ServerReadSetupfor instructions on how to install a proxy server on an EC2 instance.How to UseInstall the package:pip install ec2_proxyCreate an AWS account and obtain the access key and secret key fromHere.There are 2 ways to use this package:Way #1 - Use it with the credentials that are present in your.awsfolder in your home directoryfromec2_proxyimportTProxytp=TProxy(<instance_id_here>)ip=tp.start()print(ip)Way #2 - Use it with the credentials that you will pass at runtimefromec2_proxyimportTProxyfrombotocore.configimportConfigimportboto3region='us-west-2'access_key_id='YOUR_ACCESS_KEY_ID'secret_access_key='YOUR_SECRET_ACCESS_KEY'ec2=boto3.client('ec2',region_name=region,aws_access_key_id=access_key_id,aws_secret_access_key=secret_access_key)tp=TProxy(<instance_id_here>,ec2=ec2)ip=tp.start()print(ip)History
Package: ec2.py
# ec2.py> Simple CLI / module to create/start/stop EC2 instances.
> Originally created to spin up instances to compile Python extensions for AWS Lambda projects.Pypi Link:https://pypi.python.org/pypi/ec2.pyFeatures:Single command creation of security key and instanceIdempotent, repeated calls do not result in multiple instancesWaits for AWS tasks to complete and provides confirmation.Supports:AWS ProfilesInstance type specificationKey generationStart/stop/terminate Instances## NotesBy design, the application binds instance creation to a key file (custom name can be specified).
This allows enhanced security around managing the life cycle of an instance,
but requires creation of more than one keyfile for multiple instances.## InstallationInstall:pip install ec2.py –upgrade## SetupConfigure AWS Credentials:aws configureInstall AWS CLI:pip install –upgrade –user awscliSeehttp://docs.aws.amazon.com/cli/latest/userguide/installing.htmlhttp://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html## Usageec2- Creates a new AWS instance of t2.nano, and a new Key ec2.py if either do not exist. If these already exist, will start the instance if stopped.ec2 -s- Stop the instance. If one does not exist, will create a key and new instance.ec2 -r- Remove the instance (terminates) and delete the key.ec2 -i- Print the public dns name. Allows calling from another bash script.ec2 -i -v- Print the instance type, ami image, public ip address, public dns name.ec2 -p myProfile -k myKey -t t2.medium- Use a custom profile, key name and instance type.ec2 -h- Help## SSH to a created instance:Make sure the pem key has chmod 0600, example:chmod 600 ec2.py.pemMake sure the security group for the instance has port 22 connectivity allowed.Get the Public DNS name for the instance:ec2 -iConnect:ssh ec2-user@DNS_NAME -i ec2.py.pem## Developer SetupInstall VirtualEnvWrappersudo pip install virtualenvwrapper –upgradeecho “source /usr/local/bin/virtualenvwrapper.sh” >> ~/.bashrc”Create / switch to Virtual Envmkvirtualenv ec2orworkon ec2Setupmake setup## AMI InfoAMI name: amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2Selected based onhttps://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html## Articleshttp://www.perrygeo.com/running-python-with-compiled-code-on-aws-lambda.htmlhttps://markn.ca/2015/10/python-extension-modules-in-aws-lambda/## Linkshttp://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.htmlhttp://boto3.readthedocs.io/en/latest/reference/services/ec2.html
Package: ec2rdp
SummarySimple command line utility to decrypt the password of an
AWS EC2 windows instance, put the decrypted password in
the clipboard and write an rdp file to access the AWS
EC2 windows instance.Installpip install ec2rdpUsageec2rdp [-h] [-o OUTPUT] [-k KEY] [-q] [--aws-profile AWS_PROFILE]
       [--aws-access-key-id AWS_ACCESS_KEY_ID]
       [--aws-secret-access-key AWS_SECRET_ACCESS_KEY]
       [--aws-region AWS_REGION]
       instance-id

positional arguments:
  instance-id           The instance-id to decrypt the password.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        The path for the rdp file to be created.
  -k KEY, --key KEY     The path to the private key file to decrypt the
                        password.
  -q, --quick           The script will not ask for the passphrase for the key
                        file.
  --aws-profile AWS_PROFILE
                        The profile name for aws credentials
  --aws-access-key-id AWS_ACCESS_KEY_ID
                        The access key id for aws
  --aws-secret-access-key AWS_SECRET_ACCESS_KEY
                        The secret access key for aws
  --aws-region AWS_REGION
                        The region for awsAWS CredentialsThe script will look for credentials to AWS in the following locations:AWS_PROFILEenvironment variable with credentials set in either~/.aws/credentialsor~/.aws/config. When using this,--aws-regionmust be set,~/.aws/configmust contain a region value for the profile orAWS_DEFAULT_REGIONmust be set.AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYenvironment variables. When using this,--aws-regionmust be set orAWS_DEFAULT_REGIONmust be set.--aws-profilecommand line option. When using this,--aws-regionmust be set,~/.aws/configmust contain a region value for the profile orAWS_DEFAULT_REGIONmust be set.--aws-access-key-id,--aws-secret-access-keycommand line options. When using this,--aws-regionmust be set orAWS_DEFAULT_REGIONmust be set.Key in AWS Config fileIf you are using the same key for all the AWS EC2 Windows instances available from a profile, you can set the path to
the key file in the~/.aws/configfile. To do so, add aec2rdp_keyentry with the path to the key file under
the profile.Example:[profile profile1]
output = json
region = us-west-1
ec2rdp_key = ~/keys/profile1.pem
Package: ec2-reaper
EC2 ReaperCLI & module for terminating instances that match tag and age requirements.FeaturesSearches all (or specified) regions for instances.Matches instances against a tag pattern.Allows instances a grace period before termination.Can be used as a Python module, CLI application, or an AWS Lambda functionUsageTag Matchers[{“tag”: “Name”, “includes”: [], “excludes”: [“*”]}]This is the default tag matcher and it will match anything that lacks aNametag.To terminate any instance named “cirunner”, the filter would look like so:[{“tag”: “Name”, “includes”: [“cirunner”], “excludes”: []}]CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2017-11-27)First release on PyPI.
Package: ec2-simple-snapshot
Introductionec2-simple-snapshot is a command line tool designed to make dealing
with EBS snapshots simple. This tool requires Python 2.7 and the
boto module.InstallationInstall viapip:$ sudo pip install ec2-simple-snapshotInstall from source:$ git clone https://github.com/nickryand/ec2-simple-snapshot.git
$ cd ec2-simple-snapshot
$ sudo python setup.py installConfigurationAuthentication credentials are stored in a configuration file. Create
a configuration file like the following. Be sure to replace the example
credentials here with your own aws credentials:[default]
aws_access_key_id = AKTESTACCESSID
aws_secret_access_key = wJalrXUtnBERF\GF84d91!PxRfiCYEXAMPLEKEY
region = us-west-2The region directive is optional here. However, if it is not set, you
must set the region using the-rREGIONor--regionREGIONcommand line option.Default location:~/.aws/configIf you would like to have your configuration file elsewhere, use the-c<path to config>or--config<path to config>command line
option to tell ec2-simple-snapshot where to look.Default Profile:defaultVery similar to the aws-cli tool from Amazon, you can store multiple
profiles in a single configuration file. This allows you to set multiple
sets of credentials using profiles to separate them. The default profile
is nameddefaultbut can be changed using the-pPROFILEor--profilePROFILEcommand line option.Example:[production]
aws_access_key_id = AKTESTACCESSID
aws_secret_access_key = wJalrXUtnBERF\GF84d91!PxRfiCYEXAMPLEKEY
region = us-east-1IAM Policy ActionsThis is a list of the required set of IAM actions needed for each command.Listec2:DescribeSnapshotsCreateec2:DescribeVolumesec2:CreateSnapshotec2:CreateTagsDeleteec2:DescribeSnapshotsec2:DeleteSnapshotUsage ExamplesShow help screen:$ ec2-simple-snapshot -hShow help screen for a subcommand:$ ec2-simple-snapshot <command> -hList the two newest snapshots owned by your AWS Account:$ ec2-simple-snapshot list --count 2List snapshots taken within the last 4 days:$ ec2-simple-snapshot list --count 4 --type daysDelete snapshots older than 3 days that have the tag “Type=Backup” and “Name=Test”:$ ec2-simple-snapshot delete --count 3 --type days --filter 'Type=Backup' 'Name=Test'Delete all but the last 30 snapshots, however limit deletes to 2:$ ec2-simple-snapshot delete --count 30 --limit 2Create a snapshot for volume ‘vol-123456’ setting a description and adding a tag:$ ec2-simple-snapshot create \
> --description "This is a test"
> --tags "Environment=Production" vol-123456Test SuiteThe easiest way to get started with the testing suite is to use thetoxautomation project.Install tox:$ pip install toxRun the test suite:$ git clone https://github.com/nickryand/ec2-simple-snapshot.git
$ cd ec2-simple-snapshot
$ toxIf you do not want to use tox, you can install the development dependencies
usingpipand use the python unittest module to execute the tests.Install dependencies and run suite:$ git clone https://github.com/nickryand/ec2-simple-snapshot.git
$ cd ec2-simple-snapshot
$ pip install -r requirements.txt
$ python -m unittest discover
Package: ec2ssh
# ec2ssh
Python script to facilitate SSH access to AWS EC2 instances with dynamic IPs or behind bastion hostsec2ssh uses subprocess.call to connect via SSH to EC2 instances on Amazon Web Services and Boto 3 to get the curret public static IP address of the instance.
This way you don’t have to allocate an Elastic IP Address to conveniently connect via SSH to the instance, or repeatedly check it’s current static IP address.This script is in extremely early stage, but it works (I’m currently using it). It’s mostly a way for me to start using and learning Python.To get the static IP address of the instance and connect you have to provide the program with an identity file with the following information:
* Path to the key pair file for the host
* User
* EC2 Instance IDAlso, Boto 3 must be able to call the AWS EC2 API, which requires AWS credentials. Ideally, you should install the AWS CLI (sudo pip install awscli) and configure it with your credentials (aws configure).ec2ssh also supports SSH connections via a bastion host, in which case the identity file must also contain the path to the bastion host key pair, the user for the bastion host and the EC2 Instance ID of the bastion host.What it’s curretly lacking:
* A cli command to create a new identity file (which will ask you if you are using a bastion host or not, followed by the required data)
* It does not check for any kind of error or exception
* It’s not a Python module yet, it’s just a .py script file; ideally it will install itself via pip in the Python modules folder (the identity files will be saved there too)ec2ssh add <connection_name>        => to add a connection name
ec2ssh connect <connection_name>    => connect to ec2
ec2ssh ls                           => to list avaible connections
ec2ssh rm <connection_name>         => remove a connectionFeel free to contribute or comment my code!