Create a Fleet - Amazon SageMaker
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).

Create a Fleet

You can create a fleet programmatically with the Amazon SDK for Python (Boto3) or through the SageMaker console https://console.amazonaws.cn/sagemaker.

Create a Fleet (Boto3)

Use the CreateDeviceFleet API to create a fleet. Specify a name for the fleet, your Amazon IoT Role ARN for the RoleArn field, as well as an Amazon S3 URI where you want the device to store sampled data.

You can optionally include a description of the fleet, tags, and an Amazon KMS Key ID.

import boto3 # Create SageMaker client so you can interact and manage SageMaker resources sagemaker_client = boto3.client("sagemaker", region_name="aws-region") sagemaker_client.create_device_fleet( DeviceFleetName="sample-fleet-name", RoleArn="arn:aws:iam::999999999:role/rolename", # IoT Role ARN Description="fleet description", OutputConfig={ S3OutputLocation="s3://bucket/", KMSKeyId: "1234abcd-12ab-34cd-56ef-1234567890ab", }, Tags=[ { "Key": "string", "Value" : "string" } ], )

An Amazon IoT Role Alias is created for you when you create a device fleet. The Amazon IoT role alias provides a mechanism for connected devices to authenticate to Amazon IoT using X.509 certificates and then obtain short-lived Amazon credentials from an IAM role that is associated with the Amazon IoT role alias.

Use DescribeDeviceFleet to get the role alias name and ARN.

# Print Amazon Resource Name (ARN) and alias that has access # to Amazon Internet of Things (IoT). sagemaker_client.describe_device_fleet(DeviceFleetName=device_fleet_name)['IotRoleAlias']

Use DescribeDeviceFleet API to get a description of fleets you created.

sagemaker_client.describe_device_fleet( DeviceFleetName="sample-fleet-name" )

By default, it returns the name of the fleet, the device fleet ARN, the Amazon S3 bucket URI, the IAM role, the role alias created in Amazon IoT, a timestamp of when the fleet was created, and a timestamp of when the fleet was last modified.

{ "DeviceFleetName": "sample-fleet-name", "DeviceFleetArn": "arn:aws:sagemaker:us-west-2:9999999999:device-fleet/sample-fleet-name", "IAMRole": "arn:aws:iam::999999999:role/rolename", "Description": "this is a sample fleet", "IoTRoleAlias": "arn:aws:iot:us-west-2:9999999999:rolealias/SagemakerEdge-sample-fleet-name" "OutputConfig": { "S3OutputLocation": "s3://bucket/folder", "KMSKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab" }, "CreationTime": "1600977370", "LastModifiedTime": "1600977370"}

Create a Fleet (Console)

You can create a Edge Manager packaging job using the Amazon SageMaker console at https://console.amazonaws.cn/sagemaker.

  1. In the SageMaker console, choose Edge Manager and then choose Edge device fleets.

  2. Choose Create device fleet.

  3. Enter a name for the device fleet in the Device fleet name field. Choose Next.

  4. On the Output configuration page, specify the Amazon S3 bucket URI where you want to store sample data from your device fleet. You can optionally add an encryption key as well by electing an existing Amazon KMS key from the dropdown list or by entering a key’s ARN. Choose Submit.

  5. Choose the name of your device fleet to be redirected to the device fleet details. This page displays the name of the device fleet, ARN, description (if you provided one), date the fleet was created, last time the fleet was modified, Amazon S3 bucket URI, Amazon KMS key ID (if provided), Amazon IoT alias (if provided), and IAM role. If you added tags, they appear in the Device fleet tags section.