No description
Find a file
dependabot[bot] 87bf56167e
Bump aws-sdk-ec2 from 1.412.0 to 1.419.0
Bumps [aws-sdk-ec2](https://github.com/aws/aws-sdk-ruby) from 1.412.0 to 1.419.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-ec2/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-ec2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 15:28:40 +00:00
.github Update release workflow 2023-01-30 10:08:23 -05:00
lib (POD-10) Log reason for failed VM checks. 2023-08-17 13:17:25 -07:00
spec standardize Name tag, implement tag_vm_user method 2022-07-28 08:42:28 -05:00
.github_changelog_generator Add changelog and release instructions 2023-01-30 10:08:29 -05:00
.gitignore rename from AWS to EC2 for consistency 2022-07-07 08:49:46 -05:00
.jrubyrc Added aws dependency and renamed directories 2022-07-06 13:41:54 -05:00
.rubocop.yml fix rubocop offenses 2022-07-06 14:49:04 -05:00
CHANGELOG.md Add changelog and release instructions 2023-01-30 10:08:29 -05:00
CODEOWNERS Remove DIO as codeowners 2022-08-26 09:43:11 -04:00
Gemfile Added aws dependency and renamed directories 2022-07-06 13:41:54 -05:00
Gemfile.lock Bump aws-sdk-ec2 from 1.412.0 to 1.419.0 2023-11-13 15:28:40 +00:00
LICENSE Added aws dependency and renamed directories 2022-07-06 13:41:54 -05:00
Rakefile Added aws dependency and renamed directories 2022-07-06 13:41:54 -05:00
README.md Add changelog and release instructions 2023-01-30 10:08:29 -05:00
update-changelog Add changelog and release instructions 2023-01-30 10:08:29 -05:00
update-gemfile-lock Add changelog and release instructions 2023-01-30 10:08:29 -05:00
vmpooler-provider-ec2.gemspec Update rubocop requirement from ~> 1.28.2 to ~> 1.50.2 2023-05-08 16:05:18 +00:00
vmpooler.yaml.example integrtae GCP Cloud DNS from the gce provider 2022-07-27 10:19:22 -05:00

vmpooler-provider-aws

This is a provider for VMPooler allows using aws to create instances, disks, snapshots, or destroy instances for specific pools.

Usage

Include this gem in the same Gemfile that you use to install VMPooler itself and then define one or more pools with the provider key set to aws. VMPooler will take care of the rest. See what configuration is needed for this provider in the example file.

Examples of deploying VMPooler with extra providers can be found in the puppetlabs/vmpooler-deployment repository.

aws authorization is handled via two required ENV vars

  1. ABS_AWS_ACCESS_KEY
  2. ABS_AWS_SECRET_KEY

Provisioning the new nodes

When you add the pool config provision: true to a pool, the new VMs will also get initialized with extra steps to setup the sshd config via NET:SSH These steps expect two environment vars

  1. ROOT_KEYS_SCRIPT: (optional) the URI location of a script (eg https in github) that will be run to setup keys. If not set, this will be skipped
  2. AWS_KEY_FILE_LOCATION: (required) the location on local disk where the ssh key resides for VMPooler to connect via SSH to the EC2 node

DNS

AWS will setup a private ip and private dns hostname for the VM once running. Optionally we can setup a human readable DNS entry to resolve the VMPooler provider spicy-proton fqdn

DNS is integrated via Google's CloudDNS service. GCE authorization is handled via a service account (or personal account) private key (json format) and can be configured via

  1. GOOGLE_APPLICATION_CREDENTIALS environment variable eg GOOGLE_APPLICATION_CREDENTIALS=/my/home/directory/my_account_key.json

Provider config needed:

  1. domain
  2. project
  3. dns_zone_resource_name (see the example yaml file)

An A record is then created in that zone upon instance creation with the VM's internal IP, and deleted when the instance is destroyed.

Labels

This provider adds tags to all resources that are managed

resource labels note
instance vm=$vm_name, pool=$pool_name for example vm=foo-bar, pool=pool1
disk vm=$vm_name, pool=$pool_name for example vm=foo-bar and pool=pool1
snapshot snapshot_name=$snapshot_name, vm=$vm_name, pool=$pool_name for example snapshot_name=snap1, vm=foo-bar, pool=pool1

Also see the usage of vmpooler's optional purge_unconfigured_resources, which is used to delete any resource found that do not have the pool label, and can be configured to allow a specific list of unconfigured pool names.

Pre-requisite

  • An IAM user must exist in the target AWS account with permissions to create, delete vms etc
  • if using DNS see section above, and a service account with permissions to change Cloud DNS need to exist

Update the Gemfile Lock

To update the Gemfile.lock run ./update-gemfile-lock.

Verify, and update if needed, that the docker tag in the script and GitHub action workflows matches what is used in the vmpooler-deployment Dockerfile.

Releasing

Follow these steps to publish a new GitHub release, and build and push the gem to https://rubygems.org.

  1. Bump the "VERSION" in lib/vmpooler-provider-ec2/version.rb appropriately based on changes in CHANGELOG.md since the last release.
  2. Run ./update-gemfile-lock to update Gemfile.lock.
  3. Run ./update-changelog to update CHANGELOG.md.
  4. Commit and push changes to a new branch, then open a pull request against main and be sure to add the "maintenance" label.
  5. After the pull request is approved and merged, then navigate to Actions --> Release Gem --> run workflow --> Branch: main --> Run workflow.

License

vmpooler-provider-aws is distributed under the Apache License, Version 2.0. See the LICENSE file for more details.