Amazon IAM enables you to manage access to AWS services and resources securely.
This is a workspace where you can find the following AWS SDK for JavaScript version 3 (v3) Amazon IAM examples.
- Access last key used
- Attach a policy to a role
- Create access keys
- Create an account alias
- Create an IAM policy
- Create an IAM user
- Delete access keys
- Delete an account alias
- Delete a server certificate
- Delete an IAM user
- Detact a policy from an IAM role
- Get an IAM policy
- Get a server certificate
- List access keys
- List account aliases
- List server certificated
- List IAM users
- Update access key
- Update server certificate
- Update an IAM user
- Assume a role
Note: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see JavaScript ES6/CommonJS syntax.
-
Clone the AWS SDK Code Samples repo to your local environment. See the Github documentation for instructions.
-
Install the dependencies listed in the package.json in the folder containing the example(s).
Note: These dependencies include the client modules for the AWS services that this example requires, which are @aws-sdk/client-iam and @aws-sdk/client-sts.
npm install node -g
cd javascriptv3/example_code/iam
npm install
-
In your text editor, update user variables specified in the
Inputs
section of the sample file. -
Run sample code:
cd src
node [example name].js // For example, node iam_accesskeylastused.js
AWS SDK for JavaScript v3 AWS SDK for JavaScript v3 Developer Guide AWS SDK for JavaScript v3 API Reference Guide