AWS Glue ListCrawlers - StepFunctions

0

Hi All,

I'm trying to get Glue crawlers names based on Tags (Key/Value) using "ListCrawlers" in Step Functions. It is working with single tag, but how to give multiple tags in ListCrawlers step. Please find the code example below. I was expecting two crawler names which have the tags - "test": "test_crawler",. and "Name": "crawler_customer_csv"

Can you please help me on this one?

Step Functions Code

{
  "Comment": "List Crawler names based on input tags.",
  "StartAt": "ListCrawlers",
  "States": {
    "ListCrawlers": {
      "Type": "Task",
      "End": true,
      "Parameters": {
        "MaxResults.$": "$.maxResults",
        "Tags.$": "$.tags"
      },
      "Resource": "arn:aws:states:::aws-sdk:glue:listCrawlers"
    }
  }
}

Input Event:

{
  "maxResults": 10,
  "tags": {
    "test": "test_crawler",
    "Name": "crawler_customer_csv"
  }
}

Output Response

{
  "CrawlerNames": []
}
asked a year ago329 views
2 Answers
0
Accepted Answer

Hi,

Both your code and the input parameters seem correct. Are you sure that when you filter by more than one tag the crawler contains all of them? Otherwise the listCrawlers method will not return it.

Additionally, remember that tags are case-sensitive, so they must be written exactly the same.

profile picture
EXPERT
answered a year ago
  • Hi,

    Thanks for the response. I want to confirm one thing, ListCrawler will return crawler names that are matching to the given input tags, correct? In my code example, I was expecting two crawler names which have those tags.

  • Yes, as long as the crawler matches all the tags specified in the input parameter.

0

Hi,

It looks like there is a bug in ListCrawler action/method. It is not working with different Key Value pair in Tags.

I have modified my crawler tags to use same tags for two different crawlers. At that time, ListCrawler actions returned two crawlers names which are matching to that Tag value.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions