Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): update docs #550

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions versioned_docs/version-latest/01-start-here/03-hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand All @@ -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!
Expand Down
18 changes: 14 additions & 4 deletions versioned_docs/version-latest/01-start-here/05-aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.