1 Answer
- Newest
- Most votes
- Most comments
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);
answered 6 years ago
Relevant content
- asked 2 years ago
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago