gpt4 book ai didi

amazon-web-services - 如何在appflow中自动映射字段?

转载 作者:行者123 更新时间:2023-12-04 13:53:29 31 4
gpt4 key购买 nike

我正在尝试通过云形成自动创建应用程序流。我在源中有多个字段(130+)并且我无法手动映射它。从 UI 中我可以直接选择多个列,但从 cloudformation 中我必须指定,因此寻找是否有任何选项可以自动从源中获取所有列。

AWSTemplateFormatVersion: "2010-09-09"
Metadata:
Generator: "Automation"
Description: ""
Parameters:
snowusername:
Type: String
MaxLength: 128
snowpassword:
Type: String
MaxLength: 128
ServicenowUrl:
Type: String
MaxLength: 180
Resources:
AppFlowFlowTest:
Type: "AWS::AppFlow::Flow"
Properties:
FlowName: "IMGroupTest"
Description: "Servicenow"
SourceFlowConfig:
ConnectorType: "Servicenow"
ConnectorProfileName: !Ref AppFlowConnectorProfile
SourceConnectorProperties:
ServiceNow:
Object: "business_service_group"
DestinationFlowConfigList:
-
ConnectorType: "S3"
DestinationConnectorProperties:
S3:
BucketName: "raw-data
BucketPrefix: "servicenow/appflow"
S3OutputFormatConfig:
FileType: "PARQUET"
PrefixConfig:
PrefixType: "FILENAME"
AggregationConfig:
AggregationType: "None"
TriggerConfig:
TriggerType: "OnDemand"
Tasks:
-
SourceFields:
- "id"
- "site_name"
.
.
.
.

最佳答案

关于使用 Map_all 的 AWS 文档有点缺乏。当没有传递 TaskProperties 时,Map_all 任务(至少在使用 YAML 时)会出错。为了解决这个问题,我添加了 EXCLUDE_SOURCE_FIELDS_LIST 属性并传递一个空列表,因为我不想排除任何字段。

以下是模板的相关部分:

Tasks:
- TaskType: Map_all
SourceFields: []
TaskProperties:
- Key: EXCLUDE_SOURCE_FIELDS_LIST
Value: '[]'
ConnectorOperator:
Salesforce: NO_OP

这是我的完整模板

    AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation Template for a MAP_ALL Salesforce AppFlow
Parameters:
Connection:
Type: String
S3Bucket:
Type: String
BucketPrefix:
Type: String
ObjectName:
Type: String
FlowName:
Type: String
Resources:

GenericFlow:
Type: 'AWS::AppFlow::Flow'
Properties:
Description: !Join [ "", [ 'App Flow for ', !Ref ObjectName, ' object' ] ]
DestinationFlowConfigList:
- ConnectorType: S3
DestinationConnectorProperties:
S3:
BucketName: !Ref S3Bucket
BucketPrefix: !Ref BucketPrefix
S3OutputFormatConfig:
AggregationConfig:
AggregationType: None
FileType: PARQUET
FlowName: !Ref FlowName
SourceFlowConfig:
ConnectorProfileName: !Ref Connection
ConnectorType: Salesforce
SourceConnectorProperties:
Salesforce:
EnableDynamicFieldUpdate: true
IncludeDeletedRecords: false
Object: !Ref ObjectName
Tasks:
- TaskType: Map_all
SourceFields: []
TaskProperties:
- Key: EXCLUDE_SOURCE_FIELDS_LIST
Value: '[]'
ConnectorOperator:
Salesforce: NO_OP
TriggerConfig:
TriggerType: OnDemand

关于amazon-web-services - 如何在appflow中自动映射字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66742683/

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