Submit
Path:
~
/
/
lib
/
python2.7
/
site-packages
/
awscli
/
examples
/
opsworks
/
File Content:
register.rst
**To register instances with a stack** The following examples show a variety of ways to register instances with a stack that were created outside of AWS Opsworks. You can run ``register`` from the instance to be registered, or from a separate workstation. For more information, see `Registering Amazon EC2 and On-premises Instances`_ in the *AWS OpsWorks User Guide*. .. _`Registering Amazon EC2 and On-premises Instances`: http://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-register-registering.html **Note**: For brevity, the examples omit the ``region`` argument. AWS OpsWorks CLI commands should set ``region`` to us-east-1 regardless of the stack's location. *To register an Amazon EC2 instance* To indicate that you are registering an EC2 instance, set the ``--infrastructure-class`` argument to ``ec2``. The following example registers an EC2 instance with the specified stack from a separate workstation. The instance is identified by its EC2 ID, ``i-12345678``. The example uses the workstation's default SSH username and attempts to log in to the instance using authentication techniques that do not require a password, such as a default private SSH key. If that fails, ``register`` queries for the password. :: aws opsworks register --infrastructure-class=ec2 --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb i-12345678 The following example registers an EC2 instance with the specifed stack from a separate workstation. It uses the ``--ssh-username`` and ``--ssh-private-key`` arguments to explicitly specify the SSH username and private key file that the command uses to log into the instance. ``ec2-user`` is the standard username for Amazon Linux instances. Use ``ubuntu`` for Ubuntu instances. :: aws opsworks register --infrastructure-class=ec2 --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --ssh-username ec2-user --ssh-private-key ssh_private_key i-12345678 The following example registers the EC2 instance that is running the ``register`` command. Log in to the instance with SSH and run ``register`` with the ``--local`` argument instead of an instance ID or hostname. :: aws opsworks register --infrastructure-class ec2 --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --local *To register an on-premises instance* To indicate that you are registering an on-premises instance, set the ``--infrastructure-class`` argument to ``on-premises``. The following example registers an existing on-premises instance with a specified stack from a separate workstation. The instance is identified by its IP address, ``192.0.2.3``. The example uses the workstation's default SSH username and attempts to log in to the instance using authentication techniques that do not require a password, such as a default private SSH key. If that fails, ``register`` queries for the password. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb 192.0.2.3 The following example registers an on-premises instance with a specified stack from a separate workstation. The instance is identified by its hostname, ``host1``. The ``--override-...`` arguments direct AWS OpsWorks to display ``webserver1`` as the host name and ``192.0.2.3`` and ``10.0.0.2`` as the instance's public and private IP addresses, respectively. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --override-hostname webserver1 --override-public-ip 192.0.2.3 --override-private-ip 10.0.0.2 host1 The following example registers an on-premises instance with a specified stack from a separate workstation. The instance is identified by its IP address. ``register`` logs into the instance using the specified SSH username and private key file. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --ssh-username admin --ssh-private-key ssh_private_key 192.0.2.3 The following example registers an existing on-premises instance with a specified stack from a separate workstation. The command logs into the instance using a custom SSH command string that specifies the SSH password and the instance's IP address. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --override-ssh "sshpass -p 'mypassword' ssh your-user@192.0.2.3" The following example registers the on-premises instance that is running the ``register`` command. Log in to the instance with SSH and run ``register`` with the ``--local`` argument instead of an instance ID or hostname. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --local *Output*: The following is typical output for registering an EC2 instance. :: Warning: Permanently added '52.11.41.206' (ECDSA) to the list of known hosts. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6403k 100 6403k 0 0 2121k 0 0:00:03 0:00:03 --:--:-- 2121k [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Initializing AWS OpsWorks environment [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Running on Ubuntu [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Checking if OS is supported [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Running on supported OS [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Setup motd [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Executing: ln -sf --backup /etc/motd.opsworks-static /etc/motd [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Enabling multiverse repositories [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Customizing APT environment [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Installing system packages [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Executing: dpkg --configure -a [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Executing with retry: apt-get update [Tue, 24 Feb 2015 20:49:13 +0000] opsworks-init: Executing: apt-get install -y ruby ruby-dev libicu-dev libssl-dev libxslt-dev libxml2-dev libyaml-dev monit [Tue, 24 Feb 2015 20:50:13 +0000] opsworks-init: Using assets bucket from environment: 'opsworks-instance-assets-us-east-1.s3.amazonaws.com'. [Tue, 24 Feb 2015 20:50:13 +0000] opsworks-init: Installing Ruby for the agent [Tue, 24 Feb 2015 20:50:13 +0000] opsworks-init: Executing: /tmp/opsworks-agent-installer.YgGq8wF3UUre6yDy/opsworks-agent-installer/opsworks-agent/bin/installer_wrapper.sh -r -R opsworks-instance-assets-us-east-1.s3.amazonaws.com [Tue, 24 Feb 2015 20:50:44 +0000] opsworks-init: Starting the installer Instance successfully registered. Instance ID: 4d6d1710-ded9-42a1-b08e-b043ad7af1e2 Connection to 52.11.41.206 closed. **More Information** For more information, see `Registering an Instance with an AWS OpsWorks Stack`_ in the *AWS OpsWorks User Guide*. .. _`Registering an Instance with an AWS OpsWorks Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-register.html
Submit
FILE
FOLDER
Name
Size
Permission
Action
assign-instance.rst
557 bytes
0644
assign-volume.rst
905 bytes
0644
associate-elastic-ip.rst
496 bytes
0644
attach-elastic-load-balancer.rst
523 bytes
0644
create-app.rst
2005 bytes
0644
create-deployment.rst
2513 bytes
0644
create-instance.rst
1042 bytes
0644
create-layer.rst
586 bytes
0644
create-stack.rst
1081 bytes
0644
create-user-profile.rst
1173 bytes
0644
delete-app.rst
525 bytes
0644
delete-instance.rst
1092 bytes
0644
delete-layer.rst
712 bytes
0644
delete-stack.rst
733 bytes
0644
delete-user-profile.rst
765 bytes
0644
deregister-elastic-ip.rst
520 bytes
0644
deregister-instance.rst
531 bytes
0644
deregister-rds-db-instance.rst
791 bytes
0644
deregister-volume.rst
638 bytes
0644
describe-apps.rst
1066 bytes
0644
describe-commands.rst
1988 bytes
0644
describe-deployments.rst
1717 bytes
0644
describe-elastic-ips.rst
608 bytes
0644
describe-elastic-load-balancers.rst
1150 bytes
0644
describe-instances.rst
3400 bytes
0644
describe-layers.rst
5773 bytes
0644
describe-load-based-auto-scaling.rst
1253 bytes
0644
describe-my-user-profile.rst
838 bytes
0644
describe-permissions.rst
903 bytes
0644
describe-raid-arrays.rst
1073 bytes
0644
describe-rds-db-instances.rst
1013 bytes
0644
describe-stack-summary.rst
770 bytes
0644
describe-stacks.rst
2271 bytes
0644
describe-timebased-auto-scaling.rst
1228 bytes
0644
describe-user-profiles.rst
922 bytes
0644
describe-volumes.rst
835 bytes
0644
detach-elastic-load-balancer.rst
521 bytes
0644
disassociate-elastic-ip.rst
454 bytes
0644
get-hostname-suggestion.rst
695 bytes
0644
reboot-instance.rst
448 bytes
0644
register-elastic-ip.rst
697 bytes
0644
register-rds-db-instance.rst
918 bytes
0644
register-volume.rst
639 bytes
0644
register.rst
7115 bytes
0644
set-load-based-auto-scaling.rst
1350 bytes
0644
set-permission.rst
1268 bytes
0644
set-time-based-auto-scaling.rst
1082 bytes
0644
start-instance.rst
851 bytes
0644
start-stack.rst
520 bytes
0644
stop-instance.rst
762 bytes
0644
stop-stack.rst
519 bytes
0644
unassign-instance.rst
524 bytes
0644
unassign-volume.rst
719 bytes
0644
update-app.rst
417 bytes
0644
update-elastic-ip.rst
436 bytes
0644
update-instance.rst
485 bytes
0644
update-layer.rst
519 bytes
0644
update-my-user-profile.rst
723 bytes
0644
update-rds-db-instance.rst
758 bytes
0644
update-volume.rst
758 bytes
0644
N4ST4R_ID | Naxtarrr