1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
I figured it out. For anyone who runs into this same problem, you can create a second section in your appsettings.json:
"AwsIotDataConfig": {
"Profile": "default",
"ServiceURL": "https://data.iot.us-east-1.amazonaws.com/"
},
"AwsConfig": {
"Profile": "default",
"Region": "us-east-1"
}
then in your Startup.cs, when you call GetAWSOptions, you can pass in the name of the config section:
var awsGenericOptions = Configuration.GetAWSOptions("AwsConfig");
services.AddDefaultAWSOptions(awsGenericOptions);
var awsIotDataOptions = Configuration.GetAWSOptions("AwsIotDataConfig");
and when you add the IotData service, specify that it should use the IotData specific options:
services.AddAWSService<IAmazonIoT>();
services.AddAWSService<IAmazonIotData>(awsIotDataOptions);
답변함 5년 전
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 3년 전