awspec 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +6 -0
- data/doc/_resource_types/batch_compute_environment.md +23 -0
- data/doc/_resource_types/batch_job_definition.md +7 -0
- data/doc/_resource_types/batch_job_queue.md +23 -0
- data/doc/resource_types.md +85 -4
- data/lib/awspec/generator/doc/type/batch_compute_environment.rb +23 -0
- data/lib/awspec/generator/doc/type/batch_job_definition.rb +17 -0
- data/lib/awspec/generator/doc/type/batch_job_queue.rb +17 -0
- data/lib/awspec/helper/finder.rb +4 -1
- data/lib/awspec/helper/finder/batch.rb +20 -0
- data/lib/awspec/helper/type.rb +2 -1
- data/lib/awspec/resource_reader.rb +5 -1
- data/lib/awspec/stub/batch_compute_environment.rb +40 -0
- data/lib/awspec/stub/batch_job_definition.rb +28 -0
- data/lib/awspec/stub/batch_job_queue.rb +22 -0
- data/lib/awspec/type/batch_compute_environment.rb +32 -0
- data/lib/awspec/type/batch_job_definition.rb +16 -0
- data/lib/awspec/type/batch_job_queue.rb +31 -0
- data/lib/awspec/version.rb +1 -1
- metadata +16 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6655351533f5b1e75da73be4f8d6afb5d33f217af8395c0167404526ed6b0d69
|
4
|
+
data.tar.gz: '01973536aea2d38dca2984f561c36cc266aa14f4e2b7a8892173a3ebf94188eb'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c282cea7043cfc622a81cac9eeb0cd8830bc70fc6586ddc2c761ee21bac746b94daeec4470e1779142a4b8bc6aba2e595a94b4bf891b3554e8f0cdde0b22e94e
|
7
|
+
data.tar.gz: df86ffd6f2a31554d9eae1f017be1e741178f07126c3e789e8ff500197f3c37a097198b8f20e5556ba2cd91c2acff51238a282ef70df47d70ff55091721aa91a
|
data/README.md
CHANGED
@@ -97,6 +97,7 @@ end
|
|
97
97
|
```
|
98
98
|
|
99
99
|
### STEP 4. Run tests
|
100
|
+
Add gem "rake" in your Gemfile if you are starting a blank project.
|
100
101
|
|
101
102
|
$ bundle exec rake spec
|
102
103
|
|
@@ -108,6 +109,11 @@ Generate spec from AWS resources already exists.
|
|
108
109
|
$ awspec generate ec2 vpc-ab123cde >> spec/ec2_spec.rb
|
109
110
|
```
|
110
111
|
|
112
|
+
Make sure you have added in your spec file
|
113
|
+
```ruby
|
114
|
+
require 'spec_helper'
|
115
|
+
```
|
116
|
+
|
111
117
|
### Advanced Tips: Use Shared Credentials (~/.aws/config ~/.aws/credentials)
|
112
118
|
|
113
119
|
```sh
|
@@ -0,0 +1,23 @@
|
|
1
|
+
### exist
|
2
|
+
|
3
|
+
```ruby
|
4
|
+
describe batch_compute_environment('my-batch-compute-environment') do
|
5
|
+
it { should exist }
|
6
|
+
end
|
7
|
+
```
|
8
|
+
|
9
|
+
### be_enabled, be_disabled
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
describe batch_compute_environment('my-batch-compute-environment') do
|
13
|
+
it { should be_enabled }
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
### be_managed, be_unmanaged
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
describe batch_compute_environment('my-batch-compute-environment') do
|
21
|
+
it { should be_managed }
|
22
|
+
end
|
23
|
+
```
|
@@ -0,0 +1,23 @@
|
|
1
|
+
### exist
|
2
|
+
|
3
|
+
```ruby
|
4
|
+
describe batch_job_queue('my-batch-job-queue') do
|
5
|
+
it { should exist }
|
6
|
+
end
|
7
|
+
```
|
8
|
+
|
9
|
+
### be_enabled, be_disabled
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
describe batch_job_queue('my-batch-job-queue') do
|
13
|
+
it { should be_enabled }
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
### have_compute_environment_order
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
describe batch_job_queue('my-batch-job-queue') do
|
21
|
+
it { should have_compute_environment_order('arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand', 1) }
|
22
|
+
end
|
23
|
+
```
|
data/doc/resource_types.md
CHANGED
@@ -7,6 +7,9 @@
|
|
7
7
|
| [ami](#ami)
|
8
8
|
| [apigateway](#apigateway)
|
9
9
|
| [autoscaling_group](#autoscaling_group)
|
10
|
+
| [batch_compute_environment](#batch_compute_environment)
|
11
|
+
| [batch_job_definition](#batch_job_definition)
|
12
|
+
| [batch_job_queue](#batch_job_queue)
|
10
13
|
| [cloudformation_stack](#cloudformation_stack)
|
11
14
|
| [cloudfront_distribution](#cloudfront_distribution)
|
12
15
|
| [cloudtrail](#cloudtrail)
|
@@ -313,6 +316,84 @@ end
|
|
313
316
|
```
|
314
317
|
|
315
318
|
### its(:auto_scaling_group_name), its(:auto_scaling_group_arn), its(:launch_configuration_name), its(:launch_template), its(:min_size), its(:max_size), its(:desired_capacity), its(:default_cooldown), its(:availability_zones), its(:load_balancer_names), its(:target_group_arns), its(:health_check_type), its(:health_check_grace_period), its(:created_time), its(:placement_group), its(:vpc_zone_identifier), its(:enabled_metrics), its(:status), its(:termination_policies), its(:new_instances_protected_from_scale_in), its(:service_linked_role_arn)
|
319
|
+
## <a name="batch_compute_environment">batch_compute_environment</a>
|
320
|
+
|
321
|
+
BatchComputeEnvironment resource type.
|
322
|
+
|
323
|
+
### exist
|
324
|
+
|
325
|
+
```ruby
|
326
|
+
describe batch_compute_environment('my-batch-compute-environment') do
|
327
|
+
it { should exist }
|
328
|
+
end
|
329
|
+
```
|
330
|
+
|
331
|
+
|
332
|
+
### be_disabled
|
333
|
+
|
334
|
+
### be_enabled
|
335
|
+
|
336
|
+
### be_enabled, be_disabled
|
337
|
+
|
338
|
+
```ruby
|
339
|
+
describe batch_compute_environment('my-batch-compute-environment') do
|
340
|
+
it { should be_enabled }
|
341
|
+
end
|
342
|
+
```
|
343
|
+
|
344
|
+
|
345
|
+
### be_managed
|
346
|
+
|
347
|
+
### be_managed, be_unmanaged
|
348
|
+
|
349
|
+
```ruby
|
350
|
+
describe batch_compute_environment('my-batch-compute-environment') do
|
351
|
+
it { should be_managed }
|
352
|
+
end
|
353
|
+
```
|
354
|
+
|
355
|
+
### be_unmanaged
|
356
|
+
|
357
|
+
### its(:compute_environment_name), its(:compute_environment_arn), its(:ecs_cluster_arn), its(:type), its(:state), its(:status), its(:status_reason), its(:service_role)
|
358
|
+
## <a name="batch_job_definition">batch_job_definition</a>
|
359
|
+
|
360
|
+
BatchJobDefinition resource type.
|
361
|
+
|
362
|
+
### exist
|
363
|
+
|
364
|
+
```ruby
|
365
|
+
describe batch_job_definition('my-batch-job-definition') do
|
366
|
+
it { should exist }
|
367
|
+
end
|
368
|
+
```
|
369
|
+
|
370
|
+
### its(:job_definition_name), its(:job_definition_arn), its(:revision), its(:status), its(:type), its(:parameters), its(:retry_strategy), its(:timeout)
|
371
|
+
## <a name="batch_job_queue">batch_job_queue</a>
|
372
|
+
|
373
|
+
BatchJobQueue resource type.
|
374
|
+
|
375
|
+
### exist
|
376
|
+
|
377
|
+
```ruby
|
378
|
+
describe batch_job_queue('my-batch-job-queue') do
|
379
|
+
it { should exist }
|
380
|
+
end
|
381
|
+
```
|
382
|
+
|
383
|
+
|
384
|
+
### be_disabled
|
385
|
+
|
386
|
+
### be_enabled
|
387
|
+
|
388
|
+
### have_compute_environment_order
|
389
|
+
|
390
|
+
```ruby
|
391
|
+
describe batch_job_queue('my-batch-job-queue') do
|
392
|
+
it { should have_compute_environment_order('arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand', 1) }
|
393
|
+
end
|
394
|
+
```
|
395
|
+
|
396
|
+
### its(:job_queue_name), its(:job_queue_arn), its(:state), its(:status), its(:status_reason), its(:priority)
|
316
397
|
## <a name="cloudformation_stack">cloudformation_stack</a>
|
317
398
|
|
318
399
|
CloudformationStack resource type.
|
@@ -637,7 +718,7 @@ describe directconnect_virtual_interface('my-directconnect-virtual-interface') d
|
|
637
718
|
end
|
638
719
|
```
|
639
720
|
|
640
|
-
### its(:owner_account), its(:virtual_interface_id), its(:location), its(:connection_id), its(:virtual_interface_type), its(:virtual_interface_name), its(:vlan), its(:asn), its(:amazon_side_asn), its(:auth_key), its(:amazon_address), its(:customer_address), its(:address_family), its(:virtual_interface_state), its(:customer_router_config), its(:virtual_gateway_id), its(:direct_connect_gateway_id), its(:route_filter_prefixes), its(:bgp_peers), its(:region), its(:aws_device_v2)
|
721
|
+
### its(:owner_account), its(:virtual_interface_id), its(:location), its(:connection_id), its(:virtual_interface_type), its(:virtual_interface_name), its(:vlan), its(:asn), its(:amazon_side_asn), its(:auth_key), its(:amazon_address), its(:customer_address), its(:address_family), its(:virtual_interface_state), its(:customer_router_config), its(:mtu), its(:jumbo_frame_capable), its(:virtual_gateway_id), its(:direct_connect_gateway_id), its(:route_filter_prefixes), its(:bgp_peers), its(:region), its(:aws_device_v2)
|
641
722
|
## <a name="dynamodb_table">dynamodb_table</a>
|
642
723
|
|
643
724
|
DynamodbTable resource type.
|
@@ -908,7 +989,7 @@ end
|
|
908
989
|
```
|
909
990
|
|
910
991
|
|
911
|
-
### its(:ami_launch_index), its(:image_id), its(:instance_id), its(:instance_type), its(:kernel_id), its(:key_name), its(:launch_time), its(:monitoring), its(:placement), its(:platform), its(:private_dns_name), its(:private_ip_address), its(:product_codes), its(:public_dns_name), its(:public_ip_address), its(:ramdisk_id), its(:state_transition_reason), its(:subnet_id), its(:vpc_id), its(:architecture), its(:client_token), its(:ebs_optimized), its(:ena_support), its(:hypervisor), its(:instance_lifecycle), its(:elastic_gpu_associations), its(:root_device_name), its(:root_device_type), its(:source_dest_check), its(:spot_instance_request_id), its(:sriov_net_support), its(:state_reason), its(:virtualization_type), its(:cpu_options)
|
992
|
+
### its(:ami_launch_index), its(:image_id), its(:instance_id), its(:instance_type), its(:kernel_id), its(:key_name), its(:launch_time), its(:monitoring), its(:placement), its(:platform), its(:private_dns_name), its(:private_ip_address), its(:product_codes), its(:public_dns_name), its(:public_ip_address), its(:ramdisk_id), its(:state_transition_reason), its(:subnet_id), its(:vpc_id), its(:architecture), its(:client_token), its(:ebs_optimized), its(:ena_support), its(:hypervisor), its(:instance_lifecycle), its(:elastic_gpu_associations), its(:root_device_name), its(:root_device_type), its(:source_dest_check), its(:spot_instance_request_id), its(:sriov_net_support), its(:state_reason), its(:virtualization_type), its(:cpu_options), its(:capacity_reservation_id), its(:capacity_reservation_specification)
|
912
993
|
### :unlock: Advanced use
|
913
994
|
|
914
995
|
`ec2` can use `Aws::EC2::Instance` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Instance.html).
|
@@ -1234,7 +1315,7 @@ end
|
|
1234
1315
|
```
|
1235
1316
|
|
1236
1317
|
|
1237
|
-
### its(:domain_id), its(:domain_name), its(:arn), its(:created), its(:deleted), its(:endpoint), its(:endpoints), its(:processing), its(:elasticsearch_version), its(:access_policies), its(:snapshot_options), its(:vpc_options), its(:cognito_options), its(:encryption_at_rest_options), its(:advanced_options), its(:log_publishing_options)
|
1318
|
+
### its(:domain_id), its(:domain_name), its(:arn), its(:created), its(:deleted), its(:endpoint), its(:endpoints), its(:processing), its(:upgrade_processing), its(:elasticsearch_version), its(:access_policies), its(:snapshot_options), its(:vpc_options), its(:cognito_options), its(:encryption_at_rest_options), its(:node_to_node_encryption_options), its(:advanced_options), its(:log_publishing_options), its(:service_software_options)
|
1238
1319
|
## <a name="elastictranscoder_pipeline">elastictranscoder_pipeline</a>
|
1239
1320
|
|
1240
1321
|
ElastictranscoderPipeline resource type.
|
@@ -2234,7 +2315,7 @@ end
|
|
2234
2315
|
```
|
2235
2316
|
|
2236
2317
|
|
2237
|
-
### its(:vpc_id), its(:db_instance_identifier), its(:db_instance_class), its(:engine), its(:db_instance_status), its(:master_username), its(:db_name), its(:endpoint), its(:allocated_storage), its(:instance_create_time), its(:preferred_backup_window), its(:backup_retention_period), its(:db_security_groups), its(:availability_zone), its(:preferred_maintenance_window), its(:pending_modified_values), its(:latest_restorable_time), its(:multi_az), its(:engine_version), its(:auto_minor_version_upgrade), its(:read_replica_source_db_instance_identifier), its(:read_replica_db_instance_identifiers), its(:read_replica_db_cluster_identifiers), its(:license_model), its(:iops), its(:character_set_name), its(:secondary_availability_zone), its(:publicly_accessible), its(:status_infos), its(:storage_type), its(:tde_credential_arn), its(:db_instance_port), its(:db_cluster_identifier), its(:storage_encrypted), its(:kms_key_id), its(:dbi_resource_id), its(:ca_certificate_identifier), its(:domain_memberships), its(:copy_tags_to_snapshot), its(:monitoring_interval), its(:enhanced_monitoring_resource_arn), its(:monitoring_role_arn), its(:promotion_tier), its(:db_instance_arn), its(:timezone), its(:iam_database_authentication_enabled), its(:performance_insights_enabled), its(:performance_insights_kms_key_id), its(:performance_insights_retention_period), its(:enabled_cloudwatch_logs_exports), its(:processor_features)
|
2318
|
+
### its(:vpc_id), its(:db_instance_identifier), its(:db_instance_class), its(:engine), its(:db_instance_status), its(:master_username), its(:db_name), its(:endpoint), its(:allocated_storage), its(:instance_create_time), its(:preferred_backup_window), its(:backup_retention_period), its(:db_security_groups), its(:availability_zone), its(:preferred_maintenance_window), its(:pending_modified_values), its(:latest_restorable_time), its(:multi_az), its(:engine_version), its(:auto_minor_version_upgrade), its(:read_replica_source_db_instance_identifier), its(:read_replica_db_instance_identifiers), its(:read_replica_db_cluster_identifiers), its(:license_model), its(:iops), its(:character_set_name), its(:secondary_availability_zone), its(:publicly_accessible), its(:status_infos), its(:storage_type), its(:tde_credential_arn), its(:db_instance_port), its(:db_cluster_identifier), its(:storage_encrypted), its(:kms_key_id), its(:dbi_resource_id), its(:ca_certificate_identifier), its(:domain_memberships), its(:copy_tags_to_snapshot), its(:monitoring_interval), its(:enhanced_monitoring_resource_arn), its(:monitoring_role_arn), its(:promotion_tier), its(:db_instance_arn), its(:timezone), its(:iam_database_authentication_enabled), its(:performance_insights_enabled), its(:performance_insights_kms_key_id), its(:performance_insights_retention_period), its(:enabled_cloudwatch_logs_exports), its(:processor_features), its(:deletion_protection)
|
2238
2319
|
### :unlock: Advanced use
|
2239
2320
|
|
2240
2321
|
`rds` can use `Aws::RDS::DBInstance` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/RDS/DBInstance.html).
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Awspec::Generator
|
2
|
+
module Doc
|
3
|
+
module Type
|
4
|
+
class BatchComputeEnvironment < Base
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@type_name = 'BatchComputeEnvironment'
|
8
|
+
@type = Awspec::Type::BatchComputeEnvironment.new('my-batch-compute-environment')
|
9
|
+
@ret = @type.resource_via_client
|
10
|
+
@matchers = [
|
11
|
+
Awspec::Type::BatchComputeEnvironment::STATES.map { |state| 'be_' + state.downcase }.join(', '),
|
12
|
+
Awspec::Type::BatchComputeEnvironment::TYPES.map { |type| 'be_' + type.downcase }.join(', ')
|
13
|
+
]
|
14
|
+
@ignore_matchers = [
|
15
|
+
Awspec::Type::BatchComputeEnvironment::STATES.map { |state| 'be_' + state.downcase }.join(', '),
|
16
|
+
Awspec::Type::BatchComputeEnvironment::TYPES.map { |type| 'be_' + type.downcase }.join(', ')
|
17
|
+
]
|
18
|
+
@describes = []
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Awspec::Generator
|
2
|
+
module Doc
|
3
|
+
module Type
|
4
|
+
class BatchJobDefinition < Base
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@type_name = 'BatchJobDefinition'
|
8
|
+
@type = Awspec::Type::BatchJobDefinition.new('my-batch-job-definition')
|
9
|
+
@ret = @type.resource_via_client
|
10
|
+
@matchers = []
|
11
|
+
@ignore_matchers = []
|
12
|
+
@describes = []
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Awspec::Generator
|
2
|
+
module Doc
|
3
|
+
module Type
|
4
|
+
class BatchJobQueue < Base
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@type_name = 'BatchJobQueue'
|
8
|
+
@type = Awspec::Type::BatchJobQueue.new('my-batch-job-queue')
|
9
|
+
@ret = @type.resource_via_client
|
10
|
+
@matchers = []
|
11
|
+
@ignore_matchers = []
|
12
|
+
@describes = []
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/awspec/helper/finder.rb
CHANGED
@@ -38,6 +38,7 @@ require 'awspec/helper/finder/ssm_parameter'
|
|
38
38
|
require 'awspec/helper/finder/codebuild'
|
39
39
|
require 'awspec/helper/finder/apigateway'
|
40
40
|
require 'awspec/helper/finder/kinesis'
|
41
|
+
require 'awspec/helper/finder/batch'
|
41
42
|
|
42
43
|
require 'awspec/helper/finder/account_attributes'
|
43
44
|
|
@@ -85,6 +86,7 @@ module Awspec::Helper
|
|
85
86
|
include Awspec::Helper::Finder::Codebuild
|
86
87
|
include Awspec::Helper::Finder::Apigateway
|
87
88
|
include Awspec::Helper::Finder::Kinesis
|
89
|
+
include Awspec::Helper::Finder::Batch
|
88
90
|
|
89
91
|
CLIENTS = {
|
90
92
|
ec2_client: Aws::EC2::Client,
|
@@ -120,7 +122,8 @@ module Awspec::Helper
|
|
120
122
|
cloudformation_client: Aws::CloudFormation::Client,
|
121
123
|
codebuild_client: Aws::CodeBuild::Client,
|
122
124
|
apigateway_client: Aws::APIGateway::Client,
|
123
|
-
kinesis_client: Aws::Kinesis::Client
|
125
|
+
kinesis_client: Aws::Kinesis::Client,
|
126
|
+
batch_client: Aws::Batch::Client
|
124
127
|
}
|
125
128
|
|
126
129
|
CLIENT_OPTIONS = {
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Awspec::Helper
|
2
|
+
module Finder
|
3
|
+
module Batch
|
4
|
+
def find_batch_compute_environment(name)
|
5
|
+
res = batch_client.describe_compute_environments(compute_environments: [name], max_results: 1)
|
6
|
+
res.compute_environments[0] if res.compute_environments
|
7
|
+
end
|
8
|
+
|
9
|
+
def find_batch_job_definition(name)
|
10
|
+
res = batch_client.describe_job_definitions(job_definitions: [name], max_results: 1)
|
11
|
+
res.job_definitions[0] if res.job_definitions
|
12
|
+
end
|
13
|
+
|
14
|
+
def find_batch_job_queue(name)
|
15
|
+
res = batch_client.describe_job_queues(job_queues: [name], max_results: 1)
|
16
|
+
res.job_queues[0] if res.job_queues
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/awspec/helper/type.rb
CHANGED
@@ -8,7 +8,8 @@ module Awspec
|
|
8
8
|
require 'awspec/type/account_attribute'
|
9
9
|
|
10
10
|
TYPES = %w(
|
11
|
-
alb alb_listener alb_target_group ami apigateway autoscaling_group
|
11
|
+
alb alb_listener alb_target_group ami apigateway autoscaling_group
|
12
|
+
batch_compute_environment batch_job_definition batch_job_queue cloudtrail
|
12
13
|
cloudwatch_alarm cloudwatch_event directconnect_virtual_interface
|
13
14
|
ebs ec2 ecr_repository ecs_cluster ecs_container_instance ecs_service ecs_task_definition
|
14
15
|
efs elasticache elasticache_cache_parameter_group elasticsearch elb firehose iam_group
|
@@ -4,7 +4,7 @@ module Awspec
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def method_missing_via_black_list(name, delegate_to: nil)
|
7
|
-
raise
|
7
|
+
raise ArgumentError, 'delegate_to: must be specified' unless delegate_to
|
8
8
|
if match_black_list?(name) && !match_white_list?(name)
|
9
9
|
raise CalledMethodInBlackList, "Method call #{name.inspect} is black-listed"
|
10
10
|
end
|
@@ -46,6 +46,10 @@ module Awspec
|
|
46
46
|
@resource_via_client = resource
|
47
47
|
end
|
48
48
|
|
49
|
+
def describe_time_to_live(*args)
|
50
|
+
@resource_via_client.send('describe_time_to_live', *args)
|
51
|
+
end
|
52
|
+
|
49
53
|
def method_missing(name)
|
50
54
|
method_missing_via_black_list(name, delegate_to: @resource_via_client)
|
51
55
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
Aws.config[:batch] = {
|
2
|
+
stub_responses: {
|
3
|
+
describe_compute_environments: {
|
4
|
+
compute_environments: [
|
5
|
+
{
|
6
|
+
type: 'MANAGED',
|
7
|
+
compute_environment_arn: 'arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand',
|
8
|
+
compute_environment_name: 'P2OnDemand',
|
9
|
+
compute_resources: {
|
10
|
+
type: 'EC2',
|
11
|
+
desiredv_cpus: 48,
|
12
|
+
ec2_key_pair: 'id_rsa',
|
13
|
+
instance_role: 'ecsInstanceRole',
|
14
|
+
instance_types: %w[
|
15
|
+
p2
|
16
|
+
],
|
17
|
+
maxv_cpus: 128,
|
18
|
+
minv_cpus: 0,
|
19
|
+
security_group_ids: %w[
|
20
|
+
sg-cf5093b2
|
21
|
+
],
|
22
|
+
subnets: %w[
|
23
|
+
subnet-220c0e0a
|
24
|
+
subnet-1a95556d
|
25
|
+
subnet-978f6dce
|
26
|
+
],
|
27
|
+
tags: {
|
28
|
+
'name' => 'Batch Instance - P2OnDemand'
|
29
|
+
}
|
30
|
+
},
|
31
|
+
ecs_cluster_arn: 'arn:aws:ecs:us-east-1:012345678910:cluster/P2OnDemand_Batch_2c06f29d-d1fe-3a49-879d',
|
32
|
+
service_role: 'arn:aws:iam::012345678910:role/AWSBatchServiceRole',
|
33
|
+
state: 'ENABLED',
|
34
|
+
status: 'VALID',
|
35
|
+
status_reason: 'ComputeEnvironment Healthy'
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Aws.config[:batch] = {
|
2
|
+
stub_responses: {
|
3
|
+
describe_job_definitions: {
|
4
|
+
job_definitions: [
|
5
|
+
{
|
6
|
+
type: 'container',
|
7
|
+
container_properties: {
|
8
|
+
command: %w[
|
9
|
+
sleep
|
10
|
+
60
|
11
|
+
],
|
12
|
+
environment: [],
|
13
|
+
image: 'busybox',
|
14
|
+
memory: 128,
|
15
|
+
mount_points: [],
|
16
|
+
ulimits: [],
|
17
|
+
vcpus: 1,
|
18
|
+
volumes: []
|
19
|
+
},
|
20
|
+
job_definition_arn: 'arn:aws:batch:us-east-1:012345678910:job-definition/sleep60:1',
|
21
|
+
job_definition_name: 'sleep60',
|
22
|
+
revision: 1,
|
23
|
+
status: 'ACTIVE'
|
24
|
+
}
|
25
|
+
]
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Aws.config[:batch] = {
|
2
|
+
stub_responses: {
|
3
|
+
describe_job_queues: {
|
4
|
+
job_queues: [
|
5
|
+
{
|
6
|
+
compute_environment_order: [
|
7
|
+
{
|
8
|
+
compute_environment: 'arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand',
|
9
|
+
order: 1
|
10
|
+
}
|
11
|
+
],
|
12
|
+
job_queue_arn: 'arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority',
|
13
|
+
job_queue_name: 'HighPriority',
|
14
|
+
priority: 1,
|
15
|
+
state: 'ENABLED',
|
16
|
+
status: 'VALID',
|
17
|
+
status_reason: 'JobQueue Healthy'
|
18
|
+
}
|
19
|
+
]
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class BatchComputeEnvironment < ResourceBase
|
3
|
+
def initialize(compenv)
|
4
|
+
super
|
5
|
+
@display_name = compenv
|
6
|
+
end
|
7
|
+
|
8
|
+
def resource_via_client
|
9
|
+
@resource_via_client ||= find_batch_compute_environment(@display_name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def id
|
13
|
+
@id ||= resource_via_client.compute_environment_name if resource_via_client
|
14
|
+
end
|
15
|
+
|
16
|
+
STATES = %w(ENABLED DISABLED)
|
17
|
+
|
18
|
+
STATES.each do |state|
|
19
|
+
define_method state.downcase + '?' do
|
20
|
+
resource_via_client.state == state
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
TYPES = %w(MANAGED UNMANAGED)
|
25
|
+
|
26
|
+
TYPES.each do |type|
|
27
|
+
define_method type.downcase + '?' do
|
28
|
+
resource_via_client.type == type
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class BatchJobDefinition < ResourceBase
|
3
|
+
def initialize(jobdef)
|
4
|
+
super
|
5
|
+
@display_name = jobdef
|
6
|
+
end
|
7
|
+
|
8
|
+
def resource_via_client
|
9
|
+
@resource_via_client ||= find_batch_job_definition(@display_name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def id
|
13
|
+
@id ||= resource_via_client.job_definition_name if resource_via_client
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class BatchJobQueue < ResourceBase
|
3
|
+
def initialize(jobqueue)
|
4
|
+
super
|
5
|
+
@display_name = jobqueue
|
6
|
+
end
|
7
|
+
|
8
|
+
def resource_via_client
|
9
|
+
@resource_via_client ||= find_batch_job_queue(@display_name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def id
|
13
|
+
@id ||= resource_via_client.job_queue_name if resource_via_client
|
14
|
+
end
|
15
|
+
|
16
|
+
STATES = %w(ENABLED DISABLED)
|
17
|
+
|
18
|
+
STATES.each do |state|
|
19
|
+
define_method state.downcase + '?' do
|
20
|
+
resource_via_client.state == state
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def has_compute_environment_order?(arn, order)
|
25
|
+
resource_via_client.compute_environment_order.each do |res|
|
26
|
+
return true if res.compute_environment == arn && res.order == order
|
27
|
+
end
|
28
|
+
false
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/awspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -221,6 +221,9 @@ files:
|
|
221
221
|
- doc/_resource_types/ami.md
|
222
222
|
- doc/_resource_types/apigateway.md
|
223
223
|
- doc/_resource_types/autoscaling_group.md
|
224
|
+
- doc/_resource_types/batch_compute_environment.md
|
225
|
+
- doc/_resource_types/batch_job_definition.md
|
226
|
+
- doc/_resource_types/batch_job_queue.md
|
224
227
|
- doc/_resource_types/cloudformation_stack.md
|
225
228
|
- doc/_resource_types/cloudfront_distribution.md
|
226
229
|
- doc/_resource_types/cloudtrail.md
|
@@ -303,6 +306,9 @@ files:
|
|
303
306
|
- lib/awspec/generator/doc/type/apigateway.rb
|
304
307
|
- lib/awspec/generator/doc/type/autoscaling_group.rb
|
305
308
|
- lib/awspec/generator/doc/type/base.rb
|
309
|
+
- lib/awspec/generator/doc/type/batch_compute_environment.rb
|
310
|
+
- lib/awspec/generator/doc/type/batch_job_definition.rb
|
311
|
+
- lib/awspec/generator/doc/type/batch_job_queue.rb
|
306
312
|
- lib/awspec/generator/doc/type/cloudformation_stack.rb
|
307
313
|
- lib/awspec/generator/doc/type/cloudfront_distribution.rb
|
308
314
|
- lib/awspec/generator/doc/type/cloudtrail.rb
|
@@ -406,6 +412,7 @@ files:
|
|
406
412
|
- lib/awspec/helper/finder/ami.rb
|
407
413
|
- lib/awspec/helper/finder/apigateway.rb
|
408
414
|
- lib/awspec/helper/finder/autoscaling.rb
|
415
|
+
- lib/awspec/helper/finder/batch.rb
|
409
416
|
- lib/awspec/helper/finder/cloudformation.rb
|
410
417
|
- lib/awspec/helper/finder/cloudfront.rb
|
411
418
|
- lib/awspec/helper/finder/cloudtrail.rb
|
@@ -487,6 +494,9 @@ files:
|
|
487
494
|
- lib/awspec/stub/ami.rb
|
488
495
|
- lib/awspec/stub/apigateway.rb
|
489
496
|
- lib/awspec/stub/autoscaling_group.rb
|
497
|
+
- lib/awspec/stub/batch_compute_environment.rb
|
498
|
+
- lib/awspec/stub/batch_job_definition.rb
|
499
|
+
- lib/awspec/stub/batch_job_queue.rb
|
490
500
|
- lib/awspec/stub/cloudformation_stack.rb
|
491
501
|
- lib/awspec/stub/cloudfront_distribution.rb
|
492
502
|
- lib/awspec/stub/cloudtrail.rb
|
@@ -557,6 +567,9 @@ files:
|
|
557
567
|
- lib/awspec/type/apigateway.rb
|
558
568
|
- lib/awspec/type/autoscaling_group.rb
|
559
569
|
- lib/awspec/type/base.rb
|
570
|
+
- lib/awspec/type/batch_compute_environment.rb
|
571
|
+
- lib/awspec/type/batch_job_definition.rb
|
572
|
+
- lib/awspec/type/batch_job_queue.rb
|
560
573
|
- lib/awspec/type/cloudformation_stack.rb
|
561
574
|
- lib/awspec/type/cloudfront_distribution.rb
|
562
575
|
- lib/awspec/type/cloudtrail.rb
|
@@ -638,7 +651,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
638
651
|
version: '0'
|
639
652
|
requirements: []
|
640
653
|
rubyforge_project:
|
641
|
-
rubygems_version: 2.
|
654
|
+
rubygems_version: 2.7.6
|
642
655
|
signing_key:
|
643
656
|
specification_version: 4
|
644
657
|
summary: RSpec tests for your AWS resources.
|