Skip to content

GetPasswordData

Source: src/AWS/EC2/GetPasswordData.ts

Runtime binding for the GetPasswordData operation scoped to the bound Instance (IAM action ec2:GetPasswordData on the instance ARN).

Retrieves the encrypted Windows administrator password for the instance. The PasswordData field is sensitive and surfaces as Redacted.Redacted<string> — decrypt it with the launch key pair’s private key. Linux instances return an empty value. Provide the implementation with Effect.provide(AWS.EC2.GetPasswordDataHttp).

// init — bind the operation to the instance
const getPasswordData = yield* AWS.EC2.GetPasswordData(instance);
// runtime — the ciphertext is Redacted; unwrap explicitly to decrypt
const result = yield* getPasswordData();
const ciphertext = result.PasswordData; // Redacted<string>