Ruby§“‚‹AWS 第67›‍Rubyé–¢è¥ ‹‰¼·¼

  • View
    3.228

  • Download
    5

Embed Size (px)

Text of Ruby§“‚‹AWS...

1. RubyAWS NRI 2015/6/13Ruby 2. AWS blog: http://blog.takuros.net twitter: @dkfj 3. Ruby 21 http://amzn.to/1lsJ5id 14 4. Amazon Web Services http://amzn.to/1BLiYcO 2015325 5. NRI Web Web 24365 AWS Ruby 6. RubyAWS 7. AWS EC2,S3 8. 9. AWS 10. 11. IaaS/PaaS IT e-Words http://e-words.jp/w/%E3%82%AF%E3%83%A9%E3%82%A6%E3%83%89%E3%83%95%E3%82%A1%E3%83%BC%E3%82%B9%E3%83%88.html 12. SaaS 2-Tier 13. 3-Tier Web/AP ec2 S3 NoSQL DynamoDB RDS Web 14. 2-Tier S3 NoSQL DynamoDB Cognito Credential SQS Lambda AWS 15. http://www.nri-net.com/mobileconf/ https://www.youtube.com/watch?v=7Rk2pL3PAXc 16. Web 17. AWS IAM Role DynamoDB NoSQL DB Cognito S3 JavaScript SDK DynamoDB AWS 18. RubyAWS 19. RubyAWS SDK SDKAWS 20. SDK iOS Android iOS JavanodeJS .Net PHP Python Ruby Ruby PowerShell CLI 21. RubySDK V1 require aws-sdk-v1 AWS V2 20152 aws-sdk-coreaws-sdk-resouces require aws-sdk Aws V1 AWS::EC2AWS 22. AWS IAM AccessKeySecretAccessKey IAM Role Cognito 23. AccessKeySecretAccessKey ENV['AWS_ACCESS_KEY_ID'] ENV['AWS_SECRET_ACCESS_KEY'] /.aws/credentials [default] aws_access_key_id = ABCDEFGHIJKLMNOPQRST aws_secret_access_key = abcdefghijklmnopqrstuvwxyz1234567890abcd Aws.config.update({ region: 'us-west-2', credentials: Aws::Credentials.new('akid', 'secret'), }) 24. IAM IAM Role IAM EC2 AWS IAM Role AWS 25. Cognito JavaScript Ruby Cognito Identity Providers (Facebook,Google,Amazon,etc) IAM Role AWS Cognito 26. Lambda 27. Lambda Node.JS Aamzon LinuxDocker 28. RubyLambda AWS LambdaRuby http://qiita.com/Keisuke69/items/40bab85fa2a6ba5b257f Aws.config[:region] = "us-east-1" lambda = Aws::Lambda::Client.new begin param = { key1: "from ruby"}.to_json #=>functionJSON resp = lambda.invoke_async(function_name: "HttpTest", invoke_args: param) if resp[:status] == 202 puts "success" end rescue Aws::Lambda::Errors::ServiceError => e p e.message end RubyLambda 29. LambdaRuby Node.jsOS OS require( child_process ).exec Ruby console.log('Loading function'); var exec = require('child_process').exec, child; exports.handler = function(event, context) { exec(which ruby', function (error, stdout, stderr) { console.log('stderr:', stderr); console.log('stdout: ' + stdout); context.done(null, stdout); }); }; 30. LambdaRuby Ruby EC2AmazonLinuxAMI Ruby Zip ./congure --disable-shared --enable-static zip -r exec-ruby.zip index.js ruby test.rb 31. LambdaRuby Lambda START RequestId: be73209f-112b-11e5-9756-91ae3f4733 2015-06-12T17:52:09.862Z be73209f-112b-11e5-9756-91ae3f4733 stderr: :1:in `require': cannot load such le -- rubygems.rb (LoadError) from :1:in `' 32.