gpt4 book ai didi

amazon-web-services - 在 SAM 模板中添加 AWS Glue 作业和爬网程序后,标签未添加/更新

转载 作者:行者123 更新时间:2023-12-03 07:16:35 26 4
gpt4 key购买 nike

MainGlueJob:
Type: AWS::Glue::Job
Properties:
Name: !Ref GlueJobName
Role: !Ref GlueResourcesServiceRoleName
Description: Job created with CloudFormation.
GlueVersion: 2.0
Command:
Name: glueetl
PythonVersion: 3
ScriptLocation: !Ref JobScriptLocation
AllocatedCapacity: 3
ExecutionProperty:
MaxConcurrentRuns: 1
DefaultArguments:
--job-bookmark-option: job-bookmark-enable
--enable-continuous-cloudwatch-log: true
--enable-metrics: true
--enable-s3-parquet-optimized-committer: true
--TempDir: 's3://aws-glue-temporary-123-ap-south-1/dir'
Tags: {
"tag:Key1": "Value1",
"tag:Key2": "Value2"
}

MainCrawler:
Type: AWS::Glue::Crawler
Properties:
Name: Main
Role: !Ref GlueResourcesServiceRoleName
Description: AWS Glue crawler
DatabaseName: !Ref DatabaseName
Targets:
S3Targets:
- Path: !Ref S3Path
SchemaChangePolicy:
UpdateBehavior: "UPDATE_IN_DATABASE"
DeleteBehavior: "LOG"
Configuration: '{"Version":1.0,"CrawlerOutput":{"Partitions":{"AddOrUpdateBehavior":"InheritFromTable"},"Tables":{"AddOrUpdateBehavior":"MergeNewColumns"}}}'
Tags: {
"tag:Key1": "Value1",
"tag:Key2": "Value2"
}

尝试在 SAM 模板中为粘合作业定义标签,但未在粘合作业或爬虫中更新

Tags: {
"tagKeyName1": "tagValue1",
"tagKeyName2": "tagValue2",
"tagKeyName3": "tagValue3"
}

我只能用标签更新胶水资源,因为胶水作业已在使用中。由于 Glue 作业书签无法由用户控制,因此堆栈的删除和重新创建将花费我们大量成本。

我正在使用 SAM 模板并尝试将标签添加到 Glue Job 和 Crawler。

是否要使用标签更新资源?

在 Glue 资源的 SAM 模板中声明标签的正确格式是什么?

有人愿意帮忙吗?

最佳答案

你可以尝试:

Tags: {
tagKeyName1: !Ref tagValue1
tagKeyName2: !Ref tagValue2
tagKeyName3: !Ref tagValue3
}

这必须是 JSON 格式:不要使用引号或大括号。

关于amazon-web-services - 在 SAM 模板中添加 AWS Glue 作业和爬网程序后,标签未添加/更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65558696/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com