diff --git a/aws/resource_aws_kinesis_analytics_application.go b/aws/resource_aws_kinesis_analytics_application.go index 99fb400c4ec..8930fc77bca 100644 --- a/aws/resource_aws_kinesis_analytics_application.go +++ b/aws/resource_aws_kinesis_analytics_application.go @@ -218,7 +218,7 @@ func resourceAwsKinesisAnalyticsApplication() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "record_columns": { - Type: schema.TypeSet, + Type: schema.TypeList, Required: true, MaxItems: 1000, Elem: &schema.Resource{ @@ -481,7 +481,7 @@ func resourceAwsKinesisAnalyticsApplication() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "record_columns": { - Type: schema.TypeSet, + Type: schema.TypeList, Required: true, MaxItems: 1000, Elem: &schema.Resource{ @@ -1248,8 +1248,8 @@ func expandKinesisAnalyticsInputUpdate(vInput []interface{}) *kinesisanalytics.I mInputSchema := vInputSchema[0].(map[string]interface{}) - if vRecordColumns, ok := mInputSchema["record_columns"].(*schema.Set); ok && vRecordColumns.Len() > 0 { - inputSchemaUpdate.RecordColumnUpdates = expandKinesisAnalyticsRecordColumns(vRecordColumns.List()) + if vRecordColumns, ok := mInputSchema["record_columns"].([]interface{}); ok { + inputSchemaUpdate.RecordColumnUpdates = expandKinesisAnalyticsRecordColumns(vRecordColumns) } if vRecordEncoding, ok := mInputSchema["record_encoding"].(string); ok && vRecordEncoding != "" { @@ -1555,8 +1555,8 @@ func expandKinesisAnalyticsSourceSchema(vSourceSchema []interface{}) *kinesisana mSourceSchema := vSourceSchema[0].(map[string]interface{}) - if vRecordColumns, ok := mSourceSchema["record_columns"].(*schema.Set); ok && vRecordColumns.Len() > 0 { - sourceSchema.RecordColumns = expandKinesisAnalyticsRecordColumns(vRecordColumns.List()) + if vRecordColumns, ok := mSourceSchema["record_columns"].([]interface{}); ok { + sourceSchema.RecordColumns = expandKinesisAnalyticsRecordColumns(vRecordColumns) } if vRecordEncoding, ok := mSourceSchema["record_encoding"].(string); ok && vRecordEncoding != "" { diff --git a/aws/resource_aws_kinesis_analytics_application_test.go b/aws/resource_aws_kinesis_analytics_application_test.go index 6fb4fd9385f..bcf278756be 100644 --- a/aws/resource_aws_kinesis_analytics_application_test.go +++ b/aws/resource_aws_kinesis_analytics_application_test.go @@ -483,10 +483,8 @@ func TestAccAWSKinesisAnalyticsApplication_Input_Add(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -549,10 +547,8 @@ func TestAccAWSKinesisAnalyticsApplication_Input_Update(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -592,16 +588,12 @@ func TestAccAWSKinesisAnalyticsApplication_Input_Update(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "2"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_2", - "sql_type": "VARCHAR(8)", - "mapping": "MAPPING-2", - }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_3", - "sql_type": "DOUBLE", - "mapping": "MAPPING-3", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.mapping", "MAPPING-2"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_2"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "VARCHAR(8)"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.1.mapping", "MAPPING-3"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.1.name", "COLUMN_3"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.1.sql_type", "DOUBLE"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", "UTF-8"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -662,10 +654,8 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Add(t *t resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -705,10 +695,8 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Add(t *t resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -773,10 +761,8 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Delete(t resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -819,10 +805,8 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Delete(t resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -886,10 +870,8 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Update(t resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -932,10 +914,8 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Update(t resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1006,10 +986,8 @@ func TestAccAWSKinesisAnalyticsApplication_Multiple_Update(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1063,16 +1041,12 @@ func TestAccAWSKinesisAnalyticsApplication_Multiple_Update(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "inputs.0.id"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.#", "2"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_2", - "sql_type": "VARCHAR(8)", - "mapping": "MAPPING-2", - }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "inputs.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_3", - "sql_type": "DOUBLE", - "mapping": "MAPPING-3", - }), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.mapping", "MAPPING-2"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.name", "COLUMN_2"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.0.sql_type", "VARCHAR(8)"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.1.mapping", "MAPPING-3"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.1.name", "COLUMN_3"), + resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_columns.1.sql_type", "DOUBLE"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_encoding", "UTF-8"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "inputs.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1112,10 +1086,8 @@ func TestAccAWSKinesisAnalyticsApplication_Multiple_Update(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "reference_data_sources.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "reference_data_sources.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1304,10 +1276,8 @@ func TestAccAWSKinesisAnalyticsApplication_ReferenceDataSource_Add(t *testing.T) resource.TestCheckResourceAttr(resourceName, "reference_data_sources.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "reference_data_sources.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1364,10 +1334,8 @@ func TestAccAWSKinesisAnalyticsApplication_ReferenceDataSource_Delete(t *testing resource.TestCheckResourceAttr(resourceName, "reference_data_sources.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "reference_data_sources.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1444,10 +1412,8 @@ func TestAccAWSKinesisAnalyticsApplication_ReferenceDataSource_Update(t *testing resource.TestCheckResourceAttr(resourceName, "reference_data_sources.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "reference_data_sources.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1483,16 +1449,12 @@ func TestAccAWSKinesisAnalyticsApplication_ReferenceDataSource_Update(t *testing resource.TestCheckResourceAttr(resourceName, "reference_data_sources.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.#", "2"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "reference_data_sources.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_2", - "sql_type": "VARCHAR(8)", - "mapping": "MAPPING-2", - }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "reference_data_sources.0.schema.0.record_columns.*", map[string]string{ - "name": "COLUMN_3", - "sql_type": "DOUBLE", - "mapping": "MAPPING-3", - }), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.mapping", "MAPPING-2"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.name", "COLUMN_2"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.0.sql_type", "VARCHAR(8)"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.1.mapping", "MAPPING-3"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.1.name", "COLUMN_3"), + resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_columns.1.sql_type", "DOUBLE"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_encoding", "UTF-8"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "reference_data_sources.0.schema.0.record_format.0.mapping_parameters.#", "1"), diff --git a/aws/resource_aws_kinesisanalyticsv2_application.go b/aws/resource_aws_kinesisanalyticsv2_application.go index a958bc889a8..928033636fe 100644 --- a/aws/resource_aws_kinesisanalyticsv2_application.go +++ b/aws/resource_aws_kinesisanalyticsv2_application.go @@ -337,7 +337,7 @@ func resourceAwsKinesisAnalyticsV2Application() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "record_column": { - Type: schema.TypeSet, + Type: schema.TypeList, Required: true, MaxItems: 1000, Elem: &schema.Resource{ @@ -598,7 +598,7 @@ func resourceAwsKinesisAnalyticsV2Application() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "record_column": { - Type: schema.TypeSet, + Type: schema.TypeList, Required: true, MaxItems: 1000, Elem: &schema.Resource{ @@ -1897,8 +1897,8 @@ func expandKinesisAnalyticsV2InputUpdate(vInput []interface{}) *kinesisanalytics mInputSchema := vInputSchema[0].(map[string]interface{}) - if vRecordColumns, ok := mInputSchema["record_column"].(*schema.Set); ok && vRecordColumns.Len() > 0 { - inputSchemaUpdate.RecordColumnUpdates = expandKinesisAnalyticsV2RecordColumns(vRecordColumns.List()) + if vRecordColumns, ok := mInputSchema["record_column"].([]interface{}); ok { + inputSchemaUpdate.RecordColumnUpdates = expandKinesisAnalyticsV2RecordColumns(vRecordColumns) } if vRecordEncoding, ok := mInputSchema["record_encoding"].(string); ok && vRecordEncoding != "" { @@ -2208,8 +2208,8 @@ func expandKinesisAnalyticsV2SourceSchema(vSourceSchema []interface{}) *kinesisa mSourceSchema := vSourceSchema[0].(map[string]interface{}) - if vRecordColumns, ok := mSourceSchema["record_column"].(*schema.Set); ok && vRecordColumns.Len() > 0 { - sourceSchema.RecordColumns = expandKinesisAnalyticsV2RecordColumns(vRecordColumns.List()) + if vRecordColumns, ok := mSourceSchema["record_column"].([]interface{}); ok { + sourceSchema.RecordColumns = expandKinesisAnalyticsV2RecordColumns(vRecordColumns) } if vRecordEncoding, ok := mSourceSchema["record_encoding"].(string); ok && vRecordEncoding != "" { diff --git a/aws/resource_aws_kinesisanalyticsv2_application_test.go b/aws/resource_aws_kinesisanalyticsv2_application_test.go index 09099e1d2fe..622d76467b8 100644 --- a/aws/resource_aws_kinesisanalyticsv2_application_test.go +++ b/aws/resource_aws_kinesisanalyticsv2_application_test.go @@ -1059,10 +1059,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Input_A resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1135,10 +1133,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Input_U resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1189,16 +1185,12 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Input_U resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "2"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_2", - "sql_type": "VARCHAR(8)", - "mapping": "MAPPING-2", - }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_3", - "sql_type": "DOUBLE", - "mapping": "MAPPING-3", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.mapping", "MAPPING-2"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_2"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "VARCHAR(8)"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.1.mapping", "MAPPING-3"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.1.name", "COLUMN_3"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.1.sql_type", "DOUBLE"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", "UTF-8"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1270,10 +1262,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1324,10 +1314,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1402,10 +1390,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1458,10 +1444,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1535,10 +1519,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1591,10 +1573,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1673,10 +1653,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Multipl resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1740,16 +1718,12 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Multipl resource.TestCheckResourceAttrSet(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_id"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.#", "2"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_2", - "sql_type": "VARCHAR(8)", - "mapping": "MAPPING-2", - }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_3", - "sql_type": "DOUBLE", - "mapping": "MAPPING-3", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.mapping", "MAPPING-2"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.name", "COLUMN_2"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.0.sql_type", "VARCHAR(8)"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.1.mapping", "MAPPING-3"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.1.name", "COLUMN_3"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_column.1.sql_type", "DOUBLE"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_encoding", "UTF-8"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.input.0.input_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -1786,10 +1760,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Multipl resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -2027,10 +1999,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Referen resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -2098,10 +2068,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Referen resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -2197,10 +2165,8 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Referen resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_1", - "sql_type": "INTEGER", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.name", "COLUMN_1"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.sql_type", "INTEGER"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_encoding", ""), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.0.mapping_parameters.#", "1"), @@ -2247,16 +2213,12 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Referen resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.#", "2"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_2", - "sql_type": "VARCHAR(8)", - "mapping": "MAPPING-2", - }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.*", map[string]string{ - "name": "COLUMN_3", - "sql_type": "DOUBLE", - "mapping": "MAPPING-3", - }), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.mapping", "MAPPING-2"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.name", "COLUMN_2"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.0.sql_type", "VARCHAR(8)"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.1.mapping", "MAPPING-3"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.1.name", "COLUMN_3"), + resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_column.1.sql_type", "DOUBLE"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_encoding", "UTF-8"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.#", "1"), resource.TestCheckResourceAttr(resourceName, "application_configuration.0.sql_application_configuration.0.reference_data_source.0.reference_schema.0.record_format.0.mapping_parameters.#", "1"),