

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::IoTAnalytics::Channel
<a name="aws-resource-iotanalytics-channel"></a>

The AWS::IoTAnalytics::Channel resource collects data from an MQTT topic and archives the raw, unprocessed messages before publishing the data to a pipeline. For more information, see [ How to Use AWS IoT Analytics](https://docs.aws.amazon.com/iotanalytics/latest/userguide/welcome.html#aws-iot-analytics-how) in the *AWS IoT Analytics User Guide*. 

## Syntax
<a name="aws-resource-iotanalytics-channel-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-iotanalytics-channel-syntax.json"></a>

```
{
  "Type" : "AWS::IoTAnalytics::Channel",
  "Properties" : {
      "[ChannelName](#cfn-iotanalytics-channel-channelname)" : String,
      "[ChannelStorage](#cfn-iotanalytics-channel-channelstorage)" : ChannelStorage,
      "[RetentionPeriod](#cfn-iotanalytics-channel-retentionperiod)" : RetentionPeriod,
      "[Tags](#cfn-iotanalytics-channel-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-iotanalytics-channel-syntax.yaml"></a>

```
Type: AWS::IoTAnalytics::Channel
Properties:
  [ChannelName](#cfn-iotanalytics-channel-channelname): String
  [ChannelStorage](#cfn-iotanalytics-channel-channelstorage): 
    ChannelStorage
  [RetentionPeriod](#cfn-iotanalytics-channel-retentionperiod): 
    RetentionPeriod
  [Tags](#cfn-iotanalytics-channel-tags): 
    - Tag
```

## Properties
<a name="aws-resource-iotanalytics-channel-properties"></a>

`ChannelName`  <a name="cfn-iotanalytics-channel-channelname"></a>
The name of the channel.  
*Required*: No  
*Type*: String  
*Pattern*: `(^(?!_{2}))(^[a-zA-Z0-9_]+$)`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ChannelStorage`  <a name="cfn-iotanalytics-channel-channelstorage"></a>
Where channel data is stored.  
*Required*: No  
*Type*: [ChannelStorage](aws-properties-iotanalytics-channel-channelstorage.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RetentionPeriod`  <a name="cfn-iotanalytics-channel-retentionperiod"></a>
How long, in days, message data is kept for the channel.  
*Required*: No  
*Type*: [RetentionPeriod](aws-properties-iotanalytics-channel-retentionperiod.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-iotanalytics-channel-tags"></a>
Metadata which can be used to manage the channel.  
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).  
*Required*: No  
*Type*: Array of [Tag](aws-properties-iotanalytics-channel-tag.md)  
*Minimum*: `1`  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-resource-iotanalytics-channel--examples"></a>



**Topics**
+ [Simple Channel](#aws-resource-iotanalytics-channel--examples--Simple_Channel)
+ [Complex Channel](#aws-resource-iotanalytics-channel--examples--Complex_Channel)

### Simple Channel
<a name="aws-resource-iotanalytics-channel--examples--Simple_Channel"></a>

The following example creates a simple channel that uses service-managed channel storage.

#### JSON
<a name="aws-resource-iotanalytics-channel--examples--Simple_Channel--json"></a>

```
{
    "Description": "Create a simple Channel",
    "Resources": {
        "Channel": {
            "Type": "AWS::IoTAnalytics::Channel",
            "Properties": {
                "ChannelName": "SimpleChannel"
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-iotanalytics-channel--examples--Simple_Channel--yaml"></a>

```
---
Description: "Create a simple Channel"
Resources:
  Channel:
    Type: "AWS::IoTAnalytics::Channel"
    Properties:
      ChannelName: "SimpleChannel"
```

### Complex Channel
<a name="aws-resource-iotanalytics-channel--examples--Complex_Channel"></a>

The following example creates a complex channel.

#### JSON
<a name="aws-resource-iotanalytics-channel--examples--Complex_Channel--json"></a>

```
{
    "Description": "Create a complex channel",
    "Resources": {
        "Channel": {
            "Type": "AWS::IoTAnalytics::Channel",
            "Properties": {
                "ChannelName": "ComplexChannel",
                "RetentionPeriod": {
                    "Unlimited": false,
                    "NumberOfDays": 10
                },
                "Tags": [
                    {
                        "Key": "keyname1",
                        "Value": "value1"
                    },
                    {
                        "Key": "keyname2",
                        "Value": "value2"
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-iotanalytics-channel--examples--Complex_Channel--yaml"></a>

```
---
Description: "Create a complex channel"
Resources:
  Channel:
    Type: "AWS::IoTAnalytics::Channel"
    Properties:
      ChannelName: "ComplexChannel"
      RetentionPeriod:
        Unlimited: false
        NumberOfDays: 10
      Tags:
        -
          Key: "keyname1"
          Value: "value1"
        -
          Key: "keyname2"
          Value: "value2"
```

## See also
<a name="aws-resource-iotanalytics-channel--seealso"></a>
+ [How to Use AWS IoT Analytics](https://docs.aws.amazon.com/iotanalytics/latest/userguide/welcome.html#aws-iot-analytics-how) in the *AWS IoT Analytics User Guide*
+ [CreateChannel](https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_CreateChannel.html) in the *AWS IoT Analytics API Reference*

# AWS::IoTAnalytics::Channel ChannelStorage
<a name="aws-properties-iotanalytics-channel-channelstorage"></a>

Where channel data is stored. You may choose one of `serviceManagedS3`, `customerManagedS3` storage. If not specified, the default is `serviceManagedS3`. This can't be changed after creation of the channel.

## Syntax
<a name="aws-properties-iotanalytics-channel-channelstorage-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-iotanalytics-channel-channelstorage-syntax.json"></a>

```
{
  "[CustomerManagedS3](#cfn-iotanalytics-channel-channelstorage-customermanageds3)" : CustomerManagedS3,
  "[ServiceManagedS3](#cfn-iotanalytics-channel-channelstorage-servicemanageds3)" : Json
}
```

### YAML
<a name="aws-properties-iotanalytics-channel-channelstorage-syntax.yaml"></a>

```
  [CustomerManagedS3](#cfn-iotanalytics-channel-channelstorage-customermanageds3): 
    CustomerManagedS3
  [ServiceManagedS3](#cfn-iotanalytics-channel-channelstorage-servicemanageds3): Json
```

## Properties
<a name="aws-properties-iotanalytics-channel-channelstorage-properties"></a>

`CustomerManagedS3`  <a name="cfn-iotanalytics-channel-channelstorage-customermanageds3"></a>
Used to store channel data in an S3 bucket that you manage. If customer managed storage is selected, the `retentionPeriod` parameter is ignored. You can't change the choice of S3 storage after the data store is created.  
*Required*: No  
*Type*: [CustomerManagedS3](aws-properties-iotanalytics-channel-customermanageds3.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ServiceManagedS3`  <a name="cfn-iotanalytics-channel-channelstorage-servicemanageds3"></a>
Used to store channel data in an S3 bucket managed by AWS IoT Analytics. You can't change the choice of S3 storage after the data store is created.  
*Required*: No  
*Type*: Json  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::IoTAnalytics::Channel CustomerManagedS3
<a name="aws-properties-iotanalytics-channel-customermanageds3"></a>

Used to store channel data in an S3 bucket that you manage.

## Syntax
<a name="aws-properties-iotanalytics-channel-customermanageds3-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-iotanalytics-channel-customermanageds3-syntax.json"></a>

```
{
  "[Bucket](#cfn-iotanalytics-channel-customermanageds3-bucket)" : String,
  "[KeyPrefix](#cfn-iotanalytics-channel-customermanageds3-keyprefix)" : String,
  "[RoleArn](#cfn-iotanalytics-channel-customermanageds3-rolearn)" : String
}
```

### YAML
<a name="aws-properties-iotanalytics-channel-customermanageds3-syntax.yaml"></a>

```
  [Bucket](#cfn-iotanalytics-channel-customermanageds3-bucket): String
  [KeyPrefix](#cfn-iotanalytics-channel-customermanageds3-keyprefix): String
  [RoleArn](#cfn-iotanalytics-channel-customermanageds3-rolearn): String
```

## Properties
<a name="aws-properties-iotanalytics-channel-customermanageds3-properties"></a>

`Bucket`  <a name="cfn-iotanalytics-channel-customermanageds3-bucket"></a>
The name of the S3 bucket in which channel data is stored.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9.\-_]*$`  
*Minimum*: `3`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`KeyPrefix`  <a name="cfn-iotanalytics-channel-customermanageds3-keyprefix"></a>
(Optional) The prefix used to create the keys of the channel data objects. Each object in an S3 bucket has a key that is its unique identifier within the bucket (each object in a bucket has exactly one key). The prefix must end with a forward slash (/).  
*Required*: No  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9!_.*'()/{}:-]*/$`  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RoleArn`  <a name="cfn-iotanalytics-channel-customermanageds3-rolearn"></a>
The ARN of the role that grants AWS IoT Analytics permission to interact with your Amazon S3 resources.  
*Required*: Yes  
*Type*: String  
*Minimum*: `20`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::IoTAnalytics::Channel RetentionPeriod
<a name="aws-properties-iotanalytics-channel-retentionperiod"></a>

How long, in days, message data is kept.

## Syntax
<a name="aws-properties-iotanalytics-channel-retentionperiod-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-iotanalytics-channel-retentionperiod-syntax.json"></a>

```
{
  "[NumberOfDays](#cfn-iotanalytics-channel-retentionperiod-numberofdays)" : Integer,
  "[Unlimited](#cfn-iotanalytics-channel-retentionperiod-unlimited)" : Boolean
}
```

### YAML
<a name="aws-properties-iotanalytics-channel-retentionperiod-syntax.yaml"></a>

```
  [NumberOfDays](#cfn-iotanalytics-channel-retentionperiod-numberofdays): Integer
  [Unlimited](#cfn-iotanalytics-channel-retentionperiod-unlimited): Boolean
```

## Properties
<a name="aws-properties-iotanalytics-channel-retentionperiod-properties"></a>

`NumberOfDays`  <a name="cfn-iotanalytics-channel-retentionperiod-numberofdays"></a>
The number of days that message data is kept. The `unlimited` parameter must be false.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `2147483647`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Unlimited`  <a name="cfn-iotanalytics-channel-retentionperiod-unlimited"></a>
If true, message data is kept indefinitely.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::IoTAnalytics::Channel Tag
<a name="aws-properties-iotanalytics-channel-tag"></a>

A set of key-value pairs that are used to manage the resource.

## Syntax
<a name="aws-properties-iotanalytics-channel-tag-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-iotanalytics-channel-tag-syntax.json"></a>

```
{
  "[Key](#cfn-iotanalytics-channel-tag-key)" : String,
  "[Value](#cfn-iotanalytics-channel-tag-value)" : String
}
```

### YAML
<a name="aws-properties-iotanalytics-channel-tag-syntax.yaml"></a>

```
  [Key](#cfn-iotanalytics-channel-tag-key): String
  [Value](#cfn-iotanalytics-channel-tag-value): String
```

## Properties
<a name="aws-properties-iotanalytics-channel-tag-properties"></a>

`Key`  <a name="cfn-iotanalytics-channel-tag-key"></a>
The tag's key.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-iotanalytics-channel-tag-value"></a>
The tag's value.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)