Skip to content
v2.277.0

HookConfigurationProperty Struct ​

Provides the configuration information for invoking a Lambda function in AWS Lambda to alter document metadata and content when ingesting documents into Amazon Kendra.

You can configure your Lambda function using PreExtractionHookConfiguration if you want to apply advanced alterations on the original or raw documents. If you want to apply advanced alterations on the Amazon Kendra structured documents, you must configure your Lambda function using PostExtractionHookConfiguration . You can only invoke one Lambda function. However, this function can invoke other functions it requires.

For more information, see Customizing document metadata during the ingestion process .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_kendra as kendra } from 'aws-cdk-lib';
const hookConfigurationProperty: kendra.CfnDataSource.HookConfigurationProperty = {
  lambdaArn: 'lambdaArn',
  s3Bucket: 's3Bucket',

  // the properties below are optional
  invocationCondition: {
    conditionDocumentAttributeKey: 'conditionDocumentAttributeKey',
    operator: 'operator',

    // the properties below are optional
    conditionOnValue: {
      dateValue: 'dateValue',
      longValue: 123,
      stringListValue: ['stringListValue'],
      stringValue: 'stringValue',
    },
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_kendra as kendra

hook_configuration_property = kendra.CfnDataSource.HookConfigurationProperty(
    lambda_arn="lambdaArn",
    s3_bucket="s3Bucket",

    # the properties below are optional
    invocation_condition=kendra.CfnDataSource.DocumentAttributeConditionProperty(
        condition_document_attribute_key="conditionDocumentAttributeKey",
        operator="operator",

        # the properties below are optional
        condition_on_value=kendra.CfnDataSource.DocumentAttributeValueProperty(
            date_value="dateValue",
            long_value=123,
            string_list_value=["stringListValue"],
            string_value="stringValue"
        )
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.kendra.*;

HookConfigurationProperty hookConfigurationProperty = HookConfigurationProperty.builder()
        .lambdaArn("lambdaArn")
        .s3Bucket("s3Bucket")

        // the properties below are optional
        .invocationCondition(DocumentAttributeConditionProperty.builder()
                .conditionDocumentAttributeKey("conditionDocumentAttributeKey")
                .operator("operator")

                // the properties below are optional
                .conditionOnValue(DocumentAttributeValueProperty.builder()
                        .dateValue("dateValue")
                        .longValue(123)
                        .stringListValue(List.of("stringListValue"))
                        .stringValue("stringValue")
                        .build())
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Kendra;

var hookConfigurationProperty = new HookConfigurationProperty {
    LambdaArn = "lambdaArn",
    S3Bucket = "s3Bucket",

    // the properties below are optional
    InvocationCondition = new DocumentAttributeConditionProperty {
        ConditionDocumentAttributeKey = "conditionDocumentAttributeKey",
        Operator = "operator",

        // the properties below are optional
        ConditionOnValue = new DocumentAttributeValueProperty {
            DateValue = "dateValue",
            LongValue = 123,
            StringListValue = new [] { "stringListValue" },
            StringValue = "stringValue"
        }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

hookConfigurationProperty := &HookConfigurationProperty{
	LambdaArn: jsii.String("lambdaArn"),
	S3Bucket: jsii.String("s3Bucket"),

	// the properties below are optional
	InvocationCondition: &DocumentAttributeConditionProperty{
		ConditionDocumentAttributeKey: jsii.String("conditionDocumentAttributeKey"),
		Operator: jsii.String("operator"),

		// the properties below are optional
		ConditionOnValue: &DocumentAttributeValueProperty{
			DateValue: jsii.String("dateValue"),
			LongValue: jsii.Number(123),
			StringListValue: []*string{
				jsii.String("stringListValue"),
			},
			StringValue: jsii.String("stringValue"),
		},
	},
}

Properties ​

invocationConditionoptionalIResolvable | CfnDataSource.DocumentAttributeConditionPropertyinvocation_conditionoptionaltyping.Union[IResolvable, DocumentAttributeConditionProperty]invocationConditionoptionalIResolvableInvocationConditionoptionalIResolvableInvocationConditionoptionalinterface{}#
The condition used for when a Lambda function should be invoked.

For example, you can specify a condition that if there are empty date-time values, then Amazon Kendra should invoke a function that inserts the current date-time.

lambdaArnstringlambda_arnstrlambdaArnStringLambdaArnstringLambdaArn*stringrequired#
The Amazon Resource Name (ARN) of an IAM role with permission to run a Lambda function during ingestion.

For more information, see an IAM roles for Amazon Kendra .

s3Bucketstrings3_bucketstrs3BucketStringS3BucketstringS3Bucket*stringrequired#
Stores the original, raw documents or the structured, parsed documents before and after altering them.

For more information, see Data contracts for Lambda functions .