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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン