awspec 1.18.2 → 1.18.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 733898476ad809cb9ba0e2b92ca1037cdff5293cce4518b63eba160b5efa10cd
4
- data.tar.gz: e224b157c145b236495857c21d0895f892724bd7bb61cee81e924ac9c7c58420
3
+ metadata.gz: bb0f0d41e833307fa113f79242db844f92839b8957cda778037099ae996fd07e
4
+ data.tar.gz: ef50e4986fb63cfbb75cf7227b34c524864e0728c51d0e56ab5bf4f5dc671051
5
5
  SHA512:
6
- metadata.gz: 0f1e654eefddc6f84527661c13e1bd89dc27fd28434c3fbbbfb4672d4d5ccd89283a71b9d99cc789a02be0c31b721e006047c7a0438f79a5144255e0356ba678
7
- data.tar.gz: 075ea1941cc6420619bbdfa2de120d4a84853c001b8dc0f4d19ccee92ac6bf5d0f6817738d032172df7c214aa95f83d267bc78c699a89ce3c845b6c503865ac8
6
+ metadata.gz: 1073d5248b672be4cfeea40672c2f06ade383bc1ea402d952183f906ed6d32241754c126a542ed30f5bd2d16083fbfe98810db03ec96b1f3689e7878ca71dd86
7
+ data.tar.gz: 74ca0db14930a8ebe0a5de40c1631800a88be27ee9cc4efdd0f8f667eca514073e8673a1176bfcf6b0678729c904c83055b082f3bf53472d738938f15f1af68d
data/README.md CHANGED
@@ -151,6 +151,29 @@ $ awspec generate ec2 vpc-ab123cde --profile mycreds
151
151
  $ AWS_PROFILE=mycreds bundle exec rake spec
152
152
  ```
153
153
 
154
+ ### Advanced Tips: Configuring the AWS client retries
155
+
156
+ The [`ClientWrap` class](https://github.com/k1LoW/awspec/blob/master/lib/awspec/helper/client_wrap.rb)
157
+ provides mechanisms for retrying AWS API calls when it receives a
158
+ `RequestLimitExceeded` error. `ClientWrap` implements a backoff algorithm
159
+ where the client will sleep for successively longer periods of time until the
160
+ algorithm has calculated a backoff greater than or equal to the
161
+ `backoff_limit`, at which point it will give up and re-raise the error. You
162
+ can see the full implementation in `ClientWrap#method_missing`.
163
+
164
+ You can configure this retry and backoff logic in your `spec_helper.rb`:
165
+
166
+ ```ruby
167
+ require 'awspec'
168
+
169
+ # These are the defaults, but you can change them.
170
+ Awspec.configure do |config|
171
+ config.client_backoff 0.0
172
+ config.client_backoff_limit 30
173
+ config.client_iteration 1
174
+ end
175
+ ```
176
+
154
177
  ## Support AWS Resources
155
178
 
156
179
  [Resource Types information here](doc/resource_types.md)
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_runtime_dependency 'rspec-its'
30
30
  spec.add_runtime_dependency 'term-ansicolor'
31
31
  spec.add_runtime_dependency 'thor'
32
- spec.add_development_dependency 'bundler', '>= 1.9', '< 2.1'
32
+ spec.add_development_dependency 'bundler', '>= 1.9', '< 3.0'
33
33
  spec.add_development_dependency 'octorelease'
34
34
  spec.add_development_dependency 'pry'
35
35
  spec.add_development_dependency 'rake', '~> 12.0'
@@ -346,7 +346,7 @@ describe autoscaling_group('my-auto-scaling-group') do
346
346
  end
347
347
  ```
348
348
 
349
- ### its(:auto_scaling_group_name), its(:auto_scaling_group_arn), its(:launch_configuration_name), its(:launch_template), its(:mixed_instances_policy), 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)
349
+ ### its(:auto_scaling_group_name), its(:auto_scaling_group_arn), its(:launch_configuration_name), its(:launch_template), its(:mixed_instances_policy), 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), its(:max_instance_lifetime)
350
350
  ## <a name="batch_compute_environment">batch_compute_environment</a>
351
351
 
352
352
  BatchComputeEnvironment resource type.
@@ -574,7 +574,7 @@ describe cloudtrail('my-trail') do
574
574
  end
575
575
  ```
576
576
 
577
- ### its(:name), its(:s3_bucket_name), its(:s3_key_prefix), its(:sns_topic_name), its(:sns_topic_arn), its(:include_global_service_events), its(:is_multi_region_trail), its(:home_region), its(:trail_arn), its(:log_file_validation_enabled), its(:cloud_watch_logs_log_group_arn), its(:cloud_watch_logs_role_arn), its(:kms_key_id), its(:has_custom_event_selectors), its(:is_organization_trail)
577
+ ### its(:name), its(:s3_bucket_name), its(:s3_key_prefix), its(:sns_topic_name), its(:sns_topic_arn), its(:include_global_service_events), its(:is_multi_region_trail), its(:home_region), its(:trail_arn), its(:log_file_validation_enabled), its(:cloud_watch_logs_log_group_arn), its(:cloud_watch_logs_role_arn), its(:kms_key_id), its(:has_custom_event_selectors), its(:has_insight_selectors), its(:is_organization_trail)
578
578
  ## <a name="cloudwatch_alarm">cloudwatch_alarm</a>
579
579
 
580
580
  CloudwatchAlarm resource type.
@@ -762,7 +762,7 @@ end
762
762
  ```
763
763
 
764
764
 
765
- ### its(:bgp_asn), its(:customer_gateway_id), its(:ip_address), its(:certificate_arn), its(:state), its(:type), its(:tags)
765
+ ### its(:bgp_asn), its(:customer_gateway_id), its(:ip_address), its(:certificate_arn), its(:state), its(:type), its(:device_name), its(:tags)
766
766
  ## <a name="directconnect_virtual_interface">directconnect_virtual_interface</a>
767
767
 
768
768
  DirectconnectVirtualInterface resource type.
@@ -834,7 +834,7 @@ end
834
834
  ```
835
835
 
836
836
 
837
- ### its(:table_name), its(:table_status), its(:creation_date_time), its(:table_size_bytes), its(:item_count), its(:table_arn), its(:table_id), its(:billing_mode_summary), its(:local_secondary_indexes), its(:global_secondary_indexes), its(:stream_specification), its(:latest_stream_label), its(:latest_stream_arn), its(:restore_summary), its(:sse_description)
837
+ ### its(:table_name), its(:table_status), its(:creation_date_time), its(:table_size_bytes), its(:item_count), its(:table_arn), its(:table_id), its(:billing_mode_summary), its(:local_secondary_indexes), its(:global_secondary_indexes), its(:stream_specification), its(:latest_stream_label), its(:latest_stream_arn), its(:global_table_version), its(:replicas), its(:restore_summary), its(:sse_description), its(:archival_summary)
838
838
  ### :unlock: Advanced use
839
839
 
840
840
  `dynamodb_table` can use `Aws::DynamoDB::Table` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Table.html).
@@ -894,7 +894,7 @@ end
894
894
  ```
895
895
 
896
896
 
897
- ### its(:availability_zone), its(:create_time), its(:encrypted), its(:kms_key_id), its(:size), its(:snapshot_id), its(:state), its(:volume_id), its(:iops), its(:volume_type)
897
+ ### its(:availability_zone), its(:create_time), its(:encrypted), its(:kms_key_id), its(:outpost_arn), its(:size), its(:snapshot_id), its(:state), its(:volume_id), its(:iops), its(:volume_type), its(:fast_restored)
898
898
  ### :unlock: Advanced use
899
899
 
900
900
  `ebs` can use `Aws::EC2::Volume` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Volume.html).
@@ -1080,7 +1080,7 @@ end
1080
1080
  ```
1081
1081
 
1082
1082
 
1083
- ### 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(:elastic_inference_accelerator_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), its(:hibernation_options), its(:licenses)
1083
+ ### 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(:elastic_inference_accelerator_associations), its(:outpost_arn), 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), its(:hibernation_options), its(:licenses), its(:metadata_options)
1084
1084
  ### :unlock: Advanced use
1085
1085
 
1086
1086
  `ec2` can use `Aws::EC2::Instance` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Instance.html).
@@ -1176,7 +1176,7 @@ describe ecs_cluster('my-ecs-cluster') do
1176
1176
  end
1177
1177
  ```
1178
1178
 
1179
- ### its(:cluster_arn), its(:cluster_name), its(:status), its(:registered_container_instances_count), its(:running_tasks_count), its(:pending_tasks_count), its(:active_services_count), its(:statistics), its(:tags), its(:settings)
1179
+ ### its(:cluster_arn), its(:cluster_name), its(:status), its(:registered_container_instances_count), its(:running_tasks_count), its(:pending_tasks_count), its(:active_services_count), its(:statistics), its(:tags), its(:settings), its(:capacity_providers), its(:default_capacity_provider_strategy), its(:attachments), its(:attachments_status)
1180
1180
  ## <a name="ecs_container_instance">ecs_container_instance</a>
1181
1181
 
1182
1182
  ECS Container Instance resource type.
@@ -1201,7 +1201,7 @@ end
1201
1201
  ```
1202
1202
 
1203
1203
 
1204
- ### its(:container_instance_arn), its(:ec2_instance_id), its(:version), its(:version_info), its(:status), its(:status_reason), its(:agent_connected), its(:running_tasks_count), its(:pending_tasks_count), its(:agent_update_status), its(:attributes), its(:registered_at), its(:attachments), its(:tags)
1204
+ ### its(:container_instance_arn), its(:ec2_instance_id), its(:capacity_provider_name), its(:version), its(:version_info), its(:status), its(:status_reason), its(:agent_connected), its(:running_tasks_count), its(:pending_tasks_count), its(:agent_update_status), its(:attributes), its(:registered_at), its(:attachments), its(:tags)
1205
1205
  ## <a name="ecs_service">ecs_service</a>
1206
1206
 
1207
1207
  ECS Service resource type.
@@ -1223,7 +1223,7 @@ describe ecs_service('my-ecs-service') do
1223
1223
  end
1224
1224
  ```
1225
1225
 
1226
- ### its(:service_arn), its(:service_name), its(:cluster_arn), its(:load_balancers), its(:service_registries), its(:status), its(:desired_count), its(:running_count), its(:pending_count), its(:launch_type), its(:platform_version), its(:task_definition), its(:task_sets), its(:role_arn), its(:created_at), its(:placement_constraints), its(:placement_strategy), its(:network_configuration), its(:health_check_grace_period_seconds), its(:scheduling_strategy), its(:deployment_controller), its(:tags), its(:created_by), its(:enable_ecs_managed_tags), its(:propagate_tags)
1226
+ ### its(:service_arn), its(:service_name), its(:cluster_arn), its(:load_balancers), its(:service_registries), its(:status), its(:desired_count), its(:running_count), its(:pending_count), its(:launch_type), its(:capacity_provider_strategy), its(:platform_version), its(:task_definition), its(:task_sets), its(:role_arn), its(:created_at), its(:placement_constraints), its(:placement_strategy), its(:network_configuration), its(:health_check_grace_period_seconds), its(:scheduling_strategy), its(:deployment_controller), its(:tags), its(:created_by), its(:enable_ecs_managed_tags), its(:propagate_tags)
1227
1227
  ## <a name="ecs_task_definition">ecs_task_definition</a>
1228
1228
 
1229
1229
  ECS Task Definition resource type.
@@ -1245,7 +1245,7 @@ describe ecs_task_definition('my-ecs-task-definition') do
1245
1245
  end
1246
1246
  ```
1247
1247
 
1248
- ### its(:task_definition_arn), its(:family), its(:task_role_arn), its(:execution_role_arn), its(:network_mode), its(:revision), its(:volumes), its(:status), its(:requires_attributes), its(:placement_constraints), its(:compatibilities), its(:requires_compatibilities), its(:cpu), its(:memory), its(:pid_mode), its(:ipc_mode), its(:proxy_configuration)
1248
+ ### its(:task_definition_arn), its(:family), its(:task_role_arn), its(:execution_role_arn), its(:network_mode), its(:revision), its(:volumes), its(:status), its(:requires_attributes), its(:placement_constraints), its(:compatibilities), its(:requires_compatibilities), its(:cpu), its(:memory), its(:inference_accelerators), its(:pid_mode), its(:ipc_mode), its(:proxy_configuration)
1249
1249
  ## <a name="efs">efs</a>
1250
1250
 
1251
1251
  EFS resource type.
@@ -1388,7 +1388,7 @@ describe elasticache('my-rep-group-001') do
1388
1388
  end
1389
1389
  ```
1390
1390
 
1391
- ### its(:cache_cluster_id), its(:configuration_endpoint), its(:client_download_landing_page), its(:cache_node_type), its(:engine), its(:engine_version), its(:cache_cluster_status), its(:num_cache_nodes), its(:preferred_availability_zone), its(:cache_cluster_create_time), its(:preferred_maintenance_window), its(:notification_configuration), its(:cache_security_groups), its(:cache_subnet_group_name), its(:cache_nodes), its(:auto_minor_version_upgrade), its(:replication_group_id), its(:snapshot_retention_limit), its(:snapshot_window), its(:auth_token_enabled), its(:transit_encryption_enabled), its(:at_rest_encryption_enabled)
1391
+ ### its(:cache_cluster_id), its(:configuration_endpoint), its(:client_download_landing_page), its(:cache_node_type), its(:engine), its(:engine_version), its(:cache_cluster_status), its(:num_cache_nodes), its(:preferred_availability_zone), its(:cache_cluster_create_time), its(:preferred_maintenance_window), its(:notification_configuration), its(:cache_security_groups), its(:cache_subnet_group_name), its(:cache_nodes), its(:auto_minor_version_upgrade), its(:replication_group_id), its(:snapshot_retention_limit), its(:snapshot_window), its(:auth_token_enabled), its(:auth_token_last_modified_date), its(:transit_encryption_enabled), its(:at_rest_encryption_enabled)
1392
1392
  ## <a name="elasticache_cache_parameter_group">elasticache_cache_parameter_group</a>
1393
1393
 
1394
1394
  ElasticacheCacheParameterGroup resource type.
@@ -1467,7 +1467,7 @@ end
1467
1467
  ```
1468
1468
 
1469
1469
 
1470
- ### 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)
1470
+ ### 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), its(:domain_endpoint_options)
1471
1471
  ## <a name="elastictranscoder_pipeline">elastictranscoder_pipeline</a>
1472
1472
 
1473
1473
  ElastictranscoderPipeline resource type.
@@ -1612,7 +1612,7 @@ describe emr('my-emr') do
1612
1612
  end
1613
1613
  ```
1614
1614
 
1615
- ### its(:id), its(:name), its(:instance_collection_type), its(:log_uri), its(:requested_ami_version), its(:running_ami_version), its(:release_label), its(:auto_terminate), its(:termination_protected), its(:visible_to_all_users), its(:service_role), its(:normalized_instance_hours), its(:master_public_dns_name), its(:configurations), its(:security_configuration), its(:auto_scaling_role), its(:scale_down_behavior), its(:custom_ami_id), its(:ebs_root_volume_size), its(:repo_upgrade_on_boot)
1615
+ ### its(:id), its(:name), its(:instance_collection_type), its(:log_uri), its(:requested_ami_version), its(:running_ami_version), its(:release_label), its(:auto_terminate), its(:termination_protected), its(:visible_to_all_users), its(:service_role), its(:normalized_instance_hours), its(:master_public_dns_name), its(:configurations), its(:security_configuration), its(:auto_scaling_role), its(:scale_down_behavior), its(:custom_ami_id), its(:ebs_root_volume_size), its(:repo_upgrade_on_boot), its(:cluster_arn), its(:step_concurrency_level), its(:outpost_arn)
1616
1616
  ## <a name="firehose">firehose</a>
1617
1617
 
1618
1618
  Firehose resource type.
@@ -1648,7 +1648,7 @@ end
1648
1648
  ```
1649
1649
 
1650
1650
 
1651
- ### its(:delivery_stream_name), its(:delivery_stream_arn), its(:delivery_stream_status), its(:delivery_stream_encryption_configuration), its(:delivery_stream_type), its(:version_id), its(:create_timestamp), its(:last_update_timestamp), its(:source), its(:has_more_destinations)
1651
+ ### its(:delivery_stream_name), its(:delivery_stream_arn), its(:delivery_stream_status), its(:failure_description), its(:delivery_stream_encryption_configuration), its(:delivery_stream_type), its(:version_id), its(:create_timestamp), its(:last_update_timestamp), its(:source), its(:has_more_destinations)
1652
1652
  ### :unlock: Advanced use
1653
1653
 
1654
1654
  ```ruby
@@ -1880,7 +1880,7 @@ end
1880
1880
  ```
1881
1881
 
1882
1882
 
1883
- ### its(:path), its(:role_name), its(:role_id), its(:arn), its(:create_date), its(:assume_role_policy_document), its(:description), its(:max_session_duration), its(:permissions_boundary), its(:tags)
1883
+ ### its(:path), its(:role_name), its(:role_id), its(:arn), its(:create_date), its(:assume_role_policy_document), its(:description), its(:max_session_duration), its(:permissions_boundary), its(:tags), its(:role_last_used)
1884
1884
  ### :unlock: Advanced use
1885
1885
 
1886
1886
  `iam_role` can use `Aws::IAM::Role` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/IAM/Role.html).
@@ -2125,7 +2125,7 @@ DOC
2125
2125
  end
2126
2126
  ```
2127
2127
 
2128
- ### its(:aws_account_id), its(:key_id), its(:arn), its(:creation_date), its(:enabled), its(:description), its(:key_usage), its(:key_state), its(:deletion_date), its(:valid_to), its(:origin), its(:custom_key_store_id), its(:cloud_hsm_cluster_id), its(:expiration_model), its(:key_manager)
2128
+ ### its(:aws_account_id), its(:key_id), its(:arn), its(:creation_date), its(:enabled), its(:description), its(:key_usage), its(:key_state), its(:deletion_date), its(:valid_to), its(:origin), its(:custom_key_store_id), its(:cloud_hsm_cluster_id), its(:expiration_model), its(:key_manager), its(:customer_master_key_spec), its(:encryption_algorithms), its(:signing_algorithms)
2129
2129
  ## <a name="lambda">lambda</a>
2130
2130
 
2131
2131
  Lambda resource type.
@@ -2174,7 +2174,7 @@ end
2174
2174
 
2175
2175
  This matcher does not support Amazon S3 event sources ([see SDK doc](http://docs.aws.amazon.com/sdkforruby/api/Aws/Lambda/Client.html#list_event_source_mappings-instance_method)).
2176
2176
 
2177
- ### its(:function_name), its(:function_arn), its(:runtime), its(:role), its(:handler), its(:code_size), its(:description), its(:timeout), its(:memory_size), its(:last_modified), its(:code_sha_256), its(:version), its(:vpc_config), its(:dead_letter_config), its(:kms_key_arn), its(:master_arn), its(:revision_id), its(:layers)
2177
+ ### its(:function_name), its(:function_arn), its(:runtime), its(:role), its(:handler), its(:code_size), its(:description), its(:timeout), its(:memory_size), its(:last_modified), its(:code_sha_256), its(:version), its(:vpc_config), its(:dead_letter_config), its(:kms_key_arn), its(:master_arn), its(:revision_id), its(:layers), its(:state), its(:state_reason), its(:state_reason_code), its(:last_update_status), its(:last_update_status_reason), its(:last_update_status_reason_code)
2178
2178
  ## <a name="launch_configuration">launch_configuration</a>
2179
2179
 
2180
2180
  LaunchConfiguration resource type.
@@ -2296,7 +2296,7 @@ describe mq('my-mq') do
2296
2296
  end
2297
2297
  ```
2298
2298
 
2299
- ### its(:vpc_id), its(:auto_minor_version_upgrade), its(:broker_arn), its(:broker_id), its(:broker_name), its(:broker_state), its(:created), its(:deployment_mode), its(:encryption_options), its(:engine_type), its(:engine_version), its(:host_instance_type), its(:pending_engine_version), its(:pending_security_groups), its(:pending_host_instance_type), its(:publicly_accessible), its(:security_groups), its(:subnet_ids)
2299
+ ### its(:vpc_id), its(:auto_minor_version_upgrade), its(:broker_arn), its(:broker_id), its(:broker_name), its(:broker_state), its(:created), its(:deployment_mode), its(:encryption_options), its(:engine_type), its(:engine_version), its(:host_instance_type), its(:pending_engine_version), its(:pending_host_instance_type), its(:pending_security_groups), its(:publicly_accessible), its(:security_groups), its(:storage_type), its(:subnet_ids)
2300
2300
  ## <a name="nat_gateway">nat_gateway</a>
2301
2301
 
2302
2302
  NatGateway resource type.
@@ -2496,7 +2496,7 @@ describe network_interface('eni-12ab3cde') do
2496
2496
  end
2497
2497
  ```
2498
2498
 
2499
- ### its(:association), its(:availability_zone), its(:description), its(:interface_type), its(:ipv_6_addresses), its(:mac_address), its(:network_interface_id), its(:owner_id), its(:private_dns_name), its(:private_ip_address), its(:requester_id), its(:requester_managed), its(:source_dest_check), its(:status), its(:subnet_id), its(:vpc_id)
2499
+ ### its(:association), its(:availability_zone), its(:description), its(:interface_type), its(:ipv_6_addresses), its(:mac_address), its(:network_interface_id), its(:outpost_arn), its(:owner_id), its(:private_dns_name), its(:private_ip_address), its(:requester_id), its(:requester_managed), its(:source_dest_check), its(:status), its(:subnet_id), its(:vpc_id)
2500
2500
  ## <a name="nlb">nlb</a>
2501
2501
 
2502
2502
  NLB resource type.
@@ -3425,7 +3425,7 @@ end
3425
3425
  ```
3426
3426
 
3427
3427
 
3428
- ### its(:availability_zone), its(:availability_zone_id), its(:available_ip_address_count), its(:cidr_block), its(:default_for_az), its(:map_public_ip_on_launch), its(:state), its(:subnet_id), its(:vpc_id), its(:owner_id), its(:assign_ipv_6_address_on_creation), its(:ipv_6_cidr_block_association_set), its(:subnet_arn)
3428
+ ### its(:availability_zone), its(:availability_zone_id), its(:available_ip_address_count), its(:cidr_block), its(:default_for_az), its(:map_public_ip_on_launch), its(:state), its(:subnet_id), its(:vpc_id), its(:owner_id), its(:assign_ipv_6_address_on_creation), its(:ipv_6_cidr_block_association_set), its(:subnet_arn), its(:outpost_arn)
3429
3429
  ### :unlock: Advanced use
3430
3430
 
3431
3431
  `subnet` can use `Aws::EC2::Subnet` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Subnet.html).
@@ -6,6 +6,7 @@ require 'dry/inflector'
6
6
  require 'ipaddr'
7
7
  require 'ipaddress'
8
8
  require 'awsecrets'
9
+ require 'awspec/config'
9
10
  require 'awspec/version'
10
11
  require 'awspec/ext'
11
12
  require 'awspec/error'
@@ -0,0 +1,41 @@
1
+ require 'singleton'
2
+
3
+ require 'awspec/error'
4
+
5
+ module Awspec
6
+ class Config
7
+ include Singleton
8
+
9
+ def initialize
10
+ @config = {
11
+ client_backoff: 0.0,
12
+ client_backoff_limit: 30.0,
13
+ client_iteration: 1
14
+ }
15
+ end
16
+
17
+ def client_backoff(backoff)
18
+ @config[:client_backoff] = backoff
19
+ end
20
+
21
+ def client_backoff_limit(backoff_limit)
22
+ @config[:client_backoff_limit] = backoff_limit
23
+ end
24
+
25
+ def client_iteration(iteration)
26
+ @config[:client_iteration] = iteration
27
+ end
28
+
29
+ def [](key)
30
+ @config.fetch(key)
31
+ end
32
+
33
+ def method_missing(method_name, *_args)
34
+ raise UnknownConfiguration, "'#{method_name}' is not a valid configuration for Awspec."
35
+ end
36
+ end
37
+
38
+ def self.configure
39
+ yield(Config.instance)
40
+ end
41
+ end
@@ -25,4 +25,8 @@ module Awspec
25
25
  super message
26
26
  end
27
27
  end
28
+
29
+ # Let the user know the configuration they provided is not known.
30
+ class UnknownConfiguration < StandardError
31
+ end
28
32
  end
@@ -6,10 +6,22 @@ module Awspec::Generator
6
6
  hosted_zone = find_hosted_zone(id)
7
7
  raise 'Not Found Route53 Hosted Zone' unless hosted_zone
8
8
  id = hosted_zone[:id]
9
+ selected = []
9
10
  res = @route53_client.list_resource_record_sets({
10
11
  hosted_zone_id: id
11
12
  })
12
- resource_record_sets = res.resource_record_sets.map do |record_set|
13
+ loop do
14
+ selected += res.resource_record_sets
15
+ break unless res.is_truncated
16
+
17
+ res = @route53_client.list_resource_record_sets({
18
+ hosted_zone_id: id,
19
+ start_record_name: res.next_record_name,
20
+ start_record_type: res.next_record_type
21
+ })
22
+ end
23
+
24
+ resource_record_sets = selected.map do |record_set|
13
25
  generate_linespec(record_set)
14
26
  end
15
27
 
@@ -1,14 +1,17 @@
1
+ require 'awspec/config'
2
+
1
3
  module Awspec::Helper
2
4
  class ClientWrap
3
5
  attr_reader :client, :backoff, :iteration, :backoff_limit, :symbol
4
- def initialize(real_client = nil, args = {})
6
+ def initialize(real_client = nil)
5
7
  raise ArgumentError, 'Client can not be nil' if real_client.nil?
8
+ config = Awspec::Config.instance
6
9
  @client = real_client
7
- @backoff = args.key?(:backoff) ? args[:backoff] : 0.0
10
+ @backoff = config[:client_backoff]
8
11
  @orig_backoff = @backoff
9
- @iteration = args.key?(:iteration) ? args[:iteration] : 1
12
+ @iteration = config[:client_iteration]
10
13
  @orig_iter = @iteration
11
- @backoff_limit = args.key?(:backoff_limit) ? args[:backoff_limit] : 30.0
14
+ @backoff_limit = config[:client_backoff_limit]
12
15
  # build the symbol we'll use to compare to any errors caught in method_missing
13
16
  # below.
14
17
  @symbol = real_client.class.to_s.split('::').shift(2).push('Errors', 'RequestLimitExceeded').join('::').to_sym
@@ -8,7 +8,10 @@ module Awspec::Helper
8
8
  selected += res.distribution_list.items.select do |item|
9
9
  item.id == id || item.domain_name == id
10
10
  end
11
- (res.next_page? && res = res.next_page) || break
11
+ break unless res.distribution_list.is_truncated
12
+ res = cloudfront_client.list_distributions({
13
+ marker: res.distribution_list.next_marker
14
+ })
12
15
  end
13
16
 
14
17
  selected.single_resource(id)
@@ -20,7 +20,10 @@ module Awspec::Helper
20
20
 
21
21
  loop do
22
22
  selected += res.metric_alarms
23
- (res.next_page? && res = res.next_page) || break
23
+ break if res.next_token.nil?
24
+ res = cloudwatch_client.describe_alarms({
25
+ next_token: res.next_token
26
+ })
24
27
  end
25
28
 
26
29
  selected
@@ -30,7 +30,10 @@ module Awspec::Helper
30
30
 
31
31
  loop do
32
32
  selected += res.volumes.select { |v| v.attachments.count > 0 }
33
- (res.next_page? && res = res.next_page) || break
33
+ break if res.next_token.nil?
34
+ res = ec2_client.describe_volumes({
35
+ next_token: res.next_token
36
+ })
34
37
  end
35
38
 
36
39
  selected
@@ -8,7 +8,10 @@ module Awspec::Helper
8
8
  selected += res.pipelines.select do |pipeline|
9
9
  pipeline.id == id || pipeline.name == id
10
10
  end
11
- (res.next_page? && res = res.next_page) || break
11
+ break if res.next_page_token.nil?
12
+ res = elastictranscoder_client.list_pipelines({
13
+ page_token: res.next_page_token
14
+ })
12
15
  end
13
16
 
14
17
  selected.single_resource(id)
@@ -12,7 +12,12 @@ module Awspec::Helper
12
12
  selected += res[type.pluralize].select do |u|
13
13
  u[type + '_name'] == id || u[type + '_id'] == id || u.arn == id
14
14
  end
15
- (res.next_page? && res = res.next_page) || break
15
+
16
+ break unless res.is_truncated
17
+ res = iam_client.send(
18
+ 'list_' + type.pluralize,
19
+ { marker => res.marker }
20
+ )
16
21
  end
17
22
 
18
23
  selected.single_resource(id)
@@ -62,7 +67,10 @@ module Awspec::Helper
62
67
 
63
68
  loop do
64
69
  selected += res.policies.select { |p| p.attachment_count > 0 }
65
- (res.next_page? && res = res.next_page) || break
70
+ break unless res.is_truncated
71
+ res = iam_client.list_policies({
72
+ marker: res.marker
73
+ })
66
74
  end
67
75
 
68
76
  selected
@@ -9,7 +9,10 @@ module Awspec::Helper
9
9
  selected += res.functions.select do |function|
10
10
  function.function_name == id || function.function_arn == id
11
11
  end
12
- (res.next_page? && res = res.next_page) || break
12
+ break if res.next_marker.nil?
13
+ res = lambda_client.list_functions({
14
+ marker: res.next_marker
15
+ })
13
16
  end
14
17
 
15
18
  selected.single_resource(id)
@@ -30,7 +30,11 @@ module Awspec::Helper
30
30
  res.parameters.each do |param|
31
31
  parameters[param.parameter_name] = param.parameter_value
32
32
  end
33
- (res.next_page? && res = res.next_page) || break
33
+ break if res.marker.nil?
34
+ res = rds_client.describe_db_parameters({
35
+ db_parameter_group_name: parameter_group,
36
+ marker: res.marker
37
+ })
34
38
  end
35
39
  parameters
36
40
  end
@@ -24,7 +24,11 @@ module Awspec::Helper
24
24
  res.parameters.each do |param|
25
25
  parameters[param.parameter_name] = param.parameter_value
26
26
  end
27
- (res.respond_to?(:next_page?) && res.next_page? && res = res.next_page) || break
27
+ break if res.marker.nil?
28
+ res = redshift_client.describe_cluster_parameters({
29
+ parameter_group_name: parameter_group,
30
+ marker: res.marker
31
+ })
28
32
  end
29
33
  parameters
30
34
  end
@@ -10,7 +10,11 @@ module Awspec::Helper
10
10
  selected.push(hosted_zone)
11
11
  end
12
12
  end
13
- (res.next_page? && res = res.next_page) || break
13
+
14
+ break unless res.is_truncated
15
+ res = route53_client.list_hosted_zones({
16
+ marker: res.next_marker
17
+ })
14
18
  end
15
19
  selected.single_resource(id)
16
20
  end
@@ -22,7 +26,13 @@ module Awspec::Helper
22
26
  })
23
27
  loop do
24
28
  selected += res.resource_record_sets
25
- (res.next_page? && res = res.next_page) || break
29
+ break unless res.is_truncated
30
+
31
+ res = route53_client.list_resource_record_sets({
32
+ hosted_zone_id: id,
33
+ start_record_name: res.next_record_name,
34
+ start_record_type: res.next_record_type
35
+ })
26
36
  end
27
37
  selected
28
38
  end
@@ -17,7 +17,11 @@ module Awspec::Type
17
17
  res.parameters.each do |param|
18
18
  parameters[param.parameter_name] = param.parameter_value
19
19
  end
20
- (res.next_page? && res = res.next_page) || break
20
+ break if res.marker.nil?
21
+ res = elasticache_client.describe_cache_parameters({
22
+ cache_parameter_group_name: @display_name,
23
+ marker: res.marker
24
+ })
21
25
  end
22
26
  @resource_via_client ||= parameters
23
27
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '1.18.2'
2
+ VERSION = '1.18.3'
3
3
  end
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.18.2
4
+ version: 1.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-03 00:00:00.000000000 Z
11
+ date: 2020-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -131,7 +131,7 @@ dependencies:
131
131
  version: '1.9'
132
132
  - - "<"
133
133
  - !ruby/object:Gem::Version
134
- version: '2.1'
134
+ version: '3.0'
135
135
  type: :development
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
@@ -141,7 +141,7 @@ dependencies:
141
141
  version: '1.9'
142
142
  - - "<"
143
143
  - !ruby/object:Gem::Version
144
- version: '2.1'
144
+ version: '3.0'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: octorelease
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -303,6 +303,7 @@ files:
303
303
  - lib/awspec.rb
304
304
  - lib/awspec/cli.rb
305
305
  - lib/awspec/command/generate.rb
306
+ - lib/awspec/config.rb
306
307
  - lib/awspec/error.rb
307
308
  - lib/awspec/ext.rb
308
309
  - lib/awspec/ext/array.rb