Advertisement
Leo_rossi

fonction lambda print data

Dec 11th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. ///// fonction lambda avec print data global et le résultat :
  2.  
  3. var AWS = require('aws-sdk');
  4.  
  5. AWS.config.update({region: 'us-east-2'});
  6.  
  7. exports.handler= function(event, context) {
  8.  
  9. // Create EC2 service object
  10. var ec2 = new AWS.EC2({apiVersion: '2016-11-15'});
  11.  
  12. var params = {
  13. };
  14. ec2.describeVolumes(params, function(err, data) {
  15. if (err) console.log(err, err.stack); // an error occurred
  16. else console.log(data); // successful response
  17.  
  18. });
  19.  
  20. };
  21.  
  22. ///////////// le résultat :
  23.  
  24.  
  25. START RequestId: 04a43959-4c7e-4548-a9eb-67f3fe808546 Version: $LATEST
  26. 2019-12-11T09:12:58.409Z 04a43959-4c7e-4548-a9eb-67f3fe808546
  27.  
  28. INFO {
  29. Volumes: [
  30. {
  31. Attachments: [],
  32. AvailabilityZone: 'us-east-2b',
  33. CreateTime: 2019-12-02T21:56:49.803Z,
  34. Encrypted: false,
  35. Size: 2,
  36. SnapshotId: '',
  37. State: 'available',
  38. VolumeId: 'vol-042b886ef743e3a45',
  39. Tags: [Array],
  40. VolumeType: 'standard'
  41. },
  42. {
  43. Attachments: [],
  44. AvailabilityZone: 'us-east-2a',
  45. CreateTime: 2019-12-02T21:55:45.248Z,
  46. Encrypted: false,
  47. Size: 1,
  48. SnapshotId: '',
  49. State: 'available',
  50. VolumeId: 'vol-011319e334b94e18b',
  51. Tags: [Array],
  52. VolumeType: 'standard'
  53. }
  54. ]
  55. }
  56.  
  57. END
  58.  
  59. RequestId: 04a43959-4c7e-4548-a9eb-67f3fe808546
  60. REPORT RequestId: 04a43959-4c7e-4548-a9eb-67f3fe808546 Duration: 1716.58 ms Billed Duration: 1800 ms Memory Size: 128 MB Max Memory Used: 99 MB Init Duration: 304.28 ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement