Skip to content

Commit

Permalink
JavaScript (v3): Chore - Update READMES (awsdocs#5408)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpyle0819 authored Sep 26, 2023
1 parent 38f6eb4 commit c970a8a
Show file tree
Hide file tree
Showing 76 changed files with 746 additions and 420 deletions.
18 changes: 9 additions & 9 deletions .doc_gen/metadata/cloudwatch-events_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ cloudwatch-events_PutRule:
github: javascriptv3/example_code/cloudwatch-events
sdkguide: sdk-for-javascript/v3/developer-guide/cloudwatch-examples-sending-events.html#cloudwatch-examples-sending-events-rules
excerpts:
- description: Create the client in a separate module and export it.
snippet_tags:
- javascript.v3.cloudwatchevents.client
- description: Import the SDK and client modules and call the API.
snippet_tags:
- javascript.v3.cloudwatchlogs.actions.PutRule
- description: Create the client in a separate module and export it.
snippet_tags:
- javascript.v3.cloudwatchevents.client
- sdk_version: 2
github: javascript/example_code/cloudwatch-events
sdkguide: sdk-for-javascript/v2/developer-guide/cloudwatch-examples-sending-events.html#cloudwatch-examples-sending-events-rules
Expand Down Expand Up @@ -56,12 +56,12 @@ cloudwatch-events_PutEvents:
github: javascriptv3/example_code/cloudwatch-events
sdkguide: sdk-for-javascript/v3/developer-guide/cloudwatch-examples-sending-events.html#cloudwatch-examples-sending-events-putevents
excerpts:
- description: Create the client in a separate module and export it.
snippet_tags:
- javascript.v3.cloudwatchevents.client
- description: Import the SDK and client modules and call the API.
snippet_tags:
- javascript.v3.cloudwatchlogs.actions.PutEvents
- description: Create the client in a separate module and export it.
snippet_tags:
- javascript.v3.cloudwatchevents.client
- sdk_version: 2
github: javascript/example_code/cloudwatch-events
sdkguide: sdk-for-javascript/v2/developer-guide/cloudwatch-examples-sending-events.html#cloudwatch-examples-sending-events-putevents
Expand Down Expand Up @@ -92,12 +92,12 @@ cloudwatch-events_PutTargets:
github: javascriptv3/example_code/cloudwatch-events
sdkguide: sdk-for-javascript/v3/developer-guide/cloudwatch-examples-sending-events.html#cloudwatch-examples-sending-events-targets
excerpts:
- description: Create the client in a separate module and export it.
snippet_tags:
- javascript.v3.cloudwatchevents.client
- description: Import the SDK and client modules and call the API.
snippet_tags:
- javascript.v3.cloudwatchlogs.actions.PutTargets
- description: Create the client in a separate module and export it.
snippet_tags:
- javascript.v3.cloudwatchevents.client
- sdk_version: 2
github: javascript/example_code/cloudwatch-events
sdkguide: sdk-for-javascript/v2/developer-guide/cloudwatch-examples-sending-events.html#cloudwatch-examples-sending-events-targets
Expand Down
28 changes: 14 additions & 14 deletions .doc_gen/metadata/cognito-identity-provider_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cognito-identity-provider_Hello:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -97,7 +97,7 @@ cognito-identity-provider_SignUp:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -161,7 +161,7 @@ cognito-identity-provider_AdminGetUser:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito/
github: javascriptv3/example_code/cognito-identity-provider/
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -225,7 +225,7 @@ cognito-identity-provider_ResendConfirmationCode:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -289,7 +289,7 @@ cognito-identity-provider_ConfirmSignUp:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -353,7 +353,7 @@ cognito-identity-provider_ListUsers:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -407,7 +407,7 @@ cognito-identity-provider_AdminInitiateAuth:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito/
github: javascriptv3/example_code/cognito-identity-provider/
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -471,7 +471,7 @@ cognito-identity-provider_AssociateSoftwareToken:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -535,7 +535,7 @@ cognito-identity-provider_VerifySoftwareToken:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -600,7 +600,7 @@ cognito-identity-provider_AdminRespondToAuthChallenge:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -645,7 +645,7 @@ cognito-identity-provider_ConfirmDevice:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -683,7 +683,7 @@ cognito-identity-provider_InitiateAuth:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -712,7 +712,7 @@ cognito-identity-provider_RespondToAuthChallenge:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito
github: javascriptv3/example_code/cognito-identity-provider
sdkguide:
excerpts:
- description:
Expand Down Expand Up @@ -790,7 +790,7 @@ cognito-identity-provider_Scenario_SignUpUserWithMfa:
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/cognito/scenarios/basic
github: javascriptv3/example_code/cognito-identity-provider/scenarios/basic
sdkguide:
excerpts:
- description: For the best experience, clone the GitHub repository and run this
Expand Down
18 changes: 9 additions & 9 deletions .doc_gen/metadata/transcribe_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ transcribe_StartTranscriptionJob:
github: javascriptv3/example_code/transcribe
sdkguide: sdk-for-javascript/v3/developer-guide/transcribe-examples-section.html#transcribe-start-transcription
excerpts:
- description: Create the client.
snippet_tags:
- transcribe.JavaScript.createclientv3
- description: Start a transcription job.
snippet_tags:
- transcribe.JavaScript.jobs.createJobV3
- description: Create the client.
snippet_tags:
- transcribe.JavaScript.createclientv3
services:
transcribe: {StartTranscriptionJob}
transcribe_ListTranscriptionJobs:
Expand Down Expand Up @@ -67,12 +67,12 @@ transcribe_ListTranscriptionJobs:
github: javascriptv3/example_code/transcribe
sdkguide: sdk-for-javascript/v3/developer-guide/transcribe-examples-section.html#transcribe-list-jobs
excerpts:
- description: Create the client.
snippet_tags:
- transcribe.JavaScript.createclientv3
- description: List transcription jobs.
snippet_tags:
- transcribe.JavaScript.jobs.listJobsV3
- description: Create the client.
snippet_tags:
- transcribe.JavaScript.createclientv3
services:
transcribe: {ListTranscriptionJobs}
transcribe_GetTranscriptionJob:
Expand Down Expand Up @@ -131,12 +131,12 @@ transcribe_DeleteTranscriptionJob:
github: javascriptv3/example_code/transcribe
sdkguide: sdk-for-javascript/v3/developer-guide/transcribe-examples-section.html#transcribe-delete-job
excerpts:
- description: Create the client.
snippet_tags:
- transcribe.JavaScript.createclientv3
- description: Delete a transcription job.
snippet_tags:
- transcribe.JavaScript.jobs.deleteJobV3
- description: Create the client.
snippet_tags:
- transcribe.JavaScript.createclientv3
services:
transcribe: {DeleteTranscriptionJob}
transcribe_CreateVocabulary:
Expand Down
1 change: 1 addition & 0 deletions .doc_gen/readmes/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'__pycache__',
'cdk.out',
'node_modules',
'Pods',
'dist',
'target',
'venv',
Expand Down
90 changes: 60 additions & 30 deletions javascriptv3/example_code/cloudwatch-events/README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,91 @@
# CloudWatch Events code examples for the SDK for JavaScript in Node.js
<!--Generated by WRITEME on 2023-09-25 14:15:58.223814 (UTC)-->
# CloudWatch Events code examples for the SDK for JavaScript (v3)

## Overview

The code examples in this directory demonstrate how to work with Amazon CloudWatch Events
using the AWS SDK for JavaScript (v3).
Shows how to use the AWS SDK for JavaScript (v3) to work with Amazon CloudWatch Events.

Amazon CloudWatch Events delivers a near real-time stream of system events that describe
changes in Amazon Web Services (AWS) resources.
<!--custom.overview.start-->
<!--custom.overview.end-->

## ⚠️ Important
*CloudWatch Events send system events from AWS resources to AWS Lambda functions, Amazon Simple Notification Service topics, streams in Amazon Kinesis, and other target types.*

- Running this code might result in charges to your AWS account.
- Running the tests might result in charges to your AWS account.
- 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).
- 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).
## ⚠ Important

* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).
* Running the tests might result in charges to your AWS account.
* 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).
* 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).

<!--custom.important.start-->
<!--custom.important.end-->

## Code examples

### Prerequisites

For prerequisites, see the [README](../../README.md#Prerequisites) in the `javascriptv3` folder.


<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->

### Single actions

Code excerpts that show you how to call individual service functions.

- [Add an AWS Lambda function target](actions/put-targets.js)(PutTargets)
- [Create a scheduled rule](actions/put-rule.js)(PutRule)
- [Send events](actions/put-events.js)(PutEvents)
* [Adding a target](actions/put-targets.js#L6) (`PutTargets`)
* [Create a scheduled rule](actions/put-rule.js#L6) (`PutRule`)
* [Send events](actions/put-events.js#L6) (`PutEvents`)

## Run the examples

### Instructions

**Note**: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see
[JavaScript ES6/CommonJS syntax](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sdk-examples-javascript-syntax.html).

### Prerequisites
**Run a single action**

- [Set up AWS SDK for JavaScript](../README.rst)
- Run `npm i` to install dependencies.
```bash
node ./actions/<fileName>
```

## Instructions
**Run a scenario**
Most scenarios can be run with the following command:
```bash
node ./scenarios/<fileName>
```

**Run a single action**
<!--custom.instructions.start-->
<!--custom.instructions.end-->



### Tests

1. Run `node ./actions/<fileName>`.
OR
1. Import `./actions/fileName` into another module.
⚠ Running tests might result in charges to your AWS account.

## Tests

⚠️ Running the tests might result in charges to your AWS account.
To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `javascriptv3` folder.

### Integration tests

1. Run `npm i`.
1. Run `npm run integration-test`.

<!--custom.tests.start-->
<!--custom.tests.end-->

## Additional resources

- [Amazon CloudWatch Events User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html)
- [Amazon CloudWatch Logs API Reference](https://docs.aws.amazon.com/eventbridge/latest/APIReference/Welcome.html)
- [CloudWatch Events Client - AWS SDK for JavaScript (v3)](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-events/index.html)
* [CloudWatch Events User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html)
* [CloudWatch Events API Reference](https://docs.aws.amazon.com/eventbridge/latest/APIReference/Welcome.html)
* [SDK for JavaScript (v3) CloudWatch Events reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-events)

<!--custom.resources.start-->
<!--custom.resources.end-->

---

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
Loading

0 comments on commit c970a8a

Please sign in to comment.