Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-8662

Failed to parse AWS region from VPCE endpoint URL in AbstractAWSProcessor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.14.0
    • None
    • None

    Description

      The AWS client library cannot parse the region from custom endpoint URLs properly.
      NIFI-5456 fixed this issue via passing the region configured on the processor to AmazonWebServiceClient.setEndpoint() directly (no parsing needed in the client library, neither in NiFi).
      NIFI-5893 implemented the fix in another way: parsing the region from the endpoint URL on the NiFi side. It is not clear for me what special use case it wanted to solve but a regular VPCE endpoint does not work with it now.

      Endpoint URL: https://vpce-*****************-********.sqs.us-west-2.vpce.amazonaws.com
      Error:

      2021-06-04 18:25:57,101 ERROR [Timer-Driven Process Thread-5] o.apache.nifi.processors.aws.sqs.PutSQS PutSQS[id=c4714170-c2cb-39e9-a36c-c43e4604f64a] Failed to send messages to Amazon SQS due to com.amazonaws.services.sqs.model.AmazonSQSException: Credential should be scoped to a valid region, not 'us-east-1'. (Service: AmazonSQS; Status Code: 403; Error Code: SignatureDoesNotMatch; Request ID: 63ea72ad-a856-5eca-8c00-2b99da238d07)
      

      It seems the "sqs" part does not match the regex used for parsing: ^(?:.[vpce-][a-z0-9-]\.)?([a-z0-9-]+)$.

      However, the endpoint properly works with NIFI-5456 only.

      To support both fixes, I will implement the following logic:

      • use the parse method from NIFI-5893 first and use that region if the parse successful (no change here)
      • if the parsing fails, then fall back to NIFI-5456 (that is using the configured region) instead of the hard coded "us-east-1"

      Attachments

        Issue Links

          Activity

            People

              turcsanyip Peter Turcsanyi
              turcsanyip Peter Turcsanyi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m