Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify documentation for forking servers #1

Open
wants to merge 198 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
4e524a0
RUBY-2512 Support AWS temporary credentials (#2572)
comandeo-mongo Aug 3, 2022
d985b2e
RUBY-2497 Add test for limited connection pool (#2573)
comandeo-mongo Aug 3, 2022
2c7afb4
RUBY-3080 Fix FLE tests in docker (#2580)
comandeo-mongo Aug 3, 2022
f649313
RUBY-3081 Avoid creating mongocryptd client (#2579)
comandeo-mongo Aug 3, 2022
b9671fc
RUBY-2757 Bump maxWireVersion in SDAM monitoring tests (#2574)
Neilshweky Aug 3, 2022
657ad73
RUBY-2765 change Populator to Mongo::Server::ConnectionPool::Populat…
Neilshweky Aug 3, 2022
b174d24
RUBY-3074 Add rewrapManyDataKey prose test (#2581)
comandeo-mongo Aug 4, 2022
713b15d
RUBY-2759 Add minItems unified spec test (#2575)
Neilshweky Aug 4, 2022
2fbbdde
RUBY-2774 Split unified runner valid-fail tests with malformed operat…
Neilshweky Aug 4, 2022
6ce5a4f
RUBY-3075 Sync fle2-InsertFind-Unindexed test (#2583)
comandeo-mongo Aug 5, 2022
7b6f3a1
RUBY-3078 Retry unified KMS tests (#2584)
comandeo-mongo Aug 5, 2022
b2ea49c
RUBY-3083 Fix AWS auth test configuration (#2585)
comandeo-mongo Aug 5, 2022
9a58636
RUBY-1595 Improve error reporting when symbol/string is passed as rea…
Neilshweky Aug 5, 2022
82c8586
RUBY-1627 Document collection insert options (#2587)
Neilshweky Aug 9, 2022
c3ec8c1
RUBY-2288 Verify clients closure (#2590)
comandeo-mongo Aug 10, 2022
92027ab
RUBY-1673 Document collection options (#2588)
Neilshweky Aug 11, 2022
c5341dc
Clarify collection method documentation w.r.t. effective options (#2593)
p-mongo Aug 12, 2022
1013de8
Repair links to Collection::View::Aggregation in api docs (#2591)
p-mongo Aug 12, 2022
6c72185
RUBY-1613 Verify handling of write concern errors by user management …
Neilshweky Aug 15, 2022
47aeedd
RUBY-1554 Mention to_json in logging examples in tutorial (#2589)
Neilshweky Aug 18, 2022
b70ca2d
RUBY-1775 Make driver Ruby warning-clean (#2597)
Neilshweky Aug 19, 2022
c35c266
RUBY-3095 fix options mapper to apply_transform (#2599)
Neilshweky Aug 26, 2022
dec1a32
RUBY-2673 Verify connection pools are created for all server types in…
p-mongo Aug 26, 2022
6bf442e
RUBY-3087 reinstate ability to call insert_many with Enumerable input…
midnight-wonderer Aug 28, 2022
2d1352c
RUBY-3033 update sdam specs (#2598)
Neilshweky Aug 28, 2022
48a3005
RUBY-3085 Remove pre-OP_MSG wire protocols (#2600)
comandeo-mongo Aug 29, 2022
31fbe5c
Attempt to unflake the integration map/reduce test on sharded cluster…
p-mongo Aug 29, 2022
de58920
RUBY-3068 Expose rich field information in the updateDescription (#2604)
Neilshweky Aug 30, 2022
a4a2d2a
RUBY-3095 write tests, docs for option mapper (#2606)
Neilshweky Sep 1, 2022
948ebdb
RUBY-2989 Obtain AWS credentials for CSFLE (#2605)
comandeo-mongo Sep 2, 2022
6c5cdcf
RUBY-3095 remove readConcernLevel special case (#2609)
p-mongo Sep 2, 2022
a71064f
RUBY-3106 add spec test for ChangeStreamEvent type definition to incl…
Neilshweky Sep 4, 2022
050f408
RUBY-3103 Exclude create events from change stream events when testin…
Neilshweky Sep 4, 2022
ede6e10
RUBY-3099 Add Ruby 3.1 to compat tables (#2614)
comandeo-mongo Sep 6, 2022
3b2c5b5
RUBY-3104 support all options in collection create (#2610)
Neilshweky Sep 6, 2022
de292d7
RUBY-3104 remove tests for server < 3.6 (#2611)
Neilshweky Sep 6, 2022
06f654c
RUBY-3105 Do not raise errors when closing cursor (#2615)
comandeo-mongo Sep 8, 2022
135e299
RUBY-3079 Propagate Original Error for Write Errors Labeled NoWritesP…
Neilshweky Sep 9, 2022
b9090de
RUBY-3113 add client param to sdam_proc call (#2619)
Neilshweky Sep 12, 2022
5e7d71e
RUBY-3108 Forbid Serverless in Change Stream Disambiguated Unified Sp…
Neilshweky Sep 12, 2022
6ffed65
RUBY-3111 Fix test failures in BSON master cause by the changing of t…
Neilshweky Sep 12, 2022
ad55437
RUBY-2671 remove old drivers, remove rapid releases, update kerberos …
Neilshweky Sep 13, 2022
b713192
RUBY-2752 Integration tests for observeSensitiveCommands (#2621)
Neilshweky Sep 13, 2022
5612568
RUBY-3117 investigate and fix test failures as a result of removing v…
Neilshweky Sep 13, 2022
ae385ca
RUBY-2716 Note what command events/payloads are not published (#2629)
Neilshweky Sep 15, 2022
d7bf75d
RUBY-2609 Enable TCP_USER_TIMEOUT by default when possible (#2632)
Neilshweky Sep 19, 2022
e8b4f8f
RUBY-3114 FLE - maxWireVersion should run on Mongo Server 4.0.x (#2631)
Neilshweky Sep 19, 2022
4697bb4
RUBY-2534/RUBY-3120 Clarify specifying username with X509 certificate…
Neilshweky Sep 19, 2022
c678f8d
RUBY-3119 Add `serverless: forbid` to change streams clusterTime test…
Neilshweky Sep 23, 2022
d80ea7e
RUBY-2773 Verify query cache behavior with concurrent iterations of t…
Neilshweky Sep 23, 2022
024eac5
RUBY-2854 Test: :session option is passed correctly to count_document…
Neilshweky Sep 23, 2022
b0d7f04
RUBY-1253 Detect cursor closure from other thread (#2639)
comandeo-mongo Sep 27, 2022
db1efb5
RUBY-3112 Run all unified tests on serverless (#2634)
comandeo-mongo Sep 27, 2022
c192289
RUBY-2707 Document list_collections in tutorial (#2628)
Neilshweky Sep 28, 2022
6333c6d
RUBY-2592 add tests for load-balancers (#2638)
Neilshweky Sep 28, 2022
cb84f70
RUBY-2897 Remove use of example.com in Client Side Encryption prose t…
Neilshweky Sep 28, 2022
be64792
RUBY-2768 Communicate maintenance & bug fix policy to userbase (#2635)
Neilshweky Sep 29, 2022
8056718
RUBY-3118 Fix flaky sdam unified test (#2623)
Neilshweky Sep 29, 2022
825ac4a
RUBY-3134 attempt to fix flaky speculativeAuthenitcate test (#2643)
Neilshweky Sep 29, 2022
a25b381
RUBY-2803 Add a load balancer test case for SRV resolving to 0 hosts …
Neilshweky Sep 30, 2022
f284c06
RUBY-2942: Update documentation links (#2644)
alexbevi Oct 3, 2022
b70744d
RUBY-3139: Update Ruby Team details (#2645)
alexbevi Oct 3, 2022
15a77cc
RUBY-2808 add other cmap tests that work (#2641)
Neilshweky Oct 7, 2022
829b7fb
RUBY-1768 change to_s to return original URI (#2596)
Neilshweky Oct 12, 2022
35cd0fa
RUBY-3097 Use monotonic time for deadlines (#2646)
Neilshweky Oct 20, 2022
1436dda
RUBY-3115 Run legacy FLE tests on serverless (#2648)
comandeo-mongo Oct 24, 2022
4864e4b
RUBY-3157 Remove the unified/invalid tests (#2652)
Neilshweky Oct 26, 2022
aff32a6
RUBY-2496 Implement and test connection pool paused state (#2650)
Neilshweky Nov 3, 2022
815bab5
RUBY-3090 Prioritize electionId over setVersion (#2651)
comandeo-mongo Nov 4, 2022
cabe95b
RUBY-3177 Update valid-pass tests (#2655)
Neilshweky Nov 8, 2022
fe5a87f
RUBY-3130 Test no mcd connected if crypt shared (#2657)
comandeo-mongo Nov 8, 2022
9936c11
RUBY-3062 Add GCP KMS auto credentials (#2653)
comandeo-mongo Nov 8, 2022
d6f4d28
RUBY-3049 Provide access to raw result document when the server retur…
Neilshweky Nov 9, 2022
e4df91b
RUBY-2927 Preemptively cancel in progress operations when SDAM heartb…
Neilshweky Nov 9, 2022
6c58731
RUBY-3173 Allow client to be used after closing (#2659)
Neilshweky Nov 10, 2022
2760d21
RUBY-3175 Remove use of activate_venv.sh (#2658)
comandeo-mongo Nov 11, 2022
da7472f
RUBY-2804 Clarify clearing behavior for load balanced pools (#2660)
Neilshweky Nov 11, 2022
496b4f2
RUBY-2598 Clear pool when connection establishment fails in populator…
Neilshweky Nov 14, 2022
4fb852e
RUBY-3179 Fix FLE spec (#2663)
comandeo-mongo Nov 15, 2022
416a84a
RUBY-2539 Provide explicit guidance on handling command errors that o…
Neilshweky Nov 16, 2022
aef3515
RUBY-3168 Add tests for not spawn mongocryptd (#2665)
comandeo-mongo Nov 17, 2022
8b9387e
RUBY-3171 Improve test coverage for retryable handshake errors (#2668)
Neilshweky Nov 21, 2022
d3c2d72
RUBY-3058 sync causal consistency test (#2667)
Neilshweky Nov 21, 2022
4022460
RUBY-3070 Add atlas to main test suite (#2669)
comandeo-mongo Nov 23, 2022
932b06b
RUBY-3184 Rename crypt_shared_lib_required (#2670)
comandeo-mongo Nov 23, 2022
c369355
RUBY-2495 rework the check_out method (#2671)
Neilshweky Nov 28, 2022
d5bf24d
RUBY-3189 Fix URI Options table (#2673)
Neilshweky Dec 1, 2022
5bcfbe9
RUBY-3160 fix all parse errors except bson-tutorials (#2672)
Neilshweky Dec 1, 2022
e10a3ee
RUBY-2495/RUBY-2840/RUBY-2808 Rate limit new connection creations (ma…
Neilshweky Dec 7, 2022
466e7cd
RUBY-3190 Break NoWritesPerformed-Only Error Sequence (#2675)
Neilshweky Dec 7, 2022
a76e800
RUBY-3185 Remove getNonce command usage for 6.2+ (#2676)
Neilshweky Dec 7, 2022
419ed2a
RUBY-2492 Test that clients wait 500ms between failed isMaster checks…
Neilshweky Dec 8, 2022
83f1055
RUBY-3192 Fix serverless test setup (#2679)
comandeo-mongo Dec 9, 2022
a94421d
RUBY-3187 Allow disable ocsp endpoint verify for KMS (#2678)
comandeo-mongo Dec 9, 2022
972456b
Revert "RUBY-3184 Rename crypt_shared_lib_required (#2670)" (#2677)
comandeo-mongo Dec 9, 2022
e19bc7e
RUBY-2547 Add test that ensures the error returned from being evicted…
Neilshweky Dec 15, 2022
ee89d34
RUBY-3191 Abstract retryability of errors (#2682)
jamis Jan 6, 2023
bdcac84
RUBY-2732 Add service account support (#2681)
comandeo-mongo Jan 8, 2023
9aab22a
Mongo::Retryable refactoring (#2683)
jamis Jan 13, 2023
ec94aa2
Update public key (#2684)
comandeo-mongo Jan 31, 2023
2516ff5
Fix KMIP test setup (#2687)
comandeo-mongo Feb 3, 2023
d727dba
RUBY-3005 Support Range Indexes for auto encryption (#2689)
comandeo-mongo Feb 9, 2023
3c1379c
MONGOID-5304: Add Rubocop static code analyzer (#2460)
johnnyshields Feb 10, 2023
2af5dbe
Fix failures on latest (#2692)
comandeo-mongo Feb 13, 2023
f2ac12e
RUBY-3005 Range indexes in explicit encryption (#2690)
comandeo-mongo Feb 13, 2023
b92b7f4
RUBY-3052 Add create_encrypted_collection helper (#2693)
comandeo-mongo Feb 21, 2023
03dbe22
RUBY-3066 Cache AWS Credentials Where Possible (#2695)
comandeo-mongo Mar 3, 2023
bd9de56
add the new spec test (#2697)
jamis Mar 14, 2023
39ea9c9
restore jruby FLE tests to see if they will pass (#2700)
jamis Mar 23, 2023
5defc85
RUBY-3216 Skip failing view spec (#2701)
comandeo-mongo Mar 27, 2023
7f52414
RUBY-3215: Update client connection example to include Atlas (#2699)
alexbevi Mar 27, 2023
f987336
update spec files (#2702)
jamis Mar 27, 2023
75d392c
RUBY-3143 split CSFLE and QE docs into separate sections (#2703)
jamis Apr 5, 2023
413555d
RUBY-3154 Fix broken mongocryptd spec (#2704)
comandeo-mongo Apr 6, 2023
aa0813e
RUBY-3219: Add link for AWS Lambda connection to Atlas (#2707)
alexbevi Apr 10, 2023
30bcf22
RUBY-3154 Test crypt_shared with older server versions (#2705)
jamis Apr 12, 2023
a0ed71f
Enable all cops, but opt all files out of rubocop (#2708)
jamis Apr 24, 2023
137e302
RUBY-3088 Move FLE test configurations to docker (#2709)
comandeo-mongo Apr 25, 2023
690e002
RUBY-3088 Support Azure Managed Identity for KMS (#2710)
comandeo-mongo May 2, 2023
899fd8d
RUBY-3247 Remove rspec-mocks-diag (#2711)
comandeo-mongo May 12, 2023
2803b97
RUBY-3231 Bump maxWireVersion for 7.0 (#2713)
comandeo-mongo May 12, 2023
7fc62fa
Remove egos (#2715)
comandeo-mongo May 12, 2023
0feee3a
POC for DRIVERS-2609 (#2714)
comandeo-mongo May 25, 2023
fcedc87
RUBY-3226 Update libmongocrypt payloads to new QE protocol (#2718)
jamis May 25, 2023
1b17ac9
RUBY-3232 Switch to supported build hosts (#2712)
jamis May 25, 2023
bafb129
RUBY-3253 Remove "Public Technical Preview" from Queryable Encryption…
jamis May 31, 2023
6c2c84d
RUBY-3156 Error if RewrapManyDataKey is called with masterKey and wit…
jamis May 31, 2023
4c79339
RUBY-3156 Linter appeasement for #2720 (#2721)
jamis Jun 1, 2023
dd3b99b
RUBY-3152 Collect FaaS platform info in handshake (#2722)
jamis Jun 1, 2023
3c5cc83
RUBY-3152 FaaS environment detection spec changes (#2724)
jamis Jun 1, 2023
e9d8dc1
RUBY-3152 Linter appeasement for #2722 (#2723)
jamis Jun 1, 2023
32543f3
RUBY-3246 Test against 7.0 (#2725)
comandeo-mongo Jun 2, 2023
d44d19f
RUBY-3200 add Ruby 3.2 to CI (#2728)
jamis Jun 12, 2023
990d02c
RUBY-3252 Show user friendly error if no ffi (#2730)
comandeo-mongo Jun 12, 2023
dc0865c
RUBY-3275 Update Atlas certificate (#2735)
comandeo-mongo Jun 13, 2023
adda483
RUBY-3225 New spec test for timeseries (#2733)
comandeo-mongo Jun 14, 2023
bc9da14
RUBY-3216 Fix wildcard projection spec (#2734)
comandeo-mongo Jun 15, 2023
c1835c7
RUBY-3262 enable QEv2 tests on Serverless (#2731)
jamis Jun 20, 2023
98da783
Prepare release of 2.19.0 (#2736)
comandeo-mongo Jun 21, 2023
5a6a8c0
Update compatibility tables (#2737)
comandeo-mongo Jun 23, 2023
eef4b20
RUBY-3205 Deprecate collStats (#2738)
comandeo-mongo Jul 7, 2023
c928e60
RUBY-1599 Test against BSON 5 (#2740)
jamis Jul 12, 2023
7f338a1
RUBY-3284 Enable max_connecting client option (#2739)
comandeo-mongo Jul 13, 2023
ea09dbe
RUBY-3288 Serverless tests fail when building greenlet on python 3.12…
jamis Jul 18, 2023
9c90702
DOCSP-31496: fix API link (#2743)
Jul 21, 2023
98da223
RUBY-3209 Generate api docs (#2768)
comandeo-mongo Aug 7, 2023
bed8c09
RUBY-3308 Fixing serverless test failures (#2770)
jamis Aug 14, 2023
4bde723
RUBY-3314 Implement variable iterations for benchmarks (#2771)
jamis Aug 17, 2023
0f866fd
RUBY-3313 Record benchmark percentiles (#2772)
jamis Aug 21, 2023
5320336
RUBY-3315 BSON benchmark scoring (#2773)
jamis Aug 22, 2023
d149d6a
RUBY-3242 Add spec tests for runCommand (#2776)
comandeo-mongo Aug 25, 2023
b03052a
RUBY-2748 Retry reads/writes on another mongos (#2717)
comandeo-mongo Aug 25, 2023
12f789e
RUBY-3316 Quality of life updates for BSON benchmarks (#2774)
jamis Aug 28, 2023
c2c7ad0
RUBY-3268 search index management helpers (#2777)
jamis Sep 7, 2023
5cf1f10
RUBY-3324 bump drivers-evergreen-tools to get updated atlas setup/tea…
jamis Sep 13, 2023
dd27df7
RUBY-3328 add `execution` expansion to environment for atlas cluster …
jamis Sep 18, 2023
cddfeed
RUBY-3372 Fix failing explain tests (#2782)
comandeo-mongo Sep 18, 2023
e7b4a22
RUBY-3279 Bump min server version for FLE test (#2779)
comandeo-mongo Sep 18, 2023
bbc0941
RUBY-3267 make specs pass when X.509 authentication is active (#2781)
jamis Sep 19, 2023
7fd9ad4
DOCSP-32949: docs link to the BSON 4.x Tutorial (#2784)
Sep 21, 2023
bfe7a35
RUBY-2706 Test find related options (#2789)
comandeo-mongo Oct 5, 2023
e9bed68
RUBY-3331: Inline server lifecycle callout (#2790)
alexbevi Oct 6, 2023
16b0d29
RUBY-3296 Write to log when non-genuine host is detected (#2791)
jamis Oct 11, 2023
11dc883
RUBY-3332 Fix tailable cursors (#2793)
comandeo-mongo Oct 17, 2023
00d178e
RUBY-3149 Test on AWS Lambda (#2800)
comandeo-mongo Oct 20, 2023
2961065
Fix serverless tests (#2802)
comandeo-mongo Oct 31, 2023
511e324
RUBY-3333 Update AWS auth tests (#2803)
comandeo-mongo Nov 2, 2023
cc79991
add docs for the Atlas search index management API (#2806)
jamis Nov 15, 2023
0002cf8
RUBY-3347 add additional serverless project to tests (#2810)
jamis Nov 21, 2023
308326d
update API link (#2812)
jordan-smith721 Nov 28, 2023
f30f563
Fix broken link in Mongo::Monitoring::Event::Secure (#2775)
alexbevi Nov 28, 2023
e84afde
RUBY-3341 Document error handling in transactions (#2809)
comandeo-mongo Dec 5, 2023
d75a422
RUBY-3365 remove spec (#2820)
jamis Jan 9, 2024
f18c409
RUBY-3362 sync specs to fix failing tests on server version 7.3 (#2819)
jamis Jan 9, 2024
e06e03a
RUBY-3361 resync specs (#2818)
jamis Jan 9, 2024
69b0ec1
RUBY-3298 Add container info to handshake metadata (#2821)
jamis Jan 12, 2024
9228f5f
RUBY-1813 Discard ServerSessions involved in network errors (#2825)
jamis Jan 15, 2024
1afa0a5
RUBY-3329 Connection String: make delimiting slash between hosts and …
jamis Jan 15, 2024
199816f
RUBY-2254 sort by id when comparing collection contents (#2823)
jamis Jan 15, 2024
5f4a7e3
RUBY-1791 Raise if transactions not supported (#2822)
comandeo-mongo Jan 15, 2024
60d1f69
RUBY-3358 Handle nil session is write_worker (#2826)
comandeo-mongo Jan 19, 2024
853c268
Fix failing atlas connectivity specs (#2829)
jamis Jan 25, 2024
3329f15
RUBY-1250 Run DriverBench benchmarks in Evergreen (#2827)
jamis Jan 25, 2024
7cb06f0
RUBY-3393: Rename BSON tutorial page (#2832)
alexbevi Feb 8, 2024
9aefc4e
RUBY-3384 Update serverless tests (#2830)
comandeo-mongo Feb 12, 2024
f92ecf2
RUBY-3397 update the public key for signing gems (#2834)
jamis Feb 12, 2024
44c607f
RUBY-3399 Skip queryPlanner output specs (#2835)
comandeo-mongo Feb 13, 2024
e459c3f
DOCSP-37038: Fix broken link (#2841)
norareidy Feb 22, 2024
94eb2f5
Remove unnecessary file (#2845)
comandeo-mongo Feb 27, 2024
efdaddd
Use latest YARD version (#2847)
comandeo-mongo Mar 4, 2024
d332cd9
RUBY-3400 fix failing specs (#2846)
jamis Mar 6, 2024
0c65ebf
MONGOID-5739 Support BSON 5 (#2848)
jamis Mar 12, 2024
74e4e38
RUBY-3424 Prep for 2.20 (#2852)
jamis Mar 28, 2024
dd1adad
need zlib1g-dev for libxml for nokogiri, etc, etc (#2854)
jamis Apr 2, 2024
4fb3eff
Clarify documentation for forking servers
johnnyshields Apr 4, 2024
ead4ccc
Tweaks
johnnyshields Apr 4, 2024
cb30414
More tweaks
johnnyshields Apr 4, 2024
ae03f90
Correct method name
johnnyshields Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .evergreen/atlas
1 change: 1 addition & 0 deletions .evergreen/auth_aws
102 changes: 62 additions & 40 deletions .evergreen/aws
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,32 @@ $: << File.join(File.dirname(__FILE__), '../spec')
require 'support/aws_utils'
require 'optparse'

options = {}
OptionParser.new do |opts|
opts.banner = "Usage: aws [options] command ..."
def parse_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: aws [options] command ..."

opts.on("-a", "--access-key-id=ID", "AWS access key ID") do |v|
options[:access_key_id] = v
end

opts.on("-s", "--secret-access-key=SECRET", "AWS secret access key") do |v|
options[:secret_access_key] = v
end
opts.on("-a", "--access-key-id=ID", "AWS access key ID") do |v|
options[:access_key_id] = v
end

opts.on("-r", "--region=REGION", "AWS region") do |v|
options[:region] = v
end
opts.on("-s", "--secret-access-key=SECRET", "AWS secret access key") do |v|
options[:secret_access_key] = v
end

# launch-ecs options
opts.on('--ec2', 'Use EC2 launch type instead of Fargate') do |v|
options[:ec2] = true
end
end.parse!
opts.on("-r", "--region=REGION", "AWS region") do |v|
options[:region] = v
end

case cmd = ARGV.shift
when 'setup-resources'
AwsUtils::Provisioner.new.setup_aws_auth_resources
when 'reset-keys'
AwsUtils::Provisioner.new.reset_keys
when 'assume-role'
arn = ARGV.shift
# launch-ecs options
opts.on('--ec2', 'Use EC2 launch type instead of Fargate') do |v|
options[:ec2] = true
end
end.parse!
options
end

def assume_role(arn, options)
orchestrator = AwsUtils::Orchestrator.new(**options)
if arn.nil?
arn = AwsUtils::Inspector.new(**options).assume_role_arn
Expand All @@ -43,39 +39,36 @@ when 'assume-role'
puts "AWS_ACCESS_KEY_ID=#{credentials.access_key_id}"
puts "AWS_SECRET_ACCESS_KEY=#{credentials.secret_access_key}"
puts "AWS_SESSION_TOKEN=#{credentials.session_token}"
#puts "EXPIRATION=#{credentials.expiration.utc.strftime('%Y%m%dT%H%M%SZ')}"
puts
when 'set-instance-profile'
instance_id = ARGV.shift
end

def set_instance_profile(instance_id, options)
unless instance_id
raise 'Instance id is required'
end

orchestrator = AwsUtils::Orchestrator.new(**options)
orchestrator.set_instance_profile(instance_id)
when 'clear-instance-profile'
instance_id = ARGV.shift
end

def clear_instance_profile(instance_id, options)
unless instance_id
raise 'Instance id is required'
end

orchestrator = AwsUtils::Orchestrator.new(**options)
orchestrator.clear_instance_profile(instance_id)
when 'key-pairs'
AwsUtils::Inspector.new(**options).list_key_pairs
when 'launch-ec2'
public_key_path, = ARGV
end

def launch_ec2(public_key_path, options)
unless public_key_path
raise "Public key path must be given"
end

orchestrator = AwsUtils::Orchestrator.new(**options)
orchestrator.provision_auth_ec2_instance(public_key_path: public_key_path)
when 'stop-ec2'
orchestrator = AwsUtils::Orchestrator.new(**options)
orchestrator.terminate_auth_ec2_instance
when 'launch-ecs'
public_key_path, = ARGV
end

def launch_ecs(public_key_path, options)
unless public_key_path
raise "Public key path must be given"
end
Expand All @@ -84,6 +77,35 @@ when 'launch-ecs'
orchestrator.provision_auth_ecs_task(
public_key_path: public_key_path,
)
end

options = parse_options

case cmd = ARGV.shift
when 'setup-resources'
AwsUtils::Provisioner.new.setup_aws_auth_resources
when 'reset-keys'
AwsUtils::Provisioner.new.reset_keys
when 'assume-role'
arn = ARGV.shift
assume_role(arn, options)
when 'set-instance-profile'
instance_id = ARGV.shift
set_instance_profile(instance_id, options)
when 'clear-instance-profile'
instance_id = ARGV.shift
clear_instance_profile(instance_id, options)
when 'key-pairs'
AwsUtils::Inspector.new(**options).list_key_pairs
when 'launch-ec2'
public_key_path, = ARGV
launch_ec2(public_key_path, options)
when 'stop-ec2'
orchestrator = AwsUtils::Orchestrator.new(**options)
orchestrator.terminate_auth_ec2_instance
when 'launch-ecs'
public_key_path, = ARGV
launch_ecs(public_key_path, options)
when 'stop-ecs'
orchestrator = AwsUtils::Orchestrator.new(**options)
orchestrator.terminate_auth_ecs_task
Expand Down
Loading