Skip to content

Commit d4a7afe

Browse files
committed
Updates to classes and specification
1 parent 4210f94 commit d4a7afe

File tree

7 files changed

+369
-51
lines changed

7 files changed

+369
-51
lines changed

dotnetv4/IoT/Actions/IoTWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Amazon.IotData;
77
using Amazon.IotData.Model;
88
using Microsoft.Extensions.Logging;
9-
using System.Text.Json;
109

1110
namespace IoTActions;
1211

@@ -542,5 +541,6 @@ public async Task<List<ThingAttribute>> ListThingsAsync()
542541
}
543542
}
544543
// snippet-end:[iot.dotnetv4.ListThings]
544+
545545
}
546546
// snippet-end:[iot.dotnetv4.IoTWrapper]

dotnetv4/IoT/Scenarios/IoTBasics.cs

Lines changed: 345 additions & 47 deletions
Large diffs are not rendered by default.

dotnetv4/IoT/Scenarios/IoTBasics.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<ItemGroup>
1111
<PackageReference Include="AWSSDK.IoT" Version="4.0.3.7" />
1212
<PackageReference Include="AWSSDK.IotData" Version="4.0.2.7" />
13+
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="4.0.2.7" />
14+
<PackageReference Include="AWSSDK.IdentityManagement" Version="4.0.3.7" />
1315
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.3.14" />
1416
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
1517
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"AwsIotDataConfig": {
3+
"Profile": "default",
4+
"ServiceURL": "https://data.iot.us-east-1.amazonaws.com/"
5+
},
6+
7+
"AwsConfig": {
8+
"Profile": "default",
9+
"Region": "us-east-1"
10+
}
11+
}

dotnetv4/IoT/Tests/IoTIntegrationTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Amazon.IoT;
55
using Amazon.IotData;
66
using IoTActions;
7+
using IoTScenarios;
78
using Microsoft.Extensions.DependencyInjection;
89
using Microsoft.Extensions.Hosting;
910
using Microsoft.Extensions.Logging;
@@ -49,6 +50,9 @@ public IoTIntegrationTests(ITestOutputHelper output)
4950
[Trait("Category", "Integration")]
5051
public async Task IoTWrapperMethodsTest()
5152
{
53+
// Set to non-interactive mode for testing
54+
IoTScenarios.IoTBasics.IsInteractive = false;
55+
5256
var thingName = $"test-thing-{Guid.NewGuid():N}";
5357
var certificateArn = "";
5458
var certificateId = "";

dotnetv4/IoT/Tests/IoTTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
<ItemGroup>
3131
<ProjectReference Include="..\Actions\IoTActions.csproj" />
32+
<ProjectReference Include="..\Scenarios\IoTBasics.csproj" />
3233
</ItemGroup>
3334

3435
</Project>

scenarios/basics/iot/SPECIFICATION.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ This example shows how to use AWS SDKs to perform device management use cases us
66
The AWS Iot API provides secure, bi-directional communication between Internet-connected devices (such as sensors, actuators, embedded devices, or smart appliances) and the Amazon Web Services cloud. This example shows some typical use cases such as creating things, creating certifications, applying the certifications to the IoT Thing and so on.
77

88
## Resources
9-
This program requires these AWS resources.
9+
This program should create and manage these AWS resources automatically:
1010

11-
1. **roleARN** - The ARN of an IAM role that has permission to work with AWS IOT.
12-
2. **snsAction** - An ARN of an SNS topic.
11+
1. **roleARN** - The ARN of an IAM role that has permission to work with AWS IOT. This role must be automatically created during the scenario execution with proper permissions to publish to SNS topics.
12+
2. **snsAction** - An ARN of an SNS topic. This topic must be automatically created during the scenario execution for use with IoT rules.
13+
14+
Both resources must be created during scenario setup and automatically cleaned up at the end of the scenario execution.
1315

1416
## Hello AWS IoT
1517

0 commit comments

Comments
 (0)