Skip to content

IAMServiceResource#

Index > IAM > IAMServiceResource

Auto-generated documentation for IAM type annotations stubs module mypy-boto3-iam.

IAMServiceResource#

Type annotations and code completion for boto3.resource("iam"), included resources and collections. boto3 documentation

# IAMServiceResource usage example

from mypy_boto3_iam.service_resource import IAMServiceResource

def get_iam_resource() -> IAMServiceResource:
    return boto3.resource("iam")

Attributes#

  • meta: "IAMResourceMeta"

  • groups: ServiceResourceGroupsCollection

  • instance_profiles: ServiceResourceInstanceProfilesCollection

  • policies: ServiceResourcePoliciesCollection

  • roles: ServiceResourceRolesCollection

  • saml_providers: ServiceResourceSamlProvidersCollection

  • server_certificates: ServiceResourceServerCertificatesCollection

  • users: ServiceResourceUsersCollection

  • virtual_mfa_devices: ServiceResourceVirtualMfaDevicesCollection

Collections#

ServiceResourceGroupsCollection#

Provides access to Group resource.

Type annotations and code completion for boto3.resource("iam").groups collection. boto3 documentation

# ServiceResourceGroupsCollection usage example

from mypy_boto3_iam.service_resource import ServiceResourceGroupsCollection

def get_collection() -> ServiceResourceGroupsCollection:
    return boto3.resource("iam").groups

ServiceResourceInstanceProfilesCollection#

Provides access to InstanceProfile resource.

Type annotations and code completion for boto3.resource("iam").instance_profiles collection. boto3 documentation

# ServiceResourceInstanceProfilesCollection usage example

from mypy_boto3_iam.service_resource import ServiceResourceInstanceProfilesCollection

def get_collection() -> ServiceResourceInstanceProfilesCollection:
    return boto3.resource("iam").instance_profiles

ServiceResourcePoliciesCollection#

Provides access to Policy resource.

Type annotations and code completion for boto3.resource("iam").policies collection. boto3 documentation

# ServiceResourcePoliciesCollection usage example

from mypy_boto3_iam.service_resource import ServiceResourcePoliciesCollection

def get_collection() -> ServiceResourcePoliciesCollection:
    return boto3.resource("iam").policies

ServiceResourceRolesCollection#

Provides access to Role resource.

Type annotations and code completion for boto3.resource("iam").roles collection. boto3 documentation

# ServiceResourceRolesCollection usage example

from mypy_boto3_iam.service_resource import ServiceResourceRolesCollection

def get_collection() -> ServiceResourceRolesCollection:
    return boto3.resource("iam").roles

ServiceResourceSamlProvidersCollection#

Provides access to SamlProvider resource.

Type annotations and code completion for boto3.resource("iam").saml_providers collection. boto3 documentation

# ServiceResourceSamlProvidersCollection usage example

from mypy_boto3_iam.service_resource import ServiceResourceSamlProvidersCollection

def get_collection() -> ServiceResourceSamlProvidersCollection:
    return boto3.resource("iam").saml_providers

ServiceResourceServerCertificatesCollection#

Provides access to ServerCertificate resource.

Type annotations and code completion for boto3.resource("iam").server_certificates collection. boto3 documentation

# ServiceResourceServerCertificatesCollection usage example

from mypy_boto3_iam.service_resource import ServiceResourceServerCertificatesCollection

def get_collection() -> ServiceResourceServerCertificatesCollection:
    return boto3.resource("iam").server_certificates

ServiceResourceUsersCollection#

Provides access to User resource.

Type annotations and code completion for boto3.resource("iam").users collection. boto3 documentation

# ServiceResourceUsersCollection usage example

from mypy_boto3_iam.service_resource import ServiceResourceUsersCollection

def get_collection() -> ServiceResourceUsersCollection:
    return boto3.resource("iam").users

ServiceResourceVirtualMfaDevicesCollection#

Provides access to VirtualMfaDevice resource.

Type annotations and code completion for boto3.resource("iam").virtual_mfa_devices collection. boto3 documentation

# ServiceResourceVirtualMfaDevicesCollection usage example

from mypy_boto3_iam.service_resource import ServiceResourceVirtualMfaDevicesCollection

def get_collection() -> ServiceResourceVirtualMfaDevicesCollection:
    return boto3.resource("iam").virtual_mfa_devices

Methods#

IAMServiceResource.AccessKey method#

Creates a AccessKey resource.

Type annotations and code completion for boto3.resource("iam").AccessKey method. boto3 documentation

# AccessKey method definition

def AccessKey(
    self,
    user_name: str,
    id: str,
) -> "_AccessKey":
    ...

IAMServiceResource.AccessKeyPair method#

Creates a AccessKeyPair resource.

Type annotations and code completion for boto3.resource("iam").AccessKeyPair method. boto3 documentation

# AccessKeyPair method definition

def AccessKeyPair(
    self,
    user_name: str,
    id: str,
    secret: str,
) -> "_AccessKeyPair":
    ...

IAMServiceResource.AccountPasswordPolicy method#

Creates a AccountPasswordPolicy resource.

Type annotations and code completion for boto3.resource("iam").AccountPasswordPolicy method. boto3 documentation

# AccountPasswordPolicy method definition

def AccountPasswordPolicy(
    self,
) -> "_AccountPasswordPolicy":
    ...

IAMServiceResource.AccountSummary method#

Creates a AccountSummary resource.

Type annotations and code completion for boto3.resource("iam").AccountSummary method. boto3 documentation

# AccountSummary method definition

def AccountSummary(
    self,
) -> "_AccountSummary":
    ...

IAMServiceResource.AssumeRolePolicy method#

Creates a AssumeRolePolicy resource.

Type annotations and code completion for boto3.resource("iam").AssumeRolePolicy method. boto3 documentation

# AssumeRolePolicy method definition

def AssumeRolePolicy(
    self,
    role_name: str,
) -> "_AssumeRolePolicy":
    ...

IAMServiceResource.CurrentUser method#

Creates a CurrentUser resource.

Type annotations and code completion for boto3.resource("iam").CurrentUser method. boto3 documentation

# CurrentUser method definition

def CurrentUser(
    self,
) -> "_CurrentUser":
    ...

IAMServiceResource.Group method#

Creates a Group resource.

Type annotations and code completion for boto3.resource("iam").Group method. boto3 documentation

# Group method definition

def Group(
    self,
    name: str,
) -> "_Group":
    ...

IAMServiceResource.GroupPolicy method#

Creates a GroupPolicy resource.

Type annotations and code completion for boto3.resource("iam").GroupPolicy method. boto3 documentation

# GroupPolicy method definition

def GroupPolicy(
    self,
    group_name: str,
    name: str,
) -> "_GroupPolicy":
    ...

IAMServiceResource.InstanceProfile method#

Creates a InstanceProfile resource.

Type annotations and code completion for boto3.resource("iam").InstanceProfile method. boto3 documentation

# InstanceProfile method definition

def InstanceProfile(
    self,
    name: str,
) -> "_InstanceProfile":
    ...

IAMServiceResource.LoginProfile method#

Creates a LoginProfile resource.

Type annotations and code completion for boto3.resource("iam").LoginProfile method. boto3 documentation

# LoginProfile method definition

def LoginProfile(
    self,
    user_name: str,
) -> "_LoginProfile":
    ...

IAMServiceResource.MfaDevice method#

Creates a MfaDevice resource.

Type annotations and code completion for boto3.resource("iam").MfaDevice method. boto3 documentation

# MfaDevice method definition

def MfaDevice(
    self,
    user_name: str,
    serial_number: str,
) -> "_MfaDevice":
    ...

IAMServiceResource.Policy method#

Creates a Policy resource.

Type annotations and code completion for boto3.resource("iam").Policy method. boto3 documentation

# Policy method definition

def Policy(
    self,
    arn: str,
) -> "_Policy":
    ...

IAMServiceResource.PolicyVersion method#

Creates a PolicyVersion resource.

Type annotations and code completion for boto3.resource("iam").PolicyVersion method. boto3 documentation

# PolicyVersion method definition

def PolicyVersion(
    self,
    arn: str,
    version_id: str,
) -> "_PolicyVersion":
    ...

IAMServiceResource.Role method#

Creates a Role resource.

Type annotations and code completion for boto3.resource("iam").Role method. boto3 documentation

# Role method definition

def Role(
    self,
    name: str,
) -> "_Role":
    ...

IAMServiceResource.RolePolicy method#

Creates a RolePolicy resource.

Type annotations and code completion for boto3.resource("iam").RolePolicy method. boto3 documentation

# RolePolicy method definition

def RolePolicy(
    self,
    role_name: str,
    name: str,
) -> "_RolePolicy":
    ...

IAMServiceResource.SamlProvider method#

Creates a SamlProvider resource.

Type annotations and code completion for boto3.resource("iam").SamlProvider method. boto3 documentation

# SamlProvider method definition

def SamlProvider(
    self,
    arn: str,
) -> "_SamlProvider":
    ...

IAMServiceResource.ServerCertificate method#

Creates a ServerCertificate resource.

Type annotations and code completion for boto3.resource("iam").ServerCertificate method. boto3 documentation

# ServerCertificate method definition

def ServerCertificate(
    self,
    name: str,
) -> "_ServerCertificate":
    ...

IAMServiceResource.SigningCertificate method#

Creates a SigningCertificate resource.

Type annotations and code completion for boto3.resource("iam").SigningCertificate method. boto3 documentation

# SigningCertificate method definition

def SigningCertificate(
    self,
    user_name: str,
    id: str,
) -> "_SigningCertificate":
    ...

IAMServiceResource.User method#

Creates a User resource.

Type annotations and code completion for boto3.resource("iam").User method. boto3 documentation

# User method definition

def User(
    self,
    name: str,
) -> "_User":
    ...

IAMServiceResource.UserPolicy method#

Creates a UserPolicy resource.

Type annotations and code completion for boto3.resource("iam").UserPolicy method. boto3 documentation

# UserPolicy method definition

def UserPolicy(
    self,
    user_name: str,
    name: str,
) -> "_UserPolicy":
    ...

IAMServiceResource.VirtualMfaDevice method#

Creates a VirtualMfaDevice resource.

Type annotations and code completion for boto3.resource("iam").VirtualMfaDevice method. boto3 documentation

# VirtualMfaDevice method definition

def VirtualMfaDevice(
    self,
    serial_number: str,
) -> "_VirtualMfaDevice":
    ...

IAMServiceResource.change_password method#

Changes the password of the IAM user who is calling this operation.

Type annotations and code completion for boto3.resource("iam").change_password method. boto3 documentation

# change_password method definition

def change_password(
    self,
    *,
    OldPassword: str,
    NewPassword: str,
) -> None:
    ...
# change_password method usage example with argument unpacking

kwargs: ChangePasswordRequestServiceResourceChangePasswordTypeDef = {  # (1)
    "OldPassword": ...,
    "NewPassword": ...,
}

parent.change_password(**kwargs)
  1. See ChangePasswordRequestServiceResourceChangePasswordTypeDef

IAMServiceResource.create_account_alias method#

Creates an alias for your Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").create_account_alias method. boto3 documentation

# create_account_alias method definition

def create_account_alias(
    self,
    *,
    AccountAlias: str,
) -> None:
    ...
# create_account_alias method usage example with argument unpacking

kwargs: CreateAccountAliasRequestServiceResourceCreateAccountAliasTypeDef = {  # (1)
    "AccountAlias": ...,
}

parent.create_account_alias(**kwargs)
  1. See CreateAccountAliasRequestServiceResourceCreateAccountAliasTypeDef

IAMServiceResource.create_account_password_policy method#

Updates the password policy settings for the Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").create_account_password_policy method. boto3 documentation

# create_account_password_policy method definition

def create_account_password_policy(
    self,
    *,
    MinimumPasswordLength: int = ...,
    RequireSymbols: bool = ...,
    RequireNumbers: bool = ...,
    RequireUppercaseCharacters: bool = ...,
    RequireLowercaseCharacters: bool = ...,
    AllowUsersToChangePassword: bool = ...,
    MaxPasswordAge: int = ...,
    PasswordReusePrevention: int = ...,
    HardExpiry: bool = ...,
) -> "_AccountPasswordPolicy":
    ...
# create_account_password_policy method usage example with argument unpacking

kwargs: UpdateAccountPasswordPolicyRequestServiceResourceCreateAccountPasswordPolicyTypeDef = {  # (1)
    "MinimumPasswordLength": ...,
}

parent.create_account_password_policy(**kwargs)
  1. See UpdateAccountPasswordPolicyRequestServiceResourceCreateAccountPasswordPolicyTypeDef

IAMServiceResource.create_group method#

Creates a new group.

Type annotations and code completion for boto3.resource("iam").create_group method. boto3 documentation

# create_group method definition

def create_group(
    self,
    *,
    GroupName: str,
    Path: str = ...,
) -> "_Group":
    ...
# create_group method usage example with argument unpacking

kwargs: CreateGroupRequestServiceResourceCreateGroupTypeDef = {  # (1)
    "GroupName": ...,
}

parent.create_group(**kwargs)
  1. See CreateGroupRequestServiceResourceCreateGroupTypeDef

IAMServiceResource.create_instance_profile method#

Creates a new instance profile.

Type annotations and code completion for boto3.resource("iam").create_instance_profile method. boto3 documentation

# create_instance_profile method definition

def create_instance_profile(
    self,
    *,
    InstanceProfileName: str,
    Path: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> "_InstanceProfile":
    ...
  1. See TagTypeDef
# create_instance_profile method usage example with argument unpacking

kwargs: CreateInstanceProfileRequestServiceResourceCreateInstanceProfileTypeDef = {  # (1)
    "InstanceProfileName": ...,
}

parent.create_instance_profile(**kwargs)
  1. See CreateInstanceProfileRequestServiceResourceCreateInstanceProfileTypeDef

IAMServiceResource.create_policy method#

Creates a new managed policy for your Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").create_policy method. boto3 documentation

# create_policy method definition

def create_policy(
    self,
    *,
    PolicyName: str,
    PolicyDocument: str,
    Path: str = ...,
    Description: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> "_Policy":
    ...
  1. See TagTypeDef
# create_policy method usage example with argument unpacking

kwargs: CreatePolicyRequestServiceResourceCreatePolicyTypeDef = {  # (1)
    "PolicyName": ...,
    "PolicyDocument": ...,
}

parent.create_policy(**kwargs)
  1. See CreatePolicyRequestServiceResourceCreatePolicyTypeDef

IAMServiceResource.create_role method#

Creates a new role for your Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").create_role method. boto3 documentation

# create_role method definition

def create_role(
    self,
    *,
    RoleName: str,
    AssumeRolePolicyDocument: str,
    Path: str = ...,
    Description: str = ...,
    MaxSessionDuration: int = ...,
    PermissionsBoundary: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> "_Role":
    ...
  1. See TagTypeDef
# create_role method usage example with argument unpacking

kwargs: CreateRoleRequestServiceResourceCreateRoleTypeDef = {  # (1)
    "RoleName": ...,
    "AssumeRolePolicyDocument": ...,
}

parent.create_role(**kwargs)
  1. See CreateRoleRequestServiceResourceCreateRoleTypeDef

IAMServiceResource.create_saml_provider method#

Creates an IAM resource that describes an identity provider (IdP) that supports SAML 2.0.

Type annotations and code completion for boto3.resource("iam").create_saml_provider method. boto3 documentation

# create_saml_provider method definition

def create_saml_provider(
    self,
    *,
    SAMLMetadataDocument: str,
    Name: str,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> "_SamlProvider":
    ...
  1. See TagTypeDef
# create_saml_provider method usage example with argument unpacking

kwargs: CreateSAMLProviderRequestServiceResourceCreateSamlProviderTypeDef = {  # (1)
    "SAMLMetadataDocument": ...,
    "Name": ...,
}

parent.create_saml_provider(**kwargs)
  1. See CreateSAMLProviderRequestServiceResourceCreateSamlProviderTypeDef

IAMServiceResource.create_server_certificate method#

Uploads a server certificate entity for the Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").create_server_certificate method. boto3 documentation

# create_server_certificate method definition

def create_server_certificate(
    self,
    *,
    ServerCertificateName: str,
    CertificateBody: str,
    PrivateKey: str,
    Path: str = ...,
    CertificateChain: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> "_ServerCertificate":
    ...
  1. See TagTypeDef
# create_server_certificate method usage example with argument unpacking

kwargs: UploadServerCertificateRequestServiceResourceCreateServerCertificateTypeDef = {  # (1)
    "ServerCertificateName": ...,
    "CertificateBody": ...,
    "PrivateKey": ...,
}

parent.create_server_certificate(**kwargs)
  1. See UploadServerCertificateRequestServiceResourceCreateServerCertificateTypeDef

IAMServiceResource.create_signing_certificate method#

Uploads an X.509 signing certificate and associates it with the specified IAM user.

Type annotations and code completion for boto3.resource("iam").create_signing_certificate method. boto3 documentation

# create_signing_certificate method definition

def create_signing_certificate(
    self,
    *,
    CertificateBody: str,
    UserName: str = ...,
) -> "_SigningCertificate":
    ...
# create_signing_certificate method usage example with argument unpacking

kwargs: UploadSigningCertificateRequestServiceResourceCreateSigningCertificateTypeDef = {  # (1)
    "CertificateBody": ...,
}

parent.create_signing_certificate(**kwargs)
  1. See UploadSigningCertificateRequestServiceResourceCreateSigningCertificateTypeDef

IAMServiceResource.create_user method#

Creates a new IAM user for your Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").create_user method. boto3 documentation

# create_user method definition

def create_user(
    self,
    *,
    UserName: str,
    Path: str = ...,
    PermissionsBoundary: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> "_User":
    ...
  1. See TagTypeDef
# create_user method usage example with argument unpacking

kwargs: CreateUserRequestServiceResourceCreateUserTypeDef = {  # (1)
    "UserName": ...,
}

parent.create_user(**kwargs)
  1. See CreateUserRequestServiceResourceCreateUserTypeDef

IAMServiceResource.create_virtual_mfa_device method#

Creates a new virtual MFA device for the Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").create_virtual_mfa_device method. boto3 documentation

# create_virtual_mfa_device method definition

def create_virtual_mfa_device(
    self,
    *,
    VirtualMFADeviceName: str,
    Path: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> "_VirtualMfaDevice":
    ...
  1. See TagTypeDef
# create_virtual_mfa_device method usage example with argument unpacking

kwargs: CreateVirtualMFADeviceRequestServiceResourceCreateVirtualMfaDeviceTypeDef = {  # (1)
    "VirtualMFADeviceName": ...,
}

parent.create_virtual_mfa_device(**kwargs)
  1. See CreateVirtualMFADeviceRequestServiceResourceCreateVirtualMfaDeviceTypeDef

IAMServiceResource.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

AccessKey#

Type annotations and code completion for boto3.resource("iam").AccessKey class. boto3 documentation

# AccessKey usage example

from mypy_boto3_iam.service_resource import AccessKey

def get_resource() -> AccessKey:
    return boto3.resource("iam").AccessKey(...)

AccessKey attributes#

  • access_key_id: str
  • status: StatusTypeType
  • create_date: datetime
  • user_name: str
  • id: str
  • meta: "IAMResourceMeta"

AccessKey methods#

AccessKey.User method#

Creates a User resource.

Type annotations and code completion for boto3.resource("iam").User method. boto3 documentation

# User method definition

def User(
    self,
) -> "_User":
    ...

AccessKey.activate method#

Changes the status of the specified access key from Active to Inactive, or vice versa.

Type annotations and code completion for boto3.resource("iam").activate method. boto3 documentation

# activate method definition

def activate(
    self,
    *,
    Status: StatusTypeType = 'Active',  # (1)
) -> None:
    ...
  1. See StatusTypeType
# activate method usage example with argument unpacking

kwargs: UpdateAccessKeyRequestAccessKeyActivateTypeDef = {  # (1)
    "Status": ...,
}

parent.activate(**kwargs)
  1. See UpdateAccessKeyRequestAccessKeyActivateTypeDef

AccessKey.deactivate method#

Changes the status of the specified access key from Active to Inactive, or vice versa.

Type annotations and code completion for boto3.resource("iam").deactivate method. boto3 documentation

# deactivate method definition

def deactivate(
    self,
    *,
    Status: StatusTypeType = 'Inactive',  # (1)
) -> None:
    ...
  1. See StatusTypeType
# deactivate method usage example with argument unpacking

kwargs: UpdateAccessKeyRequestAccessKeyDeactivateTypeDef = {  # (1)
    "Status": ...,
}

parent.deactivate(**kwargs)
  1. See UpdateAccessKeyRequestAccessKeyDeactivateTypeDef

AccessKey.delete method#

Deletes the access key pair associated with the specified IAM user.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

AccessKey.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

AccessKeyPair#

Type annotations and code completion for boto3.resource("iam").AccessKeyPair class. boto3 documentation

# AccessKeyPair usage example

from mypy_boto3_iam.service_resource import AccessKeyPair

def get_resource() -> AccessKeyPair:
    return boto3.resource("iam").AccessKeyPair(...)

AccessKeyPair attributes#

  • access_key_id: str
  • status: StatusTypeType
  • secret_access_key: str
  • create_date: datetime
  • user_name: str
  • id: str
  • secret: str
  • meta: "IAMResourceMeta"

AccessKeyPair methods#

AccessKeyPair.activate method#

Changes the status of the specified access key from Active to Inactive, or vice versa.

Type annotations and code completion for boto3.resource("iam").activate method. boto3 documentation

# activate method definition

def activate(
    self,
    *,
    Status: StatusTypeType = 'Active',  # (1)
) -> None:
    ...
  1. See StatusTypeType
# activate method usage example with argument unpacking

kwargs: UpdateAccessKeyRequestAccessKeyPairActivateTypeDef = {  # (1)
    "Status": ...,
}

parent.activate(**kwargs)
  1. See UpdateAccessKeyRequestAccessKeyPairActivateTypeDef

AccessKeyPair.deactivate method#

Changes the status of the specified access key from Active to Inactive, or vice versa.

Type annotations and code completion for boto3.resource("iam").deactivate method. boto3 documentation

# deactivate method definition

def deactivate(
    self,
    *,
    Status: StatusTypeType = 'Inactive',  # (1)
) -> None:
    ...
  1. See StatusTypeType
# deactivate method usage example with argument unpacking

kwargs: UpdateAccessKeyRequestAccessKeyPairDeactivateTypeDef = {  # (1)
    "Status": ...,
}

parent.deactivate(**kwargs)
  1. See UpdateAccessKeyRequestAccessKeyPairDeactivateTypeDef

AccessKeyPair.delete method#

Deletes the access key pair associated with the specified IAM user.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

AccessKeyPair.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

AccountPasswordPolicy#

Type annotations and code completion for boto3.resource("iam").AccountPasswordPolicy class. boto3 documentation

# AccountPasswordPolicy usage example

from mypy_boto3_iam.service_resource import AccountPasswordPolicy

def get_resource() -> AccountPasswordPolicy:
    return boto3.resource("iam").AccountPasswordPolicy(...)

AccountPasswordPolicy attributes#

  • minimum_password_length: int
  • require_symbols: bool
  • require_numbers: bool
  • require_uppercase_characters: bool
  • require_lowercase_characters: bool
  • allow_users_to_change_password: bool
  • expire_passwords: bool
  • max_password_age: int
  • password_reuse_prevention: int
  • hard_expiry: bool
  • meta: "IAMResourceMeta"

AccountPasswordPolicy methods#

AccountPasswordPolicy.delete method#

Deletes the password policy for the Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

AccountPasswordPolicy.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

AccountPasswordPolicy.load method#

Calls 🇵🇾meth:IAM.Client.get_account_password_policy to update the attributes of the AccountPasswordPolicy resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

AccountPasswordPolicy.reload method#

Calls 🇵🇾meth:IAM.Client.get_account_password_policy to update the attributes of the AccountPasswordPolicy resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

AccountPasswordPolicy.update method#

Updates the password policy settings for the Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").update method. boto3 documentation

# update method definition

def update(
    self,
    *,
    MinimumPasswordLength: int = ...,
    RequireSymbols: bool = ...,
    RequireNumbers: bool = ...,
    RequireUppercaseCharacters: bool = ...,
    RequireLowercaseCharacters: bool = ...,
    AllowUsersToChangePassword: bool = ...,
    MaxPasswordAge: int = ...,
    PasswordReusePrevention: int = ...,
    HardExpiry: bool = ...,
) -> None:
    ...
# update method usage example with argument unpacking

kwargs: UpdateAccountPasswordPolicyRequestAccountPasswordPolicyUpdateTypeDef = {  # (1)
    "MinimumPasswordLength": ...,
}

parent.update(**kwargs)
  1. See UpdateAccountPasswordPolicyRequestAccountPasswordPolicyUpdateTypeDef

AccountSummary#

Type annotations and code completion for boto3.resource("iam").AccountSummary class. boto3 documentation

# AccountSummary usage example

from mypy_boto3_iam.service_resource import AccountSummary

def get_resource() -> AccountSummary:
    return boto3.resource("iam").AccountSummary(...)

AccountSummary attributes#

AccountSummary methods#

AccountSummary.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

AccountSummary.load method#

Calls 🇵🇾meth:IAM.Client.get_account_summary to update the attributes of the AccountSummary resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

AccountSummary.reload method#

Calls 🇵🇾meth:IAM.Client.get_account_summary to update the attributes of the AccountSummary resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

AssumeRolePolicy#

Type annotations and code completion for boto3.resource("iam").AssumeRolePolicy class. boto3 documentation

# AssumeRolePolicy usage example

from mypy_boto3_iam.service_resource import AssumeRolePolicy

def get_resource() -> AssumeRolePolicy:
    return boto3.resource("iam").AssumeRolePolicy(...)

AssumeRolePolicy attributes#

  • role_name: str
  • meta: "IAMResourceMeta"

AssumeRolePolicy methods#

AssumeRolePolicy.Role method#

Creates a Role resource.

Type annotations and code completion for boto3.resource("iam").Role method. boto3 documentation

# Role method definition

def Role(
    self,
) -> "_Role":
    ...

AssumeRolePolicy.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

AssumeRolePolicy.update method#

Updates the policy that grants an IAM entity permission to assume a role.

Type annotations and code completion for boto3.resource("iam").update method. boto3 documentation

# update method definition

def update(
    self,
    *,
    PolicyDocument: str,
) -> None:
    ...
# update method usage example with argument unpacking

kwargs: UpdateAssumeRolePolicyRequestAssumeRolePolicyUpdateTypeDef = {  # (1)
    "PolicyDocument": ...,
}

parent.update(**kwargs)
  1. See UpdateAssumeRolePolicyRequestAssumeRolePolicyUpdateTypeDef

CurrentUser#

Type annotations and code completion for boto3.resource("iam").CurrentUser class. boto3 documentation

# CurrentUser usage example

from mypy_boto3_iam.service_resource import CurrentUser

def get_resource() -> CurrentUser:
    return boto3.resource("iam").CurrentUser(...)

CurrentUser attributes#

  • path: str
  • user_name: str
  • user_id: str
  • arn: str
  • create_date: datetime
  • password_last_used: datetime
  • permissions_boundary: AttachedPermissionsBoundaryTypeDef
  • tags: List[TagTypeDef]
  • user: "User"
  • access_keys: CurrentUserAccessKeysCollection
  • mfa_devices: CurrentUserMfaDevicesCollection
  • signing_certificates: CurrentUserSigningCertificatesCollection
  • meta: "IAMResourceMeta"

CurrentUser collections#

CurrentUser.access_keys#

Provides access to AccessKey resource.

Type annotations and code completion for boto3.resource("iam").CurrentUser(...).access_keys collection. boto3 documentation

# CurrentUserAccessKeysCollection usage example

from mypy_boto3_iam.service_resource import CurrentUserAccessKeysCollection

def get_collection() -> CurrentUserAccessKeysCollection:
    resource = boto3.resource("iam").CurrentUser(...)
    return resource.access_keys

CurrentUser.mfa_devices#

Provides access to MfaDevice resource.

Type annotations and code completion for boto3.resource("iam").CurrentUser(...).mfa_devices collection. boto3 documentation

# CurrentUserMfaDevicesCollection usage example

from mypy_boto3_iam.service_resource import CurrentUserMfaDevicesCollection

def get_collection() -> CurrentUserMfaDevicesCollection:
    resource = boto3.resource("iam").CurrentUser(...)
    return resource.mfa_devices

CurrentUser.signing_certificates#

Provides access to SigningCertificate resource.

Type annotations and code completion for boto3.resource("iam").CurrentUser(...).signing_certificates collection. boto3 documentation

# CurrentUserSigningCertificatesCollection usage example

from mypy_boto3_iam.service_resource import CurrentUserSigningCertificatesCollection

def get_collection() -> CurrentUserSigningCertificatesCollection:
    resource = boto3.resource("iam").CurrentUser(...)
    return resource.signing_certificates

CurrentUser methods#

CurrentUser.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

CurrentUser.load method#

Calls 🇵🇾meth:IAM.Client.get_user to update the attributes of the CurrentUser resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

CurrentUser.reload method#

Calls 🇵🇾meth:IAM.Client.get_user to update the attributes of the CurrentUser resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

Group#

Type annotations and code completion for boto3.resource("iam").Group class. boto3 documentation

# Group usage example

from mypy_boto3_iam.service_resource import Group

def get_resource() -> Group:
    return boto3.resource("iam").Group(...)

Group attributes#

  • path: str
  • group_name: str
  • group_id: str
  • arn: str
  • create_date: datetime
  • name: str
  • attached_policies: GroupAttachedPoliciesCollection
  • policies: GroupPoliciesCollection
  • users: GroupUsersCollection
  • meta: "IAMResourceMeta"

Group collections#

Group.attached_policies#

Provides access to Policy resource.

Type annotations and code completion for boto3.resource("iam").Group(...).attached_policies collection. boto3 documentation

# GroupAttachedPoliciesCollection usage example

from mypy_boto3_iam.service_resource import GroupAttachedPoliciesCollection

def get_collection() -> GroupAttachedPoliciesCollection:
    resource = boto3.resource("iam").Group(...)
    return resource.attached_policies

Group.policies#

Provides access to GroupPolicy resource.

Type annotations and code completion for boto3.resource("iam").Group(...).policies collection. boto3 documentation

# GroupPoliciesCollection usage example

from mypy_boto3_iam.service_resource import GroupPoliciesCollection

def get_collection() -> GroupPoliciesCollection:
    resource = boto3.resource("iam").Group(...)
    return resource.policies

Group.users#

Provides access to User resource.

Type annotations and code completion for boto3.resource("iam").Group(...).users collection. boto3 documentation

# GroupUsersCollection usage example

from mypy_boto3_iam.service_resource import GroupUsersCollection

def get_collection() -> GroupUsersCollection:
    resource = boto3.resource("iam").Group(...)
    return resource.users

Group methods#

Group.Policy method#

Creates a GroupPolicy resource.

Type annotations and code completion for boto3.resource("iam").Policy method. boto3 documentation

# Policy method definition

def Policy(
    self,
    name: str,
) -> "_GroupPolicy":
    ...

Group.add_user method#

Adds the specified user to the specified group.

Type annotations and code completion for boto3.resource("iam").add_user method. boto3 documentation

# add_user method definition

def add_user(
    self,
    *,
    UserName: str,
) -> None:
    ...
# add_user method usage example with argument unpacking

kwargs: AddUserToGroupRequestGroupAddUserTypeDef = {  # (1)
    "UserName": ...,
}

parent.add_user(**kwargs)
  1. See AddUserToGroupRequestGroupAddUserTypeDef

Group.attach_policy method#

Attaches the specified managed policy to the specified IAM group.

Type annotations and code completion for boto3.resource("iam").attach_policy method. boto3 documentation

# attach_policy method definition

def attach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
# attach_policy method usage example with argument unpacking

kwargs: AttachGroupPolicyRequestGroupAttachPolicyTypeDef = {  # (1)
    "PolicyArn": ...,
}

parent.attach_policy(**kwargs)
  1. See AttachGroupPolicyRequestGroupAttachPolicyTypeDef

Group.create method#

Creates a new group.

Type annotations and code completion for boto3.resource("iam").create method. boto3 documentation

# create method definition

def create(
    self,
    *,
    Path: str = ...,
) -> "_Group":
    ...
# create method usage example with argument unpacking

kwargs: CreateGroupRequestGroupCreateTypeDef = {  # (1)
    "Path": ...,
}

parent.create(**kwargs)
  1. See CreateGroupRequestGroupCreateTypeDef

Group.create_policy method#

Adds or updates an inline policy document that is embedded in the specified IAM group.

Type annotations and code completion for boto3.resource("iam").create_policy method. boto3 documentation

# create_policy method definition

def create_policy(
    self,
    *,
    PolicyName: str,
    PolicyDocument: str,
) -> "_GroupPolicy":
    ...
# create_policy method usage example with argument unpacking

kwargs: PutGroupPolicyRequestGroupCreatePolicyTypeDef = {  # (1)
    "PolicyName": ...,
    "PolicyDocument": ...,
}

parent.create_policy(**kwargs)
  1. See PutGroupPolicyRequestGroupCreatePolicyTypeDef

Group.delete method#

Deletes the specified IAM group.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

Group.detach_policy method#

Removes the specified managed policy from the specified IAM group.

Type annotations and code completion for boto3.resource("iam").detach_policy method. boto3 documentation

# detach_policy method definition

def detach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
# detach_policy method usage example with argument unpacking

kwargs: DetachGroupPolicyRequestGroupDetachPolicyTypeDef = {  # (1)
    "PolicyArn": ...,
}

parent.detach_policy(**kwargs)
  1. See DetachGroupPolicyRequestGroupDetachPolicyTypeDef

Group.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

Group.load method#

Calls 🇵🇾meth:IAM.Client.get_group to update the attributes of the Group resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

Group.reload method#

Calls 🇵🇾meth:IAM.Client.get_group to update the attributes of the Group resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

Group.remove_user method#

Removes the specified user from the specified group.

Type annotations and code completion for boto3.resource("iam").remove_user method. boto3 documentation

# remove_user method definition

def remove_user(
    self,
    *,
    UserName: str,
) -> None:
    ...
# remove_user method usage example with argument unpacking

kwargs: RemoveUserFromGroupRequestGroupRemoveUserTypeDef = {  # (1)
    "UserName": ...,
}

parent.remove_user(**kwargs)
  1. See RemoveUserFromGroupRequestGroupRemoveUserTypeDef

Group.update method#

Updates the name and/or the path of the specified IAM group.

Type annotations and code completion for boto3.resource("iam").update method. boto3 documentation

# update method definition

def update(
    self,
    *,
    NewPath: str = ...,
    NewGroupName: str = ...,
) -> "_Group":
    ...
# update method usage example with argument unpacking

kwargs: UpdateGroupRequestGroupUpdateTypeDef = {  # (1)
    "NewPath": ...,
}

parent.update(**kwargs)
  1. See UpdateGroupRequestGroupUpdateTypeDef

GroupPolicy#

Type annotations and code completion for boto3.resource("iam").GroupPolicy class. boto3 documentation

# GroupPolicy usage example

from mypy_boto3_iam.service_resource import GroupPolicy

def get_resource() -> GroupPolicy:
    return boto3.resource("iam").GroupPolicy(...)

GroupPolicy attributes#

  • policy_name: str
  • policy_document: PolicyDocumentTypeDef
  • group_name: str
  • name: str
  • meta: "IAMResourceMeta"

GroupPolicy methods#

GroupPolicy.Group method#

Creates a Group resource.

Type annotations and code completion for boto3.resource("iam").Group method. boto3 documentation

# Group method definition

def Group(
    self,
) -> "_Group":
    ...

GroupPolicy.delete method#

Deletes the specified inline policy that is embedded in the specified IAM group.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

GroupPolicy.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

GroupPolicy.load method#

Calls 🇵🇾meth:IAM.Client.get_group_policy to update the attributes of the GroupPolicy resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

GroupPolicy.put method#

Adds or updates an inline policy document that is embedded in the specified IAM group.

Type annotations and code completion for boto3.resource("iam").put method. boto3 documentation

# put method definition

def put(
    self,
    *,
    PolicyDocument: str,
) -> None:
    ...
# put method usage example with argument unpacking

kwargs: PutGroupPolicyRequestGroupPolicyPutTypeDef = {  # (1)
    "PolicyDocument": ...,
}

parent.put(**kwargs)
  1. See PutGroupPolicyRequestGroupPolicyPutTypeDef

GroupPolicy.reload method#

Calls 🇵🇾meth:IAM.Client.get_group_policy to update the attributes of the GroupPolicy resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

InstanceProfile#

Type annotations and code completion for boto3.resource("iam").InstanceProfile class. boto3 documentation

# InstanceProfile usage example

from mypy_boto3_iam.service_resource import InstanceProfile

def get_resource() -> InstanceProfile:
    return boto3.resource("iam").InstanceProfile(...)

InstanceProfile attributes#

  • path: str
  • instance_profile_name: str
  • instance_profile_id: str
  • arn: str
  • create_date: datetime
  • roles_attribute: List[RoleTypeDef]
  • tags: List[TagTypeDef]
  • name: str
  • roles: List["Role"]
  • meta: "IAMResourceMeta"

InstanceProfile methods#

InstanceProfile.add_role method#

Adds the specified IAM role to the specified instance profile.

Type annotations and code completion for boto3.resource("iam").add_role method. boto3 documentation

# add_role method definition

def add_role(
    self,
    *,
    RoleName: str,
) -> None:
    ...
# add_role method usage example with argument unpacking

kwargs: AddRoleToInstanceProfileRequestInstanceProfileAddRoleTypeDef = {  # (1)
    "RoleName": ...,
}

parent.add_role(**kwargs)
  1. See AddRoleToInstanceProfileRequestInstanceProfileAddRoleTypeDef

InstanceProfile.delete method#

Deletes the specified instance profile.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

InstanceProfile.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

InstanceProfile.load method#

Calls 🇵🇾meth:IAM.Client.get_instance_profile to update the attributes of the InstanceProfile resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

InstanceProfile.reload method#

Calls 🇵🇾meth:IAM.Client.get_instance_profile to update the attributes of the InstanceProfile resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

InstanceProfile.remove_role method#

Removes the specified IAM role from the specified Amazon EC2 instance profile.

Type annotations and code completion for boto3.resource("iam").remove_role method. boto3 documentation

# remove_role method definition

def remove_role(
    self,
    *,
    RoleName: str,
) -> None:
    ...
# remove_role method usage example with argument unpacking

kwargs: RemoveRoleFromInstanceProfileRequestInstanceProfileRemoveRoleTypeDef = {  # (1)
    "RoleName": ...,
}

parent.remove_role(**kwargs)
  1. See RemoveRoleFromInstanceProfileRequestInstanceProfileRemoveRoleTypeDef

LoginProfile#

Type annotations and code completion for boto3.resource("iam").LoginProfile class. boto3 documentation

# LoginProfile usage example

from mypy_boto3_iam.service_resource import LoginProfile

def get_resource() -> LoginProfile:
    return boto3.resource("iam").LoginProfile(...)

LoginProfile attributes#

  • create_date: datetime
  • password_reset_required: bool
  • user_name: str
  • meta: "IAMResourceMeta"

LoginProfile methods#

LoginProfile.User method#

Creates a User resource.

Type annotations and code completion for boto3.resource("iam").User method. boto3 documentation

# User method definition

def User(
    self,
) -> "_User":
    ...

LoginProfile.create method#

Creates a password for the specified IAM user.

Type annotations and code completion for boto3.resource("iam").create method. boto3 documentation

# create method definition

def create(
    self,
    *,
    Password: str = ...,
    PasswordResetRequired: bool = ...,
) -> "_LoginProfile":
    ...
# create method usage example with argument unpacking

kwargs: CreateLoginProfileRequestLoginProfileCreateTypeDef = {  # (1)
    "Password": ...,
}

parent.create(**kwargs)
  1. See CreateLoginProfileRequestLoginProfileCreateTypeDef

LoginProfile.delete method#

Deletes the password for the specified IAM user, For more information, see Managing passwords for IAM users.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

LoginProfile.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

LoginProfile.load method#

Calls 🇵🇾meth:IAM.Client.get_login_profile to update the attributes of the LoginProfile resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

LoginProfile.reload method#

Calls 🇵🇾meth:IAM.Client.get_login_profile to update the attributes of the LoginProfile resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

LoginProfile.update method#

Changes the password for the specified IAM user.

Type annotations and code completion for boto3.resource("iam").update method. boto3 documentation

# update method definition

def update(
    self,
    *,
    Password: str = ...,
    PasswordResetRequired: bool = ...,
) -> None:
    ...
# update method usage example with argument unpacking

kwargs: UpdateLoginProfileRequestLoginProfileUpdateTypeDef = {  # (1)
    "Password": ...,
}

parent.update(**kwargs)
  1. See UpdateLoginProfileRequestLoginProfileUpdateTypeDef

MfaDevice#

Type annotations and code completion for boto3.resource("iam").MfaDevice class. boto3 documentation

# MfaDevice usage example

from mypy_boto3_iam.service_resource import MfaDevice

def get_resource() -> MfaDevice:
    return boto3.resource("iam").MfaDevice(...)

MfaDevice attributes#

  • enable_date: datetime
  • user_name: str
  • serial_number: str
  • meta: "IAMResourceMeta"

MfaDevice methods#

MfaDevice.User method#

Creates a User resource.

Type annotations and code completion for boto3.resource("iam").User method. boto3 documentation

# User method definition

def User(
    self,
) -> "_User":
    ...

MfaDevice.associate method#

Enables the specified MFA device and associates it with the specified IAM user.

Type annotations and code completion for boto3.resource("iam").associate method. boto3 documentation

# associate method definition

def associate(
    self,
    *,
    AuthenticationCode1: str,
    AuthenticationCode2: str,
) -> None:
    ...
# associate method usage example with argument unpacking

kwargs: EnableMFADeviceRequestMfaDeviceAssociateTypeDef = {  # (1)
    "AuthenticationCode1": ...,
    "AuthenticationCode2": ...,
}

parent.associate(**kwargs)
  1. See EnableMFADeviceRequestMfaDeviceAssociateTypeDef

MfaDevice.disassociate method#

Deactivates the specified MFA device and removes it from association with the user name for which it was originally enabled.

Type annotations and code completion for boto3.resource("iam").disassociate method. boto3 documentation

# disassociate method definition

def disassociate(
    self,
) -> None:
    ...

MfaDevice.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

MfaDevice.resync method#

Synchronizes the specified MFA device with its IAM resource object on the Amazon Web Services servers.

Type annotations and code completion for boto3.resource("iam").resync method. boto3 documentation

# resync method definition

def resync(
    self,
    *,
    AuthenticationCode1: str,
    AuthenticationCode2: str,
) -> None:
    ...
# resync method usage example with argument unpacking

kwargs: ResyncMFADeviceRequestMfaDeviceResyncTypeDef = {  # (1)
    "AuthenticationCode1": ...,
    "AuthenticationCode2": ...,
}

parent.resync(**kwargs)
  1. See ResyncMFADeviceRequestMfaDeviceResyncTypeDef

Policy#

Type annotations and code completion for boto3.resource("iam").Policy class. boto3 documentation

# Policy usage example

from mypy_boto3_iam.service_resource import Policy

def get_resource() -> Policy:
    return boto3.resource("iam").Policy(...)

Policy attributes#

  • policy_name: str
  • policy_id: str
  • path: str
  • default_version_id: str
  • attachment_count: int
  • permissions_boundary_usage_count: int
  • is_attachable: bool
  • description: str
  • create_date: datetime
  • update_date: datetime
  • tags: List[TagTypeDef]
  • arn: str
  • default_version: "PolicyVersion"
  • attached_groups: PolicyAttachedGroupsCollection
  • attached_roles: PolicyAttachedRolesCollection
  • attached_users: PolicyAttachedUsersCollection
  • versions: PolicyVersionsCollection
  • meta: "IAMResourceMeta"

Policy collections#

Policy.attached_groups#

Provides access to Group resource.

Type annotations and code completion for boto3.resource("iam").Policy(...).attached_groups collection. boto3 documentation

# PolicyAttachedGroupsCollection usage example

from mypy_boto3_iam.service_resource import PolicyAttachedGroupsCollection

def get_collection() -> PolicyAttachedGroupsCollection:
    resource = boto3.resource("iam").Policy(...)
    return resource.attached_groups

Policy.attached_roles#

Provides access to Role resource.

Type annotations and code completion for boto3.resource("iam").Policy(...).attached_roles collection. boto3 documentation

# PolicyAttachedRolesCollection usage example

from mypy_boto3_iam.service_resource import PolicyAttachedRolesCollection

def get_collection() -> PolicyAttachedRolesCollection:
    resource = boto3.resource("iam").Policy(...)
    return resource.attached_roles

Policy.attached_users#

Provides access to User resource.

Type annotations and code completion for boto3.resource("iam").Policy(...).attached_users collection. boto3 documentation

# PolicyAttachedUsersCollection usage example

from mypy_boto3_iam.service_resource import PolicyAttachedUsersCollection

def get_collection() -> PolicyAttachedUsersCollection:
    resource = boto3.resource("iam").Policy(...)
    return resource.attached_users

Policy.versions#

Provides access to PolicyVersion resource.

Type annotations and code completion for boto3.resource("iam").Policy(...).versions collection. boto3 documentation

# PolicyVersionsCollection usage example

from mypy_boto3_iam.service_resource import PolicyVersionsCollection

def get_collection() -> PolicyVersionsCollection:
    resource = boto3.resource("iam").Policy(...)
    return resource.versions

Policy methods#

Policy.attach_group method#

Attaches the specified managed policy to the specified IAM group.

Type annotations and code completion for boto3.resource("iam").attach_group method. boto3 documentation

# attach_group method definition

def attach_group(
    self,
    *,
    GroupName: str,
) -> None:
    ...
# attach_group method usage example with argument unpacking

kwargs: AttachGroupPolicyRequestPolicyAttachGroupTypeDef = {  # (1)
    "GroupName": ...,
}

parent.attach_group(**kwargs)
  1. See AttachGroupPolicyRequestPolicyAttachGroupTypeDef

Policy.attach_role method#

Attaches the specified managed policy to the specified IAM role.

Type annotations and code completion for boto3.resource("iam").attach_role method. boto3 documentation

# attach_role method definition

def attach_role(
    self,
    *,
    RoleName: str,
) -> None:
    ...
# attach_role method usage example with argument unpacking

kwargs: AttachRolePolicyRequestPolicyAttachRoleTypeDef = {  # (1)
    "RoleName": ...,
}

parent.attach_role(**kwargs)
  1. See AttachRolePolicyRequestPolicyAttachRoleTypeDef

Policy.attach_user method#

Attaches the specified managed policy to the specified user.

Type annotations and code completion for boto3.resource("iam").attach_user method. boto3 documentation

# attach_user method definition

def attach_user(
    self,
    *,
    UserName: str,
) -> None:
    ...
# attach_user method usage example with argument unpacking

kwargs: AttachUserPolicyRequestPolicyAttachUserTypeDef = {  # (1)
    "UserName": ...,
}

parent.attach_user(**kwargs)
  1. See AttachUserPolicyRequestPolicyAttachUserTypeDef

Policy.create_version method#

Creates a new version of the specified managed policy.

Type annotations and code completion for boto3.resource("iam").create_version method. boto3 documentation

# create_version method definition

def create_version(
    self,
    *,
    PolicyDocument: str,
    SetAsDefault: bool = ...,
) -> "_PolicyVersion":
    ...
# create_version method usage example with argument unpacking

kwargs: CreatePolicyVersionRequestPolicyCreateVersionTypeDef = {  # (1)
    "PolicyDocument": ...,
}

parent.create_version(**kwargs)
  1. See CreatePolicyVersionRequestPolicyCreateVersionTypeDef

Policy.delete method#

Deletes the specified managed policy.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

Policy.detach_group method#

Removes the specified managed policy from the specified IAM group.

Type annotations and code completion for boto3.resource("iam").detach_group method. boto3 documentation

# detach_group method definition

def detach_group(
    self,
    *,
    GroupName: str,
) -> None:
    ...
# detach_group method usage example with argument unpacking

kwargs: DetachGroupPolicyRequestPolicyDetachGroupTypeDef = {  # (1)
    "GroupName": ...,
}

parent.detach_group(**kwargs)
  1. See DetachGroupPolicyRequestPolicyDetachGroupTypeDef

Policy.detach_role method#

Removes the specified managed policy from the specified role.

Type annotations and code completion for boto3.resource("iam").detach_role method. boto3 documentation

# detach_role method definition

def detach_role(
    self,
    *,
    RoleName: str,
) -> None:
    ...
# detach_role method usage example with argument unpacking

kwargs: DetachRolePolicyRequestPolicyDetachRoleTypeDef = {  # (1)
    "RoleName": ...,
}

parent.detach_role(**kwargs)
  1. See DetachRolePolicyRequestPolicyDetachRoleTypeDef

Policy.detach_user method#

Removes the specified managed policy from the specified user.

Type annotations and code completion for boto3.resource("iam").detach_user method. boto3 documentation

# detach_user method definition

def detach_user(
    self,
    *,
    UserName: str,
) -> None:
    ...
# detach_user method usage example with argument unpacking

kwargs: DetachUserPolicyRequestPolicyDetachUserTypeDef = {  # (1)
    "UserName": ...,
}

parent.detach_user(**kwargs)
  1. See DetachUserPolicyRequestPolicyDetachUserTypeDef

Policy.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

Policy.load method#

Calls 🇵🇾meth:IAM.Client.get_policy to update the attributes of the Policy resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

Policy.reload method#

Calls 🇵🇾meth:IAM.Client.get_policy to update the attributes of the Policy resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

PolicyVersion#

Type annotations and code completion for boto3.resource("iam").PolicyVersion class. boto3 documentation

# PolicyVersion usage example

from mypy_boto3_iam.service_resource import PolicyVersion

def get_resource() -> PolicyVersion:
    return boto3.resource("iam").PolicyVersion(...)

PolicyVersion attributes#

  • document: PolicyDocumentTypeDef
  • is_default_version: bool
  • create_date: datetime
  • arn: str
  • version_id: str
  • meta: "IAMResourceMeta"

PolicyVersion methods#

PolicyVersion.delete method#

Deletes the specified version from the specified managed policy.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

PolicyVersion.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

PolicyVersion.load method#

Calls 🇵🇾meth:IAM.Client.get_policy_version to update the attributes of the PolicyVersion resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

PolicyVersion.reload method#

Calls 🇵🇾meth:IAM.Client.get_policy_version to update the attributes of the PolicyVersion resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

PolicyVersion.set_as_default method#

Sets the specified version of the specified policy as the policy's default (operative) version.

Type annotations and code completion for boto3.resource("iam").set_as_default method. boto3 documentation

# set_as_default method definition

def set_as_default(
    self,
) -> None:
    ...

Role#

Type annotations and code completion for boto3.resource("iam").Role class. boto3 documentation

# Role usage example

from mypy_boto3_iam.service_resource import Role

def get_resource() -> Role:
    return boto3.resource("iam").Role(...)

Role attributes#

  • path: str
  • role_name: str
  • role_id: str
  • arn: str
  • create_date: datetime
  • assume_role_policy_document: PolicyDocumentTypeDef
  • description: str
  • max_session_duration: int
  • permissions_boundary: AttachedPermissionsBoundaryTypeDef
  • tags: List[TagTypeDef]
  • role_last_used: RoleLastUsedTypeDef
  • name: str
  • attached_policies: RoleAttachedPoliciesCollection
  • instance_profiles: RoleInstanceProfilesCollection
  • policies: RolePoliciesCollection
  • meta: "IAMResourceMeta"

Role collections#

Role.attached_policies#

Provides access to Policy resource.

Type annotations and code completion for boto3.resource("iam").Role(...).attached_policies collection. boto3 documentation

# RoleAttachedPoliciesCollection usage example

from mypy_boto3_iam.service_resource import RoleAttachedPoliciesCollection

def get_collection() -> RoleAttachedPoliciesCollection:
    resource = boto3.resource("iam").Role(...)
    return resource.attached_policies

Role.instance_profiles#

Provides access to InstanceProfile resource.

Type annotations and code completion for boto3.resource("iam").Role(...).instance_profiles collection. boto3 documentation

# RoleInstanceProfilesCollection usage example

from mypy_boto3_iam.service_resource import RoleInstanceProfilesCollection

def get_collection() -> RoleInstanceProfilesCollection:
    resource = boto3.resource("iam").Role(...)
    return resource.instance_profiles

Role.policies#

Provides access to RolePolicy resource.

Type annotations and code completion for boto3.resource("iam").Role(...).policies collection. boto3 documentation

# RolePoliciesCollection usage example

from mypy_boto3_iam.service_resource import RolePoliciesCollection

def get_collection() -> RolePoliciesCollection:
    resource = boto3.resource("iam").Role(...)
    return resource.policies

Role methods#

Role.AssumeRolePolicy method#

Creates a AssumeRolePolicy resource.

Type annotations and code completion for boto3.resource("iam").AssumeRolePolicy method. boto3 documentation

# AssumeRolePolicy method definition

def AssumeRolePolicy(
    self,
) -> "_AssumeRolePolicy":
    ...

Role.Policy method#

Creates a RolePolicy resource.

Type annotations and code completion for boto3.resource("iam").Policy method. boto3 documentation

# Policy method definition

def Policy(
    self,
    name: str,
) -> "_RolePolicy":
    ...

Role.attach_policy method#

Attaches the specified managed policy to the specified IAM role.

Type annotations and code completion for boto3.resource("iam").attach_policy method. boto3 documentation

# attach_policy method definition

def attach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
# attach_policy method usage example with argument unpacking

kwargs: AttachRolePolicyRequestRoleAttachPolicyTypeDef = {  # (1)
    "PolicyArn": ...,
}

parent.attach_policy(**kwargs)
  1. See AttachRolePolicyRequestRoleAttachPolicyTypeDef

Role.delete method#

Deletes the specified role.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

Role.detach_policy method#

Removes the specified managed policy from the specified role.

Type annotations and code completion for boto3.resource("iam").detach_policy method. boto3 documentation

# detach_policy method definition

def detach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
# detach_policy method usage example with argument unpacking

kwargs: DetachRolePolicyRequestRoleDetachPolicyTypeDef = {  # (1)
    "PolicyArn": ...,
}

parent.detach_policy(**kwargs)
  1. See DetachRolePolicyRequestRoleDetachPolicyTypeDef

Role.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

Role.load method#

Calls 🇵🇾meth:IAM.Client.get_role to update the attributes of the Role resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

Role.reload method#

Calls 🇵🇾meth:IAM.Client.get_role to update the attributes of the Role resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

RolePolicy#

Type annotations and code completion for boto3.resource("iam").RolePolicy class. boto3 documentation

# RolePolicy usage example

from mypy_boto3_iam.service_resource import RolePolicy

def get_resource() -> RolePolicy:
    return boto3.resource("iam").RolePolicy(...)

RolePolicy attributes#

  • policy_name: str
  • policy_document: PolicyDocumentTypeDef
  • role_name: str
  • name: str
  • meta: "IAMResourceMeta"

RolePolicy methods#

RolePolicy.Role method#

Creates a Role resource.

Type annotations and code completion for boto3.resource("iam").Role method. boto3 documentation

# Role method definition

def Role(
    self,
) -> "_Role":
    ...

RolePolicy.delete method#

Deletes the specified inline policy that is embedded in the specified IAM role.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

RolePolicy.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

RolePolicy.load method#

Calls 🇵🇾meth:IAM.Client.get_role_policy to update the attributes of the RolePolicy resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

RolePolicy.put method#

Adds or updates an inline policy document that is embedded in the specified IAM role.

Type annotations and code completion for boto3.resource("iam").put method. boto3 documentation

# put method definition

def put(
    self,
    *,
    PolicyDocument: str,
) -> None:
    ...
# put method usage example with argument unpacking

kwargs: PutRolePolicyRequestRolePolicyPutTypeDef = {  # (1)
    "PolicyDocument": ...,
}

parent.put(**kwargs)
  1. See PutRolePolicyRequestRolePolicyPutTypeDef

RolePolicy.reload method#

Calls 🇵🇾meth:IAM.Client.get_role_policy to update the attributes of the RolePolicy resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

SamlProvider#

Type annotations and code completion for boto3.resource("iam").SamlProvider class. boto3 documentation

# SamlProvider usage example

from mypy_boto3_iam.service_resource import SamlProvider

def get_resource() -> SamlProvider:
    return boto3.resource("iam").SamlProvider(...)

SamlProvider attributes#

  • saml_metadata_document: str
  • create_date: datetime
  • valid_until: datetime
  • tags: List[TagTypeDef]
  • arn: str
  • meta: "IAMResourceMeta"

SamlProvider methods#

SamlProvider.delete method#

Deletes a SAML provider resource in IAM.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

SamlProvider.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

SamlProvider.load method#

Calls 🇵🇾meth:IAM.Client.get_saml_provider to update the attributes of the SamlProvider resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

SamlProvider.reload method#

Calls 🇵🇾meth:IAM.Client.get_saml_provider to update the attributes of the SamlProvider resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

SamlProvider.update method#

Updates the metadata document for an existing SAML provider resource object.

Type annotations and code completion for boto3.resource("iam").update method. boto3 documentation

# update method definition

def update(
    self,
    *,
    SAMLMetadataDocument: str,
) -> UpdateSAMLProviderResponseTypeDef:  # (1)
    ...
  1. See UpdateSAMLProviderResponseTypeDef
# update method usage example with argument unpacking

kwargs: UpdateSAMLProviderRequestSamlProviderUpdateTypeDef = {  # (1)
    "SAMLMetadataDocument": ...,
}

parent.update(**kwargs)
  1. See UpdateSAMLProviderRequestSamlProviderUpdateTypeDef

ServerCertificate#

Type annotations and code completion for boto3.resource("iam").ServerCertificate class. boto3 documentation

# ServerCertificate usage example

from mypy_boto3_iam.service_resource import ServerCertificate

def get_resource() -> ServerCertificate:
    return boto3.resource("iam").ServerCertificate(...)

ServerCertificate attributes#

ServerCertificate methods#

ServerCertificate.delete method#

Deletes the specified server certificate.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

ServerCertificate.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

ServerCertificate.load method#

Calls 🇵🇾meth:IAM.Client.get_server_certificate to update the attributes of the ServerCertificate resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

ServerCertificate.reload method#

Calls 🇵🇾meth:IAM.Client.get_server_certificate to update the attributes of the ServerCertificate resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

ServerCertificate.update method#

Updates the name and/or the path of the specified server certificate stored in IAM.

Type annotations and code completion for boto3.resource("iam").update method. boto3 documentation

# update method definition

def update(
    self,
    *,
    NewPath: str = ...,
    NewServerCertificateName: str = ...,
) -> "_ServerCertificate":
    ...
# update method usage example with argument unpacking

kwargs: UpdateServerCertificateRequestServerCertificateUpdateTypeDef = {  # (1)
    "NewPath": ...,
}

parent.update(**kwargs)
  1. See UpdateServerCertificateRequestServerCertificateUpdateTypeDef

SigningCertificate#

Type annotations and code completion for boto3.resource("iam").SigningCertificate class. boto3 documentation

# SigningCertificate usage example

from mypy_boto3_iam.service_resource import SigningCertificate

def get_resource() -> SigningCertificate:
    return boto3.resource("iam").SigningCertificate(...)

SigningCertificate attributes#

  • certificate_id: str
  • certificate_body: str
  • status: StatusTypeType
  • upload_date: datetime
  • user_name: str
  • id: str
  • meta: "IAMResourceMeta"

SigningCertificate methods#

SigningCertificate.User method#

Creates a User resource.

Type annotations and code completion for boto3.resource("iam").User method. boto3 documentation

# User method definition

def User(
    self,
) -> "_User":
    ...

SigningCertificate.activate method#

Changes the status of the specified user signing certificate from active to disabled, or vice versa.

Type annotations and code completion for boto3.resource("iam").activate method. boto3 documentation

# activate method definition

def activate(
    self,
    *,
    Status: StatusTypeType = 'Active',  # (1)
) -> None:
    ...
  1. See StatusTypeType
# activate method usage example with argument unpacking

kwargs: UpdateSigningCertificateRequestSigningCertificateActivateTypeDef = {  # (1)
    "Status": ...,
}

parent.activate(**kwargs)
  1. See UpdateSigningCertificateRequestSigningCertificateActivateTypeDef

SigningCertificate.deactivate method#

Changes the status of the specified user signing certificate from active to disabled, or vice versa.

Type annotations and code completion for boto3.resource("iam").deactivate method. boto3 documentation

# deactivate method definition

def deactivate(
    self,
    *,
    Status: StatusTypeType = 'Inactive',  # (1)
) -> None:
    ...
  1. See StatusTypeType
# deactivate method usage example with argument unpacking

kwargs: UpdateSigningCertificateRequestSigningCertificateDeactivateTypeDef = {  # (1)
    "Status": ...,
}

parent.deactivate(**kwargs)
  1. See UpdateSigningCertificateRequestSigningCertificateDeactivateTypeDef

SigningCertificate.delete method#

Deletes a signing certificate associated with the specified IAM user.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

SigningCertificate.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

User#

Type annotations and code completion for boto3.resource("iam").User class. boto3 documentation

# User usage example

from mypy_boto3_iam.service_resource import User

def get_resource() -> User:
    return boto3.resource("iam").User(...)

User attributes#

  • path: str
  • user_name: str
  • user_id: str
  • arn: str
  • create_date: datetime
  • password_last_used: datetime
  • permissions_boundary: AttachedPermissionsBoundaryTypeDef
  • tags: List[TagTypeDef]
  • name: str
  • access_keys: UserAccessKeysCollection
  • attached_policies: UserAttachedPoliciesCollection
  • groups: UserGroupsCollection
  • mfa_devices: UserMfaDevicesCollection
  • policies: UserPoliciesCollection
  • signing_certificates: UserSigningCertificatesCollection
  • meta: "IAMResourceMeta"

User collections#

User.access_keys#

Provides access to AccessKey resource.

Type annotations and code completion for boto3.resource("iam").User(...).access_keys collection. boto3 documentation

# UserAccessKeysCollection usage example

from mypy_boto3_iam.service_resource import UserAccessKeysCollection

def get_collection() -> UserAccessKeysCollection:
    resource = boto3.resource("iam").User(...)
    return resource.access_keys

User.attached_policies#

Provides access to Policy resource.

Type annotations and code completion for boto3.resource("iam").User(...).attached_policies collection. boto3 documentation

# UserAttachedPoliciesCollection usage example

from mypy_boto3_iam.service_resource import UserAttachedPoliciesCollection

def get_collection() -> UserAttachedPoliciesCollection:
    resource = boto3.resource("iam").User(...)
    return resource.attached_policies

User.groups#

Provides access to Group resource.

Type annotations and code completion for boto3.resource("iam").User(...).groups collection. boto3 documentation

# UserGroupsCollection usage example

from mypy_boto3_iam.service_resource import UserGroupsCollection

def get_collection() -> UserGroupsCollection:
    resource = boto3.resource("iam").User(...)
    return resource.groups

User.mfa_devices#

Provides access to MfaDevice resource.

Type annotations and code completion for boto3.resource("iam").User(...).mfa_devices collection. boto3 documentation

# UserMfaDevicesCollection usage example

from mypy_boto3_iam.service_resource import UserMfaDevicesCollection

def get_collection() -> UserMfaDevicesCollection:
    resource = boto3.resource("iam").User(...)
    return resource.mfa_devices

User.policies#

Provides access to UserPolicy resource.

Type annotations and code completion for boto3.resource("iam").User(...).policies collection. boto3 documentation

# UserPoliciesCollection usage example

from mypy_boto3_iam.service_resource import UserPoliciesCollection

def get_collection() -> UserPoliciesCollection:
    resource = boto3.resource("iam").User(...)
    return resource.policies

User.signing_certificates#

Provides access to SigningCertificate resource.

Type annotations and code completion for boto3.resource("iam").User(...).signing_certificates collection. boto3 documentation

# UserSigningCertificatesCollection usage example

from mypy_boto3_iam.service_resource import UserSigningCertificatesCollection

def get_collection() -> UserSigningCertificatesCollection:
    resource = boto3.resource("iam").User(...)
    return resource.signing_certificates

User methods#

User.AccessKey method#

Creates a AccessKey resource.

Type annotations and code completion for boto3.resource("iam").AccessKey method. boto3 documentation

# AccessKey method definition

def AccessKey(
    self,
    id: str,
) -> "_AccessKey":
    ...

User.LoginProfile method#

Creates a LoginProfile resource.

Type annotations and code completion for boto3.resource("iam").LoginProfile method. boto3 documentation

# LoginProfile method definition

def LoginProfile(
    self,
) -> "_LoginProfile":
    ...

User.MfaDevice method#

Creates a MfaDevice resource.

Type annotations and code completion for boto3.resource("iam").MfaDevice method. boto3 documentation

# MfaDevice method definition

def MfaDevice(
    self,
    serial_number: str,
) -> "_MfaDevice":
    ...

User.Policy method#

Creates a UserPolicy resource.

Type annotations and code completion for boto3.resource("iam").Policy method. boto3 documentation

# Policy method definition

def Policy(
    self,
    name: str,
) -> "_UserPolicy":
    ...

User.SigningCertificate method#

Creates a SigningCertificate resource.

Type annotations and code completion for boto3.resource("iam").SigningCertificate method. boto3 documentation

# SigningCertificate method definition

def SigningCertificate(
    self,
    id: str,
) -> "_SigningCertificate":
    ...

User.add_group method#

Adds the specified user to the specified group.

Type annotations and code completion for boto3.resource("iam").add_group method. boto3 documentation

# add_group method definition

def add_group(
    self,
    *,
    GroupName: str,
) -> None:
    ...
# add_group method usage example with argument unpacking

kwargs: AddUserToGroupRequestUserAddGroupTypeDef = {  # (1)
    "GroupName": ...,
}

parent.add_group(**kwargs)
  1. See AddUserToGroupRequestUserAddGroupTypeDef

User.attach_policy method#

Attaches the specified managed policy to the specified user.

Type annotations and code completion for boto3.resource("iam").attach_policy method. boto3 documentation

# attach_policy method definition

def attach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
# attach_policy method usage example with argument unpacking

kwargs: AttachUserPolicyRequestUserAttachPolicyTypeDef = {  # (1)
    "PolicyArn": ...,
}

parent.attach_policy(**kwargs)
  1. See AttachUserPolicyRequestUserAttachPolicyTypeDef

User.create method#

Creates a new IAM user for your Amazon Web Services account.

Type annotations and code completion for boto3.resource("iam").create method. boto3 documentation

# create method definition

def create(
    self,
    *,
    Path: str = ...,
    PermissionsBoundary: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> "_User":
    ...
  1. See TagTypeDef
# create method usage example with argument unpacking

kwargs: CreateUserRequestUserCreateTypeDef = {  # (1)
    "Path": ...,
}

parent.create(**kwargs)
  1. See CreateUserRequestUserCreateTypeDef

User.create_access_key_pair method#

Creates a new Amazon Web Services secret access key and corresponding Amazon Web Services access key ID for the specified user.

Type annotations and code completion for boto3.resource("iam").create_access_key_pair method. boto3 documentation

# create_access_key_pair method definition

def create_access_key_pair(
    self,
) -> "_AccessKeyPair":
    ...

User.create_login_profile method#

Creates a password for the specified IAM user.

Type annotations and code completion for boto3.resource("iam").create_login_profile method. boto3 documentation

# create_login_profile method definition

def create_login_profile(
    self,
    *,
    Password: str = ...,
    PasswordResetRequired: bool = ...,
) -> "_LoginProfile":
    ...
# create_login_profile method usage example with argument unpacking

kwargs: CreateLoginProfileRequestUserCreateLoginProfileTypeDef = {  # (1)
    "Password": ...,
}

parent.create_login_profile(**kwargs)
  1. See CreateLoginProfileRequestUserCreateLoginProfileTypeDef

User.create_policy method#

Adds or updates an inline policy document that is embedded in the specified IAM user.

Type annotations and code completion for boto3.resource("iam").create_policy method. boto3 documentation

# create_policy method definition

def create_policy(
    self,
    *,
    PolicyName: str,
    PolicyDocument: str,
) -> "_UserPolicy":
    ...
# create_policy method usage example with argument unpacking

kwargs: PutUserPolicyRequestUserCreatePolicyTypeDef = {  # (1)
    "PolicyName": ...,
    "PolicyDocument": ...,
}

parent.create_policy(**kwargs)
  1. See PutUserPolicyRequestUserCreatePolicyTypeDef

User.delete method#

Deletes the specified IAM user.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

User.detach_policy method#

Removes the specified managed policy from the specified user.

Type annotations and code completion for boto3.resource("iam").detach_policy method. boto3 documentation

# detach_policy method definition

def detach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
# detach_policy method usage example with argument unpacking

kwargs: DetachUserPolicyRequestUserDetachPolicyTypeDef = {  # (1)
    "PolicyArn": ...,
}

parent.detach_policy(**kwargs)
  1. See DetachUserPolicyRequestUserDetachPolicyTypeDef

User.enable_mfa method#

Enables the specified MFA device and associates it with the specified IAM user.

Type annotations and code completion for boto3.resource("iam").enable_mfa method. boto3 documentation

# enable_mfa method definition

def enable_mfa(
    self,
    *,
    SerialNumber: str,
    AuthenticationCode1: str,
    AuthenticationCode2: str,
) -> "_MfaDevice":
    ...
# enable_mfa method usage example with argument unpacking

kwargs: EnableMFADeviceRequestUserEnableMfaTypeDef = {  # (1)
    "SerialNumber": ...,
    "AuthenticationCode1": ...,
    "AuthenticationCode2": ...,
}

parent.enable_mfa(**kwargs)
  1. See EnableMFADeviceRequestUserEnableMfaTypeDef

User.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

User.load method#

Calls 🇵🇾meth:IAM.Client.get_user to update the attributes of the User resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

User.reload method#

Calls 🇵🇾meth:IAM.Client.get_user to update the attributes of the User resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

User.remove_group method#

Removes the specified user from the specified group.

Type annotations and code completion for boto3.resource("iam").remove_group method. boto3 documentation

# remove_group method definition

def remove_group(
    self,
    *,
    GroupName: str,
) -> None:
    ...
# remove_group method usage example with argument unpacking

kwargs: RemoveUserFromGroupRequestUserRemoveGroupTypeDef = {  # (1)
    "GroupName": ...,
}

parent.remove_group(**kwargs)
  1. See RemoveUserFromGroupRequestUserRemoveGroupTypeDef

User.update method#

Updates the name and/or the path of the specified IAM user.

Type annotations and code completion for boto3.resource("iam").update method. boto3 documentation

# update method definition

def update(
    self,
    *,
    NewPath: str = ...,
    NewUserName: str = ...,
) -> "_User":
    ...
# update method usage example with argument unpacking

kwargs: UpdateUserRequestUserUpdateTypeDef = {  # (1)
    "NewPath": ...,
}

parent.update(**kwargs)
  1. See UpdateUserRequestUserUpdateTypeDef

UserPolicy#

Type annotations and code completion for boto3.resource("iam").UserPolicy class. boto3 documentation

# UserPolicy usage example

from mypy_boto3_iam.service_resource import UserPolicy

def get_resource() -> UserPolicy:
    return boto3.resource("iam").UserPolicy(...)

UserPolicy attributes#

  • policy_name: str
  • policy_document: PolicyDocumentTypeDef
  • user_name: str
  • name: str
  • meta: "IAMResourceMeta"

UserPolicy methods#

UserPolicy.User method#

Creates a User resource.

Type annotations and code completion for boto3.resource("iam").User method. boto3 documentation

# User method definition

def User(
    self,
) -> "_User":
    ...

UserPolicy.delete method#

Deletes the specified inline policy that is embedded in the specified IAM user.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

UserPolicy.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

UserPolicy.load method#

Calls 🇵🇾meth:IAM.Client.get_user_policy to update the attributes of the UserPolicy resource.

Type annotations and code completion for boto3.resource("iam").load method. boto3 documentation

# load method definition

def load(
    self,
) -> None:
    ...

UserPolicy.put method#

Adds or updates an inline policy document that is embedded in the specified IAM user.

Type annotations and code completion for boto3.resource("iam").put method. boto3 documentation

# put method definition

def put(
    self,
    *,
    PolicyDocument: str,
) -> None:
    ...
# put method usage example with argument unpacking

kwargs: PutUserPolicyRequestUserPolicyPutTypeDef = {  # (1)
    "PolicyDocument": ...,
}

parent.put(**kwargs)
  1. See PutUserPolicyRequestUserPolicyPutTypeDef

UserPolicy.reload method#

Calls 🇵🇾meth:IAM.Client.get_user_policy to update the attributes of the UserPolicy resource.

Type annotations and code completion for boto3.resource("iam").reload method. boto3 documentation

# reload method definition

def reload(
    self,
) -> None:
    ...

VirtualMfaDevice#

Type annotations and code completion for boto3.resource("iam").VirtualMfaDevice class. boto3 documentation

# VirtualMfaDevice usage example

from mypy_boto3_iam.service_resource import VirtualMfaDevice

def get_resource() -> VirtualMfaDevice:
    return boto3.resource("iam").VirtualMfaDevice(...)

VirtualMfaDevice attributes#

  • base32_string_seed: bytes
  • qr_code_png: bytes
  • user_attribute: UserTypeDef
  • enable_date: datetime
  • tags: List[TagTypeDef]
  • serial_number: str
  • user: "User"
  • meta: "IAMResourceMeta"

VirtualMfaDevice methods#

VirtualMfaDevice.delete method#

Deletes a virtual MFA device.

Type annotations and code completion for boto3.resource("iam").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

VirtualMfaDevice.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("iam").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...