Shows how to use the AWS SDK for Rust to manage AWS Identity and Access Management (IAM) resources.
IAM is a web service for securely controlling access to AWS services. With IAM, you can centrally manage users, security credentials such as access keys, and permissions that control which AWS resources users and applications can access.
- Running this code might result in charges to your AWS account.
- Running the tests might result in charges to your AWS account.
- We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see Grant least privilege.
- This code is not tested in every AWS Region. For more information, see AWS Regional Services.
- Listing roles (ListRoles)
- Listing users (ListUsers)
- Listing groups (ListGroups)
- Attaching role policies (AttachRolePolicy)
- Getting an account password policy (GetAccountPasswordPolicy)
- Listing SAML providers (ListSAMLProviders)
- Listing role policies (ListRolePolicies)
- Getting a role (GetRole)
- Listing policies (ListPolicies)
- Creating a service-linked role (CreateServiceLinkedRole)
- Creating a role (CreateRole)
- Listing attached role policies (ListAttachedRolePolicies)
- Getting a policy (GetPolicy)
Run the scenario with the following command:
cargo run --bin iam_getting_started
- You must have an AWS account, and have configured your default credentials and AWS Region as described in https://github.com/awslabs/aws-sdk-rust.
- Install Rust and Cargo as described in the Rust documentation
Run the tests with the following command:
cargo test --test test-iam-service-lib -- --include-ignore
- AWS Identity and Access Management documentation
- AWS Identity and Access Management API Reference
- AWS SDK for Rust Developer Guide
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0