rename from AWS to EC2 for consistency

The other cloud provider is GCE and not GCP. In the same way we are creating VMs
in EC2 on AWS.
This commit is contained in:
Samuel Beaulieu 2022-07-07 08:43:03 -05:00
parent ee36ee868d
commit 65c797137e
No known key found for this signature in database
GPG key ID: 12030F74136D0F34
9 changed files with 20 additions and 19 deletions

View file

@ -5,13 +5,13 @@ on: workflow_dispatch
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'puppetlabs/vmpooler-provider-aws' if: github.repository == 'puppetlabs/vmpooler-provider-ec2'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Get Version - name: Get Version
id: gv id: gv
run: | run: |
echo "::set-output name=ver::$(grep VERSION lib/vmpooler-provider-aws/version.rb |rev |cut -d "'" -f2 |rev)" echo "::set-output name=ver::$(grep VERSION lib/vmpooler-provider-ec2/version.rb |rev |cut -d "'" -f2 |rev)"
- name: Tag Release - name: Tag Release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:

1
.gitignore vendored
View file

@ -9,3 +9,4 @@ results.xml
/vmpooler.yaml /vmpooler.yaml
.idea .idea
*.json *.json
.secrets/

View file

@ -20,7 +20,7 @@ aws authorization is handled via two required ENV vars
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 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 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 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. KEY_FILE_LOCATION: (required) the location on local disk where the ssh key resides for VMPooler to connect via SSH to the AWS node 2. 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 ### 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 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

View file

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module VmpoolerProviderAws module VmpoolerProviderEc2
VERSION = '0.0.1' VERSION = '0.0.1'
end end

View file

@ -10,7 +10,7 @@ module Vmpooler
class PoolManager class PoolManager
class Provider class Provider
# This class represent a GCE provider to CRUD resources in a gce cloud. # This class represent a GCE provider to CRUD resources in a gce cloud.
class Aws < Vmpooler::PoolManager::Provider::Base class Ec2 < Vmpooler::PoolManager::Provider::Base
# The connection_pool method is normally used only for testing # The connection_pool method is normally used only for testing
attr_reader :connection_pool attr_reader :connection_pool
@ -51,7 +51,7 @@ module Vmpooler
# name of the provider class # name of the provider class
def name def name
'aws' 'ec2'
end end
def connection def connection

View file

@ -1,13 +1,13 @@
require 'spec_helper' require 'spec_helper'
require 'mock_redis' require 'mock_redis'
require 'ec2_helper' require 'ec2_helper'
require 'vmpooler/providers/aws' require 'vmpooler/providers/ec2'
RSpec::Matchers.define :relocation_spec_with_host do |value| RSpec::Matchers.define :relocation_spec_with_host do |value|
match { |actual| actual[:spec].host == value } match { |actual| actual[:spec].host == value }
end end
describe 'Vmpooler::PoolManager::Provider::Aws' do describe 'Vmpooler::PoolManager::Provider::Ec2' do
let(:logger) { MockLogger.new } let(:logger) { MockLogger.new }
let(:metrics) { Vmpooler::Metrics::DummyStatsd.new } let(:metrics) { Vmpooler::Metrics::DummyStatsd.new }
let(:poolname) { 'debian-9' } let(:poolname) { 'debian-9' }
@ -20,7 +20,7 @@ describe 'Vmpooler::PoolManager::Provider::Aws' do
max_tries: 3 max_tries: 3
retry_factor: 10 retry_factor: 10
:providers: :providers:
:aws: :ec2:
connection_pool_timeout: 1 connection_pool_timeout: 1
zone: '#{zone}' zone: '#{zone}'
region: '#{region}' region: '#{region}'
@ -32,7 +32,7 @@ describe 'Vmpooler::PoolManager::Provider::Aws' do
size: 5 size: 5
timeout: 10 timeout: 10
ready_ttl: 1440 ready_ttl: 1440
provider: 'aws' provider: 'ec2'
EOT EOT
) )
} }
@ -49,7 +49,7 @@ EOT
) { MockRedis.new } ) { MockRedis.new }
end end
subject { Vmpooler::PoolManager::Provider::Aws.new(config, logger, metrics, redis_connection_pool, 'aws', provider_options) } subject { Vmpooler::PoolManager::Provider::Ec2.new(config, logger, metrics, redis_connection_pool, 'ec2', provider_options) }
describe '#manual tests live' do describe '#manual tests live' do
context 'in itsysops' do context 'in itsysops' do

View file

@ -1,9 +1,9 @@
require 'rspec' require 'rspec'
describe 'VmpoolerProviderAws' do describe 'VmpoolerProviderEc2' do
context 'when creating class ' do context 'when creating class ' do
it 'sets a version' do it 'sets a version' do
expect(VmpoolerProviderAws::VERSION).not_to be_nil expect(VmpoolerProviderEc2::VERSION).not_to be_nil
end end
end end
end end

View file

@ -1,15 +1,15 @@
lib = File.expand_path('../lib', __FILE__) lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'vmpooler-provider-aws/version' require 'vmpooler-provider-ec2/version'
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = 'vmpooler-provider-aws' s.name = 'vmpooler-provider-ec2'
s.version = VmpoolerProviderAws::VERSION s.version = VmpoolerProviderEc2::VERSION
s.authors = ['Puppet'] s.authors = ['Puppet']
s.email = ['support@puppet.com'] s.email = ['support@puppet.com']
s.summary = 'AWS provider for VMPooler' s.summary = 'EC2 provider for VMPooler'
s.homepage = 'https://github.com/puppetlabs/vmpooler-provider-aws' s.homepage = 'https://github.com/puppetlabs/vmpooler-provider-ec2'
s.license = 'Apache-2.0' s.license = 'Apache-2.0'
s.required_ruby_version = Gem::Requirement.new('>= 2.3.0') s.required_ruby_version = Gem::Requirement.new('>= 2.3.0')

View file

@ -138,7 +138,7 @@
# #
# Provider specific pool settings # Provider specific pool settings
# #
# AWS provider # EC2 provider
# - zone # - zone
# The zone to create the VMs in # The zone to create the VMs in
# (optional: default is global provider zone value) # (optional: default is global provider zone value)