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

Usage example
from mypy_boto3_iam.service_resource import IAMServiceResource

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

Attributes

Collections

ServiceResourceGroupsCollection

Provides access to Group resource.

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

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

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

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

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

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

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

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

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

Method definition
def AccessKey(
    self,
    user_name: str,
    id: str,
) -> AccessKey:
    ...
Usage example with kwargs
kwargs: ServiceResourceAccessKeyRequestTypeDef = {  # (1)
    "user_name": ...,
    "id": ...,
}

parent.AccessKey(**kwargs)
  1. See ServiceResourceAccessKeyRequestTypeDef

IAMServiceResource.AccessKeyPair method

Creates a AccessKeyPair resource.

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

Method definition
def AccessKeyPair(
    self,
    user_name: str,
    id: str,
    secret: str,
) -> AccessKeyPair:
    ...
Usage example with kwargs
kwargs: ServiceResourceAccessKeyPairRequestTypeDef = {  # (1)
    "user_name": ...,
    "id": ...,
    "secret": ...,
}

parent.AccessKeyPair(**kwargs)
  1. See ServiceResourceAccessKeyPairRequestTypeDef

IAMServiceResource.AccountPasswordPolicy method

Creates a AccountPasswordPolicy resource.

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

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

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

Method definition
def AssumeRolePolicy(
    self,
    role_name: str,
) -> AssumeRolePolicy:
    ...
Usage example with kwargs
kwargs: ServiceResourceAssumeRolePolicyRequestTypeDef = {  # (1)
    "role_name": ...,
}

parent.AssumeRolePolicy(**kwargs)
  1. See ServiceResourceAssumeRolePolicyRequestTypeDef

IAMServiceResource.CurrentUser method

Creates a CurrentUser resource.

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

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

Method definition
def Group(
    self,
    name: str,
) -> Group:
    ...
Usage example with kwargs
kwargs: ServiceResourceGroupRequestTypeDef = {  # (1)
    "name": ...,
}

parent.Group(**kwargs)
  1. See ServiceResourceGroupRequestTypeDef

IAMServiceResource.GroupPolicy method

Creates a GroupPolicy resource.

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

Method definition
def GroupPolicy(
    self,
    group_name: str,
    name: str,
) -> GroupPolicy:
    ...
Usage example with kwargs
kwargs: ServiceResourceGroupPolicyRequestTypeDef = {  # (1)
    "group_name": ...,
    "name": ...,
}

parent.GroupPolicy(**kwargs)
  1. See ServiceResourceGroupPolicyRequestTypeDef

IAMServiceResource.InstanceProfile method

Creates a InstanceProfile resource.

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

Method definition
def InstanceProfile(
    self,
    name: str,
) -> InstanceProfile:
    ...
Usage example with kwargs
kwargs: ServiceResourceInstanceProfileRequestTypeDef = {  # (1)
    "name": ...,
}

parent.InstanceProfile(**kwargs)
  1. See ServiceResourceInstanceProfileRequestTypeDef

IAMServiceResource.LoginProfile method

Creates a LoginProfile resource.

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

Method definition
def LoginProfile(
    self,
    user_name: str,
) -> LoginProfile:
    ...
Usage example with kwargs
kwargs: ServiceResourceLoginProfileRequestTypeDef = {  # (1)
    "user_name": ...,
}

parent.LoginProfile(**kwargs)
  1. See ServiceResourceLoginProfileRequestTypeDef

IAMServiceResource.MfaDevice method

Creates a MfaDevice resource.

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

Method definition
def MfaDevice(
    self,
    user_name: str,
    serial_number: str,
) -> MfaDevice:
    ...
Usage example with kwargs
kwargs: ServiceResourceMfaDeviceRequestTypeDef = {  # (1)
    "user_name": ...,
    "serial_number": ...,
}

parent.MfaDevice(**kwargs)
  1. See ServiceResourceMfaDeviceRequestTypeDef

IAMServiceResource.Policy method

Creates a Policy resource.

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

Method definition
def Policy(
    self,
    policy_arn: str,
) -> Policy:
    ...
Usage example with kwargs
kwargs: ServiceResourcePolicyRequestTypeDef = {  # (1)
    "policy_arn": ...,
}

parent.Policy(**kwargs)
  1. See ServiceResourcePolicyRequestTypeDef

IAMServiceResource.PolicyVersion method

Creates a PolicyVersion resource.

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

Method definition
def PolicyVersion(
    self,
    arn: str,
    version_id: str,
) -> PolicyVersion:
    ...
Usage example with kwargs
kwargs: ServiceResourcePolicyVersionRequestTypeDef = {  # (1)
    "arn": ...,
    "version_id": ...,
}

parent.PolicyVersion(**kwargs)
  1. See ServiceResourcePolicyVersionRequestTypeDef

IAMServiceResource.Role method

Creates a Role resource.

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

Method definition
def Role(
    self,
    name: str,
) -> Role:
    ...
Usage example with kwargs
kwargs: ServiceResourceRoleRequestTypeDef = {  # (1)
    "name": ...,
}

parent.Role(**kwargs)
  1. See ServiceResourceRoleRequestTypeDef

IAMServiceResource.RolePolicy method

Creates a RolePolicy resource.

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

Method definition
def RolePolicy(
    self,
    role_name: str,
    name: str,
) -> RolePolicy:
    ...
Usage example with kwargs
kwargs: ServiceResourceRolePolicyRequestTypeDef = {  # (1)
    "role_name": ...,
    "name": ...,
}

parent.RolePolicy(**kwargs)
  1. See ServiceResourceRolePolicyRequestTypeDef

IAMServiceResource.SamlProvider method

Creates a SamlProvider resource.

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

Method definition
def SamlProvider(
    self,
    arn: str,
) -> SamlProvider:
    ...
Usage example with kwargs
kwargs: ServiceResourceSamlProviderRequestTypeDef = {  # (1)
    "arn": ...,
}

parent.SamlProvider(**kwargs)
  1. See ServiceResourceSamlProviderRequestTypeDef

IAMServiceResource.ServerCertificate method

Creates a ServerCertificate resource.

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

Method definition
def ServerCertificate(
    self,
    name: str,
) -> ServerCertificate:
    ...
Usage example with kwargs
kwargs: ServiceResourceServerCertificateRequestTypeDef = {  # (1)
    "name": ...,
}

parent.ServerCertificate(**kwargs)
  1. See ServiceResourceServerCertificateRequestTypeDef

IAMServiceResource.SigningCertificate method

Creates a SigningCertificate resource.

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

Method definition
def SigningCertificate(
    self,
    user_name: str,
    id: str,
) -> SigningCertificate:
    ...
Usage example with kwargs
kwargs: ServiceResourceSigningCertificateRequestTypeDef = {  # (1)
    "user_name": ...,
    "id": ...,
}

parent.SigningCertificate(**kwargs)
  1. See ServiceResourceSigningCertificateRequestTypeDef

IAMServiceResource.User method

Creates a User resource.

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

Method definition
def User(
    self,
    name: str,
) -> User:
    ...
Usage example with kwargs
kwargs: ServiceResourceUserRequestTypeDef = {  # (1)
    "name": ...,
}

parent.User(**kwargs)
  1. See ServiceResourceUserRequestTypeDef

IAMServiceResource.UserPolicy method

Creates a UserPolicy resource.

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

Method definition
def UserPolicy(
    self,
    user_name: str,
    name: str,
) -> UserPolicy:
    ...
Usage example with kwargs
kwargs: ServiceResourceUserPolicyRequestTypeDef = {  # (1)
    "user_name": ...,
    "name": ...,
}

parent.UserPolicy(**kwargs)
  1. See ServiceResourceUserPolicyRequestTypeDef

IAMServiceResource.VirtualMfaDevice method

Creates a VirtualMfaDevice resource.

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

Method definition
def VirtualMfaDevice(
    self,
    serial_number: str,
) -> VirtualMfaDevice:
    ...
Usage example with kwargs
kwargs: ServiceResourceVirtualMfaDeviceRequestTypeDef = {  # (1)
    "serial_number": ...,
}

parent.VirtualMfaDevice(**kwargs)
  1. See ServiceResourceVirtualMfaDeviceRequestTypeDef

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

Method definition
def change_password(
    self,
    *,
    OldPassword: str,
    NewPassword: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def create_account_alias(
    self,
    *,
    AccountAlias: str,
) -> None:
    ...
Usage example with kwargs
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

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:
    ...
Usage example with kwargs
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

Method definition
def create_group(
    self,
    *,
    GroupName: str,
    Path: str = ...,
) -> Group:
    ...
Usage example with kwargs
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

Method definition
def create_instance_profile(
    self,
    *,
    InstanceProfileName: str,
    Path: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> InstanceProfile:
    ...
  1. See TagTypeDef
Usage example with kwargs
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

Method definition
def create_policy(
    self,
    *,
    PolicyName: str,
    PolicyDocument: str,
    Path: str = ...,
    Description: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> Policy:
    ...
  1. See TagTypeDef
Usage example with kwargs
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

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
Usage example with kwargs
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

Method definition
def create_saml_provider(
    self,
    *,
    SAMLMetadataDocument: str,
    Name: str,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> SamlProvider:
    ...
  1. See TagTypeDef
Usage example with kwargs
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

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
Usage example with kwargs
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

Method definition
def create_signing_certificate(
    self,
    *,
    CertificateBody: str,
    UserName: str = ...,
) -> SigningCertificate:
    ...
Usage example with kwargs
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

Method definition
def create_user(
    self,
    *,
    UserName: str,
    Path: str = ...,
    PermissionsBoundary: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> User:
    ...
  1. See TagTypeDef
Usage example with kwargs
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

Method definition
def create_virtual_mfa_device(
    self,
    *,
    VirtualMFADeviceName: str,
    Path: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> VirtualMfaDevice:
    ...
  1. See TagTypeDef
Usage example with kwargs
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

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

AccessKey

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

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

AccessKey methods

AccessKey.User method

Creates a User resource.

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

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

Method definition
def activate(
    self,
    *,
    Status: statusTypeType = 'Active',  # (1)
) -> None:
    ...
  1. See statusTypeType
Usage example with kwargs
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

Method definition
def deactivate(
    self,
    *,
    Status: statusTypeType = 'Inactive',  # (1)
) -> None:
    ...
  1. See statusTypeType
Usage example with kwargs
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

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

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

AccessKeyPair

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

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

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

Method definition
def activate(
    self,
    *,
    Status: statusTypeType = 'Active',  # (1)
) -> None:
    ...
  1. See statusTypeType
Usage example with kwargs
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

Method definition
def deactivate(
    self,
    *,
    Status: statusTypeType = 'Inactive',  # (1)
) -> None:
    ...
  1. See statusTypeType
Usage example with kwargs
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

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

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

AccountPasswordPolicy

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

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

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

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

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

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

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

Method definition
def update(
    self,
    *,
    MinimumPasswordLength: int = ...,
    RequireSymbols: bool = ...,
    RequireNumbers: bool = ...,
    RequireUppercaseCharacters: bool = ...,
    RequireLowercaseCharacters: bool = ...,
    AllowUsersToChangePassword: bool = ...,
    MaxPasswordAge: int = ...,
    PasswordReusePrevention: int = ...,
    HardExpiry: bool = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: UpdateAccountPasswordPolicyRequestAccountPasswordPolicyUpdateTypeDef = {  # (1)
    "MinimumPasswordLength": ...,
}

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

AccountSummary

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

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

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

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

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

AssumeRolePolicy

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

Usage example
from mypy_boto3_iam.service_resource import AssumeRolePolicy

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

AssumeRolePolicy attributes

  • role_name: str

AssumeRolePolicy methods

AssumeRolePolicy.Role method

Creates a Role resource.

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

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

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

Method definition
def update(
    self,
    *,
    PolicyDocument: str,
) -> None:
    ...
Usage example with kwargs
kwargs: UpdateAssumeRolePolicyRequestAssumeRolePolicyUpdateTypeDef = {  # (1)
    "PolicyDocument": ...,
}

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

CurrentUser

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

Usage example
from mypy_boto3_iam.service_resource import CurrentUser

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

CurrentUser attributes

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

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

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

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

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

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

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

Group

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

Usage example
from mypy_boto3_iam.service_resource import Group

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

Group attributes

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

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

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

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

Method definition
def Policy(
    self,
    name: str,
) -> GroupPolicy:
    ...
Usage example with kwargs
kwargs: GroupPolicyRequestTypeDef = {  # (1)
    "name": ...,
}

parent.Policy(**kwargs)
  1. See GroupPolicyRequestTypeDef

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

Method definition
def add_user(
    self,
    *,
    UserName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def attach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def create(
    self,
    *,
    Path: str = ...,
) -> Group:
    ...
Usage example with kwargs
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

Method definition
def create_policy(
    self,
    *,
    PolicyName: str,
    PolicyDocument: str,
) -> GroupPolicy:
    ...
Usage example with kwargs
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

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

Method definition
def detach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
Usage example with kwargs
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

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

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

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

Method definition
def remove_user(
    self,
    *,
    UserName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def update(
    self,
    *,
    NewPath: str = ...,
    NewGroupName: str = ...,
) -> Group:
    ...
Usage example with kwargs
kwargs: UpdateGroupRequestGroupUpdateTypeDef = {  # (1)
    "NewPath": ...,
}

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

GroupPolicy

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

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: str
  • group_name: str
  • name: str

GroupPolicy methods

GroupPolicy.Group method

Creates a Group resource.

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

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

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

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

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

Method definition
def put(
    self,
    *,
    PolicyDocument: str,
) -> None:
    ...
Usage example with kwargs
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

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

InstanceProfile

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

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]

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

Method definition
def add_role(
    self,
    *,
    RoleName: str,
) -> None:
    ...
Usage example with kwargs
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

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

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

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

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

InstanceProfile.remove_role method

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

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

Method definition
def remove_role(
    self,
    *,
    RoleName: str,
) -> None:
    ...
Usage example with kwargs
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

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

LoginProfile methods

LoginProfile.User method

Creates a User resource.

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

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

Method definition
def create(
    self,
    *,
    Password: str,
    PasswordResetRequired: bool = ...,
) -> LoginProfile:
    ...
Usage example with kwargs
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

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

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

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

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

Method definition
def update(
    self,
    *,
    Password: str = ...,
    PasswordResetRequired: bool = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: UpdateLoginProfileRequestLoginProfileUpdateTypeDef = {  # (1)
    "Password": ...,
}

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

MfaDevice

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

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

MfaDevice methods

MfaDevice.User method

Creates a User resource.

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

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

Method definition
def associate(
    self,
    *,
    AuthenticationCode1: str,
    AuthenticationCode2: str,
) -> None:
    ...
Usage example with kwargs
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

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

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

Method definition
def resync(
    self,
    *,
    AuthenticationCode1: str,
    AuthenticationCode2: str,
) -> None:
    ...
Usage example with kwargs
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

Usage example
from mypy_boto3_iam.service_resource import Policy

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

Policy attributes

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

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

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

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

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

Method definition
def attach_group(
    self,
    *,
    GroupName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def attach_role(
    self,
    *,
    RoleName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def attach_user(
    self,
    *,
    UserName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def create_version(
    self,
    *,
    PolicyDocument: str,
    SetAsDefault: bool = ...,
) -> PolicyVersion:
    ...
Usage example with kwargs
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

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

Method definition
def detach_group(
    self,
    *,
    GroupName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def detach_role(
    self,
    *,
    RoleName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def detach_user(
    self,
    *,
    UserName: str,
) -> None:
    ...
Usage example with kwargs
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

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

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

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

PolicyVersion

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

Usage example
from mypy_boto3_iam.service_resource import PolicyVersion

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

PolicyVersion attributes

  • document: str
  • is_default_version: bool
  • create_date: datetime
  • arn: str
  • version_id: str

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

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

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

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

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

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

Role

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

Usage example
from mypy_boto3_iam.service_resource import Role

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

Role attributes

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

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

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

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

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

Method definition
def Policy(
    self,
    name: str,
) -> RolePolicy:
    ...
Usage example with kwargs
kwargs: RolePolicyRequestTypeDef = {  # (1)
    "name": ...,
}

parent.Policy(**kwargs)
  1. See RolePolicyRequestTypeDef

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

Method definition
def attach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
Usage example with kwargs
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

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

Method definition
def detach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
Usage example with kwargs
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

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

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

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

RolePolicy

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

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: str
  • role_name: str
  • name: str

RolePolicy methods

RolePolicy.Role method

Creates a Role resource.

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

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

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

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

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

Method definition
def put(
    self,
    *,
    PolicyDocument: str,
) -> None:
    ...
Usage example with kwargs
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

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

SamlProvider

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

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

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

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

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

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

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

Method definition
def update(
    self,
    *,
    SAMLMetadataDocument: str,
) -> UpdateSAMLProviderResponseTypeDef:  # (1)
    ...
  1. See UpdateSAMLProviderResponseTypeDef
Usage example with kwargs
kwargs: UpdateSAMLProviderRequestSamlProviderUpdateTypeDef = {  # (1)
    "SAMLMetadataDocument": ...,
}

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

ServerCertificate

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

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

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

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

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

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

Method definition
def update(
    self,
    *,
    NewPath: str = ...,
    NewServerCertificateName: str = ...,
) -> ServerCertificate:
    ...
Usage example with kwargs
kwargs: UpdateServerCertificateRequestServerCertificateUpdateTypeDef = {  # (1)
    "NewPath": ...,
}

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

SigningCertificate

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

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

SigningCertificate methods

SigningCertificate.User method

Creates a User resource.

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

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

Method definition
def activate(
    self,
    *,
    Status: statusTypeType = 'Active',  # (1)
) -> None:
    ...
  1. See statusTypeType
Usage example with kwargs
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

Method definition
def deactivate(
    self,
    *,
    Status: statusTypeType = 'Inactive',  # (1)
) -> None:
    ...
  1. See statusTypeType
Usage example with kwargs
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

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

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

User

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

Usage example
from mypy_boto3_iam.service_resource import User

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

User attributes

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

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

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

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

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

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

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

Method definition
def AccessKey(
    self,
    id: str,
) -> AccessKey:
    ...
Usage example with kwargs
kwargs: UserAccessKeyRequestTypeDef = {  # (1)
    "id": ...,
}

parent.AccessKey(**kwargs)
  1. See UserAccessKeyRequestTypeDef

User.LoginProfile method

Creates a LoginProfile resource.

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

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

Method definition
def MfaDevice(
    self,
    serial_number: str,
) -> MfaDevice:
    ...
Usage example with kwargs
kwargs: UserMfaDeviceRequestTypeDef = {  # (1)
    "serial_number": ...,
}

parent.MfaDevice(**kwargs)
  1. See UserMfaDeviceRequestTypeDef

User.Policy method

Creates a UserPolicy resource.

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

Method definition
def Policy(
    self,
    name: str,
) -> UserPolicy:
    ...
Usage example with kwargs
kwargs: UserPolicyRequestTypeDef = {  # (1)
    "name": ...,
}

parent.Policy(**kwargs)
  1. See UserPolicyRequestTypeDef

User.SigningCertificate method

Creates a SigningCertificate resource.

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

Method definition
def SigningCertificate(
    self,
    id: str,
) -> SigningCertificate:
    ...
Usage example with kwargs
kwargs: UserSigningCertificateRequestTypeDef = {  # (1)
    "id": ...,
}

parent.SigningCertificate(**kwargs)
  1. See UserSigningCertificateRequestTypeDef

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

Method definition
def add_group(
    self,
    *,
    GroupName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def attach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def create(
    self,
    *,
    Path: str = ...,
    PermissionsBoundary: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> User:
    ...
  1. See TagTypeDef
Usage example with kwargs
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

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

Method definition
def create_login_profile(
    self,
    *,
    Password: str,
    PasswordResetRequired: bool = ...,
) -> LoginProfile:
    ...
Usage example with kwargs
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

Method definition
def create_policy(
    self,
    *,
    PolicyName: str,
    PolicyDocument: str,
) -> UserPolicy:
    ...
Usage example with kwargs
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

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

Method definition
def detach_policy(
    self,
    *,
    PolicyArn: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def enable_mfa(
    self,
    *,
    SerialNumber: str,
    AuthenticationCode1: str,
    AuthenticationCode2: str,
) -> MfaDevice:
    ...
Usage example with kwargs
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

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

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

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

Method definition
def remove_group(
    self,
    *,
    GroupName: str,
) -> None:
    ...
Usage example with kwargs
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

Method definition
def update(
    self,
    *,
    NewPath: str = ...,
    NewUserName: str = ...,
) -> User:
    ...
Usage example with kwargs
kwargs: UpdateUserRequestUserUpdateTypeDef = {  # (1)
    "NewPath": ...,
}

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

UserPolicy

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

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: str
  • user_name: str
  • name: str

UserPolicy methods

UserPolicy.User method

Creates a User resource.

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

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

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

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

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

Method definition
def put(
    self,
    *,
    PolicyDocument: str,
) -> None:
    ...
Usage example with kwargs
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

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

VirtualMfaDevice

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

Usage example
from mypy_boto3_iam.service_resource import VirtualMfaDevice

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

VirtualMfaDevice attributes

VirtualMfaDevice methods

VirtualMfaDevice.delete method

Deletes a virtual MFA device.

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

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

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