Use CreateActivation with an Amazon SDK or CLI - Amazon Systems Manager
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use CreateActivation with an Amazon SDK or CLI

The following code examples show how to use CreateActivation.

CLI
Amazon CLI

To create a managed instance activation

The following create-activation example creates a managed instance activation.

aws ssm create-activation \ --default-instance-name "HybridWebServers" \ --iam-role "HybridWebServersRole" \ --registration-limit 5

Output:

{ "ActivationId": "5743558d-563b-4457-8682-d16c3EXAMPLE", "ActivationCode": "dRmgnYaFv567vEXAMPLE" }

For more information, see Step 4: Create a Managed-Instance Activation for a Hybrid Environment in the Amazon Systems Manager User Guide.

PowerShell
Tools for PowerShell

Example 1: This example creates a managed instance.

New-SSMActivation -DefaultInstanceName "MyWebServers" -IamRole "SSMAutomationRole" -RegistrationLimit 10

Output:

ActivationCode ActivationId -------------- ------------ KWChhOxBTiwDcKE9BlKC 08e51e79-1e36-446c-8e63-9458569c1363
  • For API details, see CreateActivation in Amazon Tools for PowerShell Cmdlet Reference.

For a complete list of Amazon SDK developer guides and code examples, see Using Systems Manager with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.