Skip to content

Commit 568eb19

Browse files
author
awstools
committed
feat(client-bedrock): Enable cross-Region inference for Amazon Bedrock Guardrails by using the crossRegionConfig parameter when calling the CreateGuardrail or UpdateGuardrail operation.
1 parent e066626 commit 568eb19

File tree

10 files changed

+287
-106
lines changed

10 files changed

+287
-106
lines changed

clients/client-bedrock/src/commands/CreateGuardrailCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ export interface CreateGuardrailCommandOutput extends CreateGuardrailResponse, _
162162
* },
163163
* ],
164164
* },
165+
* crossRegionConfig: { // GuardrailCrossRegionConfig
166+
* guardrailProfileIdentifier: "STRING_VALUE", // required
167+
* },
165168
* blockedInputMessaging: "STRING_VALUE", // required
166169
* blockedOutputsMessaging: "STRING_VALUE", // required
167170
* kmsKeyId: "STRING_VALUE",

clients/client-bedrock/src/commands/GetEvaluationJobCommand.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import {
10-
GetEvaluationJobRequest,
11-
GetEvaluationJobRequestFilterSensitiveLog,
12-
GetEvaluationJobResponse,
13-
GetEvaluationJobResponseFilterSensitiveLog,
14-
} from "../models/models_0";
9+
import { GetEvaluationJobRequest, GetEvaluationJobRequestFilterSensitiveLog } from "../models/models_0";
10+
import { GetEvaluationJobResponse, GetEvaluationJobResponseFilterSensitiveLog } from "../models/models_1";
1511
import { de_GetEvaluationJobCommand, se_GetEvaluationJobCommand } from "../protocols/Aws_restJson1";
1612

1713
/**

clients/client-bedrock/src/commands/GetGuardrailCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ export interface GetGuardrailCommandOutput extends GetGuardrailResponse, __Metad
137137
* // },
138138
* // ],
139139
* // },
140+
* // crossRegionDetails: { // GuardrailCrossRegionDetails
141+
* // guardrailProfileId: "STRING_VALUE",
142+
* // guardrailProfileArn: "STRING_VALUE",
143+
* // },
140144
* // createdAt: new Date("TIMESTAMP"), // required
141145
* // updatedAt: new Date("TIMESTAMP"), // required
142146
* // statusReasons: [ // GuardrailStatusReasons

clients/client-bedrock/src/commands/ListGuardrailsCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ export interface ListGuardrailsCommandOutput extends ListGuardrailsResponse, __M
5858
* // version: "STRING_VALUE", // required
5959
* // createdAt: new Date("TIMESTAMP"), // required
6060
* // updatedAt: new Date("TIMESTAMP"), // required
61+
* // crossRegionDetails: { // GuardrailCrossRegionDetails
62+
* // guardrailProfileId: "STRING_VALUE",
63+
* // guardrailProfileArn: "STRING_VALUE",
64+
* // },
6165
* // },
6266
* // ],
6367
* // nextToken: "STRING_VALUE",

clients/client-bedrock/src/commands/UpdateGuardrailCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ export interface UpdateGuardrailCommandOutput extends UpdateGuardrailResponse, _
168168
* },
169169
* ],
170170
* },
171+
* crossRegionConfig: { // GuardrailCrossRegionConfig
172+
* guardrailProfileIdentifier: "STRING_VALUE", // required
173+
* },
171174
* blockedInputMessaging: "STRING_VALUE", // required
172175
* blockedOutputsMessaging: "STRING_VALUE", // required
173176
* kmsKeyId: "STRING_VALUE",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
// smithy-typescript generated code
22
export * from "./models_0";
3+
export * from "./models_1";

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

Lines changed: 59 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,6 +2351,19 @@ export interface GuardrailContextualGroundingPolicyConfig {
23512351
filtersConfig: GuardrailContextualGroundingFilterConfig[] | undefined;
23522352
}
23532353

2354+
/**
2355+
* <p>The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed. Using guardrail profiles helps maintain guardrail performance and reliability when demand increases.</p>
2356+
* <p>For more information, see the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html">Amazon Bedrock User Guide</a>.</p>
2357+
* @public
2358+
*/
2359+
export interface GuardrailCrossRegionConfig {
2360+
/**
2361+
* <p>The ID or Amazon Resource Name (ARN) of the guardrail profile that your guardrail is using. Guardrail profile availability depends on your current Amazon Web Services Region. For more information, see the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region-support.html">Amazon Bedrock User Guide</a>.</p>
2362+
* @public
2363+
*/
2364+
guardrailProfileIdentifier: string | undefined;
2365+
}
2366+
23542367
/**
23552368
* @public
23562369
* @enum
@@ -3243,6 +3256,13 @@ export interface CreateGuardrailRequest {
32433256
*/
32443257
contextualGroundingPolicyConfig?: GuardrailContextualGroundingPolicyConfig | undefined;
32453258

3259+
/**
3260+
* <p>The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed.</p>
3261+
* <p>For more information, see the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html">Amazon Bedrock User Guide</a>.</p>
3262+
* @public
3263+
*/
3264+
crossRegionConfig?: GuardrailCrossRegionConfig | undefined;
3265+
32463266
/**
32473267
* <p>The message to return when the guardrail blocks a prompt.</p>
32483268
* @public
@@ -3618,6 +3638,26 @@ export interface GuardrailContextualGroundingPolicy {
36183638
filters: GuardrailContextualGroundingFilter[] | undefined;
36193639
}
36203640

3641+
/**
3642+
* <p>Contains details about the system-defined guardrail profile that you're using with your guardrail for cross-Region inference.</p>
3643+
* <p>For more information, see the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html">Amazon Bedrock User Guide</a>.</p>
3644+
* @public
3645+
*/
3646+
export interface GuardrailCrossRegionDetails {
3647+
/**
3648+
* <p>The ID of the guardrail profile that your guardrail is using. Profile availability
3649+
* depends on your current Amazon Web Services Region. For more information, see the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region-support.html">Amazon Bedrock User Guide</a>.</p>
3650+
* @public
3651+
*/
3652+
guardrailProfileId?: string | undefined;
3653+
3654+
/**
3655+
* <p>The Amazon Resource Name (ARN) of the guardrail profile that you're using with your guardrail.</p>
3656+
* @public
3657+
*/
3658+
guardrailProfileArn?: string | undefined;
3659+
}
3660+
36213661
/**
36223662
* <p>The PII entity configured for the guardrail.</p>
36233663
* @public
@@ -4135,6 +4175,12 @@ export interface GetGuardrailResponse {
41354175
*/
41364176
contextualGroundingPolicy?: GuardrailContextualGroundingPolicy | undefined;
41374177

4178+
/**
4179+
* <p>Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).</p>
4180+
* @public
4181+
*/
4182+
crossRegionDetails?: GuardrailCrossRegionDetails | undefined;
4183+
41384184
/**
41394185
* <p>The date and time at which the guardrail was created.</p>
41404186
* @public
@@ -4261,6 +4307,12 @@ export interface GuardrailSummary {
42614307
* @public
42624308
*/
42634309
updatedAt: Date | undefined;
4310+
4311+
/**
4312+
* <p>Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).</p>
4313+
* @public
4314+
*/
4315+
crossRegionDetails?: GuardrailCrossRegionDetails | undefined;
42644316
}
42654317

42664318
/**
@@ -4332,6 +4384,13 @@ export interface UpdateGuardrailRequest {
43324384
*/
43334385
contextualGroundingPolicyConfig?: GuardrailContextualGroundingPolicyConfig | undefined;
43344386

4387+
/**
4388+
* <p>The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed.</p>
4389+
* <p>For more information, see the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html">Amazon Bedrock User Guide</a>.</p>
4390+
* @public
4391+
*/
4392+
crossRegionConfig?: GuardrailCrossRegionConfig | undefined;
4393+
43354394
/**
43364395
* <p>The message to return when the guardrail blocks a prompt.</p>
43374396
* @public
@@ -9409,96 +9468,6 @@ export interface CreateEvaluationJobRequest {
94099468
outputDataConfig: EvaluationOutputDataConfig | undefined;
94109469
}
94119470

9412-
/**
9413-
* @public
9414-
*/
9415-
export interface GetEvaluationJobResponse {
9416-
/**
9417-
* <p>The name for the evaluation job.</p>
9418-
* @public
9419-
*/
9420-
jobName: string | undefined;
9421-
9422-
/**
9423-
* <p>The current status of the evaluation job.</p>
9424-
* @public
9425-
*/
9426-
status: EvaluationJobStatus | undefined;
9427-
9428-
/**
9429-
* <p>The Amazon Resource Name (ARN) of the evaluation job.</p>
9430-
* @public
9431-
*/
9432-
jobArn: string | undefined;
9433-
9434-
/**
9435-
* <p>The description of the evaluation job.</p>
9436-
* @public
9437-
*/
9438-
jobDescription?: string | undefined;
9439-
9440-
/**
9441-
* <p>The Amazon Resource Name (ARN) of the IAM service role used in the evaluation job.</p>
9442-
* @public
9443-
*/
9444-
roleArn: string | undefined;
9445-
9446-
/**
9447-
* <p>The Amazon Resource Name (ARN) of the customer managed encryption key specified when the evaluation job was created.</p>
9448-
* @public
9449-
*/
9450-
customerEncryptionKeyId?: string | undefined;
9451-
9452-
/**
9453-
* <p>Specifies whether the evaluation job is automated or human-based.</p>
9454-
* @public
9455-
*/
9456-
jobType: EvaluationJobType | undefined;
9457-
9458-
/**
9459-
* <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
9460-
* @public
9461-
*/
9462-
applicationType?: ApplicationType | undefined;
9463-
9464-
/**
9465-
* <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
9466-
* @public
9467-
*/
9468-
evaluationConfig: EvaluationConfig | undefined;
9469-
9470-
/**
9471-
* <p>Contains the configuration details of the inference model used for the evaluation job. </p>
9472-
* @public
9473-
*/
9474-
inferenceConfig: EvaluationInferenceConfig | undefined;
9475-
9476-
/**
9477-
* <p>Contains the configuration details of the Amazon S3 bucket for
9478-
* storing the results of the evaluation job.</p>
9479-
* @public
9480-
*/
9481-
outputDataConfig: EvaluationOutputDataConfig | undefined;
9482-
9483-
/**
9484-
* <p>The time the evaluation job was created.</p>
9485-
* @public
9486-
*/
9487-
creationTime: Date | undefined;
9488-
9489-
/**
9490-
* <p>The time the evaluation job was last modified.</p>
9491-
* @public
9492-
*/
9493-
lastModifiedTime?: Date | undefined;
9494-
9495-
/**
9496-
* <p>A list of strings that specify why the evaluation job failed to create.</p>
9497-
* @public
9498-
*/
9499-
failureMessages?: string[] | undefined;
9500-
}
9501-
95029471
/**
95039472
* @internal
95049473
*/
@@ -10302,13 +10271,3 @@ export const CreateEvaluationJobRequestFilterSensitiveLog = (obj: CreateEvaluati
1030210271
...(obj.evaluationConfig && { evaluationConfig: EvaluationConfigFilterSensitiveLog(obj.evaluationConfig) }),
1030310272
...(obj.inferenceConfig && { inferenceConfig: EvaluationInferenceConfigFilterSensitiveLog(obj.inferenceConfig) }),
1030410273
});
10305-
10306-
/**
10307-
* @internal
10308-
*/
10309-
export const GetEvaluationJobResponseFilterSensitiveLog = (obj: GetEvaluationJobResponse): any => ({
10310-
...obj,
10311-
...(obj.jobDescription && { jobDescription: SENSITIVE_STRING }),
10312-
...(obj.evaluationConfig && { evaluationConfig: EvaluationConfigFilterSensitiveLog(obj.evaluationConfig) }),
10313-
...(obj.inferenceConfig && { inferenceConfig: EvaluationInferenceConfigFilterSensitiveLog(obj.inferenceConfig) }),
10314-
});
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// smithy-typescript generated code
2+
import { SENSITIVE_STRING } from "@smithy/smithy-client";
3+
4+
import {
5+
ApplicationType,
6+
EvaluationConfig,
7+
EvaluationConfigFilterSensitiveLog,
8+
EvaluationInferenceConfig,
9+
EvaluationInferenceConfigFilterSensitiveLog,
10+
EvaluationJobStatus,
11+
EvaluationJobType,
12+
EvaluationOutputDataConfig,
13+
} from "./models_0";
14+
15+
/**
16+
* @public
17+
*/
18+
export interface GetEvaluationJobResponse {
19+
/**
20+
* <p>The name for the evaluation job.</p>
21+
* @public
22+
*/
23+
jobName: string | undefined;
24+
25+
/**
26+
* <p>The current status of the evaluation job.</p>
27+
* @public
28+
*/
29+
status: EvaluationJobStatus | undefined;
30+
31+
/**
32+
* <p>The Amazon Resource Name (ARN) of the evaluation job.</p>
33+
* @public
34+
*/
35+
jobArn: string | undefined;
36+
37+
/**
38+
* <p>The description of the evaluation job.</p>
39+
* @public
40+
*/
41+
jobDescription?: string | undefined;
42+
43+
/**
44+
* <p>The Amazon Resource Name (ARN) of the IAM service role used in the evaluation job.</p>
45+
* @public
46+
*/
47+
roleArn: string | undefined;
48+
49+
/**
50+
* <p>The Amazon Resource Name (ARN) of the customer managed encryption key specified when the evaluation job was created.</p>
51+
* @public
52+
*/
53+
customerEncryptionKeyId?: string | undefined;
54+
55+
/**
56+
* <p>Specifies whether the evaluation job is automated or human-based.</p>
57+
* @public
58+
*/
59+
jobType: EvaluationJobType | undefined;
60+
61+
/**
62+
* <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
63+
* @public
64+
*/
65+
applicationType?: ApplicationType | undefined;
66+
67+
/**
68+
* <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
69+
* @public
70+
*/
71+
evaluationConfig: EvaluationConfig | undefined;
72+
73+
/**
74+
* <p>Contains the configuration details of the inference model used for the evaluation job. </p>
75+
* @public
76+
*/
77+
inferenceConfig: EvaluationInferenceConfig | undefined;
78+
79+
/**
80+
* <p>Contains the configuration details of the Amazon S3 bucket for
81+
* storing the results of the evaluation job.</p>
82+
* @public
83+
*/
84+
outputDataConfig: EvaluationOutputDataConfig | undefined;
85+
86+
/**
87+
* <p>The time the evaluation job was created.</p>
88+
* @public
89+
*/
90+
creationTime: Date | undefined;
91+
92+
/**
93+
* <p>The time the evaluation job was last modified.</p>
94+
* @public
95+
*/
96+
lastModifiedTime?: Date | undefined;
97+
98+
/**
99+
* <p>A list of strings that specify why the evaluation job failed to create.</p>
100+
* @public
101+
*/
102+
failureMessages?: string[] | undefined;
103+
}
104+
105+
/**
106+
* @internal
107+
*/
108+
export const GetEvaluationJobResponseFilterSensitiveLog = (obj: GetEvaluationJobResponse): any => ({
109+
...obj,
110+
...(obj.jobDescription && { jobDescription: SENSITIVE_STRING }),
111+
...(obj.evaluationConfig && { evaluationConfig: EvaluationConfigFilterSensitiveLog(obj.evaluationConfig) }),
112+
...(obj.inferenceConfig && { inferenceConfig: EvaluationInferenceConfigFilterSensitiveLog(obj.inferenceConfig) }),
113+
});

0 commit comments

Comments
 (0)