Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates: Q app and fix for datasource configuration #56

Merged
merged 3 commits into from
Jul 3, 2024

Conversation

jregistr
Copy link
Contributor

@jregistr jregistr commented Jul 3, 2024

Issue #, if available:
Fixes #54

Description of changes:

  1. Adds Q apps configuration to Application schema
  2. Fix issue where an invalid request error was returned for DataSource configurations that used a boolean in the config json.
    For freeform JSONs in cfn (see Web crawler JSON schema for example), we'll receive number and boolean values as String in handler code and that String would then be sent to Q api which will reject it since it expects a boolean.
    This PR introduces a fix that will check string values for "true" or "false" and turn them into a boolean document.
    With this fix it is now possible to create a Datasource using the template below
{
      "Type": "AWS::QBusiness::DataSource",
      "Properties": {
        "DisplayName": "I-Am-DataSource",
        "Description": "A datasource created with cfn",
        "ApplicationId": {"Fn::ImportValue":  "appId"},
        "IndexId": {"Fn::ImportValue":  "indexId"},
        "RoleArn": {"Fn::ImportValue":  "theDataSourceRole"},
        "Configuration": {
          "type": "WEBCRAWLERV2",
          "syncMode": "FORCED_FULL_CRAWL",
          "connectionConfiguration": {
            "repositoryEndpointMetadata": {
              "seedUrlConnections": [
                {
                  "seedUrl": "https://en.wikipedia.org/wiki/Dijkstra's_algorithm"
                }
              ]
            }
          },
          "repositoryConfigurations": {
            "webPage": {
              "fieldMappings": [
                {
                  "dataSourceFieldName": "webs_id",
                  "indexFieldName": "webs_id",
                  "indexFieldType": "LONG"
                }
              ]
            }
          },
          "additionalProperties": {
            "rateLimit": "300",
            "maxFileSize": "50",
            "crawlDepth": "1",
            "crawlSubDomain": true,
            "crawlAllDomain": false,
            "maxLinksPerUrl": "5",
            "honorRobots": true,
            "proxy": {}
          }
        }
      }
    }

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jregistr jregistr marked this pull request as ready for review July 3, 2024 17:44
@jregistr jregistr merged commit 47cc991 into aws-cloudformation:main Jul 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebCrawler data source cannot be created
2 participants