<commit_before>component:
  name: api_gateway_rest_api
  dependsOn:
    - iam_api_exec_access
    - lambda_image_handler
  template:
    data:
      null_data_source:
        swagger:
          count: 'contains(list("test"), terraform.workspace) ? 0 : 1'
          depends_on:
            - null_resource.swagger
          inputs:
            path: format("%s/%s", local.component["path"], var.api_gateway_swagger_file_path)
      template_file:
        swagger:
          count: 'contains(list("test"), terraform.workspace) ? 0 : 1'
          template: >-
            file(format("%s/%s", local.component["path"], var.api_gateway_swagger_file_tpl_path))
          vars:
            host: var.api_gateway_host
            title: var.api_gateway_name
            iam_api_exec_access_role_arn: >-
              element(data.terraform_remote_state.iam_api_exec_access.outputs.arn,
              count.index),
            lambda_image_handler_uri: >-
              element(data.terraform_remote_state.lambda_image_handler.outputs.invoke_arn,
              count.index)
    resource:
      null_resource:
        swagger:
          count: 'contains(list("test"), terraform.workspace) ? 0 : 1'
          triggers:
            timestamp: timestamp()
            shasum: filebase64sha512(format("%s/%s", local.component["path"], var.api_gateway_swagger_file_tpl_path))
          provisioner:
            - local-exec:
                command: >-
                  format("echo '%s' > %s",
                    element(data.template_file.swagger.*.rendered, count.index),
                    format("%s/%s", local.component["path"], var.api_gateway_swagger_file_base_path)
                  )
            - local-exec:
                command: >-
                  format("npm install --production --prefix ./scripts && node ./scripts/generateSwaggerFiles.js %s",
                    format("%s/%s", local.component["path"],
                    var.api_gateway_swagger_file_base_path)
                  )
      aws_api_gateway_rest_api:
        api_gateway_rest_api:
          depends_on:
            - null_resource.swagger
          count: 'contains(list("test"), terraform.workspace) ? 0 : 1'
          name: var.api_gateway_name
          body: >-
            file(element(data.null_data_source.swagger.*.outputs.path, count.index))
          description: Managed by TerraHub
    dynamic:
      data:
        terraform_remote_state:
          - component: '*'
            name: '*'
    tfvars:
      api_gateway_name: MitocGroupDevApieee23249
      api_gateway_host: api-dev.mitocgroup.com
      api_gateway_description: Managed by TerraHub
      api_gateway_swagger_file_base_path: swagger.yml
      api_gateway_swagger_file_path: api-swagger.json
      api_gateway_swagger_file_tpl_path: swagger.yml.tpl
    output:
      id:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.id
      thub_id:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.id
      created_date:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.created_date
      name:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.name
      execution_arn:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.execution_arn
hook:
  apply:<commit_msg>Update rest_api_agw component<commit_after>component:
  name: api_gateway_rest_api
  dependsOn:
    - iam_api_exec_access
    - lambda_image_handler
  template:
    data:
      null_data_source:
        swagger:
          count: 'contains(list("test"), terraform.workspace) ? 0 : 1'
          depends_on:
            - null_resource.swagger
          inputs:
            path: format("%s/%s", local.component["path"], var.api_gateway_swagger_file_path)
      template_file:
        swagger:
          count: 'contains(list("test"), terraform.workspace) ? 0 : 1'
          template: >-
            file(format("%s/%s", local.component["path"], var.api_gateway_swagger_file_tpl_path))
          vars:
            host: var.api_gateway_host
            title: var.api_gateway_name
            iam_api_exec_access_role_arn: >-
              element(data.terraform_remote_state.iam_api_exec_access.outputs.arn,
              count.index),
            lambda_image_handler_uri: >-
              element(data.terraform_remote_state.lambda_image_handler.outputs.invoke_arn,
              count.index)
    resource:
      null_resource:
        swagger:
          count: 'contains(list("test"), terraform.workspace) ? 0 : 1'
          triggers:
            timestamp: timestamp()
            shasum: filebase64sha512(format("%s/%s", local.component["path"], var.api_gateway_swagger_file_tpl_path))
          provisioner:
            - local-exec:
                command: >-
                  format("echo '%s' > %s",
                    element(data.template_file.swagger.*.rendered, count.index),
                    format("%s/%s", local.component["path"], var.api_gateway_swagger_file_base_path)
                  )
            - local-exec:
                command: >-
                  format("npm install --production --prefix ./scripts && node ./scripts/generateSwaggerFiles.js %s",
                    format("%s/%s", local.component["path"],
                    var.api_gateway_swagger_file_base_path)
                  )
      aws_api_gateway_rest_api:
        api_gateway_rest_api:
          depends_on:
            - null_resource.swagger
          count: 'contains(list("test"), terraform.workspace) ? 0 : 1'
          name: var.api_gateway_name
          binary_media_types: [ '*/*' ]
          body: >-
            file(element(data.null_data_source.swagger.*.outputs.path, count.index))
          description: Managed by TerraHub
    dynamic:
      data:
        terraform_remote_state:
          - component: '*'
            name: '*'
    tfvars:
      api_gateway_name: MitocGroupDevApieee23249
      api_gateway_host: api-dev.mitocgroup.com
      api_gateway_description: Managed by TerraHub
      api_gateway_swagger_file_base_path: swagger.yml
      api_gateway_swagger_file_path: api-swagger.json
      api_gateway_swagger_file_tpl_path: swagger.yml.tpl
    output:
      id:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.id
      thub_id:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.id
      created_date:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.created_date
      name:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.name
      execution_arn:
        value: aws_api_gateway_rest_api.api_gateway_rest_api.*.execution_arn
hook:
  apply:
{'fraction_non_alphanumeric': 0.09918107370336669, 'fraction_numerical': 0.00545950864422202, 'mean_word_length': 2.1798457087753134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5553945', 'n_tokens_mistral': 2100, 'n_tokens_neox': 2074, 'n_words': 280}