Skip to content

Commit cceb702

Browse files
sashaafmbenwilson512
authored andcommitted
RDS and EC2 corrected and ready to merge (#167)
* Created the Client, Impl and Request modules for the RDS implementation/wrapper. * Added the ExAws.RDS module in ex_aws/lib. * Developing the RDS.Request module. * Solved some problems in RDS.Request and started to implement RebootDBInstace method. There's a problem with the way the query params are passed since they must be capitalized and just converting from atoms to String won't work correctly. This API sucks. * Solved the problem with the capitalized query keys. RebootDBInstance seems to be implemented correctly. * Added create_db_instance and delete_db_instance. Both seem to be working correctly. * Added the functions and callbacks for the AddSourceIdentifierToSubscription, AddTagsToResource, ModifyDBInstance and DescribeEvents method. The requests are now sent with the API version. * Added the function for the ApplyPendingMaintenanceAction method and its callback. * Some changes to the request. * Added the configs to test the RDS implementation for EU Central 1. * Refactored some code on RDS.Request. * Added documentation to RDS.Client callbacks. * Removed unwanted forgotton IO.inspects. * First commit for branch. Created the Client, Impl and Request modules for EC2. * Implemented the first Instance related functions: DescribeInstance, DescribeInstanceStatus, RunInstances, StartInstances, StopInstances and TerminateInstances. * Added the functions for RebootInstances and ReportInstanceStatus. * Added the DescribeInstanceAttribute, ModifyInstanceAttribute and ResetInstanceAttribute functions. * Added the GetConsoleOutput function. * Added the GetPasswordData function. All Instance related functions are now implemented. * Started implementing the Regions and Availability Zones related actions. Implemented DescribeAvailabilityZones. * Added the DescribeRegions action. The Regions and Availability Zones related actions are now all implemented. * Started implementing the AMI related actions. Implemented CreateImage. * Added the CopyImage action. * Added the DescribeImages action. * Added the DescribeImageAttribute action. * Added the ModifyImageAttribute action. * Added the ResetImageAttribute action and added the docs for ModifyImageAttribute. * Added the RegisterImage and DeregisterImage actions. All AMI related actions are now implemented. * Started implementing the Key Pairs related action. Added DescribeKeyPairs. * Added the CreateKeyPair action. * Added DeleteKeyPair. * Added the ImportKeyPair action. All Key Pairs actions are now implemented. * Started implementing the Resource ID related Actions. Added DescribeIdFormat. * Added the ModifyIdFormat. All Resource ID actions are now implemented. * Started implementing the Security Groups related Actions. Added DescribeSecurityGroups. * Added the CreateSecurityGroup action. * Added the AuthorizeSecurityGroupIngress action. * Added the AuthorizeSecurityGroupEgress action. * Added the RevokeSecurityGroupIngress action. * Added the RevokeSecurityGroupEgress action. All Security Groups related actions are now implemented. * Started implementing the VPCs related actions. Added DescribeVpcs. * Added the CreateVpc action. * Added the DeleteVpc action. * Added the DescribeVpcAttribute action. * Added the ModifyVpcAttribute action. All VPC related actions are now implemented. * Started impementing the Subnets related actions. Added DescribeSubnets. * Added the CreateSubnet action. * Added the DeleteSubnet action. * Added the ModifySubnetAttribute action. All Subnets related actions are now implemented. * Started implementing the Tags related actions. Added DescribeTags. * Added the CreateTags action. * Added the DeleteTags action. All Tags related actions are now implemented. * Started implementing the Elastic Block Store actions. Added DescribeVolumes. * Added the CreateVolume action. * Added the DeleteVolume action. * Added the AttachVolume action. * Added the DetachVolume action. * Added the DescribeVolumeAttribute action. * Added the EnableVolumeIO action. * Added the ModifyVolumeAttribute action. * Added the DescribeVolumeStatus action. * Added the DescribeSnapshots action. * Added the CreateSnapshot action. * Added the CopySnapshot action. * Added the DeleteSnapshot action. * Added the DescribeSnapshotAttribute action. * Added the ModifySnapshotAttribute action. * Added the ResetSnapshotAttribute action. The request seems to be correct and it's very similar as others requests from other actions but I keep getting a invalid request error for some reason. May be server side and not implementation related. * Added the DescribeAccountAttributes action. All Account Attributes actions are now implemented. * Started implementing the Bundle Tasks actions. Added the BundleInstance action. * Added the CancelBundleTask action. * Added the DescribeBundleTasks action. All Bundle Tasks actions are now implemented. * Changed add_source_id_to_subscription and describe_db_instances to have map literals and added the private function normalize_opts/1 to camelize and put the opts into a map. * Changed create_db_instance to have map literals. * Corrected a bug where the username was used twice. * Refactored DeleteDBInstance and updated the defcallback. * Refactored delete_db_instance and updated callbacks and specs for create_db_instance, reboot_db_instance and delete_db_instance. * Updated the specs for describe_db_instances. * Refactored and updated the docs for modify_db_instance. * Refactored the functions again to have the new stylistic choice of using the opts as the raw variable and passing it onto pipe operators until the Map. * Forgot to refactor describe_db_instances. * Refactored describe_events and added the specs. * Some adjustements. * Refactored and added specs for apply_pending_maintenance. * Indentation. * Refactored describe_instances and added the specs. * Refactored describe_instance_status and added the specs. * Refactored run_instances and added the specs. * Refactored start_instances and added the specs. * Refactored stop_instances and added the specs. * Refactored terminate_instances and added the specs. * Refactored reboot_instances and added the specs. * Some corrections. * Corrected the specs. * Corrected specs. Refactored monitor_instances and added specs. * Refactored unmonitor_instances and added the specs. * Refactored describe_instance_attribute and added the specs. * Refactored modify_instance_attribute and added the specs. * Added the params. * Refactored reset_instance_attribute and added the specs. * Refactored get_console_output and added the specs. * Refactored get_password_data and added the specs. * Refactored describe_availability_zones and added the specs. * Refactored describe_regions and added the specs. * Refactored create_image and added the specs. * Refactored copy_image and added the specs. * Refactored describe_images and added the specs. * Refactored describe_image_attribute and added the specs. * Refactored modify_image_attribute and added the specs. * Refactored reset_image_attribute and added the specs. * Refactored register_image and added the specs. * Refactored deregister_image and added the specs. * Refactored describe_key_pairs and added the specs. * Refactored create_key_pair and added the specs. Corrected some errors. * Refactored delete_key_pair and added the specs. * Refactored import_key_pair and added the specs. Corrected some errors. * Refactored describe_id_format and added the specs. * Refactored modify_id_format and added the specs. * Refactored describe_security_groups and added the specs. * Refactored create_security_group and added the specs. * Refactored authorize_security_group_ingress and added the specs. * Refactored authorize_security_group_egress and added the specs. * Refactored revoke_security_group_ingress and added the specs. * Refactored revoke_security_group_egress and added the specs. * Refactored describe_vpcs and added the specs. * Refactored create_vpc and added the specs. * Refactored delete_vpc and added the specs. * Refactored describe_vpc_attribute and added the specs. * Refactored modify_vpc_attribute and added the specs. * Corrected some errors. * Refactored describe_subnets and added the specs. * Refactored create_subnet and added the specs. * Refactored delete_subnet and added the specs. * Refactored modify_subnet_attribute and added the specs. * Refactored describe_tags and added the specs. * Refactored create_tags and added the specs. Have some doubts about the spec. * Refactored delete_tags and added the specs. Have some doubts about the spec. * Refactored describe_volumes and added the specs. * Refactored create_volume and added the specs. * Refactored delete_volume and added the specs. * Refactored attach_volume and added the specs. * Refactored detach_volume and added the specs. * Refactored describe_volume_attribute and added the specs. * Refactored describe_volume_attribute and modify_volume_attribute and added the specs. * Refactored describe_volume_status and added the specs. * Refactored describe_snapshots and added the specs. * Refactored create_snapshot and added the specs. * Refactored delete_snapshot and added the specs. * Refactored describe_snapshot_attribute and added specs. * Refactored modify_snapshot_attribute and added specs. * Refactored reset_snapshot_attribute and added specs. * Refactored bundle_instance and cancel_bundle_task and added specs. * Refactored describe_bundle_tasks and added specs. * Corrected most of the data types specs. * Further corrections. * Corrected more specs up to modify_instance_attribute. * Almost finished correcting the specs. Going to lunch now. * Finished all specs. * Corrected all warnings. * Corrected the specs and removed all warnings. * Added tests for every action. With and without options (when available) and corrected the problem with the tags in add_tags_to_resource. * Added tests for all instance related actions and made some corretions. * Added tests for all regions and availability zones related actions. * Added tests for all AMI related actions. * Added tests for all Key Pairs related actions. * Added tests for all Resource ID and Security Groups related actions. * Added tests for all VPCs related actions. * Added tests for all Subnets related actions. * Added tests for all Tags related actions. * Added tests for all Elastic Block Store related actions. * Added tests for all Account Attributes related actions. * Finished tests for all actions with and without options. * Added support for Poison 2.0. * Fix. * Updated the defaults.ex to allow other regions besides us-east-1. * Removed unused module params from RDS. * Removed unused module params from EC2. * Removed unused _h matching from function def. * Changed Map.put_new to Map.put.
1 parent cf2cfea commit cceb702

File tree

12 files changed

+5275
-1
lines changed

12 files changed

+5275
-1
lines changed

config/dev.exs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
use Mix.Config
22

33
config :ex_aws,
4-
debug_requests: true
4+
debug_requests: true,
5+
access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, :instance_role],
6+
secret_access_key: [{:system, "AWS_SECRET_ACCESS_KEY"}, :instance_role],
7+
region: "us-east-1"
58

69
config :ex_aws, :dynamodb,
710
scheme: "http://",
811
host: "localhost",
912
port: 8000,
1013
region: "us-east-1"
14+
15+
config :ex_aws, :rds,
16+
scheme: "https://",
17+
host: {"$region", "rds.$region.amazonaws.com"},
18+
region: "us-east-1",
19+
port: 80

lib/ex_aws/config/defaults.ex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ defmodule ExAws.Config.Defaults do
4444
region: "us-east-1",
4545
port: 80
4646
],
47+
ec2: [
48+
scheme: "https://",
49+
host: {"$region", "ec2.$region.amazonaws.com"},
50+
region: "us-east-1",
51+
port: 80
52+
],
53+
rds: [
54+
scheme: "https://",
55+
host: {"$region", "rds.$region.amazonaws.com"},
56+
region: "us-east-1",
57+
port: 80
4758
sns: [
4859
host: "sns.us-east-1.amazonaws.com",
4960
scheme: "https://",

lib/ex_aws/ec2.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
defmodule ExAws.EC2 do
2+
use ExAws.EC2.Client
3+
4+
def config_root, do: Application.get_all_env(:ex_aws)
5+
end

lib/ex_aws/ec2/client.ex

Lines changed: 1265 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)