class CfnStreamProcessor (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Rekognition.CfnStreamProcessor |
Java | software.amazon.awscdk.services.rekognition.CfnStreamProcessor |
Python | aws_cdk.aws_rekognition.CfnStreamProcessor |
TypeScript | @aws-cdk/aws-rekognition » CfnStreamProcessor |
Implements
IConstruct
, 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 * as rekognition from '@aws-cdk/aws-rekognition';
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
Cfn
— - resource properties.Stream Processor Props
Create a new AWS::Rekognition::StreamProcessor
.
Construct Props
Name | Type | Description |
---|---|---|
kinesis | Kinesis | IResolvable | The Kinesis video stream that provides the source of the streaming video for an Amazon Rekognition Video stream processor. |
role | string | The ARN of the IAM role that allows access to the stream processor. |
bounding | IResolvable | IResolvable | Bounding [] | List of BoundingBox objects, each of which denotes a region of interest on screen. |
connected | IResolvable | Connected | Connected home settings to use on a streaming video. |
data | IResolvable | Data | Allows you to opt in or opt out to share data with Rekognition to improve model performance. |
face | IResolvable | Face | The input parameters used to recognize faces in a streaming video analyzed by an Amazon Rekognition stream processor. |
kinesis | IResolvable | Kinesis | Amazon Rekognition's Video Stream Processor takes a Kinesis video stream as input. |
kms | string | The identifier for your Amazon Key Management Service key (Amazon KMS key). |
name? | string | 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. |
notification | IResolvable | Notification | The Amazon Simple Notification Service topic to which Amazon Rekognition publishes the object detection results and completion status of a video analysis operation. |
polygon | 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 . |
s3 | IResolvable | S3 | The Amazon S3 bucket location to which Amazon Rekognition publishes the detailed inference results of a video analysis operation. |
tags? | Cfn [] | A set of tags (key-value pairs) that you want to attach to the stream processor. |
kinesisVideoStream
Type:
Kinesis
|
IResolvable
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
|
Bounding
[]
(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
|
Connected
(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
|
Data
(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
|
Face
(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
|
Kinesis
(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
|
Notification
(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
|
S3
(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:
Cfn
[]
(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
Name | Type | Description |
---|---|---|
attr | string | Amazon Resource Name for the newly created stream processor. |
attr | string | Current status of the Amazon Rekognition stream processor. |
attr | string | Detailed status message about the stream processor. |
cfn | ICfn | Options for this resource, such as condition, update policy etc. |
cfn | { [string]: any } | |
cfn | string | AWS resource type. |
creation | string[] | |
kinesis | Kinesis | IResolvable | The Kinesis video stream that provides the source of the streaming video for an Amazon Rekognition Video stream processor. |
logical | string | The logical ID for this CloudFormation stack element. |
node | Construct | The construct tree node associated with this construct. |
polygon | 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 | string | Return a string that will be resolved to a CloudFormation { Ref } for this element. |
role | string | The ARN of the IAM role that allows access to the stream processor. |
stack | Stack | The stack in which this element is defined. |
tags | Tag | A set of tags (key-value pairs) that you want to attach to the stream processor. |
bounding | IResolvable | IResolvable | Bounding [] | List of BoundingBox objects, each of which denotes a region of interest on screen. |
connected | IResolvable | Connected | Connected home settings to use on a streaming video. |
data | IResolvable | Data | Allows you to opt in or opt out to share data with Rekognition to improve model performance. |
face | IResolvable | Face | The input parameters used to recognize faces in a streaming video analyzed by an Amazon Rekognition stream processor. |
kinesis | IResolvable | Kinesis | Amazon Rekognition's Video Stream Processor takes a Kinesis video stream as input. |
kms | string | The identifier for your Amazon Key Management Service key (Amazon KMS key). |
name? | string | 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. |
notification | IResolvable | Notification | The Amazon Simple Notification Service topic to which Amazon Rekognition publishes the object detection results and completion status of a video analysis operation. |
s3 | IResolvable | S3 | The Amazon S3 bucket location to which Amazon Rekognition publishes the detailed inference results of a video analysis operation. |
static CFN_RESOURCE_TYPE_NAME | string | The 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:
ICfn
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:
Kinesis
|
IResolvable
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:
Construct
The construct tree node associated with this construct.
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:
Tag
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
|
Bounding
[]
(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
|
Connected
(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
|
Data
(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
|
Face
(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
|
Kinesis
(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
|
Notification
(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
|
S3
(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
Name | Description |
---|---|
add | Syntactic sugar for addOverride(path, undefined) . |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Add a value to the CloudFormation Resource Metadata. |
add | Adds an override to the synthesized CloudFormation resource. |
add | Adds an override that deletes the value of a property from the resource definition. |
add | Adds an override to a resource property. |
apply | Sets the deletion policy of the resource based on the removal policy specified. |
get | Returns a token for an runtime attribute of this resource. |
get | Retrieve a value value from the CloudFormation Resource Metadata. |
inspect(inspector) | Examines the CloudFormation resource and discloses attributes. |
override | Overrides the auto-generated logical ID with a specific ID. |
to | Returns a string representation of this construct. |
protected render |
DeletionOverride(path)
addpublic addDeletionOverride(path: string): void
Parameters
- path
string
— The path of the value to delete.
Syntactic sugar for addOverride(path, undefined)
.
DependsOn(target)
addpublic addDependsOn(target: CfnResource): void
Parameters
- target
Cfn
Resource
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.
Metadata(key, value)
addpublic addMetadata(key: string, value: any): void
Parameters
- key
string
- value
any
Add a value to the CloudFormation Resource Metadata.
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.)
Override(path, value)
addpublic 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.
PropertyDeletionOverride(propertyPath)
addpublic 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.
PropertyOverride(propertyPath, value)
addpublic 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)
.
RemovalPolicy(policy?, options?)
applypublic applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
Parameters
- policy
Removal
Policy - options
Removal
Policy Options
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
).
Att(attributeName)
getpublic getAtt(attributeName: string): Reference
Parameters
- attributeName
string
— The name of the attribute.
Returns
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.
Metadata(key)
getpublic getMetadata(key: string): any
Parameters
- key
string
Returns
any
Retrieve a value value from the CloudFormation Resource Metadata.
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
Tree
— - tree inspector to collect and process attributes.Inspector
Examines the CloudFormation resource and discloses attributes.
LogicalId(newLogicalId)
overridepublic 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.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
Properties(props)
protected renderprotected renderProperties(props: { [string]: any }): { [string]: any }
Parameters
- props
{ [string]: any }
Returns
{ [string]: any }