Skip to content

Commit 17ec1cb

Browse files
Enable cross-Region inference for Amazon Bedrock Guardrails by using the crossRegionConfig parameter when calling the CreateGuardrail or UpdateGuardrail operation.
1 parent fdc901a commit 17ec1cb

16 files changed

+597
-1
lines changed

generator/ServiceModels/bedrock/bedrock-2023-04-20.api.json

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,7 @@
13371337
"wordPolicyConfig":{"shape":"GuardrailWordPolicyConfig"},
13381338
"sensitiveInformationPolicyConfig":{"shape":"GuardrailSensitiveInformationPolicyConfig"},
13391339
"contextualGroundingPolicyConfig":{"shape":"GuardrailContextualGroundingPolicyConfig"},
1340+
"crossRegionConfig":{"shape":"GuardrailCrossRegionConfig"},
13401341
"blockedInputMessaging":{"shape":"GuardrailBlockedMessaging"},
13411342
"blockedOutputsMessaging":{"shape":"GuardrailBlockedMessaging"},
13421343
"kmsKeyId":{"shape":"KmsKeyId"},
@@ -2520,6 +2521,7 @@
25202521
"wordPolicy":{"shape":"GuardrailWordPolicy"},
25212522
"sensitiveInformationPolicy":{"shape":"GuardrailSensitiveInformationPolicy"},
25222523
"contextualGroundingPolicy":{"shape":"GuardrailContextualGroundingPolicy"},
2524+
"crossRegionDetails":{"shape":"GuardrailCrossRegionDetails"},
25232525
"createdAt":{"shape":"Timestamp"},
25242526
"updatedAt":{"shape":"Timestamp"},
25252527
"statusReasons":{"shape":"GuardrailStatusReasons"},
@@ -3037,6 +3039,38 @@
30373039
"filtersConfig":{"shape":"GuardrailContextualGroundingFiltersConfig"}
30383040
}
30393041
},
3042+
"GuardrailCrossRegionConfig":{
3043+
"type":"structure",
3044+
"required":["guardrailProfileIdentifier"],
3045+
"members":{
3046+
"guardrailProfileIdentifier":{"shape":"GuardrailCrossRegionGuardrailProfileIdentifier"}
3047+
}
3048+
},
3049+
"GuardrailCrossRegionDetails":{
3050+
"type":"structure",
3051+
"members":{
3052+
"guardrailProfileId":{"shape":"GuardrailCrossRegionGuardrailProfileId"},
3053+
"guardrailProfileArn":{"shape":"GuardrailCrossRegionGuardrailProfileArn"}
3054+
}
3055+
},
3056+
"GuardrailCrossRegionGuardrailProfileArn":{
3057+
"type":"string",
3058+
"max":2048,
3059+
"min":20,
3060+
"pattern":"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail-profile/[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+"
3061+
},
3062+
"GuardrailCrossRegionGuardrailProfileId":{
3063+
"type":"string",
3064+
"max":30,
3065+
"min":15,
3066+
"pattern":"[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+"
3067+
},
3068+
"GuardrailCrossRegionGuardrailProfileIdentifier":{
3069+
"type":"string",
3070+
"max":2048,
3071+
"min":15,
3072+
"pattern":"[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+|arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail-profile/[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+"
3073+
},
30403074
"GuardrailDescription":{
30413075
"type":"string",
30423076
"max":200,
@@ -3363,7 +3397,8 @@
33633397
"description":{"shape":"GuardrailDescription"},
33643398
"version":{"shape":"GuardrailVersion"},
33653399
"createdAt":{"shape":"Timestamp"},
3366-
"updatedAt":{"shape":"Timestamp"}
3400+
"updatedAt":{"shape":"Timestamp"},
3401+
"crossRegionDetails":{"shape":"GuardrailCrossRegionDetails"}
33673402
}
33683403
},
33693404
"GuardrailTopic":{
@@ -5637,6 +5672,7 @@
56375672
"wordPolicyConfig":{"shape":"GuardrailWordPolicyConfig"},
56385673
"sensitiveInformationPolicyConfig":{"shape":"GuardrailSensitiveInformationPolicyConfig"},
56395674
"contextualGroundingPolicyConfig":{"shape":"GuardrailContextualGroundingPolicyConfig"},
5675+
"crossRegionConfig":{"shape":"GuardrailCrossRegionConfig"},
56405676
"blockedInputMessaging":{"shape":"GuardrailBlockedMessaging"},
56415677
"blockedOutputsMessaging":{"shape":"GuardrailBlockedMessaging"},
56425678
"kmsKeyId":{"shape":"KmsKeyId"}

generator/ServiceModels/bedrock/bedrock-2023-04-20.docs.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,38 @@
13541354
"UpdateGuardrailRequest$contextualGroundingPolicyConfig": "<p>The contextual grounding policy configuration used to update a guardrail.</p>"
13551355
}
13561356
},
1357+
"GuardrailCrossRegionConfig": {
1358+
"base": "<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> <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>",
1359+
"refs": {
1360+
"CreateGuardrailRequest$crossRegionConfig": "<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> <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>",
1361+
"UpdateGuardrailRequest$crossRegionConfig": "<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> <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>"
1362+
}
1363+
},
1364+
"GuardrailCrossRegionDetails": {
1365+
"base": "<p>Contains details about the system-defined guardrail profile that you're using with your guardrail for cross-Region inference.</p> <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>",
1366+
"refs": {
1367+
"GetGuardrailResponse$crossRegionDetails": "<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>",
1368+
"GuardrailSummary$crossRegionDetails": "<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>"
1369+
}
1370+
},
1371+
"GuardrailCrossRegionGuardrailProfileArn": {
1372+
"base": null,
1373+
"refs": {
1374+
"GuardrailCrossRegionDetails$guardrailProfileArn": "<p>The Amazon Resource Name (ARN) of the guardrail profile that you're using with your guardrail.</p>"
1375+
}
1376+
},
1377+
"GuardrailCrossRegionGuardrailProfileId": {
1378+
"base": null,
1379+
"refs": {
1380+
"GuardrailCrossRegionDetails$guardrailProfileId": "<p>The ID of the guardrail profile that your guardrail is using. 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>"
1381+
}
1382+
},
1383+
"GuardrailCrossRegionGuardrailProfileIdentifier": {
1384+
"base": null,
1385+
"refs": {
1386+
"GuardrailCrossRegionConfig$guardrailProfileIdentifier": "<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>"
1387+
}
1388+
},
13571389
"GuardrailDescription": {
13581390
"base": null,
13591391
"refs": {

generator/ServiceModels/bedrock/bedrock-2023-04-20.normal.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,10 @@
15211521
"shape":"GuardrailContextualGroundingPolicyConfig",
15221522
"documentation":"<p>The contextual grounding policy configuration used to create a guardrail.</p>"
15231523
},
1524+
"crossRegionConfig":{
1525+
"shape":"GuardrailCrossRegionConfig",
1526+
"documentation":"<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> <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>"
1527+
},
15241528
"blockedInputMessaging":{
15251529
"shape":"GuardrailBlockedMessaging",
15261530
"documentation":"<p>The message to return when the guardrail blocks a prompt.</p>"
@@ -3397,6 +3401,10 @@
33973401
"shape":"GuardrailContextualGroundingPolicy",
33983402
"documentation":"<p>The contextual grounding policy used in the guardrail.</p>"
33993403
},
3404+
"crossRegionDetails":{
3405+
"shape":"GuardrailCrossRegionDetails",
3406+
"documentation":"<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>"
3407+
},
34003408
"createdAt":{
34013409
"shape":"Timestamp",
34023410
"documentation":"<p>The date and time at which the guardrail was created.</p>"
@@ -4367,6 +4375,49 @@
43674375
},
43684376
"documentation":"<p>The policy configuration details for the guardrails contextual grounding policy.</p>"
43694377
},
4378+
"GuardrailCrossRegionConfig":{
4379+
"type":"structure",
4380+
"required":["guardrailProfileIdentifier"],
4381+
"members":{
4382+
"guardrailProfileIdentifier":{
4383+
"shape":"GuardrailCrossRegionGuardrailProfileIdentifier",
4384+
"documentation":"<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>"
4385+
}
4386+
},
4387+
"documentation":"<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> <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>"
4388+
},
4389+
"GuardrailCrossRegionDetails":{
4390+
"type":"structure",
4391+
"members":{
4392+
"guardrailProfileId":{
4393+
"shape":"GuardrailCrossRegionGuardrailProfileId",
4394+
"documentation":"<p>The ID of the guardrail profile that your guardrail is using. 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>"
4395+
},
4396+
"guardrailProfileArn":{
4397+
"shape":"GuardrailCrossRegionGuardrailProfileArn",
4398+
"documentation":"<p>The Amazon Resource Name (ARN) of the guardrail profile that you're using with your guardrail.</p>"
4399+
}
4400+
},
4401+
"documentation":"<p>Contains details about the system-defined guardrail profile that you're using with your guardrail for cross-Region inference.</p> <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>"
4402+
},
4403+
"GuardrailCrossRegionGuardrailProfileArn":{
4404+
"type":"string",
4405+
"max":2048,
4406+
"min":20,
4407+
"pattern":"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail-profile/[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+"
4408+
},
4409+
"GuardrailCrossRegionGuardrailProfileId":{
4410+
"type":"string",
4411+
"max":30,
4412+
"min":15,
4413+
"pattern":"[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+"
4414+
},
4415+
"GuardrailCrossRegionGuardrailProfileIdentifier":{
4416+
"type":"string",
4417+
"max":2048,
4418+
"min":15,
4419+
"pattern":"[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+|arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail-profile/[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+"
4420+
},
43704421
"GuardrailDescription":{
43714422
"type":"string",
43724423
"max":200,
@@ -4851,6 +4902,10 @@
48514902
"updatedAt":{
48524903
"shape":"Timestamp",
48534904
"documentation":"<p>The date and time at which the guardrail was last updated.</p>"
4905+
},
4906+
"crossRegionDetails":{
4907+
"shape":"GuardrailCrossRegionDetails",
4908+
"documentation":"<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>"
48544909
}
48554910
},
48564911
"documentation":"<p>Contains details about a guardrail.</p> <p>This data type is used in the following API operations:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListGuardrails.html#API_ListGuardrails_ResponseSyntax\">ListGuardrails response body</a> </p> </li> </ul>"
@@ -8107,6 +8162,10 @@
81078162
"shape":"GuardrailContextualGroundingPolicyConfig",
81088163
"documentation":"<p>The contextual grounding policy configuration used to update a guardrail.</p>"
81098164
},
8165+
"crossRegionConfig":{
8166+
"shape":"GuardrailCrossRegionConfig",
8167+
"documentation":"<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> <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>"
8168+
},
81108169
"blockedInputMessaging":{
81118170
"shape":"GuardrailBlockedMessaging",
81128171
"documentation":"<p>The message to return when the guardrail blocks a prompt.</p>"

sdk/code-analysis/ServiceAnalysis/Bedrock/Generated/PropertyValueRules.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,24 @@
15231523
<property>Amazon.Bedrock.Model.GuardrailContextualGroundingFilterConfig.Threshold</property>
15241524
<min>0</min>
15251525
</property-value-rule>
1526+
<property-value-rule>
1527+
<property>Amazon.Bedrock.Model.GuardrailCrossRegionConfig.GuardrailProfileIdentifier</property>
1528+
<min>15</min>
1529+
<max>2048</max>
1530+
<pattern>[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+|arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail-profile/[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+</pattern>
1531+
</property-value-rule>
1532+
<property-value-rule>
1533+
<property>Amazon.Bedrock.Model.GuardrailCrossRegionDetails.GuardrailProfileArn</property>
1534+
<min>20</min>
1535+
<max>2048</max>
1536+
<pattern>arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail-profile/[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+</pattern>
1537+
</property-value-rule>
1538+
<property-value-rule>
1539+
<property>Amazon.Bedrock.Model.GuardrailCrossRegionDetails.GuardrailProfileId</property>
1540+
<min>15</min>
1541+
<max>30</max>
1542+
<pattern>[a-z0-9-]+[.]{1}guardrail[.]{1}v[0-9:]+</pattern>
1543+
</property-value-rule>
15261544
<property-value-rule>
15271545
<property>Amazon.Bedrock.Model.GuardrailRegex.Description</property>
15281546
<min>1</min>

sdk/src/Services/Bedrock/Generated/Model/CreateGuardrailRequest.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public partial class CreateGuardrailRequest : AmazonBedrockRequest
8181
private string _clientRequestToken;
8282
private GuardrailContentPolicyConfig _contentPolicyConfig;
8383
private GuardrailContextualGroundingPolicyConfig _contextualGroundingPolicyConfig;
84+
private GuardrailCrossRegionConfig _crossRegionConfig;
8485
private string _description;
8586
private string _kmsKeyId;
8687
private string _name;
@@ -185,6 +186,31 @@ internal bool IsSetContextualGroundingPolicyConfig()
185186
return this._contextualGroundingPolicyConfig != null;
186187
}
187188

189+
/// <summary>
190+
/// Gets and sets the property CrossRegionConfig.
191+
/// <para>
192+
/// The system-defined guardrail profile that you're using with your guardrail. Guardrail
193+
/// profiles define the destination Amazon Web Services Regions where guardrail inference
194+
/// requests can be automatically routed.
195+
/// </para>
196+
///
197+
/// <para>
198+
/// For more information, see the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html">Amazon
199+
/// Bedrock User Guide</a>.
200+
/// </para>
201+
/// </summary>
202+
public GuardrailCrossRegionConfig CrossRegionConfig
203+
{
204+
get { return this._crossRegionConfig; }
205+
set { this._crossRegionConfig = value; }
206+
}
207+
208+
// Check to see if CrossRegionConfig property is set
209+
internal bool IsSetCrossRegionConfig()
210+
{
211+
return this._crossRegionConfig != null;
212+
}
213+
188214
/// <summary>
189215
/// Gets and sets the property Description.
190216
/// <para>

sdk/src/Services/Bedrock/Generated/Model/GetGuardrailResponse.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public partial class GetGuardrailResponse : AmazonWebServiceResponse
3939
private GuardrailContentPolicy _contentPolicy;
4040
private GuardrailContextualGroundingPolicy _contextualGroundingPolicy;
4141
private DateTime? _createdAt;
42+
private GuardrailCrossRegionDetails _crossRegionDetails;
4243
private string _description;
4344
private List<string> _failureRecommendations = AWSConfigs.InitializeCollections ? new List<string>() : null;
4445
private string _guardrailArn;
@@ -146,6 +147,25 @@ internal bool IsSetCreatedAt()
146147
return this._createdAt.HasValue;
147148
}
148149

150+
/// <summary>
151+
/// Gets and sets the property CrossRegionDetails.
152+
/// <para>
153+
/// Details about the system-defined guardrail profile that you're using with your guardrail,
154+
/// including the guardrail profile ID and Amazon Resource Name (ARN).
155+
/// </para>
156+
/// </summary>
157+
public GuardrailCrossRegionDetails CrossRegionDetails
158+
{
159+
get { return this._crossRegionDetails; }
160+
set { this._crossRegionDetails = value; }
161+
}
162+
163+
// Check to see if CrossRegionDetails property is set
164+
internal bool IsSetCrossRegionDetails()
165+
{
166+
return this._crossRegionDetails != null;
167+
}
168+
149169
/// <summary>
150170
/// Gets and sets the property Description.
151171
/// <para>

0 commit comments

Comments
 (0)