diff --git a/README.md b/README.md index 713a18c..57099fd 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ The Amazon AppFlow Custom Connector SDK is available for both Java and Python on #### For Java SDK Users: -Once you have the jar, create the Amazon Appflow client instance and invoke the AppFlow APIs. +Once you have the jar, create the Amazon AppFlow client instance and invoke the AppFlow APIs. ``` AmazonAppflow appflowClient = AmazonAppflowClientBuilder.standard() diff --git a/custom_connector_example/template.yml b/custom_connector_example/template.yml index d04d05d..4a1b1f1 100644 --- a/custom_connector_example/template.yml +++ b/custom_connector_example/template.yml @@ -8,7 +8,7 @@ Resources: Handler: custom_connector_example.handlers.lambda_handler.salesforce_lambda_handler Runtime: python3.8 CodeUri: ../. - Description: "Example for writing and deploying your Appflow connector" + Description: "Example for writing and deploying your AppFlow connector" Timeout: 30 MemorySize: 256 Policies: diff --git a/custom_connector_integ_test/README.md b/custom_connector_integ_test/README.md index 2d283dd..d960cf8 100644 --- a/custom_connector_integ_test/README.md +++ b/custom_connector_integ_test/README.md @@ -1,5 +1,5 @@ # Integration Test FrameWork -This document explains how to run the integration tests provided by Appflow for a custom connector. +This document explains how to run the integration tests provided by AppFlow for a custom connector. ## Prerequisites: @@ -14,7 +14,7 @@ The framework provides the following test cases. 3. Running a flow from s3 -> connector 4. Running a flow from the connector -> s3 -Additionally, we provide a test class that cleans up all Appflow resources created by the integration tests. +Additionally, we provide a test class that cleans up all AppFlow resources created by the integration tests. This test case cleans up resources based on the prefix "Integ_{ResourceType}" e.g. Integ_Profile. You can also provide a prefix in the test configuration which will be appended to all resources. If you are running multiple test cases in the same aws account, be sure to use this prefix. Otherwise, @@ -69,7 +69,7 @@ A base configuration file can be found in the current directory. ###Resources The configuration file requires several aws resources to already exist in your account. The purpose of these resources is described in the sample-test-config.json file. -1. A S3 bucket with Appflow bucket policy. +1. A S3 bucket with AppFlow bucket policy. 2. A Secrets Manager secret for each set of credentials. 3. A Lambda custom connector. @@ -114,5 +114,5 @@ Tests in unittest run in alphabetical order. Be sure to name your test so that i registered and before the profile is created. -This ensures that the Appflow test cases always run, run after the connectors and connector profiles are created, +This ensures that the AppFlow test cases always run, run after the connectors and connector profiles are created, and run before all resources are deleted. \ No newline at end of file diff --git a/custom_connector_sdk/lambda_handler/requests.py b/custom_connector_sdk/lambda_handler/requests.py index ba28818..2549064 100644 --- a/custom_connector_sdk/lambda_handler/requests.py +++ b/custom_connector_sdk/lambda_handler/requests.py @@ -206,7 +206,8 @@ def __init__(self, # List of JSON serialized string of the entity record as per the entity metadata. self.records = records - # Write all or none if any of the entity records error out. + # Specifies that Write operation will fail after the first instance of a failure when attempting to put data + # to the Application. Or if the Connector Supports Batch operation it will write all records or none. self.all_or_none = all_or_none @classmethod diff --git a/custom_connector_sdk/lambda_handler/responses.py b/custom_connector_sdk/lambda_handler/responses.py index 4ee5829..40ba6c4 100644 --- a/custom_connector_sdk/lambda_handler/responses.py +++ b/custom_connector_sdk/lambda_handler/responses.py @@ -47,40 +47,42 @@ ALL_TRIGGER_TYPES = [op for op in TriggerType] class ErrorCode(Enum): - """Enum of error codes.""" - # Specifies error is due to client. - ClientError = auto() - - # Specifies error is due to application. - ServerError = auto() - - # Invalid arguments provided as input. + """Collection of all normalized error codes for returning errors back to AppFlow.""" + # Invalid arguments provided as input/HttpStatus 400/413 from application/Bad Request exception from Application. + # For example QueryURI too large, write request payload too large etc. InvalidArgument = auto() - # Credentials were rejected by the underlying application. + # Credentials were rejected by the underlying application/HttpStatus 401 from Application. InvalidCredentials = auto() - # Resource access denied by the underlying application. + # Resource access denied by the underlying application/HttpStatus 403 from Application. AccessDenied = auto() - # The request to the underlying application timed out. + # The request to the underlying application timed out/HttpStatus 408 from Application/ + # HttpClient timeout while sending request. RequestTimeout = auto() - # Payload size is too large. - PayloadTooLarge = auto() - - # Request got rejected by the underlying application due to rate limit violation. + # Request got rejected by the underlying application due to rate limit violation/HttpStatus 429 from Application. RateLimitExceeded = auto() - # Not able to serve the request due to an internal error. - InternalServerError = auto() - - # Server is not available to serve the requests at the moment. + # Application is not available to serve the requests at the moment/HttpStatus 503 from Application. ServiceUnavailable = auto() - # Unknown Error from the application. + # Specifies error is due to client or HttpStatus 4XX from Application. + # Use specific error codes if present. + ClientError = auto() + + # Specifies error is due to Application or HttpStatus 5XX from Application. + # Use specific error codes if present. + ServerError = auto() + + # Unknown Error from the Application. Use this ErrorCode only when you are not able to use the + # other specific error codes. UnknownError = auto() + # Specifies that the connector is failed to write all the records to the Application. + PartialWriteFailure = auto() + class ErrorDetails: """Represents the error details.""" def __init__(self, error_code: ErrorCode, error_message: str, retry_after_seconds: int = None): @@ -303,7 +305,7 @@ class WriteDataResponse: def __init__(self, is_success: bool, error_details: ErrorDetails = None, write_record_results: [WriteRecordResult] = None): - # Specifies if the operation is successful or not. + # Specifies if the operation is successful or not. In case of partial failures, this should be set as false. self.is_success = is_success # Error details if the Operation is unsuccessful.