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": []
}
已提问 1 年前336 查看次数
2 回答
0
已接受的回答

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
专家
已回答 1 年前
  • 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.

已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则