

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::IVSChat::Room
<a name="aws-resource-ivschat-room"></a>

The `AWS::IVSChat::Room` resource specifies an Amazon IVS room that allows clients to connect and pass messages. For more information, see [CreateRoom](https://docs.aws.amazon.com/ivs/latest/ChatAPIReference/API_CreateRoom.html) in the *Amazon Interactive Video Service Chat API Reference*.

## Syntax
<a name="aws-resource-ivschat-room-syntax"></a>

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

### JSON
<a name="aws-resource-ivschat-room-syntax.json"></a>

```
{
  "Type" : "AWS::IVSChat::Room",
  "Properties" : {
      "[LoggingConfigurationIdentifiers](#cfn-ivschat-room-loggingconfigurationidentifiers)" : [ String, ... ],
      "[MaximumMessageLength](#cfn-ivschat-room-maximummessagelength)" : Integer,
      "[MaximumMessageRatePerSecond](#cfn-ivschat-room-maximummessageratepersecond)" : Integer,
      "[MessageReviewHandler](#cfn-ivschat-room-messagereviewhandler)" : MessageReviewHandler,
      "[Name](#cfn-ivschat-room-name)" : String,
      "[Tags](#cfn-ivschat-room-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-ivschat-room-syntax.yaml"></a>

```
Type: AWS::IVSChat::Room
Properties:
  [LoggingConfigurationIdentifiers](#cfn-ivschat-room-loggingconfigurationidentifiers): 
    - String
  [MaximumMessageLength](#cfn-ivschat-room-maximummessagelength): Integer
  [MaximumMessageRatePerSecond](#cfn-ivschat-room-maximummessageratepersecond): Integer
  [MessageReviewHandler](#cfn-ivschat-room-messagereviewhandler): 
    MessageReviewHandler
  [Name](#cfn-ivschat-room-name): String
  [Tags](#cfn-ivschat-room-tags): 
    - Tag
```

## Properties
<a name="aws-resource-ivschat-room-properties"></a>

`LoggingConfigurationIdentifiers`  <a name="cfn-ivschat-room-loggingconfigurationidentifiers"></a>
List of logging-configuration identifiers attached to the room.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `1 | 0`  
*Maximum*: `128 | 50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaximumMessageLength`  <a name="cfn-ivschat-room-maximummessagelength"></a>
Maximum number of characters in a single message. Messages are expected to be UTF-8 encoded and this limit applies specifically to rune/code-point count, not number of bytes.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `500`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaximumMessageRatePerSecond`  <a name="cfn-ivschat-room-maximummessageratepersecond"></a>
Maximum number of messages per second that can be sent to the room (by all clients).  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `10`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MessageReviewHandler`  <a name="cfn-ivschat-room-messagereviewhandler"></a>
Configuration information for optional review of messages.  
*Required*: No  
*Type*: [MessageReviewHandler](aws-properties-ivschat-room-messagereviewhandler.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Name`  <a name="cfn-ivschat-room-name"></a>
Room name. The value does not need to be unique.  
*Required*: No  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9-_]*$`  
*Minimum*: `0`  
*Maximum*: `128`  
*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-ivschat-room-tags"></a>
An array of key-value pairs to apply to this resource.  
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ivschat-room-tag.html).  
*Required*: No  
*Type*: Array of [Tag](aws-properties-ivschat-room-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-ivschat-room-return-values"></a>

### Ref
<a name="aws-resource-ivschat-room-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the room ARN. For example:

 `{ "Ref": "myRoom" }` 

For the Amazon IVS room `myRoom `, `Ref` returns the room ARN.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-ivschat-room-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-ivschat-room-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The room ARN. For example: `arn:aws:ivschat:us-west-2:123456789012:room/abcdABCDefgh`

`Id`  <a name="Id-fn::getatt"></a>
The room ID. For example: `abcdABCDefgh`

## Examples
<a name="aws-resource-ivschat-room--examples"></a>



### Room Template Examples
<a name="aws-resource-ivschat-room--examples--Room_Template_Examples"></a>

The following examples specify an Amazon IVS Chat Room.

#### JSON
<a name="aws-resource-ivschat-room--examples--Room_Template_Examples--json"></a>

```
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Resources": {
    "Room": {
      "Type": "AWS::IVSChat::Room",
      "Properties": {
        "Name": "MyRoom",
        "Tags": [
          { "Key": "MyKey", "Value": "MyValue" }
        ]
      }
    }
  },
  "Outputs": {
    "RoomArn": {
      "Value": { "Ref": "Room" }
    },
    "RoomId": {
      "Value": {
        "Fn::GetAtt": [
          "Room",
          "Id"
        ]
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-ivschat-room--examples--Room_Template_Examples--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  Room:
    Type: AWS::IVSChat::Room
    Properties:
      Name: MyRoom
      Tags:
        - Key: MyKey
          Value: MyValue
Outputs:
  RoomArn:
    Value: !Ref Room
  RoomId:
    Value: !GetAtt Room.Id
```

## See also
<a name="aws-resource-ivschat-room--seealso"></a>
+  [Getting Started with Amazon Interactive Video Service](https://docs.aws.amazon.com/ivs/latest/userguide/getting-started.html) 
+ [RoomSummary](https://docs.aws.amazon.com/ivs/latest/ChatAPIReference/API_RoomSummary.html) API data type
+ [CreateRoom](https://docs.aws.amazon.com/ivs/latest/ChatAPIReference/API_CreateRoom.html) API endpoint

# AWS::IVSChat::Room MessageReviewHandler
<a name="aws-properties-ivschat-room-messagereviewhandler"></a>

The MessageReviewHandler property type specifies configuration information for optional message review.

## Syntax
<a name="aws-properties-ivschat-room-messagereviewhandler-syntax"></a>

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

### JSON
<a name="aws-properties-ivschat-room-messagereviewhandler-syntax.json"></a>

```
{
  "[FallbackResult](#cfn-ivschat-room-messagereviewhandler-fallbackresult)" : String,
  "[Uri](#cfn-ivschat-room-messagereviewhandler-uri)" : String
}
```

### YAML
<a name="aws-properties-ivschat-room-messagereviewhandler-syntax.yaml"></a>

```
  [FallbackResult](#cfn-ivschat-room-messagereviewhandler-fallbackresult): String
  [Uri](#cfn-ivschat-room-messagereviewhandler-uri): String
```

## Properties
<a name="aws-properties-ivschat-room-messagereviewhandler-properties"></a>

`FallbackResult`  <a name="cfn-ivschat-room-messagereviewhandler-fallbackresult"></a>
Specifies the fallback behavior (whether the message is allowed or denied) if the handler does not return a valid response, encounters an error, or times out. (For the timeout period, see [ Service Quotas](https://docs.aws.amazon.com/ivs/latest/userguide/service-quotas.html).) If allowed, the message is delivered with returned content to all users connected to the room. If denied, the message is not delivered to any user.  
*Default*: `ALLOW`  
*Required*: No  
*Type*: String  
*Allowed values*: `ALLOW | DENY`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Uri`  <a name="cfn-ivschat-room-messagereviewhandler-uri"></a>
Identifier of the message review handler. Currently this must be an ARN of a lambda function.  
*Required*: No  
*Type*: String  
*Pattern*: `^$|^arn:aws:lambda:[a-z0-9-]+:[0-9]{12}:function:.+`  
*Minimum*: `0`  
*Maximum*: `170`  
*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-properties-ivschat-room-messagereviewhandler--examples"></a>



### Room Message Review Handler Template Examples
<a name="aws-properties-ivschat-room-messagereviewhandler--examples--Room_Message_Review_Handler_Template_Examples"></a>

The following examples specify an Amazon IVS Chat Room with message review.

#### JSON
<a name="aws-properties-ivschat-room-messagereviewhandler--examples--Room_Message_Review_Handler_Template_Examples--json"></a>

```
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Resources": {
    "MessageReviewHandlerRole": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "AssumeRolePolicyDocument": {
          "Version": "2012-10-17"		 	 	 ,
          "Statement": {
            "Effect": "Allow",
            "Principal": {
              "Service": "lambda.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
          }
        }
      }
    },
    "MessageReviewHandler": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "Handler": "index.handler",
        "Role": {
          "Fn::GetAtt": [
            "MessageReviewHandlerRole",
            "Arn"
          ]
        },
        "Runtime": "nodejs12.x",
        "Code": {
          "S3Bucket":"my-bucket",
          "S3Key": "function.zip"
        }
      }
    },
    "MessageReviewHandlerPermission": {
      "Type": "AWS::Lambda::Permission",
      "Properties": {
        "Principal": "ivschat.amazonaws.com",
        "Action": "lambda:InvokeFunction",
        "FunctionName": {
          "Ref": "MessageReviewHandler"
        },
        "SourceAccount": {
          "Ref": "AWS::AccountId"
        },
        "SourceArn": {
          "Fn::Sub": "arn:${AWS::Partition}:ivschat:${AWS::Region}:${AWS::AccountId}:room/*"
        }
      }
    },
    "Room": {
      "Type": "AWS::IVSChat::Room",
      "Properties": {
        "Name": "MyRoom",
        "MessageReviewHandler": {
          "FallbackResult": "ALLOW",
          "Uri": {
            "Fn::GetAtt": [
              "MessageReviewHandler",
              "Arn"
            ]
          }
        }
      },
      "DependsOn": "MessageReviewHandlerPermission"
    }
  }
}
```

#### YAML
<a name="aws-properties-ivschat-room-messagereviewhandler--examples--Room_Message_Review_Handler_Template_Examples--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  MessageReviewHandlerRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
          Effect: Allow
          Principal:
            Service: lambda.amazonaws.com
          Action: sts:AssumeRole
  MessageReviewHandler:
    Type: AWS::Lambda::Function
    Properties:
      Handler: index.handler
      Role: !GetAtt MessageReviewHandlerRole.Arn
      Runtime: nodejs12.x
      Code:
        S3Bucket: my-bucket
        S3Key: function.zip
  MessageReviewHandlerPermission:
    Type: AWS::Lambda::Permission
    Properties:
      Principal: ivschat.amazonaws.com
      Action: lambda:InvokeFunction
      FunctionName: !Ref MessageReviewHandler
      SourceAccount: !Ref AWS::AccountId
      SourceArn: !Sub arn:${AWS::Partition}:ivschat:${AWS::Region}:${AWS::AccountId}:room/*
  Room:
    Type: AWS::IVSChat::Room
    Properties:
      Name: MyRoom
      MessageReviewHandler:
        FallbackResult: ALLOW
        Uri: !GetAtt MessageReviewHandler.Arn
    DependsOn: MessageReviewHandlerPermission
```

# AWS::IVSChat::Room Tag
<a name="aws-properties-ivschat-room-tag"></a>

A key-value pair that you can use to categorize and manage Amazon IVSChat Rooms.

## Syntax
<a name="aws-properties-ivschat-room-tag-syntax"></a>

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

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

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

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

```
  [Key](#cfn-ivschat-room-tag-key): String
  [Value](#cfn-ivschat-room-tag-value): String
```

## Properties
<a name="aws-properties-ivschat-room-tag-properties"></a>

`Key`  <a name="cfn-ivschat-room-tag-key"></a>
One part of a key-value pair that makes up a tag. A `key` is a general label that acts like a category for more specific tag values.  
*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-ivschat-room-tag-value"></a>
The optional part of a key-value pair that makes up a tag. A `value` acts as a descriptor within a tag category (key).  
*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)