'Registers instances with a specified stack that were created
outside of AWS OpsWorks.
We do not recommend using this action to register instances.
The complete registration operation has two primary steps,
installing the AWS OpsWorks agent on the instance and
registering the instance with the stack. `RegisterInstance`
handles only the second step. You should instead use the AWS
CLI `register` command, which performs the entire registration
operation.
**Required Permissions**: To use this action, an IAM user must
have a Manage permissions level for the stack or an attached
policy that explicitly grants permissions. For more
information on user permissions, see `Managing User
Permissions`_.
:type stack_id: string
:param stack_id: The ID of the stack that the instance is to be
registered with.
:type hostname: string
:param hostname: The instance\'s hostname.
:type public_ip: string
:param public_ip: The instance\'s public IP address.
:type private_ip: string
:param private_ip: The instance\'s private IP address.
:type rsa_public_key: string
:param rsa_public_key: The instances public RSA key. This key is used
to encrypt communication between the instance and the service.
:type rsa_public_key_fingerprint: string
:param rsa_public_key_fingerprint: The instances public RSA key
fingerprint.
:type instance_identity: dict
:param instance_identity: An InstanceIdentity object that contains the
instance\'s identity.'

def register_instance(self, stack_id, hostname=None, public_ip=None, private_ip=None, rsa_public_key=None, rsa_public_key_fingerprint=None, instance_identity=None):

    params = {'StackId': stack_id}
    if (hostname is not None):
        params['Hostname'] = hostname
    if (public_ip is not None):
        params['PublicIp'] = public_ip
    if (private_ip is not None):
        params['PrivateIp'] = private_ip
    if (rsa_public_key is not None):
        params['RsaPublicKey'] = rsa_public_key
    if (rsa_public_key_fingerprint is not None):
        params['RsaPublicKeyFingerprint'] = rsa_public_key_fingerprint
    if (instance_identity is not None):
        params['InstanceIdentity'] = instance_identity
    return self.make_request(action='RegisterInstance', body=json.dumps(params))
