Skip to content

Commit f263170

Browse files
author
awstools
committed
feat(client-bedrock-agentcore-control): Adds support for direct code deploy with CreateAgentRuntime and UpdateAgentRuntime
1 parent 338b58b commit f263170

File tree

9 files changed

+300
-20
lines changed

9 files changed

+300
-20
lines changed

clients/client-bedrock-agentcore-control/src/commands/CreateAgentRuntimeCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ export interface CreateAgentRuntimeCommandOutput extends CreateAgentRuntimeRespo
5151
* containerConfiguration: { // ContainerConfiguration
5252
* containerUri: "STRING_VALUE", // required
5353
* },
54+
* codeConfiguration: { // CodeConfiguration
55+
* code: { // Code Union: only one key present
56+
* s3: { // S3Location
57+
* bucket: "STRING_VALUE", // required
58+
* prefix: "STRING_VALUE", // required
59+
* versionId: "STRING_VALUE",
60+
* },
61+
* },
62+
* runtime: "PYTHON_3_10" || "PYTHON_3_11" || "PYTHON_3_12" || "PYTHON_3_13", // required
63+
* entryPoint: [ // EntryPoints // required
64+
* "STRING_VALUE",
65+
* ],
66+
* },
5467
* },
5568
* roleArn: "STRING_VALUE", // required
5669
* networkConfiguration: { // NetworkConfiguration

clients/client-bedrock-agentcore-control/src/commands/CreateBrowserCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export interface CreateBrowserCommandOutput extends CreateBrowserResponse, __Met
6565
* s3Location: { // S3Location
6666
* bucket: "STRING_VALUE", // required
6767
* prefix: "STRING_VALUE", // required
68+
* versionId: "STRING_VALUE",
6869
* },
6970
* },
7071
* browserSigning: { // BrowserSigningConfigInput

clients/client-bedrock-agentcore-control/src/commands/DeleteAgentRuntimeCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface DeleteAgentRuntimeCommandOutput extends DeleteAgentRuntimeRespo
4343
* const client = new BedrockAgentCoreControlClient(config);
4444
* const input = { // DeleteAgentRuntimeRequest
4545
* agentRuntimeId: "STRING_VALUE", // required
46+
* clientToken: "STRING_VALUE",
4647
* };
4748
* const command = new DeleteAgentRuntimeCommand(input);
4849
* const response = await client.send(command);

clients/client-bedrock-agentcore-control/src/commands/GetAgentRuntimeCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ export interface GetAgentRuntimeCommandOutput extends GetAgentRuntimeResponse, _
8383
* // containerConfiguration: { // ContainerConfiguration
8484
* // containerUri: "STRING_VALUE", // required
8585
* // },
86+
* // codeConfiguration: { // CodeConfiguration
87+
* // code: { // Code Union: only one key present
88+
* // s3: { // S3Location
89+
* // bucket: "STRING_VALUE", // required
90+
* // prefix: "STRING_VALUE", // required
91+
* // versionId: "STRING_VALUE",
92+
* // },
93+
* // },
94+
* // runtime: "PYTHON_3_10" || "PYTHON_3_11" || "PYTHON_3_12" || "PYTHON_3_13", // required
95+
* // entryPoint: [ // EntryPoints // required
96+
* // "STRING_VALUE",
97+
* // ],
98+
* // },
8699
* // },
87100
* // protocolConfiguration: { // ProtocolConfiguration
88101
* // serverProtocol: "MCP" || "HTTP" || "A2A", // required

clients/client-bedrock-agentcore-control/src/commands/GetBrowserCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export interface GetBrowserCommandOutput extends GetBrowserResponse, __MetadataB
6868
* // s3Location: { // S3Location
6969
* // bucket: "STRING_VALUE", // required
7070
* // prefix: "STRING_VALUE", // required
71+
* // versionId: "STRING_VALUE",
7172
* // },
7273
* // },
7374
* // browserSigning: { // BrowserSigningConfigOutput

clients/client-bedrock-agentcore-control/src/commands/UpdateAgentRuntimeCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ export interface UpdateAgentRuntimeCommandOutput extends UpdateAgentRuntimeRespo
5151
* containerConfiguration: { // ContainerConfiguration
5252
* containerUri: "STRING_VALUE", // required
5353
* },
54+
* codeConfiguration: { // CodeConfiguration
55+
* code: { // Code Union: only one key present
56+
* s3: { // S3Location
57+
* bucket: "STRING_VALUE", // required
58+
* prefix: "STRING_VALUE", // required
59+
* versionId: "STRING_VALUE",
60+
* },
61+
* },
62+
* runtime: "PYTHON_3_10" || "PYTHON_3_11" || "PYTHON_3_12" || "PYTHON_3_13", // required
63+
* entryPoint: [ // EntryPoints // required
64+
* "STRING_VALUE",
65+
* ],
66+
* },
5467
* },
5568
* roleArn: "STRING_VALUE", // required
5669
* networkConfiguration: { // NetworkConfiguration

clients/client-bedrock-agentcore-control/src/models/models_0.ts

Lines changed: 123 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,108 @@ export interface UpdateAgentRuntimeEndpointResponse {
610610
lastUpdatedAt: Date | undefined;
611611
}
612612

613+
/**
614+
* @public
615+
* @enum
616+
*/
617+
export const AgentManagedRuntimeType = {
618+
PYTHON_3_10: "PYTHON_3_10",
619+
PYTHON_3_11: "PYTHON_3_11",
620+
PYTHON_3_12: "PYTHON_3_12",
621+
PYTHON_3_13: "PYTHON_3_13",
622+
} as const;
623+
624+
/**
625+
* @public
626+
*/
627+
export type AgentManagedRuntimeType = (typeof AgentManagedRuntimeType)[keyof typeof AgentManagedRuntimeType];
628+
629+
/**
630+
* <p>The Amazon S3 location for storing data. This structure defines where in Amazon S3 data is stored.</p>
631+
* @public
632+
*/
633+
export interface S3Location {
634+
/**
635+
* <p>The name of the Amazon S3 bucket. This bucket contains the stored data.</p>
636+
* @public
637+
*/
638+
bucket: string | undefined;
639+
640+
/**
641+
* <p>The prefix for objects in the Amazon S3 bucket. This prefix is added to the object keys to organize the data.</p>
642+
* @public
643+
*/
644+
prefix: string | undefined;
645+
646+
/**
647+
* <p>The version ID of the Amazon Amazon S3 object. If not specified, the latest version of the object is used.</p>
648+
* @public
649+
*/
650+
versionId?: string | undefined;
651+
}
652+
653+
/**
654+
* <p>The source code configuration that specifies the location and details of the code to be executed.</p>
655+
* @public
656+
*/
657+
export type Code = Code.S3Member | Code.$UnknownMember;
658+
659+
/**
660+
* @public
661+
*/
662+
export namespace Code {
663+
/**
664+
* <p>The Amazon Amazon S3 object that contains the source code for the agent runtime.</p>
665+
* @public
666+
*/
667+
export interface S3Member {
668+
s3: S3Location;
669+
$unknown?: never;
670+
}
671+
672+
/**
673+
* @public
674+
*/
675+
export interface $UnknownMember {
676+
s3?: never;
677+
$unknown: [string, any];
678+
}
679+
680+
export interface Visitor<T> {
681+
s3: (value: S3Location) => T;
682+
_: (name: string, value: any) => T;
683+
}
684+
685+
export const visit = <T>(value: Code, visitor: Visitor<T>): T => {
686+
if (value.s3 !== undefined) return visitor.s3(value.s3);
687+
return visitor._(value.$unknown[0], value.$unknown[1]);
688+
};
689+
}
690+
691+
/**
692+
* <p>The configuration for the source code that defines how the agent runtime code should be executed, including the code location, runtime environment, and entry point.</p>
693+
* @public
694+
*/
695+
export interface CodeConfiguration {
696+
/**
697+
* <p>The source code location and configuration details.</p>
698+
* @public
699+
*/
700+
code: Code | undefined;
701+
702+
/**
703+
* <p>The runtime environment for executing the code (for example, Python 3.9 or Node.js 18).</p>
704+
* @public
705+
*/
706+
runtime: AgentManagedRuntimeType | undefined;
707+
708+
/**
709+
* <p>The entry point for the code execution, specifying the function or method that should be invoked when the code runs.</p>
710+
* @public
711+
*/
712+
entryPoint: string[] | undefined;
713+
}
714+
613715
/**
614716
* <p>Representation of a container configuration.</p>
615717
* @public
@@ -627,6 +729,7 @@ export interface ContainerConfiguration {
627729
* @public
628730
*/
629731
export type AgentRuntimeArtifact =
732+
| AgentRuntimeArtifact.CodeConfigurationMember
630733
| AgentRuntimeArtifact.ContainerConfigurationMember
631734
| AgentRuntimeArtifact.$UnknownMember;
632735

@@ -640,6 +743,17 @@ export namespace AgentRuntimeArtifact {
640743
*/
641744
export interface ContainerConfigurationMember {
642745
containerConfiguration: ContainerConfiguration;
746+
codeConfiguration?: never;
747+
$unknown?: never;
748+
}
749+
750+
/**
751+
* <p>The code configuration for the agent runtime artifact, including the source code location and execution settings.</p>
752+
* @public
753+
*/
754+
export interface CodeConfigurationMember {
755+
containerConfiguration?: never;
756+
codeConfiguration: CodeConfiguration;
643757
$unknown?: never;
644758
}
645759

@@ -648,16 +762,19 @@ export namespace AgentRuntimeArtifact {
648762
*/
649763
export interface $UnknownMember {
650764
containerConfiguration?: never;
765+
codeConfiguration?: never;
651766
$unknown: [string, any];
652767
}
653768

654769
export interface Visitor<T> {
655770
containerConfiguration: (value: ContainerConfiguration) => T;
771+
codeConfiguration: (value: CodeConfiguration) => T;
656772
_: (name: string, value: any) => T;
657773
}
658774

659775
export const visit = <T>(value: AgentRuntimeArtifact, visitor: Visitor<T>): T => {
660776
if (value.containerConfiguration !== undefined) return visitor.containerConfiguration(value.containerConfiguration);
777+
if (value.codeConfiguration !== undefined) return visitor.codeConfiguration(value.codeConfiguration);
661778
return visitor._(value.$unknown[0], value.$unknown[1]);
662779
};
663780
}
@@ -1018,6 +1135,12 @@ export interface DeleteAgentRuntimeRequest {
10181135
* @public
10191136
*/
10201137
agentRuntimeId: string | undefined;
1138+
1139+
/**
1140+
* <p>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.</p>
1141+
* @public
1142+
*/
1143+
clientToken?: string | undefined;
10211144
}
10221145

10231146
/**
@@ -1761,24 +1884,6 @@ export interface BrowserNetworkConfiguration {
17611884
vpcConfig?: VpcConfig | undefined;
17621885
}
17631886

1764-
/**
1765-
* <p>The Amazon S3 location for storing data. This structure defines where in Amazon S3 data is stored.</p>
1766-
* @public
1767-
*/
1768-
export interface S3Location {
1769-
/**
1770-
* <p>The name of the Amazon S3 bucket. This bucket contains the stored data.</p>
1771-
* @public
1772-
*/
1773-
bucket: string | undefined;
1774-
1775-
/**
1776-
* <p>The prefix for objects in the Amazon S3 bucket. This prefix is added to the object keys to organize the data.</p>
1777-
* @public
1778-
*/
1779-
prefix: string | undefined;
1780-
}
1781-
17821887
/**
17831888
* <p>The recording configuration for a browser. This structure defines how browser sessions are recorded.</p>
17841889
* @public

clients/client-bedrock-agentcore-control/src/protocols/Aws_restJson1.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ import {
186186
BrowserNetworkConfiguration,
187187
BrowserSigningConfigInput,
188188
BrowserSummary,
189+
Code,
190+
CodeConfiguration,
189191
CodeInterpreterNetworkConfiguration,
190192
CodeInterpreterSummary,
191193
ConcurrentModificationException,
@@ -563,8 +565,11 @@ export const se_DeleteAgentRuntimeCommand = async (
563565
const headers: any = {};
564566
b.bp("/runtimes/{agentRuntimeId}");
565567
b.p("agentRuntimeId", () => input.agentRuntimeId!, "{agentRuntimeId}", false);
568+
const query: any = map({
569+
[_cT]: [, input[_cT] ?? generateIdempotencyToken()],
570+
});
566571
let body: any;
567-
b.m("DELETE").h(headers).b(body);
572+
b.m("DELETE").h(headers).q(query).b(body);
568573
return b.build();
569574
};
570575

@@ -3190,6 +3195,10 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
31903195

31913196
// se_BrowserSigningConfigInput omitted.
31923197

3198+
// se_Code omitted.
3199+
3200+
// se_CodeConfiguration omitted.
3201+
31933202
// se_CodeInterpreterNetworkConfiguration omitted.
31943203

31953204
// se_ContainerConfiguration omitted.
@@ -3216,6 +3225,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
32163225

32173226
// se_DeleteMemoryStrategyInput omitted.
32183227

3228+
// se_EntryPoints omitted.
3229+
32193230
// se_EnvironmentVariablesMap omitted.
32203231

32213232
// se_GatewayApiKeyCredentialProvider omitted.
@@ -3565,6 +3576,10 @@ const de_BrowserSummary = (output: any, context: __SerdeContext): BrowserSummary
35653576
}) as any;
35663577
};
35673578

3579+
// de_Code omitted.
3580+
3581+
// de_CodeConfiguration omitted.
3582+
35683583
// de_CodeInterpreterNetworkConfiguration omitted.
35693584

35703585
/**
@@ -3612,6 +3627,8 @@ const de_CodeInterpreterSummary = (output: any, context: __SerdeContext): CodeIn
36123627

36133628
// de_CustomOauth2ProviderConfigOutput omitted.
36143629

3630+
// de_EntryPoints omitted.
3631+
36153632
// de_EnvironmentVariablesMap omitted.
36163633

36173634
// de_ExtractionConfiguration omitted.

0 commit comments

Comments
 (0)