|
| 1 | +# Amazon IoT code examples for the SDK for .NET (v4) |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Shows how to use the AWS SDK for .NET (v4) to work with AWS IoT Core. |
| 6 | + |
| 7 | +<!--custom.overview.start--> |
| 8 | +<!--custom.overview.end--> |
| 9 | + |
| 10 | +_AWS IoT Core is a managed cloud service that lets connected devices easily and securely interact with cloud applications and other devices._ |
| 11 | + |
| 12 | +## ⚠ Important |
| 13 | + |
| 14 | +* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/). |
| 15 | +* Running the tests might result in charges to your AWS account. |
| 16 | +* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). |
| 17 | +* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). |
| 18 | + |
| 19 | +<!--custom.important.start--> |
| 20 | +<!--custom.important.end--> |
| 21 | + |
| 22 | +## Code examples |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +For prerequisites, see the [README](../README.md#Prerequisites) in the `dotnetv4` folder. |
| 27 | + |
| 28 | + |
| 29 | +<!--custom.prerequisites.start--> |
| 30 | +<!--custom.prerequisites.end--> |
| 31 | + |
| 32 | +### Get started |
| 33 | + |
| 34 | +- [Hello AWS IoT](Actions/HelloIoT.cs#L20) (`ListThings`) |
| 35 | + |
| 36 | + |
| 37 | +### Basics |
| 38 | + |
| 39 | +Code examples that show you how to perform the essential operations within a service. |
| 40 | + |
| 41 | +- [Learn the basics](Scenarios/IoTBasics.cs) |
| 42 | + |
| 43 | + |
| 44 | +### Single actions |
| 45 | + |
| 46 | +Code excerpts that show you how to call individual service functions. |
| 47 | + |
| 48 | +- [AttachThingPrincipal](Actions/IoTWrapper.cs#L156) |
| 49 | +- [CreateKeysAndCertificate](Actions/IoTWrapper.cs#L84) |
| 50 | +- [CreateThing](Actions/IoTWrapper.cs#L34) |
| 51 | +- [CreateTopicRule](Actions/IoTWrapper.cs#L336) |
| 52 | +- [DeleteCertificate](Actions/IoTWrapper.cs#L556) |
| 53 | +- [DeleteThing](Actions/IoTWrapper.cs#L589) |
| 54 | +- [DescribeEndpoint](Actions/IoTWrapper.cs#L213) |
| 55 | +- [DetachThingPrincipal](Actions/IoTWrapper.cs#L526) |
| 56 | +- [GetThingShadow](Actions/IoTWrapper.cs#L312) |
| 57 | +- [ListCertificates](Actions/IoTWrapper.cs#L243) |
| 58 | +- [ListThings](Actions/IoTWrapper.cs#L614) |
| 59 | +- [ListTopicRules](Actions/IoTWrapper.cs#L373) |
| 60 | +- [SearchIndex](Actions/IoTWrapper.cs#L402) |
| 61 | +- [UpdateThing](Actions/IoTWrapper.cs#L119) |
| 62 | +- [UpdateThingShadow](Actions/IoTWrapper.cs#L280) |
| 63 | + |
| 64 | + |
| 65 | +<!--custom.examples.start--> |
| 66 | +<!--custom.examples.end--> |
| 67 | + |
| 68 | +## Run the examples |
| 69 | + |
| 70 | +### Instructions |
| 71 | + |
| 72 | + |
| 73 | +<!--custom.instructions.start--> |
| 74 | +<!--custom.instructions.end--> |
| 75 | + |
| 76 | +#### Hello AWS IoT |
| 77 | + |
| 78 | +This example shows you how to get started using AWS IoT Core. |
| 79 | + |
| 80 | + |
| 81 | +#### Learn the basics |
| 82 | + |
| 83 | +This example shows you how to do the following: |
| 84 | + |
| 85 | +- Create an AWS IoT Thing. |
| 86 | +- Generate a device certificate. |
| 87 | +- Update an AWS IoT Thing with Attributes. |
| 88 | +- Return a unique endpoint specific to the Amazon Web Services account. |
| 89 | +- List your AWS IoT certificates. |
| 90 | +- Create an AWS IoT shadow that refers to a digital representation or virtual twin of a physical IoT device. |
| 91 | +- Write out the state information, in JSON format. |
| 92 | +- Creates a rule that is an administrator-level action. |
| 93 | +- List your rules. |
| 94 | +- Search things using the Thing name. |
| 95 | +- Clean up resources. |
| 96 | + |
| 97 | +<!--custom.basic_prereqs.iot_Scenario.start--> |
| 98 | +<!--custom.basic_prereqs.iot_Scenario.end--> |
| 99 | + |
| 100 | + |
| 101 | +<!--custom.basics.iot_Scenario.start--> |
| 102 | +<!--custom.basics.iot_Scenario.end--> |
| 103 | + |
| 104 | + |
| 105 | +### Tests |
| 106 | + |
| 107 | +⚠ Running tests might result in charges to your AWS account. |
| 108 | + |
| 109 | + |
| 110 | +To find instructions for running these tests, see the [README](../README.md#Tests) |
| 111 | +in the `dotnetv4` folder. |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | +<!--custom.tests.start--> |
| 116 | +<!--custom.tests.end--> |
| 117 | + |
| 118 | +## Additional resources |
| 119 | + |
| 120 | +- [AWS IoT Core Developer Guide](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) |
| 121 | +- [AWS IoT Core API Reference](https://docs.aws.amazon.com/iot/latest/apireference/Welcome.html) |
| 122 | +- [SDK for .NET (v4) AWS IoT reference](https://docs.aws.amazon.com/sdkfornet/v4/apidocs/items/IoT/NIoT.html) |
| 123 | + |
| 124 | +<!--custom.resources.start--> |
| 125 | +<!--custom.resources.end--> |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 130 | + |
| 131 | +SPDX-License-Identifier: Apache-2.0 |
0 commit comments