@@ -62,7 +62,7 @@ First, you'll need to install the AWS CDK if you haven't already. The CDK requir
6262See the [ Getting started with the AWS CDK] ( https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html ) for
6363more details.
6464
65- ` npm install -g aws-cdk `
65+ `npm install -g aws-cdk`
6666
6767Next you'll need to install the dependencies for the CDK deployment.
6868
@@ -76,7 +76,7 @@ https://pipenv.pypa.io/en/latest/install/
7676
7777Then you can use pipenv to install all the Python dependencies.
7878
79- ` pipenv install `
79+ `pipenv install`
8080
8181Once all dependencies are installed, you'll need to activate the shell with ` pipenv shell `
8282
@@ -91,11 +91,11 @@ to the ``infrastructure`` directory.
9191
92921 . If this is you're first time using the CDK you'll need to bootstrap your AWS account with the resouces the CDK needs.
9393
94- ` cdk bootstrap `
94+ ` cdk bootstrap `
9595
96962 . Now you're ready to deploy your application.
9797
98- ` cdk deploy `
98+ ` cdk deploy `
9999
100100Note: During deployment, the CDK will ask you to approve of the changes being created by CloudFormation, make sure to
101101type ` y ` when prompted.
@@ -132,25 +132,26 @@ A sample Docker environment file has been included if you choose to run the clie
132132
1331331 . Download the AWS IoT CA server certificate from [ here] ( https://www.amazontrust.com/repository/AmazonRootCA1.pem ) and
134134store it in the ` client ` directory. This will be used by the IoT client to trust the AWS IoT Core Device Gateway.
135- ` wget -O client/AmazonRootCA1.pem https://www.amazontrust.com/repository/AmazonRootCA1.pem `
135+
136+ `wget -O client/AmazonRootCA1.pem https://www.amazontrust.com/repository/AmazonRootCA1.pem`
136137
1371382 . Make sure the correct environment variables mentioned above are configured. The exact commands to do
138139this might vary slightly between operating systems and runtime environments. But generally in standard Linux/Unix shells
139140it's accomplished by running ` $ export <KEY>=<VALUE> ` for each environment variable.
140141
1411423 . With environment variables set, you're ready to start the client. The Python client requires no arguments passed to it.
142143
143- ` python iot_client.py `
144+ ` python iot_client.py `
144145
145146#### Option B - Running in Docker
146147
1471481 . For running with docker, you'll need to build the container locally using the included Dockerfile.
148149
149- ` docker build -t <use any image tag name here> . `
150+ ` docker build -t <use any image tag name here> . `
150151
1511522 . Make sure the previously mentioned environment file has the correct values set and then ` docker run ` with the following command:
152153
153- ` docker run -p 5000:5000 --env-file docker.env -it <image tag> `
154+ ` docker run -p 5000:5000 --env-file docker.env -it <image tag> `
154155
155156## Demo
156157
@@ -178,14 +179,13 @@ The overview of the demo steps are as follows:
1781792 . You will need to make a "GET" request to the registration API to get a token. When this request is made, the API will
179180generate a token as well as dummy metadata including "tenant", "location", "deviceType", and save it all to a DynamoDB table.
180181The URL for the request is: <Registration API endpoint from CloudFormation stack >/api/token
181- ` curl <endpoint>/api/token `
182+ ` curl <endpoint>/api/token `
182183
1831843 . Copy the token out of the response from the previous request and use it to create a "POST" request to the local IoT client.
184185Please note the token expires in 5 minutes. The URL for this request is ` 127.0.0.1:5000/regToken ` .
185186The body should be JSON and the structure is: ` {"registrationCode": "<value>"} `
186187
187- `curl --request POST '127.0.0.1:5000/regToken' --header 'Content-Type: application/json' \
188- --data-raw '{"registrationCode": <token from previous request >}'`
188+ `curl --request POST '127.0.0.1:5000/regToken' --header 'Content-Type: application/json' --data-raw '{"registrationCode": <token from previous request>}'`
189189
190190The registration token will then be used by the Registration API to authenticate the device and retrieve a certificate
191191issued by AWS IoT Core. Once The IoT client has the certificate, and the device has been registered, it will complete
0 commit comments