Skip to content

Commit 5d5fe64

Browse files
Merge branch 'awsdocs:main' into main
2 parents e285882 + 3d8a603 commit 5d5fe64

File tree

33 files changed

+1060
-85
lines changed

33 files changed

+1060
-85
lines changed

.doc_gen/cross-content/cross_Android_Kotlin_block.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.doc_gen/metadata/bedrock-runtime_metadata.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ bedrock-runtime_Converse_AmazonNovaText:
107107
excerpts:
108108
- description: Send a text message to Amazon Nova, using Bedrock's Converse API.
109109
snippet_tags:
110-
- javascript.v3.bedrock-runtime.Converse_AmazonTitanText
110+
- javascript.v3.bedrock-runtime.Converse_AmazonNovaText
111111
.NET:
112112
versions:
113113
- sdk_version: 3
@@ -438,7 +438,7 @@ bedrock-runtime_ConverseStream_AmazonNovaText:
438438
excerpts:
439439
- description: Send a text message to Amazon Nova using Bedrock's Converse API and process the response stream in real-time.
440440
snippet_tags:
441-
- javascript.v3.bedrock-runtime.Converse_Mistral
441+
- javascript.v3.bedrock-runtime.ConverseStream_AmazonNovaText
442442
.NET:
443443
versions:
444444
- sdk_version: 3
@@ -1403,6 +1403,24 @@ bedrock-runtime_InvokeModel_StableDiffusion:
14031403
services:
14041404
bedrock-runtime: {InvokeModel}
14051405

1406+
# Video Generation Models
1407+
bedrock-runtime_Scenario_AmazonNova_TextToVideo:
1408+
title: Use Amazon Nova Reel to generate a video from a text prompt
1409+
title_abbrev: "Text-to-video"
1410+
synopsis: use Amazon Nova Reel to generate a video from a text prompt.
1411+
category: Amazon Nova Reel
1412+
languages:
1413+
Python:
1414+
versions:
1415+
- sdk_version: 3
1416+
github: python/example_code/bedrock-runtime
1417+
excerpts:
1418+
- description: Use Amazon Nova Reel to generate a video from a text prompt.
1419+
snippet_tags:
1420+
- python.example_code.bedrock-runtime.Scenario_AmazonNova_TextToVideo
1421+
services:
1422+
bedrock-runtime: {GetAsyncInvoke, StartAsyncInvoke}
1423+
14061424
# Embedding Models
14071425
bedrock-runtime_InvokeModelWithResponseStream_TitanTextEmbeddings:
14081426
title: Invoke Amazon Titan Text Embeddings on &BR;

.doc_gen/metadata/cross_metadata.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,6 @@ cross_SubmitDataApp:
356356
synopsis: build an application that submits data to an &DDBlong; table and notifies you when a user updates the table.
357357
category: Scenarios
358358
languages:
359-
Kotlin:
360-
versions:
361-
- sdk_version: 1
362-
block_content: cross_Android_Kotlin_block.xml
363359
Java:
364360
versions:
365361
- sdk_version: 2

.github/workflows/validate-doc-metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: checkout repo content
1717
uses: actions/checkout@v4
1818
- name: validate metadata
19-
uses: awsdocs/aws-doc-sdk-examples-tools@2025.08.0
19+
uses: awsdocs/aws-doc-sdk-examples-tools@2025.09.1
2020
with:
2121
doc_gen_only: "False"
2222
strict_titles: "True"

cpp/example_code/transfer-manager/transferOnStream.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ int main(int argc, char** argv)
9898
{
9999
std::cout << "File upload finished." << std::endl;
100100

101-
// Verify that the upload retrieved the expected amount of data.
102-
assert(uploadHandle->GetBytesTotalSize() == uploadHandle->GetBytesTransferred());
103-
104101
auto downloadHandle = transfer_manager->DownloadFile(BUCKET,
105102
KEY,
106103
[&]() { //Define a lambda expression for the callback method parameter to stream back the data.
@@ -120,9 +117,6 @@ int main(int argc, char** argv)
120117
// Verify the download retrieved the expected length of data.
121118
assert(downloadHandle->GetBytesTotalSize() == downloadHandle->GetBytesTransferred());
122119

123-
// Verify that the length of the upload equals the download.
124-
assert(uploadHandle->GetBytesTotalSize() == downloadHandle->GetBytesTotalSize());
125-
126120
// Write the buffered data to local file copy.
127121
Aws::OFStream storeFile(LOCAL_FILE_COPY.c_str(), Aws::OFStream::out | Aws::OFStream::trunc);
128122
storeFile.write((const char*)(buffer.GetUnderlyingData()),

dotnetv4/DotNetV4Examples.sln

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CognitoBasics", "Cognito\Sc
129129
EndProject
130130
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CognitoActions", "Cognito\Actions\CognitoActions.csproj", "{1AF980DF-DEEA-4E5D-9001-6EC67EB96AD1}"
131131
EndProject
132+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ECS", "ECS", "{EE6D1933-1E38-406A-B691-446326310D1F}"
133+
EndProject
134+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECSTests", "ECS\ECSTests\ECSTests.csproj", "{3F159C49-3DE7-42F5-AF14-E64C03AF19E8}"
135+
EndProject
136+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECSScenario", "ECS\ECSScenario\ECSScenario.csproj", "{D44D50E1-EC65-4A1C-AAA1-C360E4FC563F}"
137+
EndProject
138+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECSActions", "ECS\ECSActions\ECSActions.csproj", "{7485EAED-F81C-4119-BABC-E009A21ACE46}"
139+
EndProject
132140
Global
133141
GlobalSection(SolutionConfigurationPlatforms) = preSolution
134142
Debug|Any CPU = Debug|Any CPU
@@ -315,6 +323,18 @@ Global
315323
{1AF980DF-DEEA-4E5D-9001-6EC67EB96AD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
316324
{1AF980DF-DEEA-4E5D-9001-6EC67EB96AD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
317325
{1AF980DF-DEEA-4E5D-9001-6EC67EB96AD1}.Release|Any CPU.Build.0 = Release|Any CPU
326+
{3F159C49-3DE7-42F5-AF14-E64C03AF19E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
327+
{3F159C49-3DE7-42F5-AF14-E64C03AF19E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
328+
{3F159C49-3DE7-42F5-AF14-E64C03AF19E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
329+
{3F159C49-3DE7-42F5-AF14-E64C03AF19E8}.Release|Any CPU.Build.0 = Release|Any CPU
330+
{D44D50E1-EC65-4A1C-AAA1-C360E4FC563F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
331+
{D44D50E1-EC65-4A1C-AAA1-C360E4FC563F}.Debug|Any CPU.Build.0 = Debug|Any CPU
332+
{D44D50E1-EC65-4A1C-AAA1-C360E4FC563F}.Release|Any CPU.ActiveCfg = Release|Any CPU
333+
{D44D50E1-EC65-4A1C-AAA1-C360E4FC563F}.Release|Any CPU.Build.0 = Release|Any CPU
334+
{7485EAED-F81C-4119-BABC-E009A21ACE46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
335+
{7485EAED-F81C-4119-BABC-E009A21ACE46}.Debug|Any CPU.Build.0 = Debug|Any CPU
336+
{7485EAED-F81C-4119-BABC-E009A21ACE46}.Release|Any CPU.ActiveCfg = Release|Any CPU
337+
{7485EAED-F81C-4119-BABC-E009A21ACE46}.Release|Any CPU.Build.0 = Release|Any CPU
318338
EndGlobalSection
319339
GlobalSection(SolutionProperties) = preSolution
320340
HideSolutionNode = FALSE
@@ -375,6 +395,9 @@ Global
375395
{D38A409C-EE40-4E70-B500-F3D6EF8E82A4} = {F5214562-85F4-4FD8-B56D-C5D8E7914901}
376396
{38C8C3B0-163D-4B7B-86A2-3EFFBC165E99} = {D38A409C-EE40-4E70-B500-F3D6EF8E82A4}
377397
{1AF980DF-DEEA-4E5D-9001-6EC67EB96AD1} = {F5214562-85F4-4FD8-B56D-C5D8E7914901}
398+
{3F159C49-3DE7-42F5-AF14-E64C03AF19E8} = {EE6D1933-1E38-406A-B691-446326310D1F}
399+
{D44D50E1-EC65-4A1C-AAA1-C360E4FC563F} = {EE6D1933-1E38-406A-B691-446326310D1F}
400+
{7485EAED-F81C-4119-BABC-E009A21ACE46} = {EE6D1933-1E38-406A-B691-446326310D1F}
378401
EndGlobalSection
379402
GlobalSection(ExtensibilityGlobals) = postSolution
380403
SolutionGuid = {08502818-E8E1-4A91-A51C-4C8C8D4FF9CA}

dotnetv4/ECS/ECS.sln

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.810.20
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECSActions", "ECSActions\ECSActions.csproj", "{775C4572-76B4-492D-A1FD-606C61D1ADC2}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECSScenario", "ECSScenario\ECSScenario.csproj", "{14A438EC-C572-47C8-91E7-344932B28DF8}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECSTests", "ECSTests\ECSTests.csproj", "{D71EADB2-F6C5-4A75-BF11-B702BF931F14}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{775C4572-76B4-492D-A1FD-606C61D1ADC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{775C4572-76B4-492D-A1FD-606C61D1ADC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{775C4572-76B4-492D-A1FD-606C61D1ADC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{775C4572-76B4-492D-A1FD-606C61D1ADC2}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{14A438EC-C572-47C8-91E7-344932B28DF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{14A438EC-C572-47C8-91E7-344932B28DF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{14A438EC-C572-47C8-91E7-344932B28DF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{14A438EC-C572-47C8-91E7-344932B28DF8}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{D71EADB2-F6C5-4A75-BF11-B702BF931F14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{D71EADB2-F6C5-4A75-BF11-B702BF931F14}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{D71EADB2-F6C5-4A75-BF11-B702BF931F14}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{D71EADB2-F6C5-4A75-BF11-B702BF931F14}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {2416AA5E-0460-4DA0-AA2C-168F0130B0EB}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<OutputType>Exe</OutputType>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
11+
<LangVersion>10.0</LangVersion>
12+
</PropertyGroup>
13+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
14+
<LangVersion>10.0</LangVersion>
15+
</PropertyGroup>
16+
<ItemGroup>
17+
<PackageReference Include="AWSSDK.Core" Version="4.0.0-preview.7" />
18+
<PackageReference Include="AWSSDK.ECS" Version="4.0.0-preview.7" />
19+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.2" />
20+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.2" />
21+
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.0-preview.7" />
22+
</ItemGroup>
23+
</Project>

dotnetv4/ECS/ECSActions/ECSWrapper.cs

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// snippet-start:[ECS.dotnetv4.ECSActions.ECSWrapper]
5+
using Amazon.ECS;
6+
using Amazon.ECS.Model;
7+
using Microsoft.Extensions.Logging;
8+
9+
namespace ECSActions;
10+
11+
public class ECSWrapper
12+
{
13+
private readonly IAmazonECS _ecsClient;
14+
private readonly ILogger<ECSWrapper> _logger;
15+
16+
/// <summary>
17+
/// Constructor for the ECS wrapper.
18+
/// </summary>
19+
/// <param name="ecsClient">The injected ECS client.</param>
20+
/// <param name="logger">The injected logger for the wrapper.</param>
21+
public ECSWrapper(IAmazonECS ecsClient, ILogger<ECSWrapper> logger)
22+
23+
{
24+
_logger = logger;
25+
_ecsClient = ecsClient;
26+
}
27+
28+
// snippet-start:[ECS.dotnetv4.ECSActions.ListClusters]
29+
/// <summary>
30+
/// List cluster ARNs available.
31+
/// </summary>
32+
/// <returns>The ARN list of clusters.</returns>
33+
public async Task<List<string>> GetClusterARNSAsync()
34+
{
35+
36+
Console.WriteLine("Getting a list of all the clusters in your AWS account...");
37+
List<string> clusterArnList = new List<string>();
38+
// Get a list of all the clusters in your AWS account.
39+
try
40+
{
41+
42+
var listClustersResponse = _ecsClient.Paginators.ListClusters(new ListClustersRequest
43+
{
44+
});
45+
46+
var clusterArns = listClustersResponse.ClusterArns;
47+
48+
// Print the ARNs of the clusters.
49+
await foreach (var clusterArn in clusterArns)
50+
{
51+
clusterArnList.Add(clusterArn);
52+
}
53+
54+
if (clusterArnList.Count == 0)
55+
{
56+
_logger.LogWarning("No clusters found in your AWS account.");
57+
}
58+
return clusterArnList;
59+
}
60+
catch (Exception e)
61+
{
62+
_logger.LogError($"An error occurred while getting a list of all the clusters in your AWS account. {e.InnerException}");
63+
throw;
64+
}
65+
}
66+
// snippet-end:[ECS.dotnetv4.ECSActions.ListClusters]
67+
68+
// snippet-start:[ECS.dotnetv4.ECSActions.ListServices]
69+
/// <summary>
70+
/// List service ARNs available.
71+
/// </summary>
72+
/// <param name="clusterARN">The arn of the ECS cluster.</param>
73+
/// <returns>The ARN list of services in given cluster.</returns>
74+
public async Task<List<string>> GetServiceARNSAsync(string clusterARN)
75+
{
76+
List<string> serviceArns = new List<string>();
77+
78+
var request = new ListServicesRequest
79+
{
80+
Cluster = clusterARN
81+
};
82+
// Call the ListServices API operation and get the list of service ARNs.
83+
var serviceList = _ecsClient.Paginators.ListServices(request);
84+
85+
await foreach (var serviceARN in serviceList.ServiceArns)
86+
{
87+
if (serviceARN is null)
88+
continue;
89+
90+
serviceArns.Add(serviceARN);
91+
}
92+
93+
if (serviceArns.Count == 0)
94+
{
95+
_logger.LogWarning($"No services found in cluster {clusterARN} .");
96+
}
97+
98+
return serviceArns;
99+
}
100+
// snippet-end:[ECS.dotnetv4.ECSActions.ListServices]
101+
102+
// snippet-start:[ECS.dotnetv4.ECSActions.ListTasks]
103+
/// <summary>
104+
/// List task ARNs available.
105+
/// </summary>
106+
/// <param name="clusterARN">The arn of the ECS cluster.</param>
107+
/// <returns>The ARN list of tasks in given cluster.</returns>
108+
public async Task<List<string>> GetTaskARNsAsync(string clusterARN)
109+
{
110+
// Set up the request to describe the tasks in the service.
111+
var listTasksRequest = new ListTasksRequest
112+
{
113+
Cluster = clusterARN
114+
};
115+
List<string> taskArns = new List<string>();
116+
117+
// Call the ListTasks API operation and get the list of task ARNs.
118+
var tasks = _ecsClient.Paginators.ListTasks(listTasksRequest);
119+
120+
await foreach (var task in tasks.TaskArns)
121+
{
122+
if (task is null)
123+
continue;
124+
125+
taskArns.Add(task);
126+
}
127+
128+
if (taskArns.Count == 0)
129+
{
130+
_logger.LogWarning("No tasks found in cluster: " + clusterARN);
131+
}
132+
133+
return taskArns;
134+
}
135+
// snippet-end:[ECS.dotnetv4.ECSActions.ListTasks]
136+
}
137+
// snippet-end:[ECS.dotnetv4.ECSActions.ECSWrapper]

0 commit comments

Comments
 (0)