Code Monkey home page Code Monkey logo

awscore.jl's Introduction

AWSCore.jl

Travis

Julia interface for Amazon Web Services.

This package provides core infrastructure functions and types.

The AWSSDK.jl package provides automatically generated low-level API wrappers for each operation in each Amazon Web Service.

The following high-level packages are also available: AWS S3, AWS SQS, AWS SNS, AWS IAM, AWS EC2, AWS Lambda, AWS SES and AWS SDB. These packages include operation specific result structure parsing, error handling, type convenience functions, iterators, etc.

Full documentation is available here, or see below for some examples of how to get started.

There are three ways to use AWSCore:

  1. Call AWSCore/Services.jl functions directly:
using AWSCore.Services.cloudformation
cloudformation("CreateStack",
               StackName = "mystack",
               TemplateBody = readstring("cloudformation_template.yaml"),
               Parameters = [["ParameterKey"   => "Foo",
                              "ParameterValue" => "bar"]],
               Capabilities = ["CAPABILITY_IAM"])
  1. Use the low-level AWSSDK wrappers:
using AWSSDK.S3.list_buckets
r = list_buckets()
buckets = [b["Name"] for b in r["Buckets"]["Bucket"]]
  1. Use one of the high-level convenience packages:
using AWSS3
buckets = s3_list_buckets()

Examples

Create an S3 bucket and store some data...

aws = aws_config()
s3_create_bucket(aws, "my.bucket")
s3_enable_versioning(aws, "my.bucket")

s3_put(aws, "my.bucket", "key", "Hello!")
println(s3_get(aws, "my.bucket", "key"))

Post a message to a queue...

q = sqs_get_queue(aws, "my-queue")

sqs_send_message(q, "Hello!")

m = sqs_receive_message(q)
println(m["message"])
sqs_delete_message(q, m)

Post a message to a notification topic...

sns_create_topic(aws, "my-topic")
sns_subscribe_sqs(aws, "my-topic", q; raw = true)

sns_publish(aws, "my-topic", "Hello!")

m = sqs_receive_message(q)
println(m["message"])
sqs_delete_message(q, m)

Start an EC2 server and fetch info...

ec2(aws, "StartInstances", var"InstanceId.1" = my_instance_id)
r = ec2(aws, "DescribeInstances", var"Filter.1.Name" = "instance-id",
                                  var"Filter.1.Value.1" = my_instance_id)
println(r)

Create an IAM user...

iam(aws, "CreateUser", UserName = "me")

Automatically assume a role(details)...

For a user with the IAM profile valid-iam-profile already in their credentials file that has permissions to a role called example-role-name:

~/.aws/config:

[profile example-role-name]
role_arn = arn:aws:iam::[role number here]:role/example-role-name
source_profile = valid-iam-profile
ENV["AWS_PROFILE"] = "example-role-name"
AWSCore.aws_config()

awscore.jl's People

Contributors

samoconnor avatar bors[bot] avatar mattbrzezinski avatar ararslan avatar omus avatar iamed2 avatar rofinn avatar meggart avatar phyatt-corp avatar barcharcraz avatar expandingman avatar rfliam avatar sebrollen avatar tkelman avatar aviks avatar dtjohnson avatar juliatagbot avatar mjram0s avatar github-actions[bot] avatar jingpengw avatar tanmaykm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.