-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for EC2 #43
Comments
In the meanwhile I am using this to get my required API call.
|
Just curious (and I know it's more layers) but did you try https://hexdocs.pm/aws/AWS.AutoScaling.html |
defmodule AWS.EC2 do
alias AWS.Request
def metadata do
%AWS.ServiceMetadata{
api_version: "2016-11-15",
content_type: "text/xml",
endpoint_prefix: "ec2",
global?: false,
protocol: "query",
signing_name: "ec2"
}
end
def describe_instances(client, input, options \\ []) do
Request.request_post(client, metadata(), "DescribeInstances", input, options)
end
end seems to work for me: > iex
Erlang/OTP 25 [RELEASE CANDIDATE 2] [erts-13.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Interactive Elixir (1.14.0-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Mix.install [:aws, :jason, :hackney]
iex(2)> defmodule AWS.EC2 do
...(2)> alias AWS.Request
...(2)>
...(2)> def metadata do
...(2)> %AWS.ServiceMetadata{
...(2)> api_version: "2016-11-15",
...(2)> content_type: "text/xml",
...(2)> endpoint_prefix: "ec2",
...(2)> global?: false,
...(2)> protocol: "query",
...(2)> signing_name: "ec2"
...(2)> }
...(2)> end
...(2)>
...(2)> def describe_instances(client, input, options \\ []) do
...(2)> Request.request_post(client, metadata(), "DescribeInstances", input, options)
...(2)> end
...(2)> end
iex(3)> client = AWS.Client.create("eu-north-1")
iex(4)> AWS.EC2.describe_instances(client, _input = %{})
{:ok,
%{
"DescribeInstancesResponse" => %{
"requestId" => "57587f0e-31f9-4d70-8f27-87b738f39f2b",
"reservationSet" => %{
"item" => [
%{
"groupSet" => :none,
"instancesSet" => %{
"item" => %{
"tagSet" => %{
# ... |
I've created two pull requests that would add support for ec2. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The library currently does not support the EC2 API.
Related: aws-beam/aws-codegen#24
The text was updated successfully, but these errors were encountered: