Repository: winglang/wing (TypeScript)

Issue:
`cloud.Schedule` deployment error - ValidationException: Parameter ScheduleExpression is not valid
### I tried this:

```js
bring cloud;

let schedule = new cloud.Schedule(
  // Every Sunday at 12:15 UTC
  cron: "15 12 * * 0",
);
```

### This happened:

When I deploy the app to AWS with Terraform (`wing test -t tf-aws`) I get:

```js
Command failed: terraform apply -auto-approve
╷
│ Error: creating EventBridge Rule (terraform-20240911153710019600000003): operation error EventBridge: PutRule, https response error StatusCode: 400, RequestID: afc37b83-3ed2-4779-ab44-42144ba011c3, api error ValidationException: Parameter ScheduleExpression is not valid.
│
│   with aws_cloudwatch_event_rule.TestpAmo4jiVDm_env0_Schedule_AC8C9C72,
│   on main.tf.json line 39, in resource.aws_cloudwatch_event_rule.TestpAmo4jiVDm_env0_Schedule_AC8C9C72:
│   39:       }
│
╵
```

It looks like the generated Terraform includes the following configuration with an invalid cron:

```
"aws_cloudwatch_event_rule": {
  "Schedule_15669BF1": {
    "schedule_expression": "cron(15 12 ? * -1 *)"
  }
},
```

### I expected this:

No error

### Is there a workaround?

_No response_

### Anything else?

_No response_

### Wing Version

0.84.7

### Node.js Version

20.12.2

### Platform(s)

MacOS

### Community Notes

<!-- Please keep this note for the community -->
* Please vote by adding a 👍 reaction to the issue to help us prioritize.
* If you are interested to work on this issue, please leave a comment.



Discussion: Congrats! :rocket: This was released in [Wing 0.85.2](https://github.com/winglang/wing/releases/tag/v0.85.2).



Fix (patch):
diff --git a/docs/api/04-standard-library/cloud/bucket.md b/docs/api/04-standard-library/cloud/bucket.md
index 329cb52cfc0..39720d2d74b 100644
--- a/docs/api/04-standard-library/cloud/bucket.md
+++ b/docs/api/04-standard-library/cloud/bucket.md
@@ -105,25 +105,27 @@ By default, buckets are configured with CORS for any origin. When a bucket is pr
 
 ```js playground example
 bring cloud;
+bring http;
 
 let uploads = new cloud.Bucket(
   // these are the default values
   public: false,
   cors: true,
   corsOptions: {
-    allowedMethods: [http.HttpMethod.GET, http.HttpMethod.POST, http.HttpMethod.PUT, http.HttpMethod.DELETE, http.HttpMethod.HEAD]
+    allowedMethods: [http.HttpMethod.GET, http.HttpMethod.POST, http.HttpMethod.PUT, http.HttpMethod.DELETE, http.HttpMethod.HEAD],
     allowedOrigins: ["*"],
     allowedHeaders: ["*"],
     exposeHeaders: [],
     maxAge: 0s
   },
-)
+);
 ```
 
 The CORS configuration can be disabled by passing `cors: false` to the constructor. CORS rules can also be configured after the bucket is created by calling the `addCorsRule` method:
 
 ```js playground example
 bring cloud;
+bring http;
 
 let bucket = new cloud.Bucket(
   cors: false, // disable any default CORS rules
@@ -131,6 +133,7 @@ let bucket = new cloud.Bucket(
 
 bucket.addCorsRule({
   allowedOrigins: ["https://example.com"],
+  allowedMethods: [http.HttpMethod.GET],
 });
 ```
 
diff --git a/packages/@winglang/sdk/src/cloud/bucket.md b/packages/@winglang/sdk/src/cloud/bucket.md
index aea715d7193..a17f72777ab 100644
--- a/packages/@winglang/sdk/src/cloud/bucket.md
+++ b/packages/@winglang/sdk/src/cloud/bucket.md
@@ -105,6 +105,7 @@ By default, buckets are configured with CORS for any origin. When a bucket is pr
 
 ```js playground example
 bring cloud;
+bring http;
 
 let uploads = new cloud.Bucket(
   // these are the default values
diff --git a/packages/@winglang/sdk/src/shared-aws/schedule.ts b/packages/@winglang/sdk/src/shared-aws/schedule.ts
index d2c81f30aca..2193d48003c 100644
--- a/packages/@winglang/sdk/src/shared-aws/schedule.ts
+++ b/packages/@winglang/sdk/src/shared-aws/schedule.ts
@@ -59,7 +59,7 @@ const convertDayOfWeekFromUnixToAWS = (dayOfWeek: string): string => {
 
   if (numbers) {
     for (const number of numbers) {
-      dayOfWeek = dayOfWeek.replace(number, (parseInt(number) - 1).toString());
+      dayOfWeek = dayOfWeek.replace(number, (parseInt(number) + 1).toString());
     }
   }