import { AccessLevelList } from '../shared/access-level' ; import { PolicyStatement , Operator } from '../shared' ; param sid export class Ec2InstanceConnect extends PolicyStatement { public servicePrefix = 'ec2-instance-connect' ; param sid constructor ( sid ? ) { super ( sid ) ; } /**
     * Grants access to push an SSH public key to the specified EC2 instance to be used for standard SSH
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifEc2Osuser()
     *
     * https://docs.aws.amazon.com/ec2-instance-connect/latest/APIReference/API_SendSSHPublicKey.html
     */ public toSendSSHPublicKey ( ) { return this . to ( 'SendSSHPublicKey' ) ; } /**
     * Grants access to push an SSH public key to the specified EC2 instance to be used for serial console SSH
     *
     * Access Level: Write
     *
     * https://docs.aws.amazon.com/ec2-instance-connect/latest/APIReference/API_SendSerialConsoleSSHPublicKey.html
     */ public toSendSerialConsoleSSHPublicKey ( ) { return this . to ( 'SendSerialConsoleSSHPublicKey' ) ; } protected accessLevelList : AccessLevelList = { Write : [ 'SendSSHPublicKey' , 'SendSerialConsoleSSHPublicKey' ] } ; param instanceId param account param region param partition public onInstance ( instanceId , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:ec2:${ region || '*' }:${ account || '*' }:instance/${ instanceId }` ) ; } param tagKey param value param operator public ifEc2ResourceTag ( tagKey , value , operator ? ) { return this . if ( `ec2:ResourceTag/${ tagKey }` , value , operator || 'StringLike' ) ; } param value param operator public ifEc2Osuser ( value , operator ? ) { return this . if ( `ec2:osuser` , value , operator || 'StringLike' ) ; } }