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.