func CreateDeviceFleet()

in aws/sagemaker.go [39:62]


func CreateDeviceFleet(client SagemakerClient, fleetName *string, role *iamTypes.Role, s3Bucket *string) {
	s3OutputLocation := fmt.Sprintf("s3://%s/%s", *s3Bucket, *fleetName)

	describeDeviceFleetOutput := GetDeviceFleet(client, fleetName)

	if describeDeviceFleetOutput == nil {
		_, err := client.CreateDeviceFleet(context.TODO(), &sagemaker.CreateDeviceFleetInput{
			DeviceFleetName: fleetName,
			OutputConfig: &types.EdgeOutputConfig{
				S3OutputLocation: &s3OutputLocation,
			},
			RoleArn: role.Arn,
		})

		if err != nil {
			var oe *smithy.OperationError
			if errors.As(err, &oe) {
				log.Printf("failed to call service: %s, operation: %s, error: %v", oe.Service(), oe.Operation(), oe.Unwrap())
			}
			log.Fatalf("Failed to create device fleet %s. Encountered error %s\n", *fleetName, reflect.TypeOf(err))
		}

	}
}