Class EC2Cloud

    • Method Detail

      • resolvePrivateKey

        @CheckForNull
        public EC2PrivateKey resolvePrivateKey()
      • readResolve

        protected Object readResolve()
      • isUseInstanceProfileForCredentials

        public boolean isUseInstanceProfileForCredentials()
      • getRoleArn

        public String getRoleArn()
      • getRoleSessionName

        public String getRoleSessionName()
      • getCredentialsId

        public String getCredentialsId()
      • getSshKeysCredentialsId

        @CheckForNull
        public String getSshKeysCredentialsId()
      • getInstanceCapStr

        public String getInstanceCapStr()
      • getInstanceCap

        public int getInstanceCap()
      • getKeyPair

        @CheckForNull
        public com.amazonaws.services.ec2.model.KeyPair getKeyPair()
                                                            throws com.amazonaws.AmazonClientException,
                                                                   IOException
        Gets the KeyPairInfo used for the launch.
        Throws:
        com.amazonaws.AmazonClientException
        IOException
      • doAttach

        public void doAttach​(org.kohsuke.stapler.StaplerRequest req,
                             org.kohsuke.stapler.StaplerResponse rsp,
                             @QueryParameter
                             String id)
                      throws javax.servlet.ServletException,
                             IOException,
                             com.amazonaws.AmazonClientException
        Debug command to attach to a running instance.
        Throws:
        javax.servlet.ServletException
        IOException
        com.amazonaws.AmazonClientException
      • doProvision

        public org.kohsuke.stapler.HttpResponse doProvision​(@QueryParameter
                                                            String template)
                                                     throws javax.servlet.ServletException,
                                                            IOException
        Throws:
        javax.servlet.ServletException
        IOException
      • provision

        public void provision​(SlaveTemplate t,
                              int number)
      • createCredentialsProvider

        protected com.amazonaws.auth.AWSCredentialsProvider createCredentialsProvider()
      • getSlaveTypeTagValue

        public static String getSlaveTypeTagValue​(String slaveType,
                                                  String templateDescription)
      • createCredentialsProvider

        public static com.amazonaws.auth.AWSCredentialsProvider createCredentialsProvider​(boolean useInstanceProfileForCredentials,
                                                                                          String credentialsId)
      • createCredentialsProvider

        public static com.amazonaws.auth.AWSCredentialsProvider createCredentialsProvider​(boolean useInstanceProfileForCredentials,
                                                                                          String credentialsId,
                                                                                          String roleArn,
                                                                                          String roleSessionName,
                                                                                          String region)
      • connect

        public com.amazonaws.services.ec2.AmazonEC2 connect()
                                                     throws com.amazonaws.AmazonClientException
        Connects to EC2 and returns AmazonEC2, which can then be used to communicate with EC2.
        Throws:
        com.amazonaws.AmazonClientException
      • createClientConfiguration

        public static com.amazonaws.ClientConfiguration createClientConfiguration​(String host)
      • getAwsPartitionHostForService

        public static String getAwsPartitionHostForService​(String region,
                                                           String service)
        Returns the DNS endpoint for a AWS service based on region provided
      • convertHostName

        public static String convertHostName​(String ec2HostName)
        Convert a configured hostname like 'us-east-1' to a FQDN or ip address
      • convertPort

        public static Integer convertPort​(String ec2Port)
        Convert a user entered string into a port number "" -> -1 to indicate default based on SSL setting
      • buildPresignedURL

        public URL buildPresignedURL​(String path)
                              throws com.amazonaws.AmazonClientException
        Computes the presigned URL for the given S3 resource.
        Parameters:
        path - String like "/bucketName/folder/folder/abc.txt" that represents the resource to request.
        Throws:
        com.amazonaws.AmazonClientException