import { CreateSshKeyRequest, CreateSshKeyResponse, DeleteSshKeyRequest, ListUserSshKeysForProjectRequest, ListUserSshKeysForProjectResponse, SendPublicKeyRequest, SendPublicKeyResponse, SshKeyPlugin } from '@aws/swb-app';
import { ProjectService } from '@aws/workbench-core-accounts';
import { AwsService } from '@aws/workbench-core-base';
import { EnvironmentService } from '@aws/workbench-core-environments';
export default class SshKeyService implements SshKeyPlugin {
    private _aws;
    private _projectService;
    private _environmentService;
    private _resourceType;
    constructor(aws: AwsService, projectService: ProjectService, environmentService: EnvironmentService);
    /**
     * Lists user-owned SSH Keys for the given project
     *
     * @param request - a {@link ListUserSshKeysForProjectRequest}
     * @returns a {@link ListUserSshKeysForProjectResponse} object
     */
    listUserSshKeysForProject(request: ListUserSshKeysForProjectRequest): Promise<ListUserSshKeysForProjectResponse>;
    /**
     * Deletes the given SSH Key
     *
     * @param request - a {@link DeleteSshKeyRequest}
     */
    deleteSshKey(request: DeleteSshKeyRequest): Promise<void>;
    /**
     * Get the user UUID from the list of tags passed or undefined if there is no user tag present.
     *
     * @param tags - list of {@link EC2.Tags}
     * @returns a string user UUID or undefined if no user tag present
     */
    private _getUserFromTags;
    /**
     * Get the env mgmt role arn and external id from the project record given the project id
     *
     * @param projectId - the project id to get the project record for
     * @returns an object containing two strings for the env mgmt role and external id
     */
    private _getEnvMgmtRoleArnAndExternalIdFromProject;
    /**
     * Creates an SSH Key for the current user and given project
     *
     * @param request - a {@link CreateSshKeyRequest}
     * @returns a {@link CreateSshKeyResponse}
     */
    createSshKey(request: CreateSshKeyRequest): Promise<CreateSshKeyResponse>;
    /**
     * Sends the public key of a Key Pair to the designated environment to allow connection
     *
     * @param request - a {@link SendPublicKeyRequest}
     */
    sendPublicKey(request: SendPublicKeyRequest): Promise<SendPublicKeyResponse>;
    /**
     * Private method to get a single SSH Key from EC2
     *
     * @param sshKeyId - the KeyName of the SSH Key to get
     * @param projectId - the project the key belongs to
     * @returns {@link KeyPairInfo} with the SSH Key info
     */
    private _getSshKey;
    /**
     * Gets the connection info (public DNS name, public IP address, private DNS name, private IP address)
     * from an EC2 {@link Reservation} for a single instance
     *
     * @param reservation - a {@link Reservation} for a single instance
     * @returns {@link SendPublicKeyResponse} that contains the connection info
     */
    private _getConnectionInfoFromReservation;
    /**
     * Get the EC2 and EC2 Instance Connect clients for the hosting account
     *
     * @param envMgmtRoleArn - the env management role ARN for the hosting account that has permissions
     *                         for EC2 and EC2 Instance Connect actions
     * @param operation - 'ListForProject' | 'Delete' | 'Create' | 'Connect' depending on the action happening
     * @param externalId - the external id for the hosting account
     * @param aws - the {@link AwsService} for the main account to ask for the hosting account {@link AwsService}
     * @returns an object containing an {@link EC2} client and an {@link EC2InstanceConnect} client for the hosting account
     */
    private _getEc2ClientsForHostingAccount;
    /**
     * Given the user id and the project it, hash them to create the unique ID for the SSH Key
     *
     * @param userId - the owner of the SSH Key
     * @param projectId - the project that the SSH Key is bounded by
     * @returns the string sshKeyId (aka EC2 KeyName)
     */
    private _getSshKeyId;
}
//# sourceMappingURL=sshKeyService.d.ts.map