<a id="cli-aws-sagemaker-create-feature-group"></a>

# create-feature-group

## Description

Create a new `FeatureGroup` . A `FeatureGroup` is a group of `Features` defined in the `FeatureStore` to describe a `Record` .

The `FeatureGroup` defines the schema and features contained in the `FeatureGroup` . A `FeatureGroup` definition is composed of a list of `Features` , a `RecordIdentifierFeatureName` , an `EventTimeFeatureName` and configurations for its `OnlineStore` and `OfflineStore` . Check [Amazon Web Services service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) to see the `FeatureGroup` s quota for your Amazon Web Services account.

Note that it can take approximately 10-15 minutes to provision an `OnlineStore`  `FeatureGroup` with the `InMemory`  `StorageType` .

#### WARNING
You must include at least one of `OnlineStoreConfig` and `OfflineStoreConfig` to create a `FeatureGroup` .

See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateFeatureGroup)

## Synopsis

```
  create-feature-group
--feature-group-name <value>
--record-identifier-feature-name <value>
--event-time-feature-name <value>
--feature-definitions <value>
[--online-store-config <value>]
[--offline-store-config <value>]
[--throughput-config <value>]
[--role-arn <value>]
[--description <value>]
[--tags <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
```

## Options

`--feature-group-name` (string) [required]

> The name of the `FeatureGroup` . The name must be unique within an Amazon Web Services Region in an Amazon Web Services account.

> The name:

> * Must start with an alphanumeric character.
> * Can only include alphanumeric characters, underscores, and hyphens. Spaces are not allowed.

> Constraints:

> * min: `1`
> * max: `64`
> * pattern: `[a-zA-Z0-9]([_-]*[a-zA-Z0-9]){0,63}`

`--record-identifier-feature-name` (string) [required]

> The name of the `Feature` whose value uniquely identifies a `Record` defined in the `FeatureStore` . Only the latest record per identifier value will be stored in the `OnlineStore` . `RecordIdentifierFeatureName` must be one of feature definitions’ names.

> You use the `RecordIdentifierFeatureName` to access data in a `FeatureStore` .

> This name:

> * Must start with an alphanumeric character.
> * Can only contains alphanumeric characters, hyphens, underscores. Spaces are not allowed.

> Constraints:

> * min: `1`
> * max: `64`
> * pattern: `[a-zA-Z0-9]([-_]*[a-zA-Z0-9]){0,63}`

`--event-time-feature-name` (string) [required]

> The name of the feature that stores the `EventTime` of a `Record` in a `FeatureGroup` .

> An `EventTime` is a point in time when a new event occurs that corresponds to the creation or update of a `Record` in a `FeatureGroup` . All `Records` in the `FeatureGroup` must have a corresponding `EventTime` .

> An `EventTime` can be a `String` or `Fractional` .

> * `Fractional` : `EventTime` feature values must be a Unix timestamp in seconds.
> * `String` : `EventTime` feature values must be an ISO-8601 string in the format. The following formats are supported `yyyy-MM-dd'T'HH:mm:ssZ` and `yyyy-MM-dd'T'HH:mm:ss.SSSZ` where `yyyy` , `MM` , and `dd` represent the year, month, and day respectively and `HH` , `mm` , `ss` , and if applicable, `SSS` represent the hour, month, second and milliseconds respsectively. `'T'` and `Z` are constants.

> Constraints:

> * min: `1`
> * max: `64`
> * pattern: `[a-zA-Z0-9]([-_]*[a-zA-Z0-9]){0,63}`

`--feature-definitions` (list) [required]

> A list of `Feature` names and types. `Name` and `Type` is compulsory per `Feature` .

> Valid feature `FeatureType` s are `Integral` , `Fractional` and `String` .

> > `FeatureName` s cannot be any of the following: `is_deleted` , `write_time` , `api_invocation_time`

> You can create up to 2,500 `FeatureDefinition` s per `FeatureGroup` .

> Constraints:

> * min: `1`
> * max: `2500`

> (structure)

> > A list of features. You must include `FeatureName` and `FeatureType` . Valid feature `FeatureType` s are `Integral` , `Fractional` and `String` .

> > FeatureName -> (string) [required]

> > > The name of a feature. The type must be a string. `FeatureName` cannot be any of the following: `is_deleted` , `write_time` , `api_invocation_time` .

> > > The name:

> > > * Must start with an alphanumeric character.
> > > * Can only include alphanumeric characters, underscores, and hyphens. Spaces are not allowed.

> > > Constraints:

> > > * min: `1`
> > > * max: `64`
> > > * pattern: `[a-zA-Z0-9]([-_]*[a-zA-Z0-9]){0,63}`

> > FeatureType -> (string) [required]

> > > The value type of a feature. Valid values are Integral, Fractional, or String.

> > > Possible values:

> > > * `Integral`
> > > * `Fractional`
> > > * `String`

> > CollectionType -> (string)

> > > A grouping of elements where each element within the collection must have the same feature type (`String` , `Integral` , or `Fractional` ).

> > > * `List` : An ordered collection of elements.
> > > * `Set` : An unordered collection of unique elements.
> > > * `Vector` : A specialized list that represents a fixed-size array of elements. The vector dimension is determined by you. Must have elements with fractional feature types.

> > > Possible values:

> > > * `List`
> > > * `Set`
> > > * `Vector`

> > CollectionConfig -> (tagged union structure)

> > > Configuration for your collection.

> > > #### NOTE
> > > This is a Tagged Union structure. Only one of the following top level keys can be set: `VectorConfig`.

> > > VectorConfig -> (structure)

> > > > Configuration for your vector collection type.

> > > > * `Dimension` : The number of elements in your vector.

> > > > Dimension -> (integer) [required]

> > > > > The number of elements in your vector.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `8192`

Shorthand Syntax:

```
FeatureName=string,FeatureType=string,CollectionType=string,CollectionConfig={VectorConfig={Dimension=integer}} ...
```

JSON Syntax:

```json
[
  {
    "FeatureName": "string",
    "FeatureType": "Integral"|"Fractional"|"String",
    "CollectionType": "List"|"Set"|"Vector",
    "CollectionConfig": {
      "VectorConfig": {
        "Dimension": integer
      }
    }
  }
  ...
]
```

`--online-store-config` (structure)

> You can turn the `OnlineStore` on or off by specifying `True` for the `EnableOnlineStore` flag in `OnlineStoreConfig` .

> You can also include an Amazon Web Services KMS key ID (`KMSKeyId` ) for at-rest encryption of the `OnlineStore` .

> The default value is `False` .

> SecurityConfig -> (structure)

> > Use to specify KMS Key ID (`KMSKeyId` ) for at-rest encryption of your `OnlineStore` .

> > KmsKeyId -> (string)

> > > The Amazon Web Services Key Management Service (KMS) key ARN that SageMaker Feature Store uses to encrypt the Amazon S3 objects at rest using Amazon S3 server-side encryption.

> > > The caller (either user or IAM role) of `CreateFeatureGroup` must have below permissions to the `OnlineStore`  `KmsKeyId` :

> > > * `"kms:Encrypt"`
> > > * `"kms:Decrypt"`
> > > * `"kms:DescribeKey"`
> > > * `"kms:CreateGrant"`
> > > * `"kms:RetireGrant"`
> > > * `"kms:ReEncryptFrom"`
> > > * `"kms:ReEncryptTo"`
> > > * `"kms:GenerateDataKey"`
> > > * `"kms:ListAliases"`
> > > * `"kms:ListGrants"`
> > > * `"kms:RevokeGrant"`

> > > The caller (either user or IAM role) to all DataPlane operations (`PutRecord` , `GetRecord` , `DeleteRecord` ) must have the following permissions to the `KmsKeyId` :

> > > * `"kms:Decrypt"`

> > > Constraints:

> > > * min: `0`
> > > * max: `2048`
> > > * pattern: `[a-zA-Z0-9:/_-]*`

> EnableOnlineStore -> (boolean)

> > Turn `OnlineStore` off by specifying `False` for the `EnableOnlineStore` flag. Turn `OnlineStore` on by specifying `True` for the `EnableOnlineStore` flag.

> > The default value is `False` .

> TtlDuration -> (structure)

> > Time to live duration, where the record is hard deleted after the expiration time is reached; `ExpiresAt` = `EventTime` + `TtlDuration` . For information on HardDelete, see the [DeleteRecord](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_feature_store_DeleteRecord.html) API in the Amazon SageMaker API Reference guide.

> > Unit -> (string)

> > > > `TtlDuration` time unit.

> > > Possible values:

> > > * `Seconds`
> > > * `Minutes`
> > > * `Hours`
> > > * `Days`
> > > * `Weeks`

> > Value -> (integer)

> > > > `TtlDuration` time value.

> > > Constraints:

> > > * min: `1`

> StorageType -> (string)

> > Option for different tiers of low latency storage for real-time data retrieval.

> > * `Standard` : A managed low latency data store for feature groups.
> > * `Standard_V2` : A managed low latency data store for feature groups that supports partial updates to individual features using the [UpdateRecord](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_feature_store_UpdateRecord.html) operation. Choose this storage type at feature group creation time if your use case requires updating specific feature values without rewriting the entire record.
> > * `InMemory` : A managed data store for feature groups that supports very low latency retrieval.

> > Possible values:

> > * `Standard`
> > * `Standard_V2`
> > * `InMemory`

Shorthand Syntax:

```
SecurityConfig={KmsKeyId=string},EnableOnlineStore=boolean,TtlDuration={Unit=string,Value=integer},StorageType=string
```

JSON Syntax:

```json
{
  "SecurityConfig": {
    "KmsKeyId": "string"
  },
  "EnableOnlineStore": true|false,
  "TtlDuration": {
    "Unit": "Seconds"|"Minutes"|"Hours"|"Days"|"Weeks",
    "Value": integer
  },
  "StorageType": "Standard"|"Standard_V2"|"InMemory"
}
```

`--offline-store-config` (structure)

> Use this to configure an `OfflineFeatureStore` . This parameter allows you to specify:

> * The Amazon Simple Storage Service (Amazon S3) location of an `OfflineStore` .
> * A configuration for an Amazon Web Services Glue or Amazon Web Services Hive data catalog.
> * An KMS encryption key to encrypt the Amazon S3 location used for `OfflineStore` . If KMS encryption key is not specified, by default we encrypt all data at rest using Amazon Web Services KMS key. By defining your [bucket-level key](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-key.html) for SSE, you can reduce Amazon Web Services KMS requests costs by up to 99 percent.
> * Format for the offline store table. Supported formats are Glue (Default) and [Apache Iceberg](https://iceberg.apache.org/) .

> To learn more about this parameter, see [OfflineStoreConfig](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_OfflineStoreConfig.html) .

> S3StorageConfig -> (structure) [required]

> > The Amazon Simple Storage (Amazon S3) location of `OfflineStore` .

> > S3Uri -> (string) [required]

> > > The S3 URI, or location in Amazon S3, of `OfflineStore` .

> > > S3 URIs have a format similar to the following: `s3://example-bucket/prefix/` .

> > > Constraints:

> > > * min: `0`
> > > * max: `1024`
> > > * pattern: `(https|s3)://([^/]+)/?(.*)`

> > KmsKeyId -> (string)

> > > The Amazon Web Services Key Management Service (KMS) key ARN of the key used to encrypt any objects written into the `OfflineStore` S3 location.

> > > The IAM `roleARN` that is passed as a parameter to `CreateFeatureGroup` must have below permissions to the `KmsKeyId` :

> > > * `"kms:GenerateDataKey"`

> > > Constraints:

> > > * min: `0`
> > > * max: `2048`
> > > * pattern: `[a-zA-Z0-9:/_-]*`

> > ResolvedOutputS3Uri -> (string)

> > > The S3 path where offline records are written.

> > > Constraints:

> > > * min: `0`
> > > * max: `1024`
> > > * pattern: `(https|s3)://([^/]+)/?(.*)`

> DisableGlueTableCreation -> (boolean)

> > Set to `True` to disable the automatic creation of an Amazon Web Services Glue table when configuring an `OfflineStore` . If set to `True` and `DataCatalogConfig` is provided, Feature Store associates the provided catalog configuration with the feature group without creating a table. In this case, you are responsible for creating and managing the Glue table. If set to `True` without `DataCatalogConfig` , no Glue table is created or associated with the feature group. The `Iceberg` table format is only supported when this is set to `False` .

> > If set to `False` and `DataCatalogConfig` is provided, Feature Store creates the table using the specified names. If set to `False` without `DataCatalogConfig` , Feature Store auto-generates the table name following [Athena’s naming recommendations](https://docs.aws.amazon.com/athena/latest/ug/tables-databases-columns-names.html) . This applies to both Glue and Apache Iceberg table formats.

> > The default value is `False` .

> DataCatalogConfig -> (structure)

> > The meta data of the Glue table for the `OfflineStore` . If not provided, Feature Store auto-generates the table name, database, and catalog when the `OfflineStore` is created. You can optionally provide this configuration to specify custom values. This applies to both Glue and Apache Iceberg table formats.

> > TableName -> (string) [required]

> > > The name of the Glue table.

> > > Constraints:

> > > * min: `1`
> > > * max: `255`
> > > * pattern: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*`

> > Catalog -> (string) [required]

> > > The name of the Glue table catalog.

> > > Constraints:

> > > * min: `1`
> > > * max: `255`
> > > * pattern: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*`

> > Database -> (string) [required]

> > > The name of the Glue table database.

> > > Constraints:

> > > * min: `1`
> > > * max: `255`
> > > * pattern: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*`

> TableFormat -> (string)

> > Format for the offline store table. Supported formats are Glue (Default) and [Apache Iceberg](https://iceberg.apache.org/) .

> > Possible values:

> > * `Default`
> > * `Glue`
> > * `Iceberg`

Shorthand Syntax:

```
S3StorageConfig={S3Uri=string,KmsKeyId=string,ResolvedOutputS3Uri=string},DisableGlueTableCreation=boolean,DataCatalogConfig={TableName=string,Catalog=string,Database=string},TableFormat=string
```

JSON Syntax:

```json
{
  "S3StorageConfig": {
    "S3Uri": "string",
    "KmsKeyId": "string",
    "ResolvedOutputS3Uri": "string"
  },
  "DisableGlueTableCreation": true|false,
  "DataCatalogConfig": {
    "TableName": "string",
    "Catalog": "string",
    "Database": "string"
  },
  "TableFormat": "Default"|"Glue"|"Iceberg"
}
```

`--throughput-config` (structure)

> Used to set feature group throughput configuration. There are two modes: `ON_DEMAND` and `PROVISIONED` . With on-demand mode, you are charged for data reads and writes that your application performs on your feature group. You do not need to specify read and write throughput because Feature Store accommodates your workloads as they ramp up and down. You can switch a feature group to on-demand only once in a 24 hour period. With provisioned throughput mode, you specify the read and write capacity per second that you expect your application to require, and you are billed based on those limits. Exceeding provisioned throughput will result in your requests being throttled.

> Note: `PROVISIONED` throughput mode is supported only for feature groups that are offline-only, or use the \` `Standard` [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_OnlineStoreConfig.html#sagemaker-Type-OnlineStoreConfig](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_OnlineStoreConfig.html#sagemaker-Type-OnlineStoreConfig)-StorageType\`_\_ tier online store.

> ThroughputMode -> (string) [required]

> > The mode used for your feature group throughput: `ON_DEMAND` or `PROVISIONED` .

> > Possible values:

> > * `OnDemand`
> > * `Provisioned`

> ProvisionedReadCapacityUnits -> (integer)

> > For provisioned feature groups with online store enabled, this indicates the read throughput you are billed for and can consume without throttling.

> > This field is not applicable for on-demand feature groups.

> > Constraints:

> > * min: `0`
> > * max: `10000000`

> ProvisionedWriteCapacityUnits -> (integer)

> > For provisioned feature groups, this indicates the write throughput you are billed for and can consume without throttling.

> > This field is not applicable for on-demand feature groups.

> > Constraints:

> > * min: `0`
> > * max: `10000000`

Shorthand Syntax:

```
ThroughputMode=string,ProvisionedReadCapacityUnits=integer,ProvisionedWriteCapacityUnits=integer
```

JSON Syntax:

```json
{
  "ThroughputMode": "OnDemand"|"Provisioned",
  "ProvisionedReadCapacityUnits": integer,
  "ProvisionedWriteCapacityUnits": integer
}
```

`--role-arn` (string)

> The Amazon Resource Name (ARN) of the IAM execution role used to persist data into the `OfflineStore` if an `OfflineStoreConfig` is provided.

> Constraints:

> * min: `20`
> * max: `2048`
> * pattern: `arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+`

`--description` (string)

> A free-form description of a `FeatureGroup` .

> Constraints:

> * min: `0`
> * max: `128`

`--tags` (list)

> Tags used to identify `Features` in each `FeatureGroup` .

> Constraints:

> * min: `0`
> * max: `50`

> (structure)

> > A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

> > You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see [AddTags](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AddTags.html) .

> > For more information on adding metadata to your Amazon Web Services resources with tagging, see [Tagging Amazon Web Services resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) . For advice on best practices for managing Amazon Web Services resources with tagging, see [Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy](https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf) .

> > Key -> (string) [required]

> > > The tag key. Tag keys must be unique per resource.

> > > Constraints:

> > > * min: `1`
> > > * max: `128`
> > > * pattern: `([\p{L}\p{Z}\p{N}_.:/=+\-@]*)`

> > Value -> (string) [required]

> > > The tag value.

> > > Constraints:

> > > * min: `0`
> > > * max: `256`
> > > * pattern: `([\p{L}\p{Z}\p{N}_.:/=+\-@]*)`

Shorthand Syntax:

```
Key=string,Value=string ...
```

JSON Syntax:

```json
[
  {
    "Key": "string",
    "Value": "string"
  }
  ...
]
```

`--cli-input-json` | `--cli-input-yaml` (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by `--generate-cli-skeleton`. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with `--cli-input-yaml`.

`--generate-cli-skeleton` (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value `input`, prints a sample input JSON that can be used as an argument for `--cli-input-json`. Similarly, if provided `yaml-input` it will print a sample input YAML that can be used with `--cli-input-yaml`. If provided with the value `output`, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

## Global Options

`--debug` (boolean)

Turn on debug logging.

`--endpoint-url` (string)

Override command’s default URL with the given URL.

`--no-verify-ssl` (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

`--no-paginate` (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

`--output` (string)

The formatting style for command output.

* json
* text
* table
* yaml
* yaml-stream
* off

`--query` (string)

A JMESPath query to use in filtering the response data.

`--profile` (string)

Use a specific profile from your credential file.

`--region` (string)

The region to use. Overrides config/env settings.

`--version` (string)

Display the version of this tool.

`--color` (string)

Turn on/off color output.

* on
* off
* auto

`--no-sign-request` (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

`--ca-bundle` (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

`--cli-read-timeout` (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

`--cli-connect-timeout` (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

`--cli-binary-format` (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob `fileb://` will always be treated as binary and use the file contents directly regardless of the `cli-binary-format` setting. When using `file://` the file contents will need to properly formatted for the configured `cli-binary-format`.

* base64
* raw-in-base64-out

`--no-cli-pager` (boolean)

Disable cli pager for output.

`--cli-auto-prompt` (boolean)

Automatically prompt for CLI input parameters.

`--no-cli-auto-prompt` (boolean)

Disable automatically prompt for CLI input parameters.

`--cli-error-format` (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

* legacy
* json
* yaml
* text
* table
* enhanced

`--help` (boolean)

Display help for the command/subcommand.

## Output

FeatureGroupArn -> (string)

> The Amazon Resource Name (ARN) of the `FeatureGroup` . This is a unique identifier for the feature group.

> Constraints:

> * min: `0`
> * max: `256`
> * pattern: `arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:feature-group/.*`
