Skip to content

Commit

Permalink
Merge branch 'main' into gh-actions-audit
Browse files Browse the repository at this point in the history
  • Loading branch information
beqqrry-aws authored Feb 12, 2024
2 parents 48763fb + 6240df8 commit 04d3224
Show file tree
Hide file tree
Showing 220 changed files with 3,766 additions and 1,913 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ rust_dev_preview
.vectors
# .snippets are created temporarily as build artifacts
.snippets
# Ignore build-related files and directories in kotlin/services/
kotlin/services/**/build/
kotlin/services/**/gradle/
kotlin/services/**/gradlew
kotlin/services/**/gradlew.bat
21 changes: 12 additions & 9 deletions .tools/readmes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,37 +72,40 @@ def main():

skipped = []
failed = []
written = []

for language_and_version in args.languages:
(language, version) = language_and_version.split(":")
if int(version) not in sdks[language]["sdk"]:
logging.debug(f"Skipping {language}:{version}")
else:
for service in args.services:
id = f"{language}:{version}:{service}"
try:
scanner.set_example(language, service)
logging.debug(f"Rendering {language}:{version}:{service}")
logging.debug("Rendering %s", id)
renderer = Renderer(scanner, int(version), args.safe)

result = renderer.render()
if result is None:
logging.info("Render returned empty for %s", id)
skipped.append(id)
continue
if args.dry_run:
if not renderer.check():
failed.append(f"{language}:{version}:{service}")
failed.append(id)
else:
renderer.write()
written.append(id)
except FileNotFoundError:
skip = f"{language}:{version}:{service}"
skipped.append(skip)
skipped.append(id)
except Exception:
skip = f"{language}:{version}:{service}"
logging.exception(
f"Exception rendering {skip}",
)
logging.exception("Exception rendering %s", id)
failed.append(id)

done_list = "\n\t".join(written)
skip_list = "\n\t".join(skipped)
logging.info(f"Run complete. Skipped: {skip_list}")
logging.info(f"Run complete.\nWrote: {done_list}\nSkipped: {skip_list}")
if len(failed) > 0:
failed_list = "\n\t".join(failed)
logging.warning(f"READMEs with incorrect formatting:\n\t{failed_list}")
Expand Down
8 changes: 5 additions & 3 deletions .tools/readmes/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ def _transform_service(self):
def _transform_actions(self, pre_actions):
post_actions = []
for _, pre in pre_actions.items():
api = ""
if self.scanner.svc_name in pre["services"]:
try:
api = next(iter(pre["services"][self.scanner.svc_name]))
except:
api = ""
action = {
"title_abbrev": pre["title_abbrev"],
"synopsis": pre["synopsis"],
Expand Down Expand Up @@ -272,6 +273,7 @@ def render(self):
unsupported=unsupported,
)
self.readme_text = self._expand_entities(self.readme_text)
return self

def write(self):
if self.safe and Path(self.readme_filename).exists():
Expand All @@ -286,4 +288,4 @@ def write(self):
def check(self):
with open(self.readme_filename, "r", encoding="utf-8") as f:
readme_current = f.read()
readme_current != self.readme_text
return readme_current == self.readme_text
24 changes: 12 additions & 12 deletions aws-cli/bash-linux/dynamodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `aws-c

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

- [Create a table](dynamodb_operations.sh#L23) (`CreateTable`)
- [Delete a table](dynamodb_operations.sh#L1004) (`DeleteTable`)
- [Delete an item from a table](dynamodb_operations.sh#L541) (`DeleteItem`)
- [Get a batch of items](dynamodb_operations.sh#L908) (`BatchGetItem`)
- [Get an item from a table](dynamodb_operations.sh#L445) (`GetItem`)
- [Get information about a table](dynamodb_operations.sh#L189) (`DescribeTable`)
- [List tables](dynamodb_operations.sh#L975) (`ListTables`)
- [Put an item in a table](dynamodb_operations.sh#L263) (`PutItem`)
- [Query a table](dynamodb_operations.sh#L620) (`Query`)
- [Scan a table](dynamodb_operations.sh#L730) (`Scan`)
- [Update an item in a table](dynamodb_operations.sh#L344) (`UpdateItem`)
- [Write a batch of items](dynamodb_operations.sh#L840) (`BatchWriteItem`)
- [Create a table](dynamodb_operations.sh#L25) (`CreateTable`)
- [Delete a table](dynamodb_operations.sh#L1006) (`DeleteTable`)
- [Delete an item from a table](dynamodb_operations.sh#L543) (`DeleteItem`)
- [Get a batch of items](dynamodb_operations.sh#L910) (`BatchGetItem`)
- [Get an item from a table](dynamodb_operations.sh#L447) (`GetItem`)
- [Get information about a table](dynamodb_operations.sh#L191) (`DescribeTable`)
- [List tables](dynamodb_operations.sh#L977) (`ListTables`)
- [Put an item in a table](dynamodb_operations.sh#L265) (`PutItem`)
- [Query a table](dynamodb_operations.sh#L622) (`Query`)
- [Scan a table](dynamodb_operations.sh#L732) (`Scan`)
- [Update an item in a table](dynamodb_operations.sh#L346) (`UpdateItem`)
- [Write a batch of items](dynamodb_operations.sh#L842) (`BatchWriteItem`)

### Scenarios

Expand Down
26 changes: 13 additions & 13 deletions aws-cli/bash-linux/iam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `aws-c

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

- [Attach a policy to a role](iam_operations.sh#L501) (`AttachRolePolicy`)
- [Create a policy](iam_operations.sh#L426) (`CreatePolicy`)
- [Create a role](iam_operations.sh#L347) (`CreateRole`)
- [Create a user](iam_operations.sh#L118) (`CreateUser`)
- [Create an access key](iam_operations.sh#L197) (`CreateAccessKey`)
- [Delete a policy](iam_operations.sh#L651) (`DeletePolicy`)
- [Delete a role](iam_operations.sh#L721) (`DeleteRole`)
- [Delete a user](iam_operations.sh#L873) (`DeleteUser`)
- [Delete an access key](iam_operations.sh#L792) (`DeleteAccessKey`)
- [Detach a policy from a role](iam_operations.sh#L576) (`DetachRolePolicy`)
- [Get a user](iam_operations.sh#L22) (`GetUser`)
- [List a user's access keys](iam_operations.sh#L278) (`ListAccessKeys`)
- [List users](iam_operations.sh#L61) (`ListUsers`)
- [Attach a policy to a role](iam_operations.sh#L503) (`AttachRolePolicy`)
- [Create a policy](iam_operations.sh#L428) (`CreatePolicy`)
- [Create a role](iam_operations.sh#L349) (`CreateRole`)
- [Create a user](iam_operations.sh#L120) (`CreateUser`)
- [Create an access key](iam_operations.sh#L199) (`CreateAccessKey`)
- [Delete a policy](iam_operations.sh#L653) (`DeletePolicy`)
- [Delete a role](iam_operations.sh#L723) (`DeleteRole`)
- [Delete a user](iam_operations.sh#L875) (`DeleteUser`)
- [Delete an access key](iam_operations.sh#L794) (`DeleteAccessKey`)
- [Detach a policy from a role](iam_operations.sh#L578) (`DetachRolePolicy`)
- [Get a user](iam_operations.sh#L24) (`GetUser`)
- [List a user's access keys](iam_operations.sh#L280) (`ListAccessKeys`)
- [List users](iam_operations.sh#L63) (`ListUsers`)

### Scenarios

Expand Down
8 changes: 4 additions & 4 deletions aws-cli/bash-linux/medical-imaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `aws-c

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

- [Create a data store](medical_imaging_operations.sh#L22) (`CreateDatastore`)
- [Delete a data store](medical_imaging_operations.sh#L218) (`DeleteDatastore`)
- [Get data store properties](medical_imaging_operations.sh#L147) (`GetDatastore`)
- [List data stores](medical_imaging_operations.sh#L91) (`ListDatastores`)
- [Create a data store](medical_imaging_operations.sh#L24) (`CreateDatastore`)
- [Delete a data store](medical_imaging_operations.sh#L220) (`DeleteDatastore`)
- [Get data store properties](medical_imaging_operations.sh#L149) (`GetDatastore`)
- [List data stores](medical_imaging_operations.sh#L93) (`ListDatastores`)


<!--custom.examples.start-->
Expand Down
18 changes: 9 additions & 9 deletions aws-cli/bash-linux/s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `aws-c

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

- [Copy an object from one bucket to another](bucket-lifecycle-operations/bucket_operations.sh#L207) (`CopyObject`)
- [Create a bucket](bucket-lifecycle-operations/bucket_operations.sh#L55) (`CreateBucket`)
- [Delete an empty bucket](bucket-lifecycle-operations/bucket_operations.sh#L348) (`DeleteBucket`)
- [Delete an object](bucket-lifecycle-operations/bucket_operations.sh#L277) (`DeleteObject`)
- [Delete multiple objects](bucket-lifecycle-operations/bucket_operations.sh#L308) (`DeleteObjects`)
- [Determine the existence of a bucket](bucket-lifecycle-operations/bucket_operations.sh#L25) (`HeadBucket`)
- [Get an object from a bucket](bucket-lifecycle-operations/bucket_operations.sh#L173) (`GetObject`)
- [List objects in a bucket](bucket-lifecycle-operations/awsdocs_general.sh#L98) (`ListObjectsV2`)
- [Upload an object to a bucket](bucket-lifecycle-operations/bucket_operations.sh#L139) (`PutObject`)
- [Copy an object from one bucket to another](bucket-lifecycle-operations/bucket_operations.sh#L202) (`CopyObject`)
- [Create a bucket](bucket-lifecycle-operations/bucket_operations.sh#L50) (`CreateBucket`)
- [Delete an empty bucket](bucket-lifecycle-operations/bucket_operations.sh#L343) (`DeleteBucket`)
- [Delete an object](bucket-lifecycle-operations/bucket_operations.sh#L272) (`DeleteObject`)
- [Delete multiple objects](bucket-lifecycle-operations/bucket_operations.sh#L303) (`DeleteObjects`)
- [Determine the existence of a bucket](bucket-lifecycle-operations/bucket_operations.sh#L20) (`HeadBucket`)
- [Get an object from a bucket](bucket-lifecycle-operations/bucket_operations.sh#L168) (`GetObject`)
- [List objects in a bucket](bucket-lifecycle-operations/awsdocs_general.sh#L94) (`ListObjectsV2`)
- [Upload an object to a bucket](bucket-lifecycle-operations/bucket_operations.sh#L134) (`PutObject`)

### Scenarios

Expand Down
5 changes: 4 additions & 1 deletion cpp/example_code/acm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Next, for information on code example structures and how to build and run the ex

### Instructions

An executable is built for each source file. These executables are located in the build folder and have
An executable is built for each source file in this folder. These executables are located in the build folder and have
"run_" prepended to the source file name, minus the suffix. See the "main" function in the source file for further instructions.

For example, to run the action in the source file "my_action.cpp", execute the following command from within the build folder. The command
Expand All @@ -54,6 +54,9 @@ will display any required arguments.
./run_my_action
```

If the source file is in a different folder, instructions can be found in the README in that
folder.

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

Expand Down
35 changes: 19 additions & 16 deletions cpp/example_code/aurora/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ Next, for information on code example structures and how to build and run the ex

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

- [Create a DB cluster](getting_started_with_db_clusters.cpp#L499) (`CreateDBCluster`)
- [Create a DB cluster parameter group](getting_started_with_db_clusters.cpp#L335) (`CreateDBClusterParameterGroup`)
- [Create a DB cluster snapshot](getting_started_with_db_clusters.cpp#L663) (`CreateDBClusterSnapshot`)
- [Create a DB instance in a DB cluster](getting_started_with_db_clusters.cpp#L590) (`CreateDBInstance`)
- [Delete a DB cluster](getting_started_with_db_clusters.cpp#L1033) (`DeleteDBCluster`)
- [Delete a DB cluster parameter group](getting_started_with_db_clusters.cpp#L1103) (`DeleteDBClusterParameterGroup`)
- [Delete a DB instance](getting_started_with_db_clusters.cpp#L1003) (`DeleteDBInstance`)
- [Describe DB cluster parameter groups](getting_started_with_db_clusters.cpp#L297) (`DescribeDBClusterParameterGroups`)
- [Describe DB cluster snapshots](getting_started_with_db_clusters.cpp#L703) (`DescribeDBClusterSnapshots`)
- [Describe DB clusters](getting_started_with_db_clusters.cpp#L748) (`DescribeDBClusters`)
- [Describe DB instances](getting_started_with_db_clusters.cpp#L885) (`DescribeDBInstances`)
- [Describe database engine versions](getting_started_with_db_clusters.cpp#L847) (`DescribeDBEngineVersions`)
- [Describe options for DB instances](getting_started_with_db_clusters.cpp#L925) (`DescribeOrderableDBInstanceOptions`)
- [Describe parameters from a DB cluster parameter group](getting_started_with_db_clusters.cpp#L788) (`DescribeDBClusterParameters`)
- [Update parameters in a DB cluster parameter group](getting_started_with_db_clusters.cpp#L404) (`ModifyDBClusterParameterGroup`)
- [Create a DB cluster](getting_started_with_db_clusters.cpp#L497) (`CreateDBCluster`)
- [Create a DB cluster parameter group](getting_started_with_db_clusters.cpp#L333) (`CreateDBClusterParameterGroup`)
- [Create a DB cluster snapshot](getting_started_with_db_clusters.cpp#L661) (`CreateDBClusterSnapshot`)
- [Create a DB instance in a DB cluster](getting_started_with_db_clusters.cpp#L588) (`CreateDBInstance`)
- [Delete a DB cluster](getting_started_with_db_clusters.cpp#L1031) (`DeleteDBCluster`)
- [Delete a DB cluster parameter group](getting_started_with_db_clusters.cpp#L1101) (`DeleteDBClusterParameterGroup`)
- [Delete a DB instance](getting_started_with_db_clusters.cpp#L1001) (`DeleteDBInstance`)
- [Describe DB cluster parameter groups](getting_started_with_db_clusters.cpp#L295) (`DescribeDBClusterParameterGroups`)
- [Describe DB cluster snapshots](getting_started_with_db_clusters.cpp#L701) (`DescribeDBClusterSnapshots`)
- [Describe DB clusters](getting_started_with_db_clusters.cpp#L746) (`DescribeDBClusters`)
- [Describe DB instances](getting_started_with_db_clusters.cpp#L883) (`DescribeDBInstances`)
- [Describe database engine versions](getting_started_with_db_clusters.cpp#L845) (`DescribeDBEngineVersions`)
- [Describe options for DB instances](getting_started_with_db_clusters.cpp#L923) (`DescribeOrderableDBInstanceOptions`)
- [Describe parameters from a DB cluster parameter group](getting_started_with_db_clusters.cpp#L786) (`DescribeDBClusterParameters`)
- [Update parameters in a DB cluster parameter group](getting_started_with_db_clusters.cpp#L402) (`ModifyDBClusterParameterGroup`)

### Scenarios

Expand All @@ -83,7 +83,7 @@ Sample applications that work across multiple AWS services.

### Instructions

An executable is built for each source file. These executables are located in the build folder and have
An executable is built for each source file in this folder. These executables are located in the build folder and have
"run_" prepended to the source file name, minus the suffix. See the "main" function in the source file for further instructions.

For example, to run the action in the source file "my_action.cpp", execute the following command from within the build folder. The command
Expand All @@ -93,6 +93,9 @@ will display any required arguments.
./run_my_action
```

If the source file is in a different folder, instructions can be found in the README in that
folder.

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

Expand Down
5 changes: 4 additions & 1 deletion cpp/example_code/cloudwatch-logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Code excerpts that show you how to call individual service functions.

### Instructions

An executable is built for each source file. These executables are located in the build folder and have
An executable is built for each source file in this folder. These executables are located in the build folder and have
"run_" prepended to the source file name, minus the suffix. See the "main" function in the source file for further instructions.

For example, to run the action in the source file "my_action.cpp", execute the following command from within the build folder. The command
Expand All @@ -68,6 +68,9 @@ will display any required arguments.
./run_my_action
```

If the source file is in a different folder, instructions can be found in the README in that
folder.

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

Expand Down
5 changes: 4 additions & 1 deletion cpp/example_code/cloudwatch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Code excerpts that show you how to call individual service functions.

### Instructions

An executable is built for each source file. These executables are located in the build folder and have
An executable is built for each source file in this folder. These executables are located in the build folder and have
"run_" prepended to the source file name, minus the suffix. See the "main" function in the source file for further instructions.

For example, to run the action in the source file "my_action.cpp", execute the following command from within the build folder. The command
Expand All @@ -72,6 +72,9 @@ will display any required arguments.
./run_my_action
```

If the source file is in a different folder, instructions can be found in the README in that
folder.

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

Expand Down
5 changes: 4 additions & 1 deletion cpp/example_code/codebuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Next, for information on code example structures and how to build and run the ex

### Instructions

An executable is built for each source file. These executables are located in the build folder and have
An executable is built for each source file in this folder. These executables are located in the build folder and have
"run_" prepended to the source file name, minus the suffix. See the "main" function in the source file for further instructions.

For example, to run the action in the source file "my_action.cpp", execute the following command from within the build folder. The command
Expand All @@ -54,6 +54,9 @@ will display any required arguments.
./run_my_action
```

If the source file is in a different folder, instructions can be found in the README in that
folder.

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

Expand Down
Loading

0 comments on commit 04d3224

Please sign in to comment.