# ReferenceDataSourceProperty

For a SQL-based Kinesis Data Analytics application, describes the reference data source by providing the source information (Amazon S3 bucket name and object key name), the resulting in-application table name that is created, and the necessary schema to map the data elements in the Amazon S3 object to the in-application table.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_kinesisanalytics as kinesisanalytics } from 'aws-cdk-lib';
const referenceDataSourceProperty: kinesisanalytics.CfnApplicationReferenceDataSourceV2.ReferenceDataSourceProperty = {
  referenceSchema: {
    recordColumns: [{
      name: 'name',
      sqlType: 'sqlType',

      // the properties below are optional
      mapping: 'mapping',
    }],
    recordFormat: {
      recordFormatType: 'recordFormatType',

      // the properties below are optional
      mappingParameters: {
        csvMappingParameters: {
          recordColumnDelimiter: 'recordColumnDelimiter',
          recordRowDelimiter: 'recordRowDelimiter',
        },
        jsonMappingParameters: {
          recordRowPath: 'recordRowPath',
        },
      },
    },

    // the properties below are optional
    recordEncoding: 'recordEncoding',
  },

  // the properties below are optional
  s3ReferenceDataSource: {
    bucketArn: 'bucketArn',
    fileKey: 'fileKey',
  },
  tableName: 'tableName',
};
```

Python:

```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_kinesisanalytics as kinesisanalytics

reference_data_source_property = kinesisanalytics.CfnApplicationReferenceDataSourceV2.ReferenceDataSourceProperty(
    reference_schema=kinesisanalytics.CfnApplicationReferenceDataSourceV2.ReferenceSchemaProperty(
        record_columns=[kinesisanalytics.CfnApplicationReferenceDataSourceV2.RecordColumnProperty(
            name="name",
            sql_type="sqlType",

            # the properties below are optional
            mapping="mapping"
        )],
        record_format=kinesisanalytics.CfnApplicationReferenceDataSourceV2.RecordFormatProperty(
            record_format_type="recordFormatType",

            # the properties below are optional
            mapping_parameters=kinesisanalytics.CfnApplicationReferenceDataSourceV2.MappingParametersProperty(
                csv_mapping_parameters=kinesisanalytics.CfnApplicationReferenceDataSourceV2.CSVMappingParametersProperty(
                    record_column_delimiter="recordColumnDelimiter",
                    record_row_delimiter="recordRowDelimiter"
                ),
                json_mapping_parameters=kinesisanalytics.CfnApplicationReferenceDataSourceV2.JSONMappingParametersProperty(
                    record_row_path="recordRowPath"
                )
            )
        ),

        # the properties below are optional
        record_encoding="recordEncoding"
    ),

    # the properties below are optional
    s3_reference_data_source=kinesisanalytics.CfnApplicationReferenceDataSourceV2.S3ReferenceDataSourceProperty(
        bucket_arn="bucketArn",
        file_key="fileKey"
    ),
    table_name="tableName"
)
```

Java:

```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.kinesisanalytics.*;

ReferenceDataSourceProperty referenceDataSourceProperty = ReferenceDataSourceProperty.builder()
        .referenceSchema(ReferenceSchemaProperty.builder()
                .recordColumns(List.of(RecordColumnProperty.builder()
                        .name("name")
                        .sqlType("sqlType")

                        // the properties below are optional
                        .mapping("mapping")
                        .build()))
                .recordFormat(RecordFormatProperty.builder()
                        .recordFormatType("recordFormatType")

                        // the properties below are optional
                        .mappingParameters(MappingParametersProperty.builder()
                                .csvMappingParameters(CSVMappingParametersProperty.builder()
                                        .recordColumnDelimiter("recordColumnDelimiter")
                                        .recordRowDelimiter("recordRowDelimiter")
                                        .build())
                                .jsonMappingParameters(JSONMappingParametersProperty.builder()
                                        .recordRowPath("recordRowPath")
                                        .build())
                                .build())
                        .build())

                // the properties below are optional
                .recordEncoding("recordEncoding")
                .build())

        // the properties below are optional
        .s3ReferenceDataSource(S3ReferenceDataSourceProperty.builder()
                .bucketArn("bucketArn")
                .fileKey("fileKey")
                .build())
        .tableName("tableName")
        .build();
```

C# / .NET:

```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.KinesisAnalytics;

var referenceDataSourceProperty = new ReferenceDataSourceProperty {
    ReferenceSchema = new ReferenceSchemaProperty {
        RecordColumns = new [] { new RecordColumnProperty {
            Name = "name",
            SqlType = "sqlType",

            // the properties below are optional
            Mapping = "mapping"
        } },
        RecordFormat = new RecordFormatProperty {
            RecordFormatType = "recordFormatType",

            // the properties below are optional
            MappingParameters = new MappingParametersProperty {
                CsvMappingParameters = new CSVMappingParametersProperty {
                    RecordColumnDelimiter = "recordColumnDelimiter",
                    RecordRowDelimiter = "recordRowDelimiter"
                },
                JsonMappingParameters = new JSONMappingParametersProperty {
                    RecordRowPath = "recordRowPath"
                }
            }
        },

        // the properties below are optional
        RecordEncoding = "recordEncoding"
    },

    // the properties below are optional
    S3ReferenceDataSource = new S3ReferenceDataSourceProperty {
        BucketArn = "bucketArn",
        FileKey = "fileKey"
    },
    TableName = "tableName"
};
```

Golang:

```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"

referenceDataSourceProperty := &ReferenceDataSourceProperty{
	ReferenceSchema: &ReferenceSchemaProperty{
		RecordColumns: []interface{}{
			&RecordColumnProperty{
				Name: jsii.String("name"),
				SqlType: jsii.String("sqlType"),

				// the properties below are optional
				Mapping: jsii.String("mapping"),
			},
		},
		RecordFormat: &RecordFormatProperty{
			RecordFormatType: jsii.String("recordFormatType"),

			// the properties below are optional
			MappingParameters: &MappingParametersProperty{
				CsvMappingParameters: &CSVMappingParametersProperty{
					RecordColumnDelimiter: jsii.String("recordColumnDelimiter"),
					RecordRowDelimiter: jsii.String("recordRowDelimiter"),
				},
				JsonMappingParameters: &JSONMappingParametersProperty{
					RecordRowPath: jsii.String("recordRowPath"),
				},
			},
		},

		// the properties below are optional
		RecordEncoding: jsii.String("recordEncoding"),
	},

	// the properties below are optional
	S3ReferenceDataSource: &S3ReferenceDataSourceProperty{
		BucketArn: jsii.String("bucketArn"),
		FileKey: jsii.String("fileKey"),
	},
	TableName: jsii.String("tableName"),
}
```

## Properties

- `referenceSchema`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnApplicationReferenceDataSourceV2.ReferenceSchemaProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesisanalytics.CfnApplicationReferenceDataSourceV2.ReferenceSchemaProperty.html) (required) — Describes the format of the data in the streaming source, and how each data element maps to corresponding columns created in the in-application stream.

- `s3ReferenceDataSource`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnApplicationReferenceDataSourceV2.S3ReferenceDataSourceProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesisanalytics.CfnApplicationReferenceDataSourceV2.S3ReferenceDataSourceProperty.html) — Identifies the S3 bucket and object that contains the reference data.

  A Kinesis Data Analytics application loads reference data only once. If the data changes, you call the [UpdateApplication](https://docs.aws.amazon.com/managed-flink/latest/apiv2/API_UpdateApplication.html) operation to trigger reloading of data into your application.

- `tableName`: string — The name of the in-application table to create.
