RegisterInstance
Registers instances that were created outside of AWS OpsWorks Stacks with a specified stack.
Note
We do not recommend using this action to register instances. The complete registration
operation includes two tasks: installing the AWS OpsWorks Stacks 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. For more information,
see
Registering an Instance with an AWS OpsWorks Stacks Stack.
Registered instances have the same requirements as instances that are created by using the CreateInstance API. For example, registered instances must be running a supported Linux-based operating system, and they must have a supported instance type. For more information about requirements for instances that you want to register, see Preparing the Instance.
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.
Request Syntax
{
"Hostname": "string
",
"InstanceIdentity": {
"Document": "string
",
"Signature": "string
"
},
"PrivateIp": "string
",
"PublicIp": "string
",
"RsaPublicKey": "string
",
"RsaPublicKeyFingerprint": "string
",
"StackId": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- Hostname
-
The instance's host name. The following are character limits for instance host names.
-
Linux-based instances: 63 characters
-
Windows-based instances: 15 characters
Type: String
Required: No
-
- InstanceIdentity
-
An InstanceIdentity object that contains the instance's identity.
Type: InstanceIdentity object
Required: No
- PrivateIp
-
The instance's private IP address.
Type: String
Required: No
- PublicIp
-
The instance's public IP address.
Type: String
Required: No
- RsaPublicKey
-
The instances public RSA key. This key is used to encrypt communication between the instance and the service.
Type: String
Required: No
- RsaPublicKeyFingerprint
-
The instances public RSA key fingerprint.
Type: String
Required: No
- StackId
-
The ID of the stack that the instance is to be registered with.
Type: String
Required: Yes
Response Syntax
{
"InstanceId": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- InstanceId
-
The registered instance's AWS OpsWorks Stacks ID.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors.
- ResourceNotFoundException
-
Indicates that a resource was not found.
HTTP Status Code: 400
- ValidationException
-
Indicates that a request was not valid.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: