# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = [
    'GetInstanceCredentialsResult',
    'AwaitableGetInstanceCredentialsResult',
    'get_instance_credentials',
    'get_instance_credentials_output',
]

@pulumi.output_type
class GetInstanceCredentialsResult:
    """
    A collection of values returned by getInstanceCredentials.
    """
    def __init__(__self__, id=None, instance_id=None, password=None, username=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        pulumi.set(__self__, "instance_id", instance_id)
        if password and not isinstance(password, str):
            raise TypeError("Expected argument 'password' to be a str")
        pulumi.set(__self__, "password", password)
        if username and not isinstance(username, str):
            raise TypeError("Expected argument 'username' to be a str")
        pulumi.set(__self__, "username", username)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> str:
        return pulumi.get(self, "instance_id")

    @property
    @pulumi.getter
    def password(self) -> str:
        """
        The password for the username.
        """
        return pulumi.get(self, "password")

    @property
    @pulumi.getter
    def username(self) -> str:
        """
        The username.
        """
        return pulumi.get(self, "username")


class AwaitableGetInstanceCredentialsResult(GetInstanceCredentialsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetInstanceCredentialsResult(
            id=self.id,
            instance_id=self.instance_id,
            password=self.password,
            username=self.username)


def get_instance_credentials(instance_id: Optional[str] = None,
                             opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInstanceCredentialsResult:
    """
    This data source provides details about a specific Instance Credential resource in Oracle Cloud Infrastructure Core service.

    Gets the generated credentials for the instance. Only works for instances that require a password to log in, such as Windows.
    For certain operating systems, users will be forced to change the initial credentials.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_instance_credential = oci.Core.get_instance_credentials(instance_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str instance_id: The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance.
    """
    __args__ = dict()
    __args__['instanceId'] = instance_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:Core/getInstanceCredentials:getInstanceCredentials', __args__, opts=opts, typ=GetInstanceCredentialsResult).value

    return AwaitableGetInstanceCredentialsResult(
        id=__ret__.id,
        instance_id=__ret__.instance_id,
        password=__ret__.password,
        username=__ret__.username)


@_utilities.lift_output_func(get_instance_credentials)
def get_instance_credentials_output(instance_id: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetInstanceCredentialsResult]:
    """
    This data source provides details about a specific Instance Credential resource in Oracle Cloud Infrastructure Core service.

    Gets the generated credentials for the instance. Only works for instances that require a password to log in, such as Windows.
    For certain operating systems, users will be forced to change the initial credentials.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_instance_credential = oci.Core.get_instance_credentials(instance_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str instance_id: The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance.
    """
    ...
