amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.GetPasswordData

Description

Retrieves the encrypted administrator password for a running Windows instance.

The Windows password is generated at boot by the EC2Config service or EC2Launch scripts (Windows Server 2016 and later). This usually only happens the first time an instance is launched. For more information, see EC2Config and EC2Launch in the Amazon EC2 User Guide.

For the EC2Config service, the password is not generated for rebundled AMIs unless Ec2SetPassword is enabled before bundling.

The password is encrypted using the key pair that you specified when you launched the instance. You must provide the corresponding key pair file.

When you launch an instance, password generation and encryption may take a few minutes. If you try to retrieve the password before it's available, the output returns an empty string. We recommend that you wait up to 15 minutes after launching an instance before trying to retrieve the generated password.

Synopsis

Creating a Request

data GetPasswordData Source #

See: newGetPasswordData smart constructor.

Constructors

GetPasswordData' 

Fields

  • dryRun :: Maybe Bool

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • instanceId :: Text

    The ID of the Windows instance.

Instances

Instances details
ToHeaders GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

ToPath GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

ToQuery GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

AWSRequest GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

Associated Types

type AWSResponse GetPasswordData #

Generic GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

Associated Types

type Rep GetPasswordData :: Type -> Type #

Read GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

Show GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

NFData GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

Methods

rnf :: GetPasswordData -> () #

Eq GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

Hashable GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

type AWSResponse GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

type Rep GetPasswordData Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

type Rep GetPasswordData = D1 ('MetaData "GetPasswordData" "Amazonka.EC2.GetPasswordData" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "GetPasswordData'" 'PrefixI 'True) (S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

newGetPasswordData Source #

Create a value of GetPasswordData with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:dryRun:GetPasswordData', getPasswordData_dryRun - Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

GetPasswordData, getPasswordData_instanceId - The ID of the Windows instance.

Request Lenses

getPasswordData_dryRun :: Lens' GetPasswordData (Maybe Bool) Source #

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

getPasswordData_instanceId :: Lens' GetPasswordData Text Source #

The ID of the Windows instance.

Destructuring the Response

data GetPasswordDataResponse Source #

See: newGetPasswordDataResponse smart constructor.

Constructors

GetPasswordDataResponse' 

Fields

Instances

Instances details
Generic GetPasswordDataResponse Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

Associated Types

type Rep GetPasswordDataResponse :: Type -> Type #

Read GetPasswordDataResponse Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

Show GetPasswordDataResponse Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

NFData GetPasswordDataResponse Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

Methods

rnf :: GetPasswordDataResponse -> () #

Eq GetPasswordDataResponse Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

type Rep GetPasswordDataResponse Source # 
Instance details

Defined in Amazonka.EC2.GetPasswordData

type Rep GetPasswordDataResponse = D1 ('MetaData "GetPasswordDataResponse" "Amazonka.EC2.GetPasswordData" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "GetPasswordDataResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "passwordData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ISO8601))))

newGetPasswordDataResponse Source #

Create a value of GetPasswordDataResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:httpStatus:GetPasswordDataResponse', getPasswordDataResponse_httpStatus - The response's http status code.

GetPasswordData, getPasswordDataResponse_instanceId - The ID of the Windows instance.

$sel:passwordData:GetPasswordDataResponse', getPasswordDataResponse_passwordData - The password of the instance. Returns an empty string if the password is not available.

GetPasswordDataResponse, getPasswordDataResponse_timestamp - The time the data was last updated.

Response Lenses

getPasswordDataResponse_passwordData :: Lens' GetPasswordDataResponse Text Source #

The password of the instance. Returns an empty string if the password is not available.