aws-solutions / data-connectors-for-aws-clean-rooms

Simplify the process of selecting application sources and preparing data for collaborating in AWS Clean Rooms
Apache License 2.0
13 stars 4 forks source link

Consolidate CfnConditions used for creating Databrew dataset #30

Closed thyagram-aws closed 10 months ago

thyagram-aws commented 1 year ago

Describe the feature you'd like Consolidate CfnConditions used for creating Databrew dataset to be more coherent and easy to follow in the code.

thyagram-aws commented 1 year ago

An example of what it could look like:

       dataset_format_option_value = Fn.condition_if(input_data_file_format_json_document_condition.logical_id,
            Fn.condition_if(input_data_file_format_json_multiline_condition.logical_id,
                json_multiline_value,
                Fn.condition_if(input_data_file_format_csv_noheader_condition.logical_id,
                    csv_no_header_value,
                    Fn.condition_if(input_data_file_format_csv_header_condition.logical_id,
                        csv_header_value,
                        Aws.NO_VALUE
                    ).to_string()
                ).to_string()
            ).to_string()
        ).to_string()

        dataset_format_value =  Fn.condition_if(input_data_file_format_json_document_condition.logical_id,
            "JSON",
            Fn.condition_if(input_data_file_format_json_multiline_condition.logical_id,
                "JSON",
                Fn.condition_if(input_data_file_format_csv_noheader_condition.logical_id,
                    "CSV",
                    Fn.condition_if(input_data_file_format_csv_header_condition.logical_id,
                        "CSV",
                        Aws.NO_VALUE
                    ).to_string()
                ).to_string()
            ).to_string()
        ).to_string()