Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///// fonction lambda avec print data global et le résultat :
- var AWS = require('aws-sdk');
- AWS.config.update({region: 'us-east-2'});
- exports.handler= function(event, context) {
- // Create EC2 service object
- var ec2 = new AWS.EC2({apiVersion: '2016-11-15'});
- var params = {
- };
- ec2.describeVolumes(params, function(err, data) {
- if (err) console.log(err, err.stack); // an error occurred
- else console.log(data); // successful response
- });
- };
- ///////////// le résultat :
- START RequestId: 04a43959-4c7e-4548-a9eb-67f3fe808546 Version: $LATEST
- 2019-12-11T09:12:58.409Z 04a43959-4c7e-4548-a9eb-67f3fe808546
- INFO {
- Volumes: [
- {
- Attachments: [],
- AvailabilityZone: 'us-east-2b',
- CreateTime: 2019-12-02T21:56:49.803Z,
- Encrypted: false,
- Size: 2,
- SnapshotId: '',
- State: 'available',
- VolumeId: 'vol-042b886ef743e3a45',
- Tags: [Array],
- VolumeType: 'standard'
- },
- {
- Attachments: [],
- AvailabilityZone: 'us-east-2a',
- CreateTime: 2019-12-02T21:55:45.248Z,
- Encrypted: false,
- Size: 1,
- SnapshotId: '',
- State: 'available',
- VolumeId: 'vol-011319e334b94e18b',
- Tags: [Array],
- VolumeType: 'standard'
- }
- ]
- }
- END
- RequestId: 04a43959-4c7e-4548-a9eb-67f3fe808546
- 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