使用 Amazon 开发工具包的 IAM 操作
以下代码示例演示了如何使用 Amazon 开发工具包来执行各个 IAM 操作。每个示例都包含一个指向 GitHub 的链接,您可以在其中找到有关设置和运行代码的说明。
这些代码节选调用了 IAM API,是必须在上下文中运行的大型程序的代码节选。您可以在使用 Amazon 开发工具包的 IAM 场景 中结合上下文查看操作。
以下示例仅包括最常用的操作。有关完整列表,请参阅 Amazon Identity and Access Management API 参考。
示例
- AddClientIdToOpenIdConnectProvider
- AddRoleToInstanceProfile
- AddUserToGroup
- AttachGroupPolicy
- AttachRolePolicy
- AttachUserPolicy
- ChangePassword
- CreateAccessKey
- CreateAccountAlias
- CreateGroup
- CreateInstanceProfile
- CreateLoginProfile
- CreateOpenIdConnectProvider
- CreatePolicy
- CreatePolicyVersion
- CreateRole
- CreateSAMLProvider
- CreateServiceLinkedRole
- CreateUser
- CreateVirtualMfaDevice
- DeactivateMfaDevice
- DeleteAccessKey
- DeleteAccountAlias
- DeleteAccountPasswordPolicy
- DeleteGroup
- DeleteGroupPolicy
- DeleteInstanceProfile
- DeleteLoginProfile
- DeleteOpenIdConnectProvider
- DeletePolicy
- DeletePolicyVersion
- DeleteRole
- DeleteRolePermissionsBoundary
- DeleteRolePolicy
- DeleteSAMLProvider
- DeleteServerCertificate
- DeleteServiceLinkedRole
- DeleteSigningCertificate
- DeleteUser
- DeleteUserPermissionsBoundary
- DeleteUserPolicy
- DeleteVirtualMfaDevice
- DetachGroupPolicy
- DetachRolePolicy
- DetachUserPolicy
- EnableMfaDevice
- GenerateCredentialReport
- GenerateServiceLastAccessedDetails
- GetAccessKeyLastUsed
- GetAccountAuthorizationDetails
- GetAccountPasswordPolicy
- GetAccountSummary
- GetContextKeysForCustomPolicy
- GetContextKeysForPrincipalPolicy
- GetCredentialReport
- GetGroup
- GetGroupPolicy
- GetInstanceProfile
- GetLoginProfile
- GetOpenIdConnectProvider
- GetPolicy
- GetPolicyVersion
- GetRole
- GetRolePolicy
- GetSamlProvider
- GetServerCertificate
- GetServiceLastAccessedDetails
- GetServiceLastAccessedDetailsWithEntities
- GetServiceLinkedRoleDeletionStatus
- GetUser
- GetUserPolicy
- ListAccessKeys
- ListAccountAliases
- ListAttachedGroupPolicies
- ListAttachedRolePolicies
- ListAttachedUserPolicies
- ListEntitiesForPolicy
- ListGroupPolicies
- ListGroups
- ListGroupsForUser
- ListInstanceProfiles
- ListInstanceProfilesForRole
- ListMfaDevices
- ListOpenIdConnectProviders
- ListPolicies
- ListPolicyVersions
- ListRolePolicies
- ListRoleTags
- ListRoles
- ListSAMLProviders
- ListServerCertificates
- ListSigningCertificates
- ListUserPolicies
- ListUserTags
- ListUsers
- ListVirtualMfaDevices
- PutGroupPolicy
- PutRolePermissionsBoundary
- PutRolePolicy
- PutUserPermissionsBoundary
- PutUserPolicy
- RemoveClientIdFromOpenIdConnectProvider
- RemoveRoleFromInstanceProfile
- RemoveUserFromGroup
- ResyncMfaDevice
- SetDefaultPolicyVersion
- TagRole
- TagUser
- UntagRole
- UntagUser
- UpdateAccessKey
- UpdateAccountPasswordPolicy
- UpdateAssumeRolePolicy
- UpdateGroup
- UpdateLoginProfile
- UpdateOpenIdConnectProviderThumbprint
- UpdateRole
- UpdateRoleDescription
- UpdateSamlProvider
- UpdateServerCertificate
- UpdateSigningCertificate
- UpdateUser
- UploadServerCertificate
- UploadSigningCertificate