diff --git a/versioned_docs/version-latest/01-start-here/03-hello.md b/versioned_docs/version-latest/01-start-here/03-hello.md index fe814fa26..9f968ffd0 100644 --- a/versioned_docs/version-latest/01-start-here/03-hello.md +++ b/versioned_docs/version-latest/01-start-here/03-hello.md @@ -24,9 +24,7 @@ entrypoint of your Wing application. bring cloud; let bucket = new cloud.Bucket(); -let counter = new cloud.Counter( - initial: 1 -); +let counter = new cloud.Counter(initial: 1); let queue = new cloud.Queue(); queue.setConsumer(inflight (message: str) => { diff --git a/versioned_docs/version-latest/01-start-here/04-run-locally.md b/versioned_docs/version-latest/01-start-here/04-run-locally.md index 40764bdf4..5923ac1f9 100644 --- a/versioned_docs/version-latest/01-start-here/04-run-locally.md +++ b/versioned_docs/version-latest/01-start-here/04-run-locally.md @@ -27,7 +27,7 @@ In the Wing Console window, you will see the following view of you application: ## The Map View -In the console [map view](../06-tools/02-wing-console.md#map-view) you'll see three resources: a **Queue**, a **Function** and a **Bucket**. The queue and the bucket are connected through the function resource, which serves as a message handler and is set as the consumer for the queue. +In the console [map view](../06-tools/02-wing-console.md#map-view) you'll see three resources: a **Queue**, a **Counter**, a **Function** and a **Bucket**. The queue, the counter and the bucket are connected through the function resource, which serves as a message handler and is set as the consumer for the queue. Click on the queue resource and check out to the right-hand panel. This is the [resource interaction panel](../tools/wing-console#interact-with-your-wing-application). @@ -49,6 +49,10 @@ You can also download the file, using the **Download** button. The downloaded file should contain `Hello, Wing it` text (as you already saw in the preview). +You can push any number of messages to the queue. Each time a message is pushed to the queue, you can see the counter's value is incremented via the `Actual value` field in the counter resource. It is even possible to reset the counter value with the `Reset value` button. + +![Counter resource view in Wing Console](./console-counter.png 'Counter resource') + ## Congrats! :clap: You have just written and ran your first Wing program! diff --git a/versioned_docs/version-latest/01-start-here/05-aws.md b/versioned_docs/version-latest/01-start-here/05-aws.md index 77a1358cc..c279f1854 100644 --- a/versioned_docs/version-latest/01-start-here/05-aws.md +++ b/versioned_docs/version-latest/01-start-here/05-aws.md @@ -147,7 +147,7 @@ through the AWS Management Console. 1. Open the [Amazon SQS Console](https://console.aws.amazon.com/sqs) 2. Select your AWS region -3. You should be able to see that you have a queue there +3. You should be able to see that you have a queue there prefixed with `cloud-Queue-` 4. Click **Send and receive messages**. 5. In the **Message Body** box type `cloud` and hit **Send message**. 6. Jump over to the [S3 Console](https://s3.console.aws.amazon.com/s3/buckets) @@ -156,15 +156,25 @@ through the AWS Management Console. 9. Click `wing-1.txt` then click the `Open` button. 10. The file should contain `Hello, cloud`. +### Exploring the counter on AWS +1. Open the [Amazon Dynamo DB Console](https://console.aws.amazon.com/dynamodb), and search for a table prefixed with `wing-counter-cloud`. +2. Use the `Explore table items` button to view the value of the `counter` id attribute, which represents the current value of the counter. +3. Optional - repeat step 5 from the above list as many times as you want. While doing it, see how the bucket fills and how the `counter` id increments. + + ## Cleanup Terraform doesn't allow destroying a non-empty bucket by default. To prepare for -easy cleanup, you may delete the newly created file by marking the checkbox next -to `wing-1.txt`, clicking the `Delete` button, typing `permanently delete` in the -confirmation box and clicking the `Delete objects` button. +easy cleanup, you may delete the newly created file(s) by marking the checkbox next +to the bucket name on the S3 console, clicking the `Empty` button, typing `permanently delete` in the +confirmation box and clicking the `Empty` button. Once you're done, you can destroy all of the resources that were created on your AWS account by running: ```sh terraform destroy + +{...} + +Destroy complete! Resources: 12 destroyed. ``` diff --git a/versioned_docs/version-latest/01-start-here/console-counter.png b/versioned_docs/version-latest/01-start-here/console-counter.png new file mode 100644 index 000000000..5d8092ea2 Binary files /dev/null and b/versioned_docs/version-latest/01-start-here/console-counter.png differ