Skip to content

EC2  >  Operations  >  get_password_data

get_password_data

Operation

get_password_data async

get_password_data(input: GetPasswordDataInput, plugins: list[Plugin] | None = None) -> GetPasswordDataOutput

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.

Parameters:

Name Type Description Default
input GetPasswordDataInput

An instance of GetPasswordDataInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
GetPasswordDataOutput

An instance of GetPasswordDataOutput.

Input

GetPasswordDataInput dataclass

Bases: _SerdeShape

Dataclass for GetPasswordDataInput structure.

Attributes

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

Checks whether you have the required permissions for the operation, 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.

instance_id class-attribute instance-attribute
instance_id: str | None = ...

The ID of the Windows instance.

Output

GetPasswordDataOutput dataclass

Bases: _SerdeShape

Dataclass for GetPasswordDataOutput structure.

Attributes

instance_id class-attribute instance-attribute
instance_id: str | None = ...

The ID of the Windows instance.

password_data class-attribute instance-attribute
password_data: str | None = ...

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

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

timestamp class-attribute instance-attribute
timestamp: datetime | None = ...

The time the data was last updated.