From the course: AWS for DevOps: Security, Governance, and Validation

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

AWS SDK for security

AWS SDK for security - Amazon Web Services (AWS) Tutorial

From the course: AWS for DevOps: Security, Governance, and Validation

Start my 1-month free trial

AWS SDK for security

- [Narrator] So now that we've got everything set up, we're going to go ahead and use the SDK. And we're going to start with the typical pattern, which is list the buckets in S3. And just for a visual, in S3, we have these three buckets. So line one, we're requiring the AWS-SDK. Line two, we're updating the configuration to specify the region of interest. In line four, we are creating an S3 object. Line six is the key line. On the S3 object, we're calling the list buckets method, and in the node style, we're passing in an anonymous function with err and data. And we're just returning an error, if there's some error, otherwise we're just console logging out the result. So let's switch over to our terminal and run this. I'm just going to clear the screen and check the directory, and list the files. And so we want to list the bucket, so we're going to type node, and then auto complete. And we expect to see the buckets. And we get a little bit more meta data. We get to see when this was…

Contents