Skip to content

modify_instance_profile async

modify_instance_profile(
    instance_profile_identifier: String,
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
    availability_zone: Optional[String] = None,
    kms_key_arn: Optional[String] = None,
    publicly_accessible: Optional[BooleanOptional] = None,
    network_type: Optional[String] = None,
    instance_profile_name: Optional[String] = None,
    description: Optional[String] = None,
    subnet_group_identifier: Optional[String] = None,
    vpc_security_groups: Optional[StringList] = None,
) -> ModifyInstanceProfileResponse

Modifies the specified instance profile using the provided parameters.

Required permissions: dms:UpdateInstanceProfile. For more information, see Actions, resources, and condition keys for Database Migration Service.

All migration projects associated with the instance profile must be deleted or modified before you can modify the instance profile.

Parameters:

  • instance_profile_identifier (String) –

    The identifier of the instance profile. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen, or contain two consecutive hyphens.

  • availability_zone (Optional[String], default: None ) –

    The Availability Zone where the instance profile runs.

  • kms_key_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.

    If you don't specify a value for the KmsKeyArn parameter, then DMS uses an Amazon Web Services owned encryption key to encrypt your resources.

  • publicly_accessible (Optional[BooleanOptional], default: None ) –

    Specifies the accessibility options for the instance profile. A value of true represents an instance profile with a public IP address. A value of false represents an instance profile with a private IP address. The default value is true.

  • network_type (Optional[String], default: None ) –

    Specifies the network type for the instance profile. A value of IPV4 represents an instance profile with IPv4 network type and only supports IPv4 addressing. A value of IPV6 represents an instance profile with IPv6 network type and only supports IPv6 addressing. A value of DUAL represents an instance profile with dual network type that supports IPv4 and IPv6 addressing.

  • instance_profile_name (Optional[String], default: None ) –

    A user-friendly name for the instance profile.

  • description (Optional[String], default: None ) –

    A user-friendly description for the instance profile.

  • subnet_group_identifier (Optional[String], default: None ) –

    A subnet group to associate with the instance profile.

  • vpc_security_groups (Optional[StringList], default: None ) –

    Specifies the VPC security groups to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.

Raises:

Examples:

Modify an instance profile The following example updates the description and network type of an instance profile.

>>> await client.modify_instance_profile(instance_profile_identifier='arn:aws:dms:us-east-1:111122223333:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS', description='Updated instance profile description', network_type='DUAL')
Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
async def modify_instance_profile(
    self,
    instance_profile_identifier: "capo_database_migration_service.types.string.String",
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
    availability_zone: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    kms_key_arn: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    publicly_accessible: Optional[
        "capo_database_migration_service.types.boolean_optional.BooleanOptional"
    ] = None,
    network_type: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    instance_profile_name: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    description: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    subnet_group_identifier: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    vpc_security_groups: Optional[
        "capo_database_migration_service.types.string_list.StringList"
    ] = None,
) -> "capo_database_migration_service.types.modify_instance_profile_response.ModifyInstanceProfileResponse":
    """<p>Modifies the specified instance profile using the provided parameters.</p> <p> <b>Required permissions:</b> <code>dms:UpdateInstanceProfile</code>. For more information, see <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsdatabasemigrationservice.html">Actions, resources, and condition keys for Database Migration Service</a>.</p> <note> <p>All migration projects associated with the instance profile must be deleted or modified before you can modify the instance profile.</p> </note>

    Args:
        instance_profile_identifier: <p>The identifier of the instance profile. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen, or contain two consecutive hyphens.</p>
        availability_zone: <p>The Availability Zone where the instance profile runs.</p>
        kms_key_arn: <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p> <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses an Amazon Web Services owned encryption key to encrypt your resources.</p>
        publicly_accessible: <p>Specifies the accessibility options for the instance profile. A value of <code>true</code> represents an instance profile with a public IP address. A value of <code>false</code> represents an instance profile with a private IP address. The default value is <code>true</code>.</p>
        network_type: <p>Specifies the network type for the instance profile. A value of <code>IPV4</code> represents an instance profile with IPv4 network type and only supports IPv4 addressing. A value of <code>IPV6</code> represents an instance profile with IPv6 network type and only supports IPv6 addressing. A value of <code>DUAL</code> represents an instance profile with dual network type that supports IPv4 and IPv6 addressing.</p>
        instance_profile_name: <p>A user-friendly name for the instance profile.</p>
        description: <p>A user-friendly description for the instance profile.</p>
        subnet_group_identifier: <p>A subnet group to associate with the instance profile.</p>
        vpc_security_groups: <p>Specifies the VPC security groups to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.</p>

    Raises:
        capo_database_migration_service.errors.access_denied_fault.AccessDeniedFault: <p>DMS was denied access to the endpoint. Check that the role is correctly configured.</p>
        capo_database_migration_service.errors.failed_dependency_fault.FailedDependencyFault: <p>A dependency threw an exception.</p>
        capo_database_migration_service.errors.invalid_resource_state_fault.InvalidResourceStateFault: <p>The resource is in a state that prevents it from being used for database migration.</p>
        capo_database_migration_service.errors.kms_key_not_accessible_fault.KMSKeyNotAccessibleFault: <p>DMS cannot access the KMS key.</p>
        capo_database_migration_service.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The resource could not be found.</p>
        capo_database_migration_service.errors.s3_access_denied_fault.S3AccessDeniedFault: <p>Insufficient privileges are preventing access to an Amazon S3 object.</p>
        capo_database_migration_service.errors.s3_resource_not_found_fault.S3ResourceNotFoundFault: <p>A specified Amazon S3 bucket, bucket folder, or other object can't be found.</p>
        capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Modify an instance profile
        The following example updates the description and network type of an instance profile.

        >>> await client.modify_instance_profile(instance_profile_identifier='arn:aws:dms:us-east-1:111122223333:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS', description='Updated instance profile description', network_type='DUAL')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_database_migration_service.types.modify_instance_profile_message.ModifyInstanceProfileMessage]",
    ) -> AsyncOperationResponse[
        "capo_database_migration_service.types.modify_instance_profile_response.ModifyInstanceProfileResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.modify_instance_profile

        (
            output,
            http_response,
        ) = await capo_database_migration_service._operations.amazon_dm_sv20160101.modify_instance_profile.async_modify_instance_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyInstanceProfile")
    )
    input_: capo_database_migration_service.types.modify_instance_profile_message.ModifyInstanceProfileMessage = {
        "instance_profile_identifier": instance_profile_identifier
    }
    if availability_zone is not None:
        input_["availability_zone"] = availability_zone
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn
    if publicly_accessible is not None:
        input_["publicly_accessible"] = publicly_accessible
    if network_type is not None:
        input_["network_type"] = network_type
    if instance_profile_name is not None:
        input_["instance_profile_name"] = instance_profile_name
    if description is not None:
        input_["description"] = description
    if subnet_group_identifier is not None:
        input_["subnet_group_identifier"] = subnet_group_identifier
    if vpc_security_groups is not None:
        input_["vpc_security_groups"] = vpc_security_groups

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output