Skip to content

geta

It runs Node.js that the environment has global variable named aws.

Setup

Local Installation

sh
/bin/bash -c "ALIAS_NAME=geta; $(curl -fsSL https://raw.githubusercontent.com/tomsdoo/aws-cli-alias/HEAD/install.sh)"

Docker Run

sh
# aws geta will start on the container
docker run -it --rm -v ~/.aws:/root/.aws tomsd/aws-cli-alias-geta:0.1.2

Usage

interactive mode

sh
aws geta

then, you will get the prompt.

> aws.profile.currentProfile
'default'

script execution mode

js
// work.js
console.log(aws.profile.currentProfile);
sh
aws geta ./work.js

http server mode

js
aws geta http
js
fetch(
  "http://localhost:3000/exec",
  {
    method: "POST",
    body: JSON.stringify({
      script: "resolve(aws.profile.currentProfile);",
    }),
  },
)
  .then(r => r.json())
  .then(({ result }) => {
    console.log(result);
  }); // "default"

options

optiondescriptiondefault value
--portport number3000
--pathnamepathname/exec

global variable named aws

aws has the properties below.

aws.apiGateway

aws.apiGateway provides the methods below.

getRestApis()
ts
getRestApis(): Promise<RestApi[]>
getRestApi(restApiId: string)
ts
getRestApi(restApiId: string): Promise<RestApi>
getStages(restApiId: string)
ts
getStages(restApiId: string): Promise<Stage[]>
getResources(restApiId: string)
ts
getResources(restApiId: string): Promise<Resource[]>
getBasePathMappings(domainName: string)
ts
getBasePathMappings(domainName: string): Promise<{
  basePath: string;
  restApiId: string;
  stage: string;
}[]>
interface RestApi
ts
interface RestApi {
  id: string;
  name: string;
  createdDate: string;
  version: string;
  apiKeySource: string;
  endpointConfiguration: {};
  tags: {};
  disableExecuteApiEndpoint: boolean;
  rootResourceId: string;
  consoleUrl: string;
  getStages: () => Promise<Stage[]>;
  getResources() => Promise<Resource[]>;
}
interface Stage
ts
interface Stage {
  deploymentId: string;
  stageName: string;
  cacheClusterEnabled: boolean;
  cacheClusterStatus: string;
  createdDate: string;
  lastUpdatedDate: string;
}
interface Resource
ts
interface Resource {
  id: string;
  parentId: string;
  pathPart: string;
  path: string;
  resourceMethods?: Record<string, object>;
}
interface Domain
ts
interface Domain {
  domainName: string;
  domainNameArn: string;
  certificateUploadDate: string;
  regionalDomainName: string;
  regionalHostedZoneId: string;
  regionalCertificateArn: string;
  endpointConfiguration: {
    types: string[];
  };
  domainNameStatus: string;
  securityPolicy: string;
  tags: {};
  routingMode: string;
  consoleUrl: string;
  getBasePathMapping: () => Promise<{
    basePath: string;
    restApiId: string;
    stage: string;
  }[]>;
}

aws.athena

aws.athena provides the methods below.

listDataCatalogs()
ts
listDataCatalogs(): Promise<{
  CatalogName: string;
  Type: stringl
  Status: string;
  listDatabases: () => Promise<{
    Name: string;
    listTableMetadata() => Promise<TableMetadata[]>
  }[]>
}[]>
listDatabases(catalogName: string)
ts
listDatabases(catalogName: string): Promise<{
  Name: string;
  listTableMetadata() => Promise<TableMetadata[]>;
}[]>
listTableMetadata(catalogName: string, databaseName: string)
ts
listTableMetadata(
  catalogName: string,
  databaseName: string
): Promise<TableMetadata[]>
executeQuery(sql: string)
ts
executeQuery(sql: string): Promise<Record<string, unknwon>[]>
interface TableMetadata
ts
interface TableMetadata {
  Name: string;
  CreateTime: string;
  TableType: string;
  Columns: {
    Name: string;
    Type: sting;
    Comment: string;
  }[];
  PartitionKeys: {
    Name: string;
    Type: string;
    Comment: string;
  }[];
  Parameters: {
    EXTERNAL: string;
    inputformat: string;
    location: string;
    outputformat: string;
  };
}

aws.cloudFront

aws.cloudFront provides the methods below.

listDistributions(keyword?: string)
ts
listDistributions(keyword?: string): Promise<Distribution[]>
interface Distribution
ts
interface Distribution {
  Id: string;
  ARN: string;
  ETag: string;
  Status: string;
  LastModifiedTime: string;
  DomainName: string;
  Aliases: {
    Quantity: number;
    Items: 
  };
  Origins: {
    Quantity: number;
    Items: 
  };
  OriginGroups: {
    Quantity: number;
  };
  DefaultCacheBahavior: {
    TargetOriginId: string;
    TrustedSigners: {};
    TrustedKeyGroups: {};
    ViewerProtocolPolicy: string;
    AllowedMethods: {};
    SmoothStreaming: boolean;
    Compress: boolean;
    LambdaFunctionAssociations: {};
    FunctionAssociations: {};
    FieldLevelEncryptionId: string;
    GrpcConfig: {
      Enabled: boolean;
    };
    FormattedValues: {};
    MinTTL: number;
    DefaultTTL: number;
    MaxTTL: number;
  };
  CacheBehaviors: {};
  CustomErrorResponses: {};
  Comment: string;
  PriceClass: string;
  Enabled: boolean;
  ViewerCertificate: {
    CloudFrontDefaultCertificate: boolean;
    SSLSupportMethod: string;
    MinumunProtocolversion: string;
    CertificateSource: string;
  };
  Restrictions: {};
  WebACLId: string;
  HttpVersion: string;
  IsIPV6Enabled: boolean;
  Staging: boolean;
  ConnectionMode: string;
  consoleUrl: string;
  hasS3Origins: boolean;
  s3Origins: string[];
  s3Buckets: string[];
}

aws.cognitoIdp

aws.cognitoIdp provides the methods below.

listUserPools()
ts
listUserPools(
  options?: { type: "array" | "map" | "object"; key: string | null }
): Promise<
  UserPoolSummary[] |
  Map<string, UserPoolSummary> |
  Record<string, UserPoolSummary>
>
listUsers(poolId: string)
ts
listUsers(
  poolId: string,
  options?: {
    email?: string;
    mergeAttributes?: boolean;
  },
): Promise<Uesr[]>
describeUserPool(poolId: string)
ts
describeUserPool(poolId: string): Promise<UserPool>
interface UserPoolSummary
ts
interface UserPoolSummary {
  Id: string;
  Name: string;
  LambdaConfig: Record<string, string>;
  LastModifiedDate: string;
  CreationDate: string;
  listUsers: (options?: {
    email?: string;
    mergeAttributes?: boolean;
  }) => Promise<User[]>;
}
interface UserPool
ts
interface UserPool {
  Id: string;
  Name: string;
  Policies: {
    PasswordPolicy?: {
      MinimumLength: number;
      RequireUpperCase: boolean;
      RequireLowercase: boolean;
      RequireNumbers: boolean;
      RequireSymbols: boolean;
      TemporaryPasswordValidityDays: number;
    };
    [key: string]: object:
  };
  DeletionProtection: string;
  LambdaConfig: Record<string, string>;
  LastModifiedDate: string;
  CreationDate: string;
  SchemaAttributes: {
    Name: string;
    AttributeDataType: string;
    DeveloperOnlyAttribute: boolean;
    Mutable: boolean;
    Required: boolean;
    StringAttributeConstrains: Record<string, string>;
    NumberAttributeConstraints: Record<string, string>;
  }[];
  AutoVerifiedAttributes: string[];
  UsernameAttributes: string[];
  SmsVerificationMessage: string;
  EmailVerificationMessage: string;
  EmailVerificationSubject: string;
  VerificationMessageTemplate: {
    SmsMessage: string;
    EmailMessage: string;
    EmailSubjet: string;
    DefaultEmailOption: string;
  };
  SmsAuthenticationMessage: string;
  UserAttributeUpdateSettings: {};
  MfaConfiguration: string;
  EstimatedNumberOfUsers: number;
  EmailConfiguration: {
    SourceArn: string;
    EmailSendingAccount: string;
    From: string;
  };
  Domain: string;
  AdminCreateUserConfig: {
    AllowAdminCreateUserOnly: boolean;
    UnusedAccountValidityDays: number;
    InviteMessageTemplate: {
      SMSMessage: string;
      EmailMessage: string;
      EmailSubject: string;
    };
  };
  UsernameConfiguration: {
    CaseSensitive: boolean;
  };
  Arn: string;
  AccountRecoverySetting: {
    RecoveryMechanisms: {
      Priority: number;
      Name: string;
    }[];
  };
  UserPoolTier: string;
}
interface User
ts
interface User {
  UserName: string;
  Atributes: {
    Name: string;
    Value: string;
  }[];
  UserCreateDate: string;
  UserLastModifiedDate: string;
  Enabled: boolean;
  UserStatus: string;
  mergedAttributes?: Record<string, string>;
}

aws.dynamodb

aws.dynamodb provides the methods below.

listTables()
ts
listTagles(): Promise<string[]>
describeTable(tableName: string)
ts
describeTable(tableName: string): Promise<Table[]>
interface Table
ts
interface Table {
  AttributeDefinitions: {
    AttributeName: string;
    AttributeType: string;
  }[];
  TableName: string;
  KeySchema: {
    AttributeName: string;
    KeyType: string;
  }[];
  TableStatus: string;
  CreationDateTime: string;
  ProvisionedThroughout: {
    NumberOfDecreasesToday: number;
    ReadCapacityUnits: number;
    WriteCapacityUnits: number;
  };
  TableSizeBytes: number;
  ItemCount: number;
  TableArn: string;
  TableId: string;
  BillingModeSummary: {
    BillingMode: string;
    LastUpdateToPayPerRequestDateTime: string;
  };
  GlobalSecondaryIndexes: {
    IndexName: string;
    KeySchema: {
      AttributeName: string;
      KeyType: string;
    }[];
    Projection: {
      ProjectionType: string;
    };
    IndexStatus: string;
    ProvisionedThroughout: {
      NumberOfDecreasesToday: number;
      ReadCapacityUnits: number;
      WriteCapacityUnits: number;
    };
    IndexSizeBytes: number;
    ItemCount: number;
    IndexArn: string;
    WarmThroughout: {
      ReadUnitsPerSecond: number;
      WriteUnitsPerSecond: number;
      Status: string;
    };
  }[];
  StreamSpecification: {
    StreamEnabled: boolean;
    StreamViewType: string;
  };
  LatestStreamLabel: string;
  LatestStreamArn: string;
  DeletionProtectionEnabled: boolean;
  WarmThroughout: {
    ReadUnitsPerSecond: number;
    WriteUnitsPerSecond: number;
    Status: string;
  };
}

aws.ec2

aws.ec2 provides the methods below.

describeInstances()
ts
describeInstances(): Promise<{
  ReservationId: string;
  OwnerId: string;
  Groups: {}[];
  Instances: Instance[];
}[]>
describeVpcs()
ts
describeVpcs(): Promise<Vpc[]>
describeSecurityGroups()
ts
describeSecurityGroups(): Promise<SecurityGroup[]>
describeSecurityGroupRules()
ts
describeSecurityGroupRules(
  filter?: { Name: string; Values: string[]; }[]
): Promise<SecurityGroupRule[]>
describeSubnets()
ts
describeSubnets(): Promise<Subnet[]>
getPureInstances()
ts
getPureInstances(): Promise<Instance[]>
getInstances(keyword: string)
ts
getInstances(keyword: string): Promise<(Instance & {
  start: () => Promise<{
    CurrentState: InstanceState;
    InstanceId: string;
    PreviousState: InstanceState;
  }>;
  stop: () => Promise<{
    CurrentState: InstanceState;
    InstanceId: string;
    PreviousState: InstanceState;
  }>:
  tagObj: Record<string, string>;
})[]>
startInstance(instanceId: string)
ts
startInstance(instanceId: string): Promise<{
  CurrentState: InstanceState;
  InstanceId: string;
  PreviousState: InstanceState;
}>
stopInstance(instanceId: string)
ts
stopInstance(instanceId: string): Promise<{
  CurrentState: InstanceState;
  InstanceId: string;
  PreviousState: InstanceState;
}>
interface Instance
ts
interface Instance {
  Architecture: string;
  BlockDeviceMappings: {}[];
  ClientToken: string;
  EbsOptimized: boolean;
  EnaSupport: boolean;
  Hypervisor: string;
  IamInstanceProfile: {};
  NetworkInterfaces: {}[];
  RootDeviceName: string;
  RootDeviceType: string;
  SecurityGroups: {}[];
  SourceDestCheck: boolean;
  Tags: {}[];
  VertualizationType: string;
  CpuOptions: {};
  CapacityReservationSpecification: {};
  HibernationOptions: {};
  MetadataOptions: {};
  EnclaveOptions: {};
  PlatformDetails: string;
  UsageOperation: string;
  UsageOperationUpdateTime: string;
  PrivateDnsNameOptions: {};
  MaintenanceOptions: {};
  CurrentInstanceBookMode: string;
  NetworkPerformanceOptions: {};
  Operator: {};
  InstanceId: string;
  ImageId: string;
  State: {};
  PrivateDnsName: string;
  PublicDnsName: string;
  StateTransitionReason: string;
  KeyName: string;
  AmiLaunchIndex: number;
  ProductCodes: {}[];
  InstanceType: string;
  LaunchTime: string;
  Placement: {};
  Monitoring: {};
  SubnetId: string;
  VpcId: string;
  PrivateIpAddress: string;
  PublicIpAddress: string;
}
interface InstanceState
ts
interface InstanceState {
  Code: number;
  Name: string;
}
interface Vpc
ts
interface Vpc {
  OwnerId: string;
  InstanceTenancy: string;
  CidrBlockAssociationSet: {
    AssociationId: string;
    CidrBlock: string;
    CidrBlockState: {
      State: string;
    };
  }[];
  IsDefault: boolean;
  Tags: {
    Key: string;
    Value: string;
  }[];
  BlockPublicAccessStates: {
    InternetGatewayBlockMode: string;
  };
  VpcId: string;
  State: string;
  CidrBlock: string;
  DhcpOptionsId: string;
}
interface Subnet
ts
interface Subnet {
  AvailabilityZoneId: string;
  MapCustomerOwnedIpOnLaunch: boolean;
  OwnerId: string;
  AssignIpv6AddressOnCreation: boolean;
  Ipv6CidrBlockAssociationSet: {}[];
  Tags: {
    Key: string;
    Value: string;
  }[];
  SubnetArn: string;
  EnableDns64: boolean;
  Ipv6Native: boolean;
  PrivateDnsNameOptionsOnLaunch: {
    HostnameType: string;
    EnableResoureNameDnsARecord: boolean;
    EnableResourceNameDnsAAAARecord: boolean;
  };
  BlockPublicAccessStates: {
    InternetGatewayBlockMode: string;
  };
  SubnetId: string;
  State: string;
  VpcId: string;
  CidrBlock: string;
  AvailableIpAddressCount: number;
  AvailabilityZone: string;
  DefaultForAz: boolean;
  MapPublicIpOnLaunch: boolean;
}
interface SecurityGroup
ts
interface SecurityGroup {
  GroupId: string;
  IpPermissionsEgress: {
    IpProtocol: string;
    FromPort: number;
    ToPort: number;
    UserIdGroupPairs: {
      Description: string;
      UserId: string;
      GroupId: string;
    }[];
  }[];
  Tags?: {
    Key: string;
    Value: string;
  }[];
  VpcId: string;
  SecurityGroupArn: string;
  OwnerId: string;
  GroupName: string;
  Description: string;
  IpPermissions: {
    IpProtocol: string;
    FromPort: number;
    ToPort: number;
    UserIdGroupPairs: {
      Description: string;
      UserId: string;
      GroupId: string;
    }[];
    IpRanges: {}[];
    Ipv6Ranges: {}[];
    PrefixListIds: {}[];
  }[];
  describeSecurityGroupRunes(): Promise<SecurityGroupRule[]>
}
interface SecurityGroupRule
ts
interface SecurityGroupRule {
  SecurityGroupRuleId: string;
  GroupId: string;
  GroupOwnerId: string;
  IsEgress: boolean;
  IpProtocol: string;
  FromPort: number;
  ToPort: number;
  CidrIpv4: string;
  Description: string;
  Tags?: {
    Key: string;
    Value: string;
  }[];
  SecurityGroupRuleArn: string;
}

aws.ecr

aws.ecr provides the methods below.

describeRepositories()
ts
describeRepositories(): Promise<{
  repositoryArn: string;
  registryId: string;
  repositoryName: string;
  repositoryUri: string;
  createdAt: string;
  imageTagMutability: string;
  imageScanningConfiguration: {
    scanOnPush: boolean;
  };
  encryptionConfiguration: {
    encryptionType: string;
  };
  describeImages: () => Promise<{
    registryId: string;
    repositoryName: string;
    imageDigest: string;
    imageTags?: string[];
    imageSizeInBytes: number;
    imagePushedAt: string;
    imageManifestMediaType: string;
    artifactMediaType: string;
    lastRecordedPullTime: string;
  }[]>
}[]>
describeImages(repositoryName: string)
ts
describeImages(repositoryName: string): Promise<{
  registryId: string;
  repositoryName: string;
  imageDigest: string;
  imageTags?: string[];
  imageSizeInBytes: number;
  imagePushedAt: string;
  imageManifestMediaType: string;
  artifactMediaType: string;
  lastRecordedPullTime: string;
}[]>

aws.ecs

aws.ecs provides the methods below.

listClusters()
ts
listClusters(): Promise<{
  clusterArn: string;
  describeClusters: () => Promise<{
    clusterArn: string;
    clusterName: string;
    status: string;
    registeredContainerInstancesCount: number;
    runningTasksCount: number;
    pendingTasksCount: number;
    activeServicesCount: number;
    statistics: {}[];
    tags: {}[];
    settings: {}[];
    capacityProviders: string[];
    defaultCapacityProviderStrategy: {
      capacityProvider: string;
      weight: number;
      base: number;
    }[];
    listServices: () => Promise<{}[]>;
  }[]>;
}[]>;
describeClusters()
ts
descibeClusters(clusterArn: string): Promise<{
  clusterArn: string;
  clusterName: string;
  status: string;
  registeredContainerInstancesCount: number;
  runningTasksCount: number;
  pendingTasksCount: number;
  activeServicesCount: number;
  statistics: {}[];
  tags: {}[];
  settings: {}[];
  capacityProviders: string[];
  defaultCapacityProviderStrategy: {
    capacityProvider: string;
    weight: number;
    base: number;
  }[];
  listServices: () => Promise<{}[]>;
}[]>
listServices(clusterArn: string)
ts
listServices(clusterArn: string): Promise<{
  clusterArn: string;
  serviceArn: string;
  describeServices: (): Promise<{
    serviceArn: string;
    serviceName: string;
    clusterArn: string;
    loadBalancers: {}[];
    serviceRegistries: {}[];
    status: string;
    desiredCount: number;
    runningCount: number;
    pendingCount: number;
    platformVersion: string;
    platformFamily: string;
    taskDefinition: string;
    deploymentConfiguration: {};
    deployments: {}[];
    roleArn: string;
    events: {}[];
    createdAt: string;
    placementConstraints: {}[];
    placementStrategy: {}[];
    networkConfiguration: {};
    healthCheckGracePeriodSeconds: number;
    schedulingStrategy: string;
    deploymentController: {
      type: string;
    };
    createdBy: string;
    enableECSManagedTags: boolean;
    propagateTags: string;
    enableExecuteCommand: boolean;
    availabilityZoneRebalancing: string;
  }[]>;
}[]>
describeServices(clusterArn: string, serviceArn: string)
ts
describeServices(clusterArn: string, serviceArn: string): Promise<{
  serviceArn: string;
  serviceName: string;
  clusterArn: string;
  loadBalancers: {}[];
  serviceRegistries: {}[];
  status: string;
  desiredCount: number;
  runningCount: number;
  pendingCount: number;
  platformVersion: string;
  platformFamily: string;
  taskDefinition: string;
  deploymentConfiguration: {};
  deployments: {}[];
  roleArn: string;
  events: {}[];
  createdAt: string;
  placementConstraints: {}[];
  placementStrategy: {}[];
  networkConfiguration: {};
  healthCheckGracePeriodSeconds: number;
  schedulingStrategy: string;
  deploymentController: {
    type: string;
  };
  createdBy: string;
  enableECSManagedTags: boolean;
  propagateTags: string;
  enableExecuteCommand: boolean;
  availabilityZoneRebalancing: string;
}[]>
listTasks(clusterArn: string)
ts
listTasks(clusterArn: string): Promise<{
  clusterArn: string;
  taskArn: string;
  describeTasks: () => Promise<{
    attachments: {
      idd: string;
      type: string;
      status: string;
      details: {}[];
    }[];
    attributes: {
      name: string;
      value: string;
    }[];
    availabilityZone: string;
    capacityProviderName: string;
    clusterArn: string;
    connectivity: string;
    connectivityAt: string;
    containers: {
      containerArn: string;
      taskArn: string;
      name: string;
      image: string;
      imageDigest: string;
      runtimeId: string;
      lastStatus: string;
      networkBindings: {}[];
      networkInterfaces: {}[];
      healthStatus: string;
      managedAgents: {}[];
      cpu: string;
    }[];
    cpu: string;
    createdAt: string;
    desiredStatus: string;
    enableExecuteCommand: boolean;
    group: string;
    healthStatus: string;
    lastStatus: string;
    launchType: string;
    memory: string;
    overrides: {
      containerOverrides: {}[];
      inferenceAcceleratorOverrides: {}[];
    };
    platformVersion: string;
    platformFamily: string;
    pullStartedAt: string;
    pullStoppedAt: string;
    startedAt: string;
    startedBy: string;
    tags: {}[];
    taskArn: string;
    taskDescription: string;
    version: number;
    ephemeralStorage: {
      sizeInGiB: number;
    };
    getExecuteCommand: () => string;
  }[]>;
}[]>
describeTasks(clusterArn: string, taskArn: string)
ts
describeTasks(clusterArn: string, taskArn: string): Promise<{
  attachments: {
    idd: string;
    type: string;
    status: string;
    details: {}[];
  }[];
  attributes: {
    name: string;
    value: string;
  }[];
  availabilityZone: string;
  capacityProviderName: string;
  clusterArn: string;
  connectivity: string;
  connectivityAt: string;
  containers: {
    containerArn: string;
    taskArn: string;
    name: string;
    image: string;
    imageDigest: string;
    runtimeId: string;
    lastStatus: string;
    networkBindings: {}[];
    networkInterfaces: {}[];
    healthStatus: string;
    managedAgents: {}[];
    cpu: string;
  }[];
  cpu: string;
  createdAt: string;
  desiredStatus: string;
  enableExecuteCommand: boolean;
  group: string;
  healthStatus: string;
  lastStatus: string;
  launchType: string;
  memory: string;
  overrides: {
    containerOverrides: {}[];
    inferenceAcceleratorOverrides: {}[];
  };
  platformVersion: string;
  platformFamily: string;
  pullStartedAt: string;
  pullStoppedAt: string;
  startedAt: string;
  startedBy: string;
  tags: {}[];
  taskArn: string;
  taskDescription: string;
  version: number;
  ephemeralStorage: {
    sizeInGiB: number;
  };
  getExecuteCommand: () => string;
}[]>

aws.elb

aws.elb provides the methods below.

describeLoadBalancers()
ts
describeLoadBalancers(): Promise<{
  LoadBalancerArn: string;
  DNSName: string;
  CanonicalHostedZoneId: string;
  CreatedTime: string;
  LoadBalancerName: string;
  Scheme: string;
  VpcId: string;
  State: {
    Code: string;
  };
  Type: string;
  AvailabilityZones: {
    ZoneName: string;
    SubnetId: string;
    LoadBalancerAdresses: string[];
  }[];
  SecurityGroups: string[];
  IpAddressType: string;
  EnablePrefixForIpv6SourceNat: string;
}[]>

aws.firehose

aws.firehose provides the methods below.

listDeliveryStreams()
ts
listDeliveryStreams(): Promise<string[]>
describeDeliveryStream(deliveryStreamName: string)
ts
describeDeliveryStream(deliveryStreamName: string): Promise<{
  DeliveryStreamName: string;
  DeliveryStreamArn: string;
  DeliveryStreamStatus: string;
  DeliveryStreamEncryptionConfiguration: {
    KeyType: string;
    Status: string;
  };
  DeliveryStreamType: string;
  VersionId: string;
  CreateTimestamp: string;
  Destinations: {
    DestinationId: string;
    S3DestinationDescription: {};
    ExtendedS3DestinationDescription: {};
  }[];
  HasMoreDestinations: boolean;
  consoleUrl: string;
}>

aws.iam

aws.iam provides the methods below.

listGroups()
ts
listGroups(): Promise<{
  Path: string;
  GroupName: string;
  GroupId: string;
  Arn: string;
  CreateDate: string;
  consoleUrl: string;
}[]>
listUsers()
ts
listUsers(): Promise<{
  Path: string;
  UserName: string;
  UserId: string;
  Arn: string;
  CreateDate: string;
  consoleUrl: string;
  listGroupsForUser: Promise<{
    Path: string;
    GroupName: string;
    GroupId: string;
    Arn: string;
    CreateDate: string;
  }[]>
}[]>
listGroupsForUser(userName: string)
ts
listGroupsForUser(userName: string): Promise<{
  Path: string;
  GroupName: string;
  GroupId: string;
  Arn: string;
  CreateDate: string;
}[]>
listRoles()
ts
listRoles(): Promise<{
  Path: string;
  RoleName: string;
  RoleId: string;
  Arn: string;
  CreateDate: string;
  AssumeRolePolicyDocument: {
    Version: string;
    Statement: {
      Effect: string;
      Principal: {
        Service: string;
      };
      Action: string;
    }[];
  };
  Description: string;
  MaxSessionDuration: number;
  consoleUrl: string;
  listRolePolicies: Promise<string[]>;
}[]>
listRolePolicies(roleName: string)
ts
listRolePolicies(roleName: string): Promise<string[]>
listPolicies()
ts
listPolicies(): Promise<{
  PolicyName: string;
  PolicyId: string;
  Arn: string;
  Path: string;
  DefaultVersionId: string;
  AttachmentCount: number;
  PermissionBoundaryUsageCount: number;
  IsAttachable: boolean;
  CreateDate: string;
  UpdateDate: string;
  consoleUrl: string;
}[]>

aws.logs

aws.logs provides the methods below.

describeLogGroups()
ts
describeLogGroups(): Promise<{
  logGroupName: string;
  creationTime: number;
  retentionInDays: number;
  metricFilterCount: number;
  arn: string;
  storeBytes: number;
  logGroupClass: string;
  logGroupArn: string;
  consoleUrl: string;
  describeSubscriptionFilters: Promise<{
    filterName: string;
    logGroupName: string;
    filterPattern: string;
    destinationArn: string;
    distribution: string;
    applyOnTransformedLogs: boolean;
    creationTime: number;
  }[]>;
}[]>
describeSubscriptionFilters(logGroupName: string)
ts
describeSubscriptionFilters(logGroupName: string): Promise<{
  filterName: string;
  logGroupName: string;
  filterPattern: string;
  destinationArn: string;
  distribution: string;
  applyOnTransformedLogs: boolean;
  creationTime: number;
}[]>

aws.profile

aws.profile provides the methods below.

currentProfile
ts
get currentProfile(): string
setCurrentProfile(profileName: string)
ts
setCurrentProfile(profileName: string): Promise<void>
listProfiles()
ts
listProfiles(): Promise<string[]>

aws.rds

aws.rds provides the methods below.

getClusters()
ts
getClusters(): Promise<{
  AllocatedStorage: number;
  AvailabilityZones: string[];
  BackupRetensionPeriod: number;
  DatabaseName: string;
  DBClusterIdentifier: string;
  DBClusterParameterGroup: string;
  DBSubnetGroup: string;
  Status: string;
  EarliestRestorableTime: string;
  Endpoint: string;
  ReaderEndpoint: string;
  MultiAZ: boolean;
  Engine: string;
  EngineVersion: string;
  LatestRestorableTime: string;
  Port: number;
  MasterUsername: string;
  PreferredBackupWindow: string;
  PreferredMaintenanceWindow: string:
  DBClusterMembers: {
    DBInstanceIdentifier: string;
    IsClusterWriter: boolean;
    DBClusterParameterGroupStatus: string;
    PromotionTier: number;
  }[];
  VpcSecurityGroups: {
    VpcSecurityGroupId: string;
    Status: string;
  }[];
  HostedZoneId: string;
  StorageEncrypted: boolean;
  KmsKeyId: string;
  DbClusterResourceId: string;
  DBClusterArn: string;
  IAMDatabaseAuthenticationEnabled: boolean;
  ClusterCreateTime: string;
  EnabledCloudwatchLogsExports: string[];
  EngineMode: string;
  DeletionProtection: boolean;
  HttpEndpointEnabled: boolean;
  ActivityStreamStatus: string;
  CopyTagsToSnapshot: boolean;
  CrossAccountClone: boolean;
  TagList: {
    Key: string;
    Value: string;
  }[];
  AutoMinorVersionUpgrade: boolean;
  DatabaseInsightsMode: string;
  NetworkType: string;
  LocalWriteForwardingStatus: string;
  EngineLifecycleSupport: string;
}[]>
getInstances()
ts
getInstances(): Promise<{
  DBInstanceIdentifier: string;
  DBInstanceClass: string;
  Engine: string;
  DBInstanceStatus: string;
  MasterUsername: string;
  Endpoint: {
    Address: string;
    Port: number;
    HostedZoneId: string;
  };
  AllocatedStorage: number;
  InstanceCreateTime: string;
  PreferredBackupWindow: string;
  BackupRetentionPeriod: number;
  VpcSecurityGroups: {
    VpcSecurityGroupId: string;
    Status: string;
  }[];
  DBParameterGroups: {
    DBParameterGroupName: string;
    ParameterApplyStatus: string;
  }[];
  AvailabilityZone: string;
  DBSubnetGroup: {};
  PreferredMaintenanceWindow: string;
  EngineVersion: string;
  AutoMinorVersionUpgrade: boolean;
  LicenseModel: string;
  PubliclyAccessible: boolean;
  StorageType: string;
  KmsKeyId: string;
  CACertificateIdentifier: string;
  DBInstanceArn: string;
  TagList: {
    Key: string;
    Value: string;
  }[];
  NetworkType: string;
  MasterUserSecret: {
    SecretArn: string;
    SecretStatus: string;
    KmsKeyId: string;
  };
  CertificateDetails: {
    CAIdentifier: string;
    ValidTill: string;
  };
}[]>

aws.redshift

aws.redshift provides the methods below.

listNamespaces()
ts
listNamespaces(): Promise<{
  adminPasswordSecretArg: string;
  adminUsername: string;
  creationDate: string;
  dbName: string;
  defaultIamRoleArn: string;
  iamRoles: string[];
  kmsKeyId: string;
  logExports: string[];
  namespaceArn: string;
  namespaceId: string;
  namespaceName: string;
  status: string;
}[]>
  • listWorkgroups()

aws.route53

aws.route53 provides the methods below.

listHostedZones()
ts
listHostedZones(): Promise<{
  Id: string;
  Name: string;
  CallerReference: string;
  Config: {
    Comment: string;
    PrivateZone: boolean;
  };
  ResourceRecordSetCount: number;
  consoleUrl: string;
  listResourceRecordSets: () => Promise<{
    Name: string;
    Type: string;
    TTL: number;
    ResourceRecords: {
      Value: string;
    }[];
  }[]>;
}[]>
listResourceRecordSets(hostedZoneId: string)
ts
listResourceRecordSets(hostedZoneId: string): Promise<{
  Name: string;
  Type: string;
  TTL: number;
  ResourceRecords: {
    Value: string;
  }[];
}[]>

aws.secretsManager

aws.secretsManager provides the methods below.

listSecrets()
ts
listSecrets(keyword?: string, onlyNames?: boolean): Promise<{
  ARN: string;
  Name: string;
  Description: string;
  LastChangedDate: string;
  LastAccessedDate: string;
  Tags: {
    Key: string;
    Value: string;
  }[];
  SecretVersionsToStages: Record<string, string[]>;
  CreatedDate: string;
}[]>
getSecret()
ts
getSecret(secretName: string): Promise<{
  ARN: string;
  Name: string;
  VersionId: string;
  SecretString: string;
  VersionStages: string[];
  CreatedDate: string;
  value: Record<string, string | number>;
}>

aws.s3api

aws.s3api provides the methods below.

listBuckets()
ts
listBuckets(): Promise<{ Name: string; CreationDate: string; }>

global variable named session

session has the properties below.

session.commandHistory

session.commandHistory is an array of the command executed.

commandHistory
ts
commandHistory: {
  time: Date;
  commandLine: string;
}[];