fog-aws 3.0.0 → 3.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/ruby.yml +36 -0
- data/.github/workflows/stale.yml +23 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +354 -22
- data/Gemfile +1 -1
- data/LICENSE.md +1 -1
- data/README.md +60 -7
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fog-aws.gemspec +5 -4
- data/lib/fog/aws.rb +27 -19
- data/lib/fog/aws/auto_scaling.rb +1 -0
- data/lib/fog/aws/cdn.rb +15 -2
- data/lib/fog/aws/compute.rb +36 -23
- data/lib/fog/aws/credential_fetcher.rb +62 -8
- data/lib/fog/aws/dns.rb +154 -5
- data/lib/fog/aws/efs.rb +1 -1
- data/lib/fog/aws/elasticache.rb +4 -2
- data/lib/fog/aws/elb.rb +3 -2
- data/lib/fog/aws/elbv2.rb +72 -0
- data/lib/fog/aws/glacier.rb +83 -21
- data/lib/fog/aws/kinesis.rb +23 -15
- data/lib/fog/aws/models/auto_scaling/group.rb +10 -0
- data/lib/fog/aws/models/cdn/distribution.rb +4 -4
- data/lib/fog/aws/models/cdn/distribution_helper.rb +2 -2
- data/lib/fog/aws/models/cdn/distributions.rb +4 -4
- data/lib/fog/aws/models/cdn/distributions_helper.rb +2 -2
- data/lib/fog/aws/models/cdn/invalidation.rb +2 -2
- data/lib/fog/aws/models/cdn/invalidations.rb +3 -3
- data/lib/fog/aws/models/cdn/streaming_distribution.rb +3 -3
- data/lib/fog/aws/models/cdn/streaming_distributions.rb +4 -4
- data/lib/fog/aws/models/compute/address.rb +3 -2
- data/lib/fog/aws/models/compute/addresses.rb +3 -3
- data/lib/fog/aws/models/compute/dhcp_option.rb +2 -2
- data/lib/fog/aws/models/compute/dhcp_options.rb +7 -7
- data/lib/fog/aws/models/compute/flavor.rb +2 -2
- data/lib/fog/aws/models/compute/flavors.rb +2719 -397
- data/lib/fog/aws/models/compute/image.rb +2 -2
- data/lib/fog/aws/models/compute/images.rb +3 -3
- data/lib/fog/aws/models/compute/internet_gateway.rb +2 -2
- data/lib/fog/aws/models/compute/internet_gateways.rb +7 -7
- data/lib/fog/aws/models/compute/key_pair.rb +2 -2
- data/lib/fog/aws/models/compute/key_pairs.rb +3 -3
- data/lib/fog/aws/models/compute/network_acl.rb +4 -4
- data/lib/fog/aws/models/compute/network_acls.rb +6 -6
- data/lib/fog/aws/models/compute/network_interface.rb +2 -2
- data/lib/fog/aws/models/compute/network_interfaces.rb +4 -4
- data/lib/fog/aws/models/compute/route_table.rb +2 -2
- data/lib/fog/aws/models/compute/route_tables.rb +7 -7
- data/lib/fog/aws/models/compute/security_group.rb +2 -2
- data/lib/fog/aws/models/compute/security_groups.rb +3 -3
- data/lib/fog/aws/models/compute/server.rb +6 -4
- data/lib/fog/aws/models/compute/servers.rb +13 -8
- data/lib/fog/aws/models/compute/snapshot.rb +9 -8
- data/lib/fog/aws/models/compute/snapshots.rb +3 -3
- data/lib/fog/aws/models/compute/spot_request.rb +2 -2
- data/lib/fog/aws/models/compute/spot_requests.rb +3 -3
- data/lib/fog/aws/models/compute/subnet.rb +2 -2
- data/lib/fog/aws/models/compute/subnets.rb +3 -3
- data/lib/fog/aws/models/compute/tag.rb +2 -2
- data/lib/fog/aws/models/compute/tags.rb +3 -3
- data/lib/fog/aws/models/compute/volume.rb +3 -3
- data/lib/fog/aws/models/compute/volumes.rb +3 -3
- data/lib/fog/aws/models/compute/vpc.rb +10 -4
- data/lib/fog/aws/models/compute/vpcs.rb +3 -3
- data/lib/fog/aws/models/dns/record.rb +2 -2
- data/lib/fog/aws/models/dns/records.rb +4 -4
- data/lib/fog/aws/models/dns/zone.rb +3 -3
- data/lib/fog/aws/models/dns/zones.rb +4 -4
- data/lib/fog/aws/models/efs/file_system.rb +4 -0
- data/lib/fog/aws/models/rds/cluster.rb +9 -1
- data/lib/fog/aws/models/rds/server.rb +66 -63
- data/lib/fog/aws/models/storage/directories.rb +3 -3
- data/lib/fog/aws/models/storage/directory.rb +40 -6
- data/lib/fog/aws/models/storage/file.rb +132 -7
- data/lib/fog/aws/models/storage/files.rb +36 -6
- data/lib/fog/aws/models/storage/version.rb +2 -2
- data/lib/fog/aws/models/storage/versions.rb +3 -3
- data/lib/fog/aws/parsers/cdn/distribution.rb +2 -2
- data/lib/fog/aws/parsers/cdn/get_distribution_list.rb +2 -2
- data/lib/fog/aws/parsers/cdn/get_invalidation.rb +2 -2
- data/lib/fog/aws/parsers/cdn/get_invalidation_list.rb +2 -2
- data/lib/fog/aws/parsers/cdn/get_streaming_distribution_list.rb +2 -2
- data/lib/fog/aws/parsers/cdn/post_invalidation.rb +2 -2
- data/lib/fog/aws/parsers/cdn/streaming_distribution.rb +1 -1
- data/lib/fog/aws/parsers/compute/allocate_address.rb +2 -2
- data/lib/fog/aws/parsers/compute/assign_private_ip_addresses.rb +2 -2
- data/lib/fog/aws/parsers/compute/associate_address.rb +2 -2
- data/lib/fog/aws/parsers/compute/associate_route_table.rb +2 -2
- data/lib/fog/aws/parsers/compute/attach_network_interface.rb +2 -2
- data/lib/fog/aws/parsers/compute/attach_volume.rb +2 -2
- data/lib/fog/aws/parsers/compute/basic.rb +2 -2
- data/lib/fog/aws/parsers/compute/cancel_spot_instance_requests.rb +2 -2
- data/lib/fog/aws/parsers/compute/copy_image.rb +2 -2
- data/lib/fog/aws/parsers/compute/copy_snapshot.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_dhcp_options.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_image.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_internet_gateway.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_key_pair.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_network_acl.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_network_interface.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_route_table.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_security_group.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_snapshot.rb +3 -3
- data/lib/fog/aws/parsers/compute/create_subnet.rb +35 -8
- data/lib/fog/aws/parsers/compute/create_volume.rb +2 -2
- data/lib/fog/aws/parsers/compute/create_vpc.rb +2 -2
- data/lib/fog/aws/parsers/compute/deregister_image.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_account_attributes.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_addresses.rb +32 -11
- data/lib/fog/aws/parsers/compute/describe_availability_zones.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_classic_link_instances.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_dhcp_options.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_image_attribute.rb +122 -0
- data/lib/fog/aws/parsers/compute/describe_images.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_instance_attribute.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_instance_status.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_instances.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_internet_gateways.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_key_pairs.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_network_acls.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_network_interface_attribute.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_network_interfaces.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_placement_groups.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_regions.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_reserved_instances.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_route_tables.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_security_groups.rb +3 -3
- data/lib/fog/aws/parsers/compute/describe_snapshots.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_spot_price_history.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_subnets.rb +35 -8
- data/lib/fog/aws/parsers/compute/describe_tags.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_volume_status.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_volumes.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_volumes_modifications.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_vpc_attribute.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_vpc_classic_link.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_vpc_classic_link_dns_support.rb +2 -2
- data/lib/fog/aws/parsers/compute/describe_vpcs.rb +2 -2
- data/lib/fog/aws/parsers/compute/detach_volume.rb +2 -2
- data/lib/fog/aws/parsers/compute/get_console_output.rb +2 -2
- data/lib/fog/aws/parsers/compute/get_password_data.rb +2 -2
- data/lib/fog/aws/parsers/compute/import_key_pair.rb +2 -2
- data/lib/fog/aws/parsers/compute/modify_subnet_attribute.rb +2 -2
- data/lib/fog/aws/parsers/compute/modify_volume.rb +2 -2
- data/lib/fog/aws/parsers/compute/monitor_unmonitor_instances.rb +2 -2
- data/lib/fog/aws/parsers/compute/move_address_to_vpc.rb +2 -2
- data/lib/fog/aws/parsers/compute/network_acl_parser.rb +2 -2
- data/lib/fog/aws/parsers/compute/network_interface_parser.rb +2 -2
- data/lib/fog/aws/parsers/compute/purchase_reserved_instances_offering.rb +2 -2
- data/lib/fog/aws/parsers/compute/register_image.rb +2 -2
- data/lib/fog/aws/parsers/compute/replace_network_acl_association.rb +2 -2
- data/lib/fog/aws/parsers/compute/restore_address_to_classic.rb +2 -2
- data/lib/fog/aws/parsers/compute/run_instances.rb +2 -2
- data/lib/fog/aws/parsers/compute/spot_datafeed_subscription.rb +2 -2
- data/lib/fog/aws/parsers/compute/spot_instance_requests.rb +2 -2
- data/lib/fog/aws/parsers/compute/start_stop_instances.rb +2 -2
- data/lib/fog/aws/parsers/compute/terminate_instances.rb +2 -2
- data/lib/fog/aws/parsers/dns/change_resource_record_sets.rb +2 -2
- data/lib/fog/aws/parsers/dns/create_hosted_zone.rb +3 -3
- data/lib/fog/aws/parsers/dns/delete_hosted_zone.rb +2 -2
- data/lib/fog/aws/parsers/dns/get_change.rb +2 -2
- data/lib/fog/aws/parsers/dns/get_hosted_zone.rb +5 -5
- data/lib/fog/aws/parsers/dns/health_check.rb +2 -2
- data/lib/fog/aws/parsers/dns/list_health_checks.rb +2 -2
- data/lib/fog/aws/parsers/dns/list_hosted_zones.rb +5 -3
- data/lib/fog/aws/parsers/dns/list_resource_record_sets.rb +2 -2
- data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +3 -3
- data/lib/fog/aws/parsers/elbv2/create_load_balancer.rb +88 -0
- data/lib/fog/aws/parsers/elbv2/describe_listeners.rb +110 -0
- data/lib/fog/aws/parsers/elbv2/describe_load_balancers.rb +88 -0
- data/lib/fog/aws/parsers/elbv2/describe_tags.rb +53 -0
- data/lib/fog/aws/parsers/elbv2/empty.rb +10 -0
- data/lib/fog/aws/parsers/rds/db_parser.rb +41 -2
- data/lib/fog/aws/parsers/storage/access_control_list.rb +2 -2
- data/lib/fog/aws/parsers/storage/complete_multipart_upload.rb +2 -2
- data/lib/fog/aws/parsers/storage/copy_object.rb +2 -2
- data/lib/fog/aws/parsers/storage/cors_configuration.rb +2 -2
- data/lib/fog/aws/parsers/storage/delete_multiple_objects.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket_lifecycle.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket_location.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket_logging.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket_notification.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket_object_versions.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket_tagging.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket_versioning.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_bucket_website.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_object_tagging.rb +33 -0
- data/lib/fog/aws/parsers/storage/get_request_payment.rb +2 -2
- data/lib/fog/aws/parsers/storage/get_service.rb +2 -2
- data/lib/fog/aws/parsers/storage/initiate_multipart_upload.rb +2 -2
- data/lib/fog/aws/parsers/storage/list_multipart_uploads.rb +2 -2
- data/lib/fog/aws/parsers/storage/list_parts.rb +2 -2
- data/lib/fog/aws/parsers/storage/upload_part_copy_object.rb +18 -0
- data/lib/fog/aws/parsers/sts/assume_role_with_web_identity.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/set_instance_protection.rb +67 -0
- data/lib/fog/aws/requests/cdn/delete_distribution.rb +6 -6
- data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +6 -6
- data/lib/fog/aws/requests/cdn/get_distribution.rb +5 -5
- data/lib/fog/aws/requests/cdn/get_distribution_list.rb +3 -3
- data/lib/fog/aws/requests/cdn/get_invalidation.rb +5 -5
- data/lib/fog/aws/requests/cdn/get_invalidation_list.rb +4 -4
- data/lib/fog/aws/requests/cdn/get_streaming_distribution.rb +5 -5
- data/lib/fog/aws/requests/cdn/get_streaming_distribution_list.rb +3 -3
- data/lib/fog/aws/requests/cdn/post_distribution.rb +6 -6
- data/lib/fog/aws/requests/cdn/post_invalidation.rb +5 -5
- data/lib/fog/aws/requests/cdn/post_streaming_distribution.rb +6 -6
- data/lib/fog/aws/requests/cdn/put_distribution_config.rb +7 -7
- data/lib/fog/aws/requests/cdn/put_streaming_distribution_config.rb +7 -7
- data/lib/fog/aws/requests/cloud_watch/put_metric_alarm.rb +2 -2
- data/lib/fog/aws/requests/compute/allocate_address.rb +4 -4
- data/lib/fog/aws/requests/compute/assign_private_ip_addresses.rb +5 -5
- data/lib/fog/aws/requests/compute/associate_address.rb +7 -7
- data/lib/fog/aws/requests/compute/associate_dhcp_options.rb +4 -4
- data/lib/fog/aws/requests/compute/associate_route_table.rb +5 -5
- data/lib/fog/aws/requests/compute/attach_classic_link_vpc.rb +7 -7
- data/lib/fog/aws/requests/compute/attach_internet_gateway.rb +4 -4
- data/lib/fog/aws/requests/compute/attach_network_interface.rb +6 -6
- data/lib/fog/aws/requests/compute/attach_volume.rb +7 -7
- data/lib/fog/aws/requests/compute/authorize_security_group_egress.rb +6 -6
- data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +11 -11
- data/lib/fog/aws/requests/compute/cancel_spot_instance_requests.rb +4 -4
- data/lib/fog/aws/requests/compute/copy_image.rb +3 -3
- data/lib/fog/aws/requests/compute/copy_snapshot.rb +3 -3
- data/lib/fog/aws/requests/compute/create_dhcp_options.rb +3 -3
- data/lib/fog/aws/requests/compute/create_image.rb +3 -3
- data/lib/fog/aws/requests/compute/create_internet_gateway.rb +3 -3
- data/lib/fog/aws/requests/compute/create_key_pair.rb +4 -4
- data/lib/fog/aws/requests/compute/create_network_acl.rb +4 -4
- data/lib/fog/aws/requests/compute/create_network_acl_entry.rb +5 -5
- data/lib/fog/aws/requests/compute/create_network_interface.rb +6 -6
- data/lib/fog/aws/requests/compute/create_placement_group.rb +3 -3
- data/lib/fog/aws/requests/compute/create_route.rb +10 -10
- data/lib/fog/aws/requests/compute/create_route_table.rb +4 -4
- data/lib/fog/aws/requests/compute/create_security_group.rb +4 -4
- data/lib/fog/aws/requests/compute/create_snapshot.rb +3 -3
- data/lib/fog/aws/requests/compute/create_spot_datafeed_subscription.rb +3 -3
- data/lib/fog/aws/requests/compute/create_subnet.rb +6 -6
- data/lib/fog/aws/requests/compute/create_tags.rb +3 -3
- data/lib/fog/aws/requests/compute/create_volume.rb +11 -11
- data/lib/fog/aws/requests/compute/create_vpc.rb +7 -7
- data/lib/fog/aws/requests/compute/delete_dhcp_options.rb +4 -4
- data/lib/fog/aws/requests/compute/delete_internet_gateway.rb +4 -4
- data/lib/fog/aws/requests/compute/delete_key_pair.rb +3 -3
- data/lib/fog/aws/requests/compute/delete_network_acl.rb +5 -5
- data/lib/fog/aws/requests/compute/delete_network_acl_entry.rb +5 -5
- data/lib/fog/aws/requests/compute/delete_network_interface.rb +5 -5
- data/lib/fog/aws/requests/compute/delete_placement_group.rb +3 -3
- data/lib/fog/aws/requests/compute/delete_route.rb +6 -6
- data/lib/fog/aws/requests/compute/delete_route_table.rb +5 -5
- data/lib/fog/aws/requests/compute/delete_security_group.rb +9 -9
- data/lib/fog/aws/requests/compute/delete_snapshot.rb +4 -4
- data/lib/fog/aws/requests/compute/delete_spot_datafeed_subscription.rb +3 -3
- data/lib/fog/aws/requests/compute/delete_subnet.rb +4 -4
- data/lib/fog/aws/requests/compute/delete_tags.rb +3 -3
- data/lib/fog/aws/requests/compute/delete_volume.rb +5 -5
- data/lib/fog/aws/requests/compute/delete_vpc.rb +4 -4
- data/lib/fog/aws/requests/compute/deregister_image.rb +4 -4
- data/lib/fog/aws/requests/compute/describe_account_attributes.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_addresses.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_availability_zones.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_classic_link_instances.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_dhcp_options.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_image_attribute.rb +74 -0
- data/lib/fog/aws/requests/compute/describe_images.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_instance_attribute.rb +4 -4
- data/lib/fog/aws/requests/compute/describe_instance_status.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_instances.rb +4 -4
- data/lib/fog/aws/requests/compute/describe_internet_gateways.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_key_pairs.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_network_acls.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_network_interface_attribute.rb +5 -5
- data/lib/fog/aws/requests/compute/describe_network_interfaces.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_placement_groups.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_regions.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_reserved_instances.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_reserved_instances_offerings.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_route_tables.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_security_groups.rb +15 -4
- data/lib/fog/aws/requests/compute/describe_snapshots.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_spot_datafeed_subscription.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_spot_instance_requests.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_spot_price_history.rb +5 -5
- data/lib/fog/aws/requests/compute/describe_subnets.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_tags.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_volume_status.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_volumes.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_volumes_modifications.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_vpc_attribute.rb +5 -5
- data/lib/fog/aws/requests/compute/describe_vpc_classic_link.rb +4 -4
- data/lib/fog/aws/requests/compute/describe_vpc_classic_link_dns_support.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_vpcs.rb +3 -3
- data/lib/fog/aws/requests/compute/detach_classic_link_vpc.rb +5 -5
- data/lib/fog/aws/requests/compute/detach_internet_gateway.rb +4 -4
- data/lib/fog/aws/requests/compute/detach_network_interface.rb +4 -4
- data/lib/fog/aws/requests/compute/detach_volume.rb +5 -5
- data/lib/fog/aws/requests/compute/disable_vpc_classic_link.rb +4 -4
- data/lib/fog/aws/requests/compute/disable_vpc_classic_link_dns_support.rb +4 -4
- data/lib/fog/aws/requests/compute/disassociate_address.rb +5 -5
- data/lib/fog/aws/requests/compute/disassociate_route_table.rb +5 -5
- data/lib/fog/aws/requests/compute/enable_vpc_classic_link.rb +4 -4
- data/lib/fog/aws/requests/compute/enable_vpc_classic_link_dns_support.rb +4 -4
- data/lib/fog/aws/requests/compute/get_console_output.rb +4 -4
- data/lib/fog/aws/requests/compute/get_password_data.rb +4 -4
- data/lib/fog/aws/requests/compute/import_key_pair.rb +4 -4
- data/lib/fog/aws/requests/compute/modify_image_attribute.rb +4 -4
- data/lib/fog/aws/requests/compute/modify_instance_attribute.rb +3 -3
- data/lib/fog/aws/requests/compute/modify_instance_placement.rb +33 -0
- data/lib/fog/aws/requests/compute/modify_network_interface_attribute.rb +8 -8
- data/lib/fog/aws/requests/compute/modify_snapshot_attribute.rb +3 -3
- data/lib/fog/aws/requests/compute/modify_subnet_attribute.rb +3 -3
- data/lib/fog/aws/requests/compute/modify_volume.rb +5 -5
- data/lib/fog/aws/requests/compute/modify_volume_attribute.rb +4 -4
- data/lib/fog/aws/requests/compute/modify_vpc_attribute.rb +7 -7
- data/lib/fog/aws/requests/compute/monitor_instances.rb +4 -4
- data/lib/fog/aws/requests/compute/move_address_to_vpc.rb +4 -4
- data/lib/fog/aws/requests/compute/purchase_reserved_instances_offering.rb +3 -3
- data/lib/fog/aws/requests/compute/reboot_instances.rb +4 -4
- data/lib/fog/aws/requests/compute/register_image.rb +4 -4
- data/lib/fog/aws/requests/compute/release_address.rb +5 -5
- data/lib/fog/aws/requests/compute/replace_network_acl_association.rb +5 -5
- data/lib/fog/aws/requests/compute/replace_network_acl_entry.rb +5 -5
- data/lib/fog/aws/requests/compute/replace_route.rb +10 -10
- data/lib/fog/aws/requests/compute/request_spot_instances.rb +8 -8
- data/lib/fog/aws/requests/compute/reset_network_interface_attribute.rb +6 -6
- data/lib/fog/aws/requests/compute/restore_address_to_classic.rb +5 -5
- data/lib/fog/aws/requests/compute/revoke_security_group_egress.rb +4 -4
- data/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +4 -4
- data/lib/fog/aws/requests/compute/run_instances.rb +24 -4
- data/lib/fog/aws/requests/compute/start_instances.rb +4 -4
- data/lib/fog/aws/requests/compute/stop_instances.rb +15 -7
- data/lib/fog/aws/requests/compute/terminate_instances.rb +4 -4
- data/lib/fog/aws/requests/compute/unmonitor_instances.rb +4 -4
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +6 -139
- data/lib/fog/aws/requests/dns/create_health_check.rb +3 -3
- data/lib/fog/aws/requests/dns/create_hosted_zone.rb +4 -4
- data/lib/fog/aws/requests/dns/delete_health_check.rb +2 -2
- data/lib/fog/aws/requests/dns/delete_hosted_zone.rb +4 -4
- data/lib/fog/aws/requests/dns/get_change.rb +4 -4
- data/lib/fog/aws/requests/dns/get_health_check.rb +3 -3
- data/lib/fog/aws/requests/dns/get_hosted_zone.rb +4 -4
- data/lib/fog/aws/requests/dns/list_health_checks.rb +3 -3
- data/lib/fog/aws/requests/dns/list_hosted_zones.rb +3 -3
- data/lib/fog/aws/requests/dns/list_resource_record_sets.rb +5 -5
- data/lib/fog/aws/requests/dynamodb/update_item.rb +6 -5
- data/lib/fog/aws/requests/efs/create_file_system.rb +15 -3
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +7 -7
- data/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/describe_instance_health.rb +1 -1
- data/lib/fog/aws/requests/elb/describe_tags.rb +1 -1
- data/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elbv2/add_tags.rb +45 -0
- data/lib/fog/aws/requests/elbv2/create_load_balancer.rb +160 -0
- data/lib/fog/aws/requests/elbv2/describe_listeners.rb +38 -0
- data/lib/fog/aws/requests/elbv2/describe_load_balancers.rb +100 -0
- data/lib/fog/aws/requests/elbv2/describe_tags.rb +50 -0
- data/lib/fog/aws/requests/elbv2/remove_tags.rb +45 -0
- data/lib/fog/aws/requests/lambda/invoke.rb +7 -7
- data/lib/fog/aws/requests/rds/authorize_db_security_group_ingress.rb +1 -1
- data/lib/fog/aws/requests/rds/create_db_instance.rb +1 -1
- data/lib/fog/aws/requests/rds/create_db_subnet_group.rb +2 -2
- data/lib/fog/aws/requests/rds/modify_db_instance.rb +1 -1
- data/lib/fog/aws/requests/rds/revoke_db_security_group_ingress.rb +1 -1
- data/lib/fog/aws/requests/storage/abort_multipart_upload.rb +3 -3
- data/lib/fog/aws/requests/storage/acl_utils.rb +3 -3
- data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +4 -4
- data/lib/fog/aws/requests/storage/copy_object.rb +3 -3
- data/lib/fog/aws/requests/storage/cors_utils.rb +3 -3
- data/lib/fog/aws/requests/storage/delete_bucket.rb +2 -2
- data/lib/fog/aws/requests/storage/delete_bucket_cors.rb +2 -2
- data/lib/fog/aws/requests/storage/delete_bucket_lifecycle.rb +2 -2
- data/lib/fog/aws/requests/storage/delete_bucket_policy.rb +2 -2
- data/lib/fog/aws/requests/storage/delete_bucket_tagging.rb +2 -2
- data/lib/fog/aws/requests/storage/delete_bucket_website.rb +2 -2
- data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +21 -11
- data/lib/fog/aws/requests/storage/delete_object.rb +2 -2
- data/lib/fog/aws/requests/storage/delete_object_url.rb +2 -2
- data/lib/fog/aws/requests/storage/get_bucket.rb +3 -3
- data/lib/fog/aws/requests/storage/get_bucket_acl.rb +4 -4
- data/lib/fog/aws/requests/storage/get_bucket_cors.rb +4 -4
- data/lib/fog/aws/requests/storage/get_bucket_lifecycle.rb +3 -3
- data/lib/fog/aws/requests/storage/get_bucket_location.rb +5 -6
- data/lib/fog/aws/requests/storage/get_bucket_logging.rb +3 -3
- data/lib/fog/aws/requests/storage/get_bucket_notification.rb +3 -3
- data/lib/fog/aws/requests/storage/get_bucket_object_versions.rb +3 -3
- data/lib/fog/aws/requests/storage/get_bucket_policy.rb +2 -2
- data/lib/fog/aws/requests/storage/get_bucket_tagging.rb +3 -3
- data/lib/fog/aws/requests/storage/get_bucket_versioning.rb +3 -3
- data/lib/fog/aws/requests/storage/get_bucket_website.rb +3 -3
- data/lib/fog/aws/requests/storage/get_object.rb +2 -2
- data/lib/fog/aws/requests/storage/get_object_acl.rb +4 -4
- data/lib/fog/aws/requests/storage/get_object_http_url.rb +2 -2
- data/lib/fog/aws/requests/storage/get_object_https_url.rb +2 -2
- data/lib/fog/aws/requests/storage/get_object_tagging.rb +41 -0
- data/lib/fog/aws/requests/storage/get_object_torrent.rb +2 -2
- data/lib/fog/aws/requests/storage/get_object_url.rb +2 -2
- data/lib/fog/aws/requests/storage/get_request_payment.rb +3 -3
- data/lib/fog/aws/requests/storage/get_service.rb +5 -5
- data/lib/fog/aws/requests/storage/head_bucket.rb +2 -2
- data/lib/fog/aws/requests/storage/head_object.rb +2 -2
- data/lib/fog/aws/requests/storage/head_object_url.rb +2 -2
- data/lib/fog/aws/requests/storage/initiate_multipart_upload.rb +4 -4
- data/lib/fog/aws/requests/storage/list_multipart_uploads.rb +3 -3
- data/lib/fog/aws/requests/storage/list_parts.rb +3 -3
- data/lib/fog/aws/requests/storage/post_object_hidden_fields.rb +2 -2
- data/lib/fog/aws/requests/storage/post_object_restore.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket_acl.rb +4 -4
- data/lib/fog/aws/requests/storage/put_bucket_cors.rb +4 -4
- data/lib/fog/aws/requests/storage/put_bucket_lifecycle.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket_logging.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket_notification.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket_policy.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket_tagging.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket_versioning.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket_website.rb +2 -2
- data/lib/fog/aws/requests/storage/put_object.rb +9 -7
- data/lib/fog/aws/requests/storage/put_object_acl.rb +4 -4
- data/lib/fog/aws/requests/storage/put_object_tagging.rb +42 -0
- data/lib/fog/aws/requests/storage/put_object_url.rb +2 -2
- data/lib/fog/aws/requests/storage/put_request_payment.rb +2 -2
- data/lib/fog/aws/requests/storage/shared_mock_methods.rb +4 -3
- data/lib/fog/aws/requests/storage/sync_clock.rb +2 -2
- data/lib/fog/aws/requests/storage/upload_part.rb +3 -3
- data/lib/fog/aws/requests/storage/upload_part_copy.rb +119 -0
- data/lib/fog/aws/requests/sts/assume_role_with_web_identity.rb +7 -6
- data/lib/fog/aws/service_mapper.rb +5 -5
- data/lib/fog/aws/storage.rb +50 -19
- data/lib/fog/aws/version.rb +1 -1
- data/tests/credentials_tests.rb +102 -39
- data/tests/helper.rb +2 -2
- data/tests/helpers/collection_helper.rb +3 -4
- data/tests/helpers/compute/flavors_helper.rb +1 -5
- data/tests/helpers/compute/server_helper.rb +1 -3
- data/tests/helpers/compute/servers_helper.rb +0 -2
- data/tests/helpers/dns_helper.rb +32 -31
- data/tests/helpers/formats_helper.rb +58 -56
- data/tests/helpers/formats_helper_tests.rb +22 -25
- data/tests/helpers/mock_helper.rb +96 -96
- data/tests/helpers/model_helper.rb +4 -5
- data/tests/helpers/responds_to_helper.rb +1 -1
- data/tests/helpers/schema_validator_tests.rb +21 -24
- data/tests/helpers/succeeds_helper.rb +2 -2
- data/tests/models/compute/address_tests.rb +1 -1
- data/tests/models/compute/network_acl_tests.rb +4 -4
- data/tests/models/compute/security_group_tests.rb +1 -1
- data/tests/models/compute/volume_tests.rb +1 -1
- data/tests/models/elb/model_tests.rb +1 -1
- data/tests/models/storage/directory_tests.rb +113 -2
- data/tests/models/storage/files_tests.rb +32 -0
- data/tests/parsers/compute/describe_images_tests.rb +2 -2
- data/tests/parsers/elb/describe_load_balancers.rb +1 -1
- data/tests/parsers/elbv2/create_load_balancer_tests.rb +48 -0
- data/tests/parsers/elbv2/describe_listeners_tests.rb +76 -0
- data/tests/parsers/elbv2/describe_load_balancers_tests.rb +54 -0
- data/tests/parsers/elbv2/describe_tags_tests.rb +35 -0
- data/tests/requests/auto_scaling/auto_scaling_tests.rb +8 -0
- data/tests/requests/compute/address_tests.rb +9 -9
- data/tests/requests/compute/assign_private_ip_tests.rb +3 -3
- data/tests/requests/compute/image_tests.rb +11 -2
- data/tests/requests/compute/instance_attrib_tests.rb +1 -1
- data/tests/requests/compute/instance_tests.rb +5 -5
- data/tests/requests/compute/internet_gateway_tests.rb +1 -1
- data/tests/requests/compute/key_pair_tests.rb +1 -1
- data/tests/requests/compute/network_acl_tests.rb +2 -2
- data/tests/requests/compute/network_interface_tests.rb +6 -6
- data/tests/requests/compute/placement_group_tests.rb +2 -2
- data/tests/requests/compute/region_tests.rb +4 -4
- data/tests/requests/compute/route_tests.rb +24 -24
- data/tests/requests/compute/security_group_tests.rb +14 -14
- data/tests/requests/compute/snapshot_tests.rb +1 -1
- data/tests/requests/compute/spot_datafeed_subscription_tests.rb +1 -1
- data/tests/requests/compute/subnet_tests.rb +3 -3
- data/tests/requests/compute/tag_tests.rb +3 -3
- data/tests/requests/compute/volume_tests.rb +11 -11
- data/tests/requests/compute/vpc_tests.rb +9 -3
- data/tests/requests/dns/change_resource_record_sets_tests.rb +3 -3
- data/tests/requests/efs/helper.rb +2 -0
- data/tests/requests/elbv2/helper.rb +66 -0
- data/tests/requests/elbv2/load_balancer_tests.rb +50 -0
- data/tests/requests/glacier/tree_hash_tests.rb +29 -0
- data/tests/requests/storage/acl_utils_tests.rb +24 -24
- data/tests/requests/storage/bucket_tests.rb +1 -1
- data/tests/requests/storage/cors_utils_tests.rb +14 -14
- data/tests/requests/storage/multipart_copy_tests.rb +93 -0
- data/tests/requests/storage/object_tests.rb +7 -0
- data/tests/requests/storage/versioning_tests.rb +38 -0
- data/tests/requests/sts/assume_role_with_web_identity_tests.rb +2 -0
- data/tests/signaturev4_tests.rb +21 -22
- data/tests/signed_params_tests.rb +7 -7
- data/tests/storage_tests.rb +1 -1
- metadata +61 -17
- data/.travis.yml +0 -55
- data/gemfiles/Gemfile-ruby-2.0 +0 -7
data/Gemfile
CHANGED
data/LICENSE.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2014-
|
3
|
+
Copyright (c) 2014-2019 [CONTRIBUTORS.md](https://github.com/fog/fog-aws/blob/master/CONTRIBUTORS.md)
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
data/README.md
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
# Fog::Aws
|
2
2
|
|
3
3
|
![Gem Version](https://badge.fury.io/rb/fog-aws.svg)
|
4
|
-
[![Build Status](https://
|
5
|
-
[![Dependency Status](https://gemnasium.com/fog/fog-aws.svg)](https://gemnasium.com/fog/fog-aws)
|
4
|
+
[![Build Status](https://github.com/fog/fog-aws/actions/workflows/ruby.yml/badge.svg)](https://github.com/fog/fog-aws/workflows/ruby.yml)
|
6
5
|
[![Test Coverage](https://codeclimate.com/github/fog/fog-aws/badges/coverage.svg)](https://codeclimate.com/github/fog/fog-aws)
|
7
6
|
[![Code Climate](https://codeclimate.com/github/fog/fog-aws.svg)](https://codeclimate.com/github/fog/fog-aws)
|
8
7
|
|
9
|
-
|
10
8
|
## Installation
|
11
9
|
|
12
10
|
Add this line to your application's Gemfile:
|
@@ -39,7 +37,10 @@ default:
|
|
39
37
|
aws_secret_access_key: <YOUR_SECRET_ACCESS_KEY>
|
40
38
|
```
|
41
39
|
|
42
|
-
###
|
40
|
+
### EC2
|
41
|
+
|
42
|
+
#### Connecting to the EC2 Service:
|
43
|
+
|
43
44
|
```ruby
|
44
45
|
ec2 = Fog::Compute.new :provider => 'AWS', :region => 'us-west-2'
|
45
46
|
```
|
@@ -50,7 +51,7 @@ You can review all the requests available with this service using ```#requests``
|
|
50
51
|
ec2.requests # => [:allocate_address, :assign_private_ip_addresses, :associate_address, ...]
|
51
52
|
```
|
52
53
|
|
53
|
-
|
54
|
+
#### Launch an EC2 on-demand instance:
|
54
55
|
|
55
56
|
```ruby
|
56
57
|
response = ec2.run_instances(
|
@@ -67,19 +68,71 @@ instance.wait_for { ready? }
|
|
67
68
|
puts instance.public_ip_address # => "356.300.501.20"
|
68
69
|
```
|
69
70
|
|
70
|
-
|
71
|
+
#### Terminate an EC2 instance:
|
71
72
|
|
72
73
|
```ruby
|
73
74
|
instance = ec2.servers.get("i-02db5af4")
|
74
75
|
instance.destroy
|
75
76
|
```
|
76
77
|
|
77
|
-
Fog::AWS is more than EC2 since it supports many services provided by AWS. The best way to learn and to know about how many services are supported is to take a look at the source code. To review the tests directory and to play with the library in ```
|
78
|
+
`Fog::AWS` is more than EC2 since it supports many services provided by AWS. The best way to learn and to know about how many services are supported is to take a look at the source code. To review the tests directory and to play with the library in ```bin/console``` can be very helpful resources as well.
|
79
|
+
|
80
|
+
### S3
|
81
|
+
|
82
|
+
#### Connecting to the S3 Service:
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
s3 = Fog::Storage.new(provider: 'AWS', region: 'eu-central-1')
|
86
|
+
```
|
87
|
+
|
88
|
+
#### Creating a file:
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
directory = s3.directories.new(key: 'gaudi-portal-dev')
|
92
|
+
file = directory.files.create(key: 'user/1/Gemfile', body: File.open('Gemfile'), tags: 'Org-Id=1&Service-Name=My-Service')
|
93
|
+
```
|
94
|
+
|
95
|
+
#### Listing files:
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
directory = s3.directories.get('gaudi-portal-dev', prefix: 'user/1/')
|
99
|
+
directory.files
|
100
|
+
```
|
101
|
+
|
102
|
+
#### Generating a URL for a file:
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
directory.files.new(key: 'user/1/Gemfile').url(Time.now + 60)
|
106
|
+
```
|
107
|
+
|
108
|
+
#### Copying a file
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
directory = s3.directories.new(key: 'gaudi-portal-dev')
|
112
|
+
file = directory.files.get('user/1/Gemfile')
|
113
|
+
file.copy("target-bucket", "user/2/Gemfile.copy")
|
114
|
+
```
|
115
|
+
|
116
|
+
To speed transfers of large files, the `concurrency` option can be used
|
117
|
+
to spawn multiple threads. Note that the file must be at least 5 MB for
|
118
|
+
multipart uploads to work. For example:
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
directory = s3.directories.new(key: 'gaudi-portal-dev')
|
122
|
+
file = directory.files.get('user/1/Gemfile')
|
123
|
+
file.multipart_chunk_size = 10 * 1024 * 1024
|
124
|
+
file.concurrency = 10
|
125
|
+
file.copy("target-bucket", "user/2/Gemfile.copy")
|
126
|
+
```
|
78
127
|
|
79
128
|
## Documentation
|
80
129
|
|
81
130
|
See the [online documentation](http://www.rubydoc.info/github/fog/fog-aws) for a complete API reference.
|
82
131
|
|
132
|
+
## Development
|
133
|
+
|
134
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
135
|
+
|
83
136
|
## Contributing
|
84
137
|
|
85
138
|
1. Fork it ( https://github.com/fog/fog-aws/fork )
|
data/Rakefile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
require "github_changelog_generator/task"
|
2
3
|
|
3
4
|
task :default => :test
|
4
5
|
|
@@ -6,3 +7,8 @@ mock = ENV['FOG_MOCK'] || 'true'
|
|
6
7
|
task :test do
|
7
8
|
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
|
8
9
|
end
|
10
|
+
|
11
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
12
|
+
config.user = 'fog'
|
13
|
+
config.project = 'fog-aws'
|
14
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "fog-aws"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/fog-aws.gemspec
CHANGED
@@ -15,15 +15,16 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
18
|
-
spec.executables = spec.files.grep(%r{^
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.required_ruby_version = '>= 2.0.0'
|
23
23
|
|
24
|
-
spec.add_development_dependency 'bundler'
|
25
|
-
spec.add_development_dependency '
|
26
|
-
spec.add_development_dependency '
|
24
|
+
spec.add_development_dependency 'bundler'
|
25
|
+
spec.add_development_dependency 'github_changelog_generator', '~> 1.16'
|
26
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
27
|
+
spec.add_development_dependency 'rubyzip', '~> 1.3.0'
|
27
28
|
spec.add_development_dependency 'shindo', '~> 0.3'
|
28
29
|
|
29
30
|
spec.add_dependency 'fog-core', '~> 2.1'
|
data/lib/fog/aws.rb
CHANGED
@@ -5,22 +5,6 @@ require 'fog/json'
|
|
5
5
|
require File.expand_path('../aws/version', __FILE__)
|
6
6
|
|
7
7
|
module Fog
|
8
|
-
module CDN
|
9
|
-
autoload :AWS, File.expand_path('../aws/cdn', __FILE__)
|
10
|
-
end
|
11
|
-
|
12
|
-
module Compute
|
13
|
-
autoload :AWS, File.expand_path('../aws/compute', __FILE__)
|
14
|
-
end
|
15
|
-
|
16
|
-
module DNS
|
17
|
-
autoload :AWS, File.expand_path('../aws/dns', __FILE__)
|
18
|
-
end
|
19
|
-
|
20
|
-
module Storage
|
21
|
-
autoload :AWS, File.expand_path('../aws/storage', __FILE__)
|
22
|
-
end
|
23
|
-
|
24
8
|
module AWS
|
25
9
|
extend Fog::Provider
|
26
10
|
|
@@ -32,13 +16,17 @@ module Fog
|
|
32
16
|
|
33
17
|
# Services
|
34
18
|
autoload :AutoScaling, File.expand_path('../aws/auto_scaling', __FILE__)
|
19
|
+
autoload :CDN, File.expand_path('../aws/cdn', __FILE__)
|
35
20
|
autoload :CloudFormation, File.expand_path('../aws/cloud_formation', __FILE__)
|
36
21
|
autoload :CloudWatch, File.expand_path('../aws/cloud_watch', __FILE__)
|
22
|
+
autoload :Compute, File.expand_path('../aws/compute', __FILE__)
|
37
23
|
autoload :DataPipeline, File.expand_path('../aws/data_pipeline', __FILE__)
|
24
|
+
autoload :DNS, File.expand_path('../aws/dns', __FILE__)
|
38
25
|
autoload :DynamoDB, File.expand_path('../aws/dynamodb', __FILE__)
|
39
26
|
autoload :ECS, File.expand_path('../aws/ecs', __FILE__)
|
40
27
|
autoload :EFS, File.expand_path('../aws/efs', __FILE__)
|
41
28
|
autoload :ELB, File.expand_path('../aws/elb', __FILE__)
|
29
|
+
autoload :ELBV2, File.expand_path('../aws/elbv2', __FILE__)
|
42
30
|
autoload :EMR, File.expand_path('../aws/emr', __FILE__)
|
43
31
|
autoload :ElasticBeanstalk, File.expand_path('../aws/beanstalk', __FILE__)
|
44
32
|
autoload :Elasticache, File.expand_path('../aws/elasticache', __FILE__)
|
@@ -54,6 +42,7 @@ module Fog
|
|
54
42
|
autoload :SNS, File.expand_path('../aws/sns', __FILE__)
|
55
43
|
autoload :SQS, File.expand_path('../aws/sqs', __FILE__)
|
56
44
|
autoload :STS, File.expand_path('../aws/sts', __FILE__)
|
45
|
+
autoload :Storage, File.expand_path('../aws/storage', __FILE__)
|
57
46
|
autoload :Support, File.expand_path('../aws/support', __FILE__)
|
58
47
|
autoload :SimpleDB, File.expand_path('../aws/simpledb', __FILE__)
|
59
48
|
|
@@ -70,6 +59,7 @@ module Fog
|
|
70
59
|
service(:ecs, 'ECS')
|
71
60
|
service(:efs, 'EFS')
|
72
61
|
service(:elb, 'ELB')
|
62
|
+
service(:elbv2, 'ELBV2')
|
73
63
|
service(:emr, 'EMR')
|
74
64
|
service(:federation, 'Federation')
|
75
65
|
service(:glacier, 'Glacier')
|
@@ -207,7 +197,7 @@ module Fog
|
|
207
197
|
options = group_name
|
208
198
|
elsif group_name
|
209
199
|
if options.key?('GroupName')
|
210
|
-
raise Fog::Compute::
|
200
|
+
raise Fog::AWS::Compute::Error, 'Arguments specified both group_name and GroupName in options'
|
211
201
|
end
|
212
202
|
options = options.clone
|
213
203
|
options['GroupName'] = group_name
|
@@ -215,7 +205,7 @@ module Fog
|
|
215
205
|
name_specified = options.key?('GroupName') && !options['GroupName'].nil?
|
216
206
|
group_id_specified = options.key?('GroupId') && !options['GroupId'].nil?
|
217
207
|
unless name_specified || group_id_specified
|
218
|
-
raise Fog::Compute::
|
208
|
+
raise Fog::AWS::Compute::Error, 'Neither GroupName nor GroupId specified'
|
219
209
|
end
|
220
210
|
if name_specified && group_id_specified
|
221
211
|
options.delete('GroupName')
|
@@ -229,7 +219,25 @@ module Fog
|
|
229
219
|
end
|
230
220
|
|
231
221
|
def self.regions
|
232
|
-
@regions ||= [
|
222
|
+
@regions ||= [
|
223
|
+
'af-south-1',
|
224
|
+
'ap-east-1',
|
225
|
+
'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3',
|
226
|
+
'ap-south-1',
|
227
|
+
'ap-southeast-1', 'ap-southeast-2',
|
228
|
+
'ca-central-1',
|
229
|
+
'cn-north-1',
|
230
|
+
'cn-northwest-1',
|
231
|
+
'eu-central-1',
|
232
|
+
'eu-north-1',
|
233
|
+
'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-south-1',
|
234
|
+
'me-south-1',
|
235
|
+
'us-east-1', 'us-east-2',
|
236
|
+
'us-west-1', 'us-west-2',
|
237
|
+
'sa-east-1',
|
238
|
+
'us-gov-east-1',
|
239
|
+
'us-gov-west-1'
|
240
|
+
]
|
233
241
|
end
|
234
242
|
|
235
243
|
def self.validate_region!(region, host=nil)
|
data/lib/fog/aws/auto_scaling.rb
CHANGED
data/lib/fog/aws/cdn.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module AWS
|
3
|
+
class CDN < Fog::Service
|
4
4
|
extend Fog::AWS::CredentialFetcher::ServiceMethods
|
5
5
|
|
6
6
|
requires :aws_access_key_id, :aws_secret_access_key
|
@@ -200,4 +200,17 @@ EOF
|
|
200
200
|
end
|
201
201
|
end
|
202
202
|
end
|
203
|
+
|
204
|
+
# @deprecated
|
205
|
+
module CDN
|
206
|
+
# @deprecated
|
207
|
+
class AWS < Fog::AWS::CDN
|
208
|
+
# @deprecated
|
209
|
+
# @overrides Fog::Service.new (from the fog-core gem)
|
210
|
+
def self.new(*)
|
211
|
+
Fog::Logger.deprecation 'Fog::CDN::AWS is deprecated, please use Fog::AWS::CDN.'
|
212
|
+
super
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
203
216
|
end
|
data/lib/fog/aws/compute.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module AWS
|
3
|
+
class Compute < Fog::Service
|
4
4
|
extend Fog::AWS::CredentialFetcher::ServiceMethods
|
5
5
|
|
6
6
|
class RequestLimitExceeded < Fog::Errors::Error; end
|
7
7
|
|
8
8
|
requires :aws_access_key_id, :aws_secret_access_key
|
9
|
-
recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :version
|
9
|
+
recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :version, :retry_request_limit_exceeded, :retry_jitter_magnitude
|
10
10
|
|
11
11
|
secrets :aws_secret_access_key, :hmac, :aws_session_token
|
12
12
|
|
@@ -101,6 +101,7 @@ module Fog
|
|
101
101
|
request :describe_classic_link_instances
|
102
102
|
request :describe_dhcp_options
|
103
103
|
request :describe_images
|
104
|
+
request :describe_image_attribute
|
104
105
|
request :describe_instances
|
105
106
|
request :describe_instance_attribute
|
106
107
|
request :describe_internet_gateways
|
@@ -143,6 +144,7 @@ module Fog
|
|
143
144
|
request :import_key_pair
|
144
145
|
request :modify_image_attribute
|
145
146
|
request :modify_instance_attribute
|
147
|
+
request :modify_instance_placement
|
146
148
|
request :modify_network_interface_attribute
|
147
149
|
request :modify_snapshot_attribute
|
148
150
|
request :modify_subnet_attribute
|
@@ -452,7 +454,7 @@ module Fog
|
|
452
454
|
|
453
455
|
def tagged_resources(resources)
|
454
456
|
Array(resources).map do |resource_id|
|
455
|
-
if match = resource_id.match(/^(\w+)-[a-z0-9]{8}/i)
|
457
|
+
if match = resource_id.match(/^(\w+)-[a-z0-9]{8,17}/i)
|
456
458
|
id = match.captures.first
|
457
459
|
else
|
458
460
|
raise(Fog::Service::NotFound.new("Unknown resource id #{resource_id}"))
|
@@ -546,11 +548,13 @@ module Fog
|
|
546
548
|
|
547
549
|
def initialize(options={})
|
548
550
|
|
549
|
-
@connection_options
|
550
|
-
@region
|
551
|
-
@instrumentor
|
552
|
-
@instrumentor_name
|
553
|
-
@version
|
551
|
+
@connection_options = options[:connection_options] || {}
|
552
|
+
@region = options[:region] ||= 'us-east-1'
|
553
|
+
@instrumentor = options[:instrumentor]
|
554
|
+
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.compute'
|
555
|
+
@version = options[:version] || '2016-11-15'
|
556
|
+
@retry_request_limit_exceeded = options.fetch(:retry_request_limit_exceeded, true)
|
557
|
+
@retry_jitter_magnitude = options[:retry_jitter_magnitude] || 0.1
|
554
558
|
|
555
559
|
@use_iam_profile = options[:use_iam_profile]
|
556
560
|
setup_credentials(options)
|
@@ -632,30 +636,39 @@ module Fog
|
|
632
636
|
raise if match.empty?
|
633
637
|
raise case match[:code]
|
634
638
|
when 'NotFound', 'Unknown'
|
635
|
-
Fog::Compute::
|
636
|
-
when 'RequestLimitExceeded'
|
637
|
-
if retries < max_retries
|
638
|
-
jitter = rand
|
639
|
-
|
640
|
-
start_time = Time.now
|
641
|
-
wait_time = ((2.0 ** (1.0 + retries) * 100) + jitter) / 1000.0
|
639
|
+
Fog::AWS::Compute::NotFound.slurp(error, match[:message])
|
640
|
+
when 'RequestLimitExceeded'
|
641
|
+
if @retry_request_limit_exceeded && retries < max_retries
|
642
|
+
jitter = rand * 10 * @retry_jitter_magnitude
|
643
|
+
wait_time = ((2.0 ** (1.0 + retries) * 100) / 1000.0) + jitter
|
642
644
|
Fog::Logger.warning "Waiting #{wait_time} seconds to retry."
|
643
|
-
|
644
|
-
if Time.now - start_time >= wait_time
|
645
|
-
waiting = false
|
646
|
-
end
|
647
|
-
end
|
645
|
+
sleep(wait_time)
|
648
646
|
retries += 1
|
649
647
|
retry
|
648
|
+
elsif @retry_request_limit_exceeded
|
649
|
+
Fog::AWS::Compute::RequestLimitExceeded.slurp(error, "Max retries exceeded (#{max_retries}) #{match[:code]} => #{match[:message]}")
|
650
650
|
else
|
651
|
-
Fog::Compute::
|
651
|
+
Fog::AWS::Compute::RequestLimitExceeded.slurp(error, "#{match[:code]} => #{match[:message]}")
|
652
652
|
end
|
653
653
|
else
|
654
|
-
Fog::Compute::
|
654
|
+
Fog::AWS::Compute::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
|
655
655
|
end
|
656
656
|
end
|
657
657
|
end
|
658
658
|
end
|
659
659
|
end
|
660
660
|
end
|
661
|
+
|
662
|
+
# @deprecated
|
663
|
+
module Compute
|
664
|
+
# @deprecated
|
665
|
+
class AWS < Fog::AWS::Compute
|
666
|
+
# @deprecated
|
667
|
+
# @overrides Fog::Service.new (from the fog-core gem)
|
668
|
+
def self.new(*)
|
669
|
+
Fog::Logger.deprecation 'Fog::Compute::AWS is deprecated, please use Fog::AWS::Compute.'
|
670
|
+
super
|
671
|
+
end
|
672
|
+
end
|
673
|
+
end
|
661
674
|
end
|
@@ -1,17 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'securerandom'
|
4
|
+
|
1
5
|
module Fog
|
2
6
|
module AWS
|
3
7
|
module CredentialFetcher
|
4
8
|
|
5
9
|
INSTANCE_METADATA_HOST = "http://169.254.169.254"
|
10
|
+
INSTANCE_METADATA_TOKEN = "/latest/api/token"
|
6
11
|
INSTANCE_METADATA_PATH = "/latest/meta-data/iam/security-credentials/"
|
7
12
|
INSTANCE_METADATA_AZ = "/latest/meta-data/placement/availability-zone/"
|
8
13
|
|
9
14
|
CONTAINER_CREDENTIALS_HOST = "http://169.254.170.2"
|
10
15
|
|
16
|
+
STS_GLOBAL_ENDPOINT = "https://sts.amazonaws.com"
|
17
|
+
|
11
18
|
module ServiceMethods
|
12
19
|
def fetch_credentials(options)
|
13
20
|
if options[:use_iam_profile] && Fog.mocking?
|
14
|
-
return Fog::Compute::
|
21
|
+
return Fog::AWS::Compute::Mock.data[:iam_role_based_creds]
|
15
22
|
end
|
16
23
|
if options[:use_iam_profile]
|
17
24
|
begin
|
@@ -22,25 +29,52 @@ module Fog
|
|
22
29
|
connection = options[:connection] || Excon.new(CONTAINER_CREDENTIALS_HOST)
|
23
30
|
credential_path = options[:credential_path] || ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
|
24
31
|
role_data = connection.get(:path => credential_path, :idempotent => true, :expects => 200).body
|
32
|
+
session = Fog::JSON.decode(role_data)
|
33
|
+
|
34
|
+
if region.nil?
|
35
|
+
connection = options[:metadata_connection] || Excon.new(INSTANCE_METADATA_HOST)
|
36
|
+
token_header = fetch_credentials_token_header(connection, options[:disable_imds_v2])
|
37
|
+
region = connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200, :headers => token_header).body[0..-2]
|
38
|
+
end
|
39
|
+
elsif ENV["AWS_WEB_IDENTITY_TOKEN_FILE"]
|
40
|
+
params = {
|
41
|
+
:Action => "AssumeRoleWithWebIdentity",
|
42
|
+
:RoleArn => options[:role_arn] || ENV.fetch("AWS_ROLE_ARN"),
|
43
|
+
:RoleSessionName => options[:role_session_name] || ENV["AWS_ROLE_SESSION_NAME"] || "fog-aws-#{SecureRandom.hex}",
|
44
|
+
:WebIdentityToken => File.read(options[:aws_web_identity_token_file] || ENV.fetch("AWS_WEB_IDENTITY_TOKEN_FILE")),
|
45
|
+
:Version => "2011-06-15",
|
46
|
+
}
|
47
|
+
connection = options[:connection] || Excon.new(STS_GLOBAL_ENDPOINT, :query => params)
|
48
|
+
document = Nokogiri::XML(connection.get(:idempotent => true, :expects => 200).body)
|
49
|
+
|
50
|
+
session = {
|
51
|
+
"AccessKeyId" => document.css("AccessKeyId").children.text,
|
52
|
+
"SecretAccessKey" => document.css("SecretAccessKey").children.text,
|
53
|
+
"Token" => document.css("SessionToken").children.text,
|
54
|
+
"Expiration" => document.css("Expiration").children.text,
|
55
|
+
}
|
25
56
|
|
26
57
|
if region.nil?
|
27
58
|
connection = options[:metadata_connection] || Excon.new(INSTANCE_METADATA_HOST)
|
28
|
-
|
59
|
+
token_header = fetch_credentials_token_header(connection, options[:disable_imds_v2])
|
60
|
+
region = connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200, :headers => token_header).body[0..-2]
|
29
61
|
end
|
30
62
|
else
|
31
63
|
connection = options[:connection] || Excon.new(INSTANCE_METADATA_HOST)
|
32
|
-
|
33
|
-
|
34
|
-
|
64
|
+
token_header = fetch_credentials_token_header(connection, options[:disable_imds_v2])
|
65
|
+
role_name = connection.get(:path => INSTANCE_METADATA_PATH, :idempotent => true, :expects => 200, :headers => token_header).body
|
66
|
+
role_data = connection.get(:path => INSTANCE_METADATA_PATH+role_name, :idempotent => true, :expects => 200, :headers => token_header).body
|
67
|
+
session = Fog::JSON.decode(role_data)
|
68
|
+
|
69
|
+
region ||= connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200, :headers => token_header).body[0..-2]
|
35
70
|
end
|
36
|
-
|
37
|
-
session = Fog::JSON.decode(role_data)
|
71
|
+
|
38
72
|
credentials = {}
|
39
73
|
credentials[:aws_access_key_id] = session['AccessKeyId']
|
40
74
|
credentials[:aws_secret_access_key] = session['SecretAccessKey']
|
41
75
|
credentials[:aws_session_token] = session['Token']
|
42
76
|
credentials[:aws_credentials_expire_at] = Time.xmlschema session['Expiration']
|
43
|
-
|
77
|
+
|
44
78
|
# set region by default to the one the instance is in.
|
45
79
|
credentials[:region] = region
|
46
80
|
#these indicate the metadata service is unavailable or has no profile setup
|
@@ -53,6 +87,26 @@ module Fog
|
|
53
87
|
super
|
54
88
|
end
|
55
89
|
end
|
90
|
+
|
91
|
+
def fetch_credentials_token_header(connection, disable_imds_v2)
|
92
|
+
return nil if disable_imds_v2
|
93
|
+
|
94
|
+
token = connection.put(
|
95
|
+
:path => INSTANCE_METADATA_TOKEN,
|
96
|
+
:idempotent => true,
|
97
|
+
:expects => 200,
|
98
|
+
:retry_interval => 1,
|
99
|
+
:retry_limit => 3,
|
100
|
+
:read_timeout => 1,
|
101
|
+
:write_timeout => 1,
|
102
|
+
:connect_timeout => 1,
|
103
|
+
:headers => { "X-aws-ec2-metadata-token-ttl-seconds" => "300" }
|
104
|
+
).body
|
105
|
+
|
106
|
+
{ "X-aws-ec2-metadata-token" => token }
|
107
|
+
rescue Excon::Error
|
108
|
+
nil
|
109
|
+
end
|
56
110
|
end
|
57
111
|
|
58
112
|
module ConnectionMethods
|