LFE wrapper for the erlcloud library
Nube serves as a wrapper for the different AWS services the erlcloud Erlang library supports with some extra macros to make your life easier.
To install and use the library just add it to your rebar.config
deps:
{deps, [
{nube, {git, "[email protected]:arpunk/nube.git", {branch, "master"}}}
]}.
Then get and compile the dependencies:
$ rebar3 compile
- EC2
- ELB
- S3
- SDB
- SQS
- STS
- SNS
- Kinesis
- IAM
- AutoScaling
- CloudTrail
- Mechanical Turk
- CloudWatch
- DynamoDB
Make sure you have exported your AWS credentials:
export AWS_ACCESS_KEY_ID="access key"
export AWS_SECRET_ACCESS_KEY="secret access key"
Then fire up a repl
:
$ rebar3 lfe repl
...
> (nube:start)
ok
> (nube-ec2:describe-images)
Or you can just create the credentials:
(let ((credentials (nube-util:make-crendentials "access key"
"secret access key")))
(nube-ec2:describe-images credentials))
(let* ((instance-spec (make-ec2_instance_spec image_id "ami"
key_name "keypair"
instance_type "t2.micro"
availability_zone "us-east-1c"))
(instance (nube-ec2:run-instances instance-spec))
(lfe_io:format "Instance: ~p~n" (list instance))))
MIT