aws-cdk-lib.aws_rekognition.CfnStreamProcessor

class CfnStreamProcessor (construct)

LanguageType name
.NETAmazon.CDK.AWS.Rekognition.CfnStreamProcessor
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsrekognition#CfnStreamProcessor
Javasoftware.amazon.awscdk.services.rekognition.CfnStreamProcessor
Pythonaws_cdk.aws_rekognition.CfnStreamProcessor
TypeScript aws-cdk-lib » aws_rekognition » CfnStreamProcessor

Implements IConstruct, IDependable, IInspectable

A CloudFormation AWS::Rekognition::StreamProcessor.

The AWS::Rekognition::StreamProcessor type creates a stream processor used to detect and recognize faces or to detect connected home labels in a streaming video. Amazon Rekognition Video is a consumer of live video from Amazon Kinesis Video Streams. There are two different settings for stream processors in Amazon Rekognition, one for detecting faces and one for connected home features.

If you are creating a stream processor for detecting faces, you provide a Kinesis video stream (input) and a Kinesis data stream (output). You also specify the face recognition criteria in FaceSearchSettings. For example, the collection containing faces that you want to recognize.

If you are creating a stream processor for detection of connected home labels, you provide a Kinesis video stream for input, and for output an Amazon S3 bucket and an Amazon SNS topic. You can also provide a KMS key ID to encrypt the data sent to your Amazon S3 bucket. You specify what you want to detect in ConnectedHomeSettings, such as people, packages, and pets.

You can also specify where in the frame you want Amazon Rekognition to monitor with BoundingBoxRegionsOfInterest and PolygonRegionsOfInterest. The Name is used to manage the stream processor and it is the identifier for the stream processor. The AWS::Rekognition::StreamProcessor resource creates a stream processor in the same Region where you create the Amazon CloudFormation stack.

For more information, see CreateStreamProcessor .

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_rekognition as rekognition } from 'aws-cdk-lib';

declare const polygonRegionsOfInterest: any;
const cfnStreamProcessor = new rekognition.CfnStreamProcessor(this, 'MyCfnStreamProcessor', {
  kinesisVideoStream: {
    arn: 'arn',
  },
  roleArn: 'roleArn',

  // the properties below are optional
  boundingBoxRegionsOfInterest: [{
    height: 123,
    left: 123,
    top: 123,
    width: 123,
  }],
  connectedHomeSettings: {
    labels: ['labels'],

    // the properties below are optional
    minConfidence: 123,
  },
  dataSharingPreference: {
    optIn: false,
  },
  faceSearchSettings: {
    collectionId: 'collectionId',

    // the properties below are optional
    faceMatchThreshold: 123,
  },
  kinesisDataStream: {
    arn: 'arn',
  },
  kmsKeyId: 'kmsKeyId',
  name: 'name',
  notificationChannel: {
    arn: 'arn',
  },
  polygonRegionsOfInterest: polygonRegionsOfInterest,
  s3Destination: {
    bucketName: 'bucketName',

    // the properties below are optional
    objectKeyPrefix: 'objectKeyPrefix',
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
});

Initializer

new CfnStreamProcessor(scope: Construct, id: string, props: CfnStreamProcessorProps)

Parameters

  • scope Construct — - scope in which this resource is defined.
  • id string — - scoped id of the resource.
  • props CfnStreamProcessorProps — - resource properties.

Create a new AWS::Rekognition::StreamProcessor.

Construct Props

NameTypeDescription
kinesisVideoStreamIResolvable | KinesisVideoStreamPropertyThe Kinesis video stream that provides the source of the streaming video for an Amazon Rekognition Video stream processor.
roleArnstringThe ARN of the IAM role that allows access to the stream processor.
boundingBoxRegionsOfInterest?IResolvable | IResolvable | BoundingBoxProperty[]List of BoundingBox objects, each of which denotes a region of interest on screen.
connectedHomeSettings?IResolvable | ConnectedHomeSettingsPropertyConnected home settings to use on a streaming video.
dataSharingPreference?IResolvable | DataSharingPreferencePropertyAllows you to opt in or opt out to share data with Rekognition to improve model performance.
faceSearchSettings?IResolvable | FaceSearchSettingsPropertyThe input parameters used to recognize faces in a streaming video analyzed by an Amazon Rekognition stream processor.
kinesisDataStream?IResolvable | KinesisDataStreamPropertyAmazon Rekognition's Video Stream Processor takes a Kinesis video stream as input.
kmsKeyId?stringThe identifier for your Amazon Key Management Service key (Amazon KMS key).
name?stringThe Name attribute specifies the name of the stream processor and it must be within the constraints described in the Name section of StreamProcessor . If you don't specify a name, Amazon CloudFormation generates a unique ID and uses that ID for the stream processor name.
notificationChannel?IResolvable | NotificationChannelPropertyThe Amazon Simple Notification Service topic to which Amazon Rekognition publishes the object detection results and completion status of a video analysis operation.
polygonRegionsOfInterest?anyA set of ordered lists of Point objects. Each entry of the set contains a polygon denoting a region of interest on the screen. Each polygon is an ordered list of Point objects. For more information, see the Polygon field of RegionOfInterest .
s3Destination?IResolvable | S3DestinationPropertyThe Amazon S3 bucket location to which Amazon Rekognition publishes the detailed inference results of a video analysis operation.
tags?CfnTag[]A set of tags (key-value pairs) that you want to attach to the stream processor.

kinesisVideoStream

Type: IResolvable | KinesisVideoStreamProperty

The Kinesis video stream that provides the source of the streaming video for an Amazon Rekognition Video stream processor.

For more information, see KinesisVideoStream .


roleArn

Type: string

The ARN of the IAM role that allows access to the stream processor.

The IAM role provides Rekognition read permissions to the Kinesis stream. It also provides write permissions to an Amazon S3 bucket and Amazon Simple Notification Service topic for a connected home stream processor. This is required for both face search and connected home stream processors. For information about constraints, see the RoleArn section of CreateStreamProcessor .


boundingBoxRegionsOfInterest?

Type: IResolvable | IResolvable | BoundingBoxProperty[] (optional)

List of BoundingBox objects, each of which denotes a region of interest on screen.

For more information, see the BoundingBox field of RegionOfInterest .


connectedHomeSettings?

Type: IResolvable | ConnectedHomeSettingsProperty (optional)

Connected home settings to use on a streaming video.

You can use a stream processor for connected home features and select what you want the stream processor to detect, such as people or pets. When the stream processor has started, one notification is sent for each object class specified. For more information, see the ConnectedHome section of StreamProcessorSettings .


dataSharingPreference?

Type: IResolvable | DataSharingPreferenceProperty (optional)

Allows you to opt in or opt out to share data with Rekognition to improve model performance.

You can choose this option at the account level or on a per-stream basis. Note that if you opt out at the account level this setting is ignored on individual streams. For more information, see StreamProcessorDataSharingPreference .


faceSearchSettings?

Type: IResolvable | FaceSearchSettingsProperty (optional)

The input parameters used to recognize faces in a streaming video analyzed by an Amazon Rekognition stream processor.

For more information regarding the contents of the parameters, see FaceSearchSettings .


kinesisDataStream?

Type: IResolvable | KinesisDataStreamProperty (optional)

Amazon Rekognition's Video Stream Processor takes a Kinesis video stream as input.

This is the Amazon Kinesis Data Streams instance to which the Amazon Rekognition stream processor streams the analysis results. This must be created within the constraints specified at KinesisDataStream .


kmsKeyId?

Type: string (optional)

The identifier for your Amazon Key Management Service key (Amazon KMS key).

Optional parameter for connected home stream processors used to encrypt results and data published to your Amazon S3 bucket. For more information, see the KMSKeyId section of CreateStreamProcessor .


name?

Type: string (optional)

The Name attribute specifies the name of the stream processor and it must be within the constraints described in the Name section of StreamProcessor . If you don't specify a name, Amazon CloudFormation generates a unique ID and uses that ID for the stream processor name.


notificationChannel?

Type: IResolvable | NotificationChannelProperty (optional)

The Amazon Simple Notification Service topic to which Amazon Rekognition publishes the object detection results and completion status of a video analysis operation.

Amazon Rekognition publishes a notification the first time an object of interest or a person is detected in the video stream. Amazon Rekognition also publishes an end-of-session notification with a summary when the stream processing session is complete. For more information, see StreamProcessorNotificationChannel .


polygonRegionsOfInterest?

Type: any (optional)

A set of ordered lists of Point objects. Each entry of the set contains a polygon denoting a region of interest on the screen. Each polygon is an ordered list of Point objects. For more information, see the Polygon field of RegionOfInterest .


s3Destination?

Type: IResolvable | S3DestinationProperty (optional)

The Amazon S3 bucket location to which Amazon Rekognition publishes the detailed inference results of a video analysis operation.

For more information, see the S3Destination section of StreamProcessorOutput .


tags?

Type: CfnTag[] (optional)

A set of tags (key-value pairs) that you want to attach to the stream processor.

For more information, see the Tags section of CreateStreamProcessor .

Properties

NameTypeDescription
attrArnstringAmazon Resource Name for the newly created stream processor.
attrStatusstringCurrent status of the Amazon Rekognition stream processor.
attrStatusMessagestringDetailed status message about the stream processor.
cfnOptionsICfnResourceOptionsOptions for this resource, such as condition, update policy etc.
cfnProperties{ [string]: any }
cfnResourceTypestringAWS resource type.
creationStackstring[]
kinesisVideoStreamIResolvable | KinesisVideoStreamPropertyThe Kinesis video stream that provides the source of the streaming video for an Amazon Rekognition Video stream processor.
logicalIdstringThe logical ID for this CloudFormation stack element.
nodeNodeThe tree node.
polygonRegionsOfInterestanyA set of ordered lists of Point objects. Each entry of the set contains a polygon denoting a region of interest on the screen. Each polygon is an ordered list of Point objects. For more information, see the Polygon field of RegionOfInterest .
refstringReturn a string that will be resolved to a CloudFormation { Ref } for this element.
roleArnstringThe ARN of the IAM role that allows access to the stream processor.
stackStackThe stack in which this element is defined.
tagsTagManagerA set of tags (key-value pairs) that you want to attach to the stream processor.
boundingBoxRegionsOfInterest?IResolvable | IResolvable | BoundingBoxProperty[]List of BoundingBox objects, each of which denotes a region of interest on screen.
connectedHomeSettings?IResolvable | ConnectedHomeSettingsPropertyConnected home settings to use on a streaming video.
dataSharingPreference?IResolvable | DataSharingPreferencePropertyAllows you to opt in or opt out to share data with Rekognition to improve model performance.
faceSearchSettings?IResolvable | FaceSearchSettingsPropertyThe input parameters used to recognize faces in a streaming video analyzed by an Amazon Rekognition stream processor.
kinesisDataStream?IResolvable | KinesisDataStreamPropertyAmazon Rekognition's Video Stream Processor takes a Kinesis video stream as input.
kmsKeyId?stringThe identifier for your Amazon Key Management Service key (Amazon KMS key).
name?stringThe Name attribute specifies the name of the stream processor and it must be within the constraints described in the Name section of StreamProcessor . If you don't specify a name, Amazon CloudFormation generates a unique ID and uses that ID for the stream processor name.
notificationChannel?IResolvable | NotificationChannelPropertyThe Amazon Simple Notification Service topic to which Amazon Rekognition publishes the object detection results and completion status of a video analysis operation.
s3Destination?IResolvable | S3DestinationPropertyThe Amazon S3 bucket location to which Amazon Rekognition publishes the detailed inference results of a video analysis operation.
static CFN_RESOURCE_TYPE_NAMEstringThe CloudFormation resource type name for this resource class.

attrArn

Type: string

Amazon Resource Name for the newly created stream processor.


attrStatus

Type: string

Current status of the Amazon Rekognition stream processor.


attrStatusMessage

Type: string

Detailed status message about the stream processor.


cfnOptions

Type: ICfnResourceOptions

Options for this resource, such as condition, update policy etc.


cfnProperties

Type: { [string]: any }


cfnResourceType

Type: string

AWS resource type.


creationStack

Type: string[]


kinesisVideoStream

Type: IResolvable | KinesisVideoStreamProperty

The Kinesis video stream that provides the source of the streaming video for an Amazon Rekognition Video stream processor.

For more information, see KinesisVideoStream .


logicalId

Type: string

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).


node

Type: Node

The tree node.


polygonRegionsOfInterest

Type: any

A set of ordered lists of Point objects. Each entry of the set contains a polygon denoting a region of interest on the screen. Each polygon is an ordered list of Point objects. For more information, see the Polygon field of RegionOfInterest .


ref

Type: string

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).


roleArn

Type: string

The ARN of the IAM role that allows access to the stream processor.

The IAM role provides Rekognition read permissions to the Kinesis stream. It also provides write permissions to an Amazon S3 bucket and Amazon Simple Notification Service topic for a connected home stream processor. This is required for both face search and connected home stream processors. For information about constraints, see the RoleArn section of CreateStreamProcessor .


stack

Type: Stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).


tags

Type: TagManager

A set of tags (key-value pairs) that you want to attach to the stream processor.

For more information, see the Tags section of CreateStreamProcessor .


boundingBoxRegionsOfInterest?

Type: IResolvable | IResolvable | BoundingBoxProperty[] (optional)

List of BoundingBox objects, each of which denotes a region of interest on screen.

For more information, see the BoundingBox field of RegionOfInterest .


connectedHomeSettings?

Type: IResolvable | ConnectedHomeSettingsProperty (optional)

Connected home settings to use on a streaming video.

You can use a stream processor for connected home features and select what you want the stream processor to detect, such as people or pets. When the stream processor has started, one notification is sent for each object class specified. For more information, see the ConnectedHome section of StreamProcessorSettings .


dataSharingPreference?

Type: IResolvable | DataSharingPreferenceProperty (optional)

Allows you to opt in or opt out to share data with Rekognition to improve model performance.

You can choose this option at the account level or on a per-stream basis. Note that if you opt out at the account level this setting is ignored on individual streams. For more information, see StreamProcessorDataSharingPreference .


faceSearchSettings?

Type: IResolvable | FaceSearchSettingsProperty (optional)

The input parameters used to recognize faces in a streaming video analyzed by an Amazon Rekognition stream processor.

For more information regarding the contents of the parameters, see FaceSearchSettings .


kinesisDataStream?

Type: IResolvable | KinesisDataStreamProperty (optional)

Amazon Rekognition's Video Stream Processor takes a Kinesis video stream as input.

This is the Amazon Kinesis Data Streams instance to which the Amazon Rekognition stream processor streams the analysis results. This must be created within the constraints specified at KinesisDataStream .


kmsKeyId?

Type: string (optional)

The identifier for your Amazon Key Management Service key (Amazon KMS key).

Optional parameter for connected home stream processors used to encrypt results and data published to your Amazon S3 bucket. For more information, see the KMSKeyId section of CreateStreamProcessor .


name?

Type: string (optional)

The Name attribute specifies the name of the stream processor and it must be within the constraints described in the Name section of StreamProcessor . If you don't specify a name, Amazon CloudFormation generates a unique ID and uses that ID for the stream processor name.


notificationChannel?

Type: IResolvable | NotificationChannelProperty (optional)

The Amazon Simple Notification Service topic to which Amazon Rekognition publishes the object detection results and completion status of a video analysis operation.

Amazon Rekognition publishes a notification the first time an object of interest or a person is detected in the video stream. Amazon Rekognition also publishes an end-of-session notification with a summary when the stream processing session is complete. For more information, see StreamProcessorNotificationChannel .


s3Destination?

Type: IResolvable | S3DestinationProperty (optional)

The Amazon S3 bucket location to which Amazon Rekognition publishes the detailed inference results of a video analysis operation.

For more information, see the S3Destination section of StreamProcessorOutput .


static CFN_RESOURCE_TYPE_NAME

Type: string

The CloudFormation resource type name for this resource class.

Methods

NameDescription
addDeletionOverride(path)Syntactic sugar for addOverride(path, undefined).
addDependency(target)Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addDependsOn(target)⚠️Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addMetadata(key, value)Add a value to the CloudFormation Resource Metadata.
addOverride(path, value)Adds an override to the synthesized CloudFormation resource.
addPropertyDeletionOverride(propertyPath)Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)Adds an override to a resource property.
applyRemovalPolicy(policy?, options?)Sets the deletion policy of the resource based on the removal policy specified.
getAtt(attributeName, typeHint?)Returns a token for an runtime attribute of this resource.
getMetadata(key)Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector)Examines the CloudFormation resource and discloses attributes.
obtainDependencies()Retrieves an array of resources this resource depends on.
obtainResourceDependencies()Get a shallow copy of dependencies between this resource and other resources in the same stack.
overrideLogicalId(newLogicalId)Overrides the auto-generated logical ID with a specific ID.
removeDependency(target)Indicates that this resource no longer depends on another resource.
replaceDependency(target, newTarget)Replaces one dependency with another.
toString()Returns a string representation of this construct.
protected renderProperties(props)

addDeletionOverride(path)

public addDeletionOverride(path: string): void

Parameters

  • path string — The path of the value to delete.

Syntactic sugar for addOverride(path, undefined).


addDependency(target)

public addDependency(target: CfnResource): void

Parameters

  • target CfnResource

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.


addDependsOn(target)⚠️

public addDependsOn(target: CfnResource): void

⚠️ Deprecated: use addDependency

Parameters

  • target CfnResource

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.


addMetadata(key, value)

public addMetadata(key: string, value: any): void

Parameters

  • key string
  • value any

Add a value to the CloudFormation Resource Metadata.

See also: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)


addOverride(path, value)

public addOverride(path: string, value: any): void

Parameters

  • path string — - The path of the property, you can use dot notation to override values in complex types.
  • value any — - The value.

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.


addPropertyDeletionOverride(propertyPath)

public addPropertyDeletionOverride(propertyPath: string): void

Parameters

  • propertyPath string — The path to the property.

Adds an override that deletes the value of a property from the resource definition.


addPropertyOverride(propertyPath, value)

public addPropertyOverride(propertyPath: string, value: any): void

Parameters

  • propertyPath string — The path of the property.
  • value any — The value.

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).


applyRemovalPolicy(policy?, options?)

public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void

Parameters

  • policy RemovalPolicy
  • options RemovalPolicyOptions

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

See also: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options


getAtt(attributeName, typeHint?)

public getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference

Parameters

  • attributeName string — The name of the attribute.
  • typeHint ResolutionTypeHint

Returns

  • Reference

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.


getMetadata(key)

public getMetadata(key: string): any

Parameters

  • key string

Returns

  • any

Retrieve a value value from the CloudFormation Resource Metadata.

See also: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)


inspect(inspector)

public inspect(inspector: TreeInspector): void

Parameters

  • inspector TreeInspector — - tree inspector to collect and process attributes.

Examines the CloudFormation resource and discloses attributes.


obtainDependencies()

public obtainDependencies(): Stack &#124; CfnResource[]

Returns

  • Stack | CfnResource[]

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.


obtainResourceDependencies()

public obtainResourceDependencies(): CfnResource[]

Returns

  • CfnResource[]

Get a shallow copy of dependencies between this resource and other resources in the same stack.


overrideLogicalId(newLogicalId)

public overrideLogicalId(newLogicalId: string): void

Parameters

  • newLogicalId string — The new logical ID to use for this stack element.

Overrides the auto-generated logical ID with a specific ID.


removeDependency(target)

public removeDependency(target: CfnResource): void

Parameters

  • target CfnResource

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.


replaceDependency(target, newTarget)

public replaceDependency(target: CfnResource, newTarget: CfnResource): void

Parameters

  • target CfnResource — The dependency to replace.
  • newTarget CfnResource — The new dependency to add.

Replaces one dependency with another.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected renderProperties(props)

protected renderProperties(props: { [string]: any }): { [string]: any }

Parameters

  • props { [string]: any }

Returns

  • { [string]: any }