published on Wednesday, Oct 28, 2026 by Pulumi
published on Wednesday, Oct 28, 2026 by Pulumi
Resource for managing an Amazon Bedrock Enforced Guardrail Configuration.
This resource configures an enforced guardrail that is applied across all Bedrock inference calls in the configured region.
Enforced guardrail configuration is configured per AWS region. To avoid overwriting settings, this resource should not be defined in multiple configurations.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.bedrock.Guardrail("example", {
wordPolicyConfig: {
wordsConfigs: [{
text: "deny",
}],
},
name: "example",
blockedInputMessaging: "Blocked input",
blockedOutputsMessaging: "Blocked output",
description: "Example guardrail",
});
const exampleGuardrailVersion = new aws.bedrock.GuardrailVersion("example", {
guardrailArn: example.guardrailArn,
description: "Example version",
});
const exampleEnforcedGuardrailConfiguration = new aws.bedrock.EnforcedGuardrailConfiguration("example", {
guardrailArn: example.guardrailArn,
guardrailVersion: exampleGuardrailVersion.version,
});
import pulumi
import pulumi_aws as aws
example = aws.bedrock.Guardrail("example",
word_policy_config={
"words_configs": [{
"text": "deny",
}],
},
name="example",
blocked_input_messaging="Blocked input",
blocked_outputs_messaging="Blocked output",
description="Example guardrail")
example_guardrail_version = aws.bedrock.GuardrailVersion("example",
guardrail_arn=example.guardrail_arn,
description="Example version")
example_enforced_guardrail_configuration = aws.bedrock.EnforcedGuardrailConfiguration("example",
guardrail_arn=example.guardrail_arn,
guardrail_version=example_guardrail_version.version)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := bedrock.NewGuardrail(ctx, "example", &bedrock.GuardrailArgs{
WordPolicyConfig: &bedrock.GuardrailWordPolicyConfigArgs{
WordsConfigs: bedrock.GuardrailWordPolicyConfigWordsConfigArray{
&bedrock.GuardrailWordPolicyConfigWordsConfigArgs{
Text: pulumi.String("deny"),
},
},
},
Name: pulumi.String("example"),
BlockedInputMessaging: pulumi.String("Blocked input"),
BlockedOutputsMessaging: pulumi.String("Blocked output"),
Description: pulumi.String("Example guardrail"),
})
if err != nil {
return err
}
exampleGuardrailVersion, err := bedrock.NewGuardrailVersion(ctx, "example", &bedrock.GuardrailVersionArgs{
GuardrailArn: example.GuardrailArn,
Description: pulumi.String("Example version"),
})
if err != nil {
return err
}
_, err = bedrock.NewEnforcedGuardrailConfiguration(ctx, "example", &bedrock.EnforcedGuardrailConfigurationArgs{
GuardrailArn: example.GuardrailArn,
GuardrailVersion: exampleGuardrailVersion.Version,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Bedrock.Guardrail("example", new()
{
WordPolicyConfig = new Aws.Bedrock.Inputs.GuardrailWordPolicyConfigArgs
{
WordsConfigs = new[]
{
new Aws.Bedrock.Inputs.GuardrailWordPolicyConfigWordsConfigArgs
{
Text = "deny",
},
},
},
Name = "example",
BlockedInputMessaging = "Blocked input",
BlockedOutputsMessaging = "Blocked output",
Description = "Example guardrail",
});
var exampleGuardrailVersion = new Aws.Bedrock.GuardrailVersion("example", new()
{
GuardrailArn = example.GuardrailArn,
Description = "Example version",
});
var exampleEnforcedGuardrailConfiguration = new Aws.Bedrock.EnforcedGuardrailConfiguration("example", new()
{
GuardrailArn = example.GuardrailArn,
GuardrailVersion = exampleGuardrailVersion.Version,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrock.Guardrail;
import com.pulumi.aws.bedrock.GuardrailArgs;
import com.pulumi.aws.bedrock.inputs.GuardrailWordPolicyConfigArgs;
import com.pulumi.aws.bedrock.inputs.GuardrailWordPolicyConfigWordsConfigArgs;
import com.pulumi.aws.bedrock.GuardrailVersion;
import com.pulumi.aws.bedrock.GuardrailVersionArgs;
import com.pulumi.aws.bedrock.EnforcedGuardrailConfiguration;
import com.pulumi.aws.bedrock.EnforcedGuardrailConfigurationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Guardrail("example", GuardrailArgs.builder()
.wordPolicyConfig(GuardrailWordPolicyConfigArgs.builder()
.wordsConfigs(GuardrailWordPolicyConfigWordsConfigArgs.builder()
.text("deny")
.build())
.build())
.name("example")
.blockedInputMessaging("Blocked input")
.blockedOutputsMessaging("Blocked output")
.description("Example guardrail")
.build());
var exampleGuardrailVersion = new GuardrailVersion("exampleGuardrailVersion", GuardrailVersionArgs.builder()
.guardrailArn(example.guardrailArn())
.description("Example version")
.build());
var exampleEnforcedGuardrailConfiguration = new EnforcedGuardrailConfiguration("exampleEnforcedGuardrailConfiguration", EnforcedGuardrailConfigurationArgs.builder()
.guardrailArn(example.guardrailArn())
.guardrailVersion(exampleGuardrailVersion.version())
.build());
}
}
resources:
example:
type: aws:bedrock:Guardrail
properties:
wordPolicyConfig:
wordsConfigs:
- text: deny
name: example
blockedInputMessaging: Blocked input
blockedOutputsMessaging: Blocked output
description: Example guardrail
exampleGuardrailVersion:
type: aws:bedrock:GuardrailVersion
name: example
properties:
guardrailArn: ${example.guardrailArn}
description: Example version
exampleEnforcedGuardrailConfiguration:
type: aws:bedrock:EnforcedGuardrailConfiguration
name: example
properties:
guardrailArn: ${example.guardrailArn}
guardrailVersion: ${exampleGuardrailVersion.version}
terraform {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_bedrock_guardrail" "example" {
lifecycle {
create_before_destroy = true
}
word_policy_config {
words_config {
text = "deny"
}
}
name = "example"
blocked_input_messaging = "Blocked input"
blocked_outputs_messaging = "Blocked output"
description = "Example guardrail"
}
resource "aws_bedrock_guardrail_version" "example" {
lifecycle {
create_before_destroy = true
}
guardrail_arn = aws_bedrock_guardrail.example.guardrail_arn
description = "Example version"
}
resource "aws_bedrock_enforced_guardrail_configuration" "example" {
lifecycle {
create_before_destroy = true
}
guardrail_arn = aws_bedrock_guardrail.example.guardrail_arn
guardrail_version = aws_bedrock_guardrail_version.example.version
}
With Selective Content Guarding
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.bedrock.Guardrail("example", {
wordPolicyConfig: {
wordsConfigs: [{
text: "deny",
}],
},
name: "example",
blockedInputMessaging: "Blocked input",
blockedOutputsMessaging: "Blocked output",
description: "Example guardrail",
});
const exampleGuardrailVersion = new aws.bedrock.GuardrailVersion("example", {
guardrailArn: example.guardrailArn,
description: "Example version",
});
const exampleEnforcedGuardrailConfiguration = new aws.bedrock.EnforcedGuardrailConfiguration("example", {
selectiveContentGuarding: {
messages: "COMPREHENSIVE",
system: "COMPREHENSIVE",
},
guardrailArn: example.guardrailArn,
guardrailVersion: exampleGuardrailVersion.version,
});
import pulumi
import pulumi_aws as aws
example = aws.bedrock.Guardrail("example",
word_policy_config={
"words_configs": [{
"text": "deny",
}],
},
name="example",
blocked_input_messaging="Blocked input",
blocked_outputs_messaging="Blocked output",
description="Example guardrail")
example_guardrail_version = aws.bedrock.GuardrailVersion("example",
guardrail_arn=example.guardrail_arn,
description="Example version")
example_enforced_guardrail_configuration = aws.bedrock.EnforcedGuardrailConfiguration("example",
selective_content_guarding={
"messages": "COMPREHENSIVE",
"system": "COMPREHENSIVE",
},
guardrail_arn=example.guardrail_arn,
guardrail_version=example_guardrail_version.version)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := bedrock.NewGuardrail(ctx, "example", &bedrock.GuardrailArgs{
WordPolicyConfig: &bedrock.GuardrailWordPolicyConfigArgs{
WordsConfigs: bedrock.GuardrailWordPolicyConfigWordsConfigArray{
&bedrock.GuardrailWordPolicyConfigWordsConfigArgs{
Text: pulumi.String("deny"),
},
},
},
Name: pulumi.String("example"),
BlockedInputMessaging: pulumi.String("Blocked input"),
BlockedOutputsMessaging: pulumi.String("Blocked output"),
Description: pulumi.String("Example guardrail"),
})
if err != nil {
return err
}
exampleGuardrailVersion, err := bedrock.NewGuardrailVersion(ctx, "example", &bedrock.GuardrailVersionArgs{
GuardrailArn: example.GuardrailArn,
Description: pulumi.String("Example version"),
})
if err != nil {
return err
}
_, err = bedrock.NewEnforcedGuardrailConfiguration(ctx, "example", &bedrock.EnforcedGuardrailConfigurationArgs{
SelectiveContentGuarding: &bedrock.EnforcedGuardrailConfigurationSelectiveContentGuardingArgs{
Messages: pulumi.String("COMPREHENSIVE"),
System: pulumi.String("COMPREHENSIVE"),
},
GuardrailArn: example.GuardrailArn,
GuardrailVersion: exampleGuardrailVersion.Version,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Bedrock.Guardrail("example", new()
{
WordPolicyConfig = new Aws.Bedrock.Inputs.GuardrailWordPolicyConfigArgs
{
WordsConfigs = new[]
{
new Aws.Bedrock.Inputs.GuardrailWordPolicyConfigWordsConfigArgs
{
Text = "deny",
},
},
},
Name = "example",
BlockedInputMessaging = "Blocked input",
BlockedOutputsMessaging = "Blocked output",
Description = "Example guardrail",
});
var exampleGuardrailVersion = new Aws.Bedrock.GuardrailVersion("example", new()
{
GuardrailArn = example.GuardrailArn,
Description = "Example version",
});
var exampleEnforcedGuardrailConfiguration = new Aws.Bedrock.EnforcedGuardrailConfiguration("example", new()
{
SelectiveContentGuarding = new Aws.Bedrock.Inputs.EnforcedGuardrailConfigurationSelectiveContentGuardingArgs
{
Messages = "COMPREHENSIVE",
System = "COMPREHENSIVE",
},
GuardrailArn = example.GuardrailArn,
GuardrailVersion = exampleGuardrailVersion.Version,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrock.Guardrail;
import com.pulumi.aws.bedrock.GuardrailArgs;
import com.pulumi.aws.bedrock.inputs.GuardrailWordPolicyConfigArgs;
import com.pulumi.aws.bedrock.inputs.GuardrailWordPolicyConfigWordsConfigArgs;
import com.pulumi.aws.bedrock.GuardrailVersion;
import com.pulumi.aws.bedrock.GuardrailVersionArgs;
import com.pulumi.aws.bedrock.EnforcedGuardrailConfiguration;
import com.pulumi.aws.bedrock.EnforcedGuardrailConfigurationArgs;
import com.pulumi.aws.bedrock.inputs.EnforcedGuardrailConfigurationSelectiveContentGuardingArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Guardrail("example", GuardrailArgs.builder()
.wordPolicyConfig(GuardrailWordPolicyConfigArgs.builder()
.wordsConfigs(GuardrailWordPolicyConfigWordsConfigArgs.builder()
.text("deny")
.build())
.build())
.name("example")
.blockedInputMessaging("Blocked input")
.blockedOutputsMessaging("Blocked output")
.description("Example guardrail")
.build());
var exampleGuardrailVersion = new GuardrailVersion("exampleGuardrailVersion", GuardrailVersionArgs.builder()
.guardrailArn(example.guardrailArn())
.description("Example version")
.build());
var exampleEnforcedGuardrailConfiguration = new EnforcedGuardrailConfiguration("exampleEnforcedGuardrailConfiguration", EnforcedGuardrailConfigurationArgs.builder()
.selectiveContentGuarding(EnforcedGuardrailConfigurationSelectiveContentGuardingArgs.builder()
.messages("COMPREHENSIVE")
.system("COMPREHENSIVE")
.build())
.guardrailArn(example.guardrailArn())
.guardrailVersion(exampleGuardrailVersion.version())
.build());
}
}
resources:
example:
type: aws:bedrock:Guardrail
properties:
wordPolicyConfig:
wordsConfigs:
- text: deny
name: example
blockedInputMessaging: Blocked input
blockedOutputsMessaging: Blocked output
description: Example guardrail
exampleGuardrailVersion:
type: aws:bedrock:GuardrailVersion
name: example
properties:
guardrailArn: ${example.guardrailArn}
description: Example version
exampleEnforcedGuardrailConfiguration:
type: aws:bedrock:EnforcedGuardrailConfiguration
name: example
properties:
selectiveContentGuarding:
messages: COMPREHENSIVE
system: COMPREHENSIVE
guardrailArn: ${example.guardrailArn}
guardrailVersion: ${exampleGuardrailVersion.version}
terraform {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_bedrock_guardrail" "example" {
lifecycle {
create_before_destroy = true
}
word_policy_config {
words_config {
text = "deny"
}
}
name = "example"
blocked_input_messaging = "Blocked input"
blocked_outputs_messaging = "Blocked output"
description = "Example guardrail"
}
resource "aws_bedrock_guardrail_version" "example" {
lifecycle {
create_before_destroy = true
}
guardrail_arn = aws_bedrock_guardrail.example.guardrail_arn
description = "Example version"
}
resource "aws_bedrock_enforced_guardrail_configuration" "example" {
lifecycle {
create_before_destroy = true
}
selective_content_guarding {
messages = "COMPREHENSIVE"
system = "COMPREHENSIVE"
}
guardrail_arn = aws_bedrock_guardrail.example.guardrail_arn
guardrail_version = aws_bedrock_guardrail_version.example.version
}
With Model Enforcement
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.bedrock.Guardrail("example", {
wordPolicyConfig: {
wordsConfigs: [{
text: "deny",
}],
},
name: "example",
blockedInputMessaging: "Blocked input",
blockedOutputsMessaging: "Blocked output",
description: "Example guardrail",
});
const exampleGuardrailVersion = new aws.bedrock.GuardrailVersion("example", {
guardrailArn: example.guardrailArn,
description: "Example version",
});
const exampleEnforcedGuardrailConfiguration = new aws.bedrock.EnforcedGuardrailConfiguration("example", {
modelEnforcement: {
includedModels: ["ALL"],
excludedModels: [],
},
guardrailArn: example.guardrailArn,
guardrailVersion: exampleGuardrailVersion.version,
});
import pulumi
import pulumi_aws as aws
example = aws.bedrock.Guardrail("example",
word_policy_config={
"words_configs": [{
"text": "deny",
}],
},
name="example",
blocked_input_messaging="Blocked input",
blocked_outputs_messaging="Blocked output",
description="Example guardrail")
example_guardrail_version = aws.bedrock.GuardrailVersion("example",
guardrail_arn=example.guardrail_arn,
description="Example version")
example_enforced_guardrail_configuration = aws.bedrock.EnforcedGuardrailConfiguration("example",
model_enforcement={
"included_models": ["ALL"],
"excluded_models": [],
},
guardrail_arn=example.guardrail_arn,
guardrail_version=example_guardrail_version.version)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := bedrock.NewGuardrail(ctx, "example", &bedrock.GuardrailArgs{
WordPolicyConfig: &bedrock.GuardrailWordPolicyConfigArgs{
WordsConfigs: bedrock.GuardrailWordPolicyConfigWordsConfigArray{
&bedrock.GuardrailWordPolicyConfigWordsConfigArgs{
Text: pulumi.String("deny"),
},
},
},
Name: pulumi.String("example"),
BlockedInputMessaging: pulumi.String("Blocked input"),
BlockedOutputsMessaging: pulumi.String("Blocked output"),
Description: pulumi.String("Example guardrail"),
})
if err != nil {
return err
}
exampleGuardrailVersion, err := bedrock.NewGuardrailVersion(ctx, "example", &bedrock.GuardrailVersionArgs{
GuardrailArn: example.GuardrailArn,
Description: pulumi.String("Example version"),
})
if err != nil {
return err
}
_, err = bedrock.NewEnforcedGuardrailConfiguration(ctx, "example", &bedrock.EnforcedGuardrailConfigurationArgs{
ModelEnforcement: &bedrock.EnforcedGuardrailConfigurationModelEnforcementArgs{
IncludedModels: pulumi.StringArray{
pulumi.String("ALL"),
},
ExcludedModels: pulumi.StringArray{},
},
GuardrailArn: example.GuardrailArn,
GuardrailVersion: exampleGuardrailVersion.Version,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Bedrock.Guardrail("example", new()
{
WordPolicyConfig = new Aws.Bedrock.Inputs.GuardrailWordPolicyConfigArgs
{
WordsConfigs = new[]
{
new Aws.Bedrock.Inputs.GuardrailWordPolicyConfigWordsConfigArgs
{
Text = "deny",
},
},
},
Name = "example",
BlockedInputMessaging = "Blocked input",
BlockedOutputsMessaging = "Blocked output",
Description = "Example guardrail",
});
var exampleGuardrailVersion = new Aws.Bedrock.GuardrailVersion("example", new()
{
GuardrailArn = example.GuardrailArn,
Description = "Example version",
});
var exampleEnforcedGuardrailConfiguration = new Aws.Bedrock.EnforcedGuardrailConfiguration("example", new()
{
ModelEnforcement = new Aws.Bedrock.Inputs.EnforcedGuardrailConfigurationModelEnforcementArgs
{
IncludedModels = new[]
{
"ALL",
},
ExcludedModels = new() { },
},
GuardrailArn = example.GuardrailArn,
GuardrailVersion = exampleGuardrailVersion.Version,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrock.Guardrail;
import com.pulumi.aws.bedrock.GuardrailArgs;
import com.pulumi.aws.bedrock.inputs.GuardrailWordPolicyConfigArgs;
import com.pulumi.aws.bedrock.inputs.GuardrailWordPolicyConfigWordsConfigArgs;
import com.pulumi.aws.bedrock.GuardrailVersion;
import com.pulumi.aws.bedrock.GuardrailVersionArgs;
import com.pulumi.aws.bedrock.EnforcedGuardrailConfiguration;
import com.pulumi.aws.bedrock.EnforcedGuardrailConfigurationArgs;
import com.pulumi.aws.bedrock.inputs.EnforcedGuardrailConfigurationModelEnforcementArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Guardrail("example", GuardrailArgs.builder()
.wordPolicyConfig(GuardrailWordPolicyConfigArgs.builder()
.wordsConfigs(GuardrailWordPolicyConfigWordsConfigArgs.builder()
.text("deny")
.build())
.build())
.name("example")
.blockedInputMessaging("Blocked input")
.blockedOutputsMessaging("Blocked output")
.description("Example guardrail")
.build());
var exampleGuardrailVersion = new GuardrailVersion("exampleGuardrailVersion", GuardrailVersionArgs.builder()
.guardrailArn(example.guardrailArn())
.description("Example version")
.build());
var exampleEnforcedGuardrailConfiguration = new EnforcedGuardrailConfiguration("exampleEnforcedGuardrailConfiguration", EnforcedGuardrailConfigurationArgs.builder()
.modelEnforcement(EnforcedGuardrailConfigurationModelEnforcementArgs.builder()
.includedModels("ALL")
.excludedModels()
.build())
.guardrailArn(example.guardrailArn())
.guardrailVersion(exampleGuardrailVersion.version())
.build());
}
}
resources:
example:
type: aws:bedrock:Guardrail
properties:
wordPolicyConfig:
wordsConfigs:
- text: deny
name: example
blockedInputMessaging: Blocked input
blockedOutputsMessaging: Blocked output
description: Example guardrail
exampleGuardrailVersion:
type: aws:bedrock:GuardrailVersion
name: example
properties:
guardrailArn: ${example.guardrailArn}
description: Example version
exampleEnforcedGuardrailConfiguration:
type: aws:bedrock:EnforcedGuardrailConfiguration
name: example
properties:
modelEnforcement:
includedModels:
- ALL
excludedModels: []
guardrailArn: ${example.guardrailArn}
guardrailVersion: ${exampleGuardrailVersion.version}
terraform {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_bedrock_guardrail" "example" {
lifecycle {
create_before_destroy = true
}
word_policy_config {
words_config {
text = "deny"
}
}
name = "example"
blocked_input_messaging = "Blocked input"
blocked_outputs_messaging = "Blocked output"
description = "Example guardrail"
}
resource "aws_bedrock_guardrail_version" "example" {
lifecycle {
create_before_destroy = true
}
guardrail_arn = aws_bedrock_guardrail.example.guardrail_arn
description = "Example version"
}
resource "aws_bedrock_enforced_guardrail_configuration" "example" {
lifecycle {
create_before_destroy = true
}
model_enforcement {
included_models = ["ALL"]
excluded_models = []
}
guardrail_arn = aws_bedrock_guardrail.example.guardrail_arn
guardrail_version = aws_bedrock_guardrail_version.example.version
}
Create EnforcedGuardrailConfiguration Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EnforcedGuardrailConfiguration(name: string, args: EnforcedGuardrailConfigurationArgs, opts?: CustomResourceOptions);@overload
def EnforcedGuardrailConfiguration(resource_name: str,
args: EnforcedGuardrailConfigurationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EnforcedGuardrailConfiguration(resource_name: str,
opts: Optional[ResourceOptions] = None,
guardrail_arn: Optional[str] = None,
guardrail_version: Optional[str] = None,
model_enforcement: Optional[EnforcedGuardrailConfigurationModelEnforcementArgs] = None,
region: Optional[str] = None,
selective_content_guarding: Optional[EnforcedGuardrailConfigurationSelectiveContentGuardingArgs] = None)func NewEnforcedGuardrailConfiguration(ctx *Context, name string, args EnforcedGuardrailConfigurationArgs, opts ...ResourceOption) (*EnforcedGuardrailConfiguration, error)public EnforcedGuardrailConfiguration(string name, EnforcedGuardrailConfigurationArgs args, CustomResourceOptions? opts = null)
public EnforcedGuardrailConfiguration(String name, EnforcedGuardrailConfigurationArgs args)
public EnforcedGuardrailConfiguration(String name, EnforcedGuardrailConfigurationArgs args, CustomResourceOptions options)
type: aws:bedrock:EnforcedGuardrailConfiguration
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws_bedrock_enforced_guardrail_configuration" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args EnforcedGuardrailConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args EnforcedGuardrailConfigurationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args EnforcedGuardrailConfigurationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnforcedGuardrailConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnforcedGuardrailConfigurationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var enforcedGuardrailConfigurationResource = new Aws.Bedrock.EnforcedGuardrailConfiguration("enforcedGuardrailConfigurationResource", new()
{
GuardrailArn = "string",
GuardrailVersion = "string",
ModelEnforcement = new Aws.Bedrock.Inputs.EnforcedGuardrailConfigurationModelEnforcementArgs
{
ExcludedModels = new[]
{
"string",
},
IncludedModels = new[]
{
"string",
},
},
Region = "string",
SelectiveContentGuarding = new Aws.Bedrock.Inputs.EnforcedGuardrailConfigurationSelectiveContentGuardingArgs
{
Messages = "string",
System = "string",
},
});
example, err := bedrock.NewEnforcedGuardrailConfiguration(ctx, "enforcedGuardrailConfigurationResource", &bedrock.EnforcedGuardrailConfigurationArgs{
GuardrailArn: pulumi.String("string"),
GuardrailVersion: pulumi.String("string"),
ModelEnforcement: &bedrock.EnforcedGuardrailConfigurationModelEnforcementArgs{
ExcludedModels: pulumi.StringArray{
pulumi.String("string"),
},
IncludedModels: pulumi.StringArray{
pulumi.String("string"),
},
},
Region: pulumi.String("string"),
SelectiveContentGuarding: &bedrock.EnforcedGuardrailConfigurationSelectiveContentGuardingArgs{
Messages: pulumi.String("string"),
System: pulumi.String("string"),
},
})
resource "aws_bedrock_enforced_guardrail_configuration" "enforcedGuardrailConfigurationResource" {
lifecycle {
create_before_destroy = true
}
guardrail_arn = "string"
guardrail_version = "string"
model_enforcement = {
excluded_models = ["string"]
included_models = ["string"]
}
region = "string"
selective_content_guarding = {
messages = "string"
system = "string"
}
}
var enforcedGuardrailConfigurationResource = new EnforcedGuardrailConfiguration("enforcedGuardrailConfigurationResource", EnforcedGuardrailConfigurationArgs.builder()
.guardrailArn("string")
.guardrailVersion("string")
.modelEnforcement(EnforcedGuardrailConfigurationModelEnforcementArgs.builder()
.excludedModels("string")
.includedModels("string")
.build())
.region("string")
.selectiveContentGuarding(EnforcedGuardrailConfigurationSelectiveContentGuardingArgs.builder()
.messages("string")
.system("string")
.build())
.build());
enforced_guardrail_configuration_resource = aws.bedrock.EnforcedGuardrailConfiguration("enforcedGuardrailConfigurationResource",
guardrail_arn="string",
guardrail_version="string",
model_enforcement={
"excluded_models": ["string"],
"included_models": ["string"],
},
region="string",
selective_content_guarding={
"messages": "string",
"system": "string",
})
const enforcedGuardrailConfigurationResource = new aws.bedrock.EnforcedGuardrailConfiguration("enforcedGuardrailConfigurationResource", {
guardrailArn: "string",
guardrailVersion: "string",
modelEnforcement: {
excludedModels: ["string"],
includedModels: ["string"],
},
region: "string",
selectiveContentGuarding: {
messages: "string",
system: "string",
},
});
type: aws:bedrock:EnforcedGuardrailConfiguration
properties:
guardrailArn: string
guardrailVersion: string
modelEnforcement:
excludedModels:
- string
includedModels:
- string
region: string
selectiveContentGuarding:
messages: string
system: string
EnforcedGuardrailConfiguration Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The EnforcedGuardrailConfiguration resource accepts the following input properties:
- Guardrail
Arn string - Guardrail ARN.
- Guardrail
Version string Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- Model
Enforcement EnforcedGuardrail Configuration Model Enforcement - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Selective
Content EnforcedGuarding Guardrail Configuration Selective Content Guarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- Guardrail
Arn string - Guardrail ARN.
- Guardrail
Version string Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- Model
Enforcement EnforcedGuardrail Configuration Model Enforcement Args - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Selective
Content EnforcedGuarding Guardrail Configuration Selective Content Guarding Args - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- guardrail_
arn string - Guardrail ARN.
- guardrail_
version string Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model_
enforcement object - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective_
content_ objectguarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- guardrail
Arn String - Guardrail ARN.
- guardrail
Version String Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model
Enforcement EnforcedGuardrail Configuration Model Enforcement - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective
Content EnforcedGuarding Guardrail Configuration Selective Content Guarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- guardrail
Arn string - Guardrail ARN.
- guardrail
Version string Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model
Enforcement EnforcedGuardrail Configuration Model Enforcement - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective
Content EnforcedGuarding Guardrail Configuration Selective Content Guarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- guardrail_
arn str - Guardrail ARN.
- guardrail_
version str Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model_
enforcement EnforcedGuardrail Configuration Model Enforcement Args - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective_
content_ Enforcedguarding Guardrail Configuration Selective Content Guarding Args - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- guardrail
Arn String - Guardrail ARN.
- guardrail
Version String Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model
Enforcement Property Map - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective
Content Property MapGuarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
Outputs
All input properties are implicitly available as output properties. Additionally, the EnforcedGuardrailConfiguration resource produces the following output properties:
- Config
Id string - Unique ID for the account enforced configuration.
- Guardrail
Id string - Unique ID of the guardrail.
- Id string
- The provider-assigned unique ID for this managed resource.
- Owner string
- Configuration owner type. Value:
ACCOUNT.
- Config
Id string - Unique ID for the account enforced configuration.
- Guardrail
Id string - Unique ID of the guardrail.
- Id string
- The provider-assigned unique ID for this managed resource.
- Owner string
- Configuration owner type. Value:
ACCOUNT.
- config_
id string - Unique ID for the account enforced configuration.
- guardrail_
id string - Unique ID of the guardrail.
- id string
- The provider-assigned unique ID for this managed resource.
- owner string
- Configuration owner type. Value:
ACCOUNT.
- config
Id String - Unique ID for the account enforced configuration.
- guardrail
Id String - Unique ID of the guardrail.
- id String
- The provider-assigned unique ID for this managed resource.
- owner String
- Configuration owner type. Value:
ACCOUNT.
- config
Id string - Unique ID for the account enforced configuration.
- guardrail
Id string - Unique ID of the guardrail.
- id string
- The provider-assigned unique ID for this managed resource.
- owner string
- Configuration owner type. Value:
ACCOUNT.
- config_
id str - Unique ID for the account enforced configuration.
- guardrail_
id str - Unique ID of the guardrail.
- id str
- The provider-assigned unique ID for this managed resource.
- owner str
- Configuration owner type. Value:
ACCOUNT.
- config
Id String - Unique ID for the account enforced configuration.
- guardrail
Id String - Unique ID of the guardrail.
- id String
- The provider-assigned unique ID for this managed resource.
- owner String
- Configuration owner type. Value:
ACCOUNT.
Look up Existing EnforcedGuardrailConfiguration Resource
Get an existing EnforcedGuardrailConfiguration resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: EnforcedGuardrailConfigurationState, opts?: CustomResourceOptions): EnforcedGuardrailConfiguration@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[str] = None,
guardrail_arn: Optional[str] = None,
guardrail_id: Optional[str] = None,
guardrail_version: Optional[str] = None,
model_enforcement: Optional[EnforcedGuardrailConfigurationModelEnforcementArgs] = None,
owner: Optional[str] = None,
region: Optional[str] = None,
selective_content_guarding: Optional[EnforcedGuardrailConfigurationSelectiveContentGuardingArgs] = None) -> EnforcedGuardrailConfigurationfunc GetEnforcedGuardrailConfiguration(ctx *Context, name string, id IDInput, state *EnforcedGuardrailConfigurationState, opts ...ResourceOption) (*EnforcedGuardrailConfiguration, error)public static EnforcedGuardrailConfiguration Get(string name, Input<string> id, EnforcedGuardrailConfigurationState? state, CustomResourceOptions? opts = null)public static EnforcedGuardrailConfiguration get(String name, Output<String> id, EnforcedGuardrailConfigurationState state, CustomResourceOptions options)resources: _: type: aws:bedrock:EnforcedGuardrailConfiguration get: id: ${id}import {
to = aws_bedrock_enforced_guardrail_configuration.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Config
Id string - Unique ID for the account enforced configuration.
- Guardrail
Arn string - Guardrail ARN.
- Guardrail
Id string - Unique ID of the guardrail.
- Guardrail
Version string Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- Model
Enforcement EnforcedGuardrail Configuration Model Enforcement - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - Owner string
- Configuration owner type. Value:
ACCOUNT. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Selective
Content EnforcedGuarding Guardrail Configuration Selective Content Guarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- Config
Id string - Unique ID for the account enforced configuration.
- Guardrail
Arn string - Guardrail ARN.
- Guardrail
Id string - Unique ID of the guardrail.
- Guardrail
Version string Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- Model
Enforcement EnforcedGuardrail Configuration Model Enforcement Args - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - Owner string
- Configuration owner type. Value:
ACCOUNT. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Selective
Content EnforcedGuarding Guardrail Configuration Selective Content Guarding Args - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- config_
id string - Unique ID for the account enforced configuration.
- guardrail_
arn string - Guardrail ARN.
- guardrail_
id string - Unique ID of the guardrail.
- guardrail_
version string Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model_
enforcement object - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - owner string
- Configuration owner type. Value:
ACCOUNT. - region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective_
content_ objectguarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- config
Id String - Unique ID for the account enforced configuration.
- guardrail
Arn String - Guardrail ARN.
- guardrail
Id String - Unique ID of the guardrail.
- guardrail
Version String Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model
Enforcement EnforcedGuardrail Configuration Model Enforcement - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - owner String
- Configuration owner type. Value:
ACCOUNT. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective
Content EnforcedGuarding Guardrail Configuration Selective Content Guarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- config
Id string - Unique ID for the account enforced configuration.
- guardrail
Arn string - Guardrail ARN.
- guardrail
Id string - Unique ID of the guardrail.
- guardrail
Version string Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model
Enforcement EnforcedGuardrail Configuration Model Enforcement - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - owner string
- Configuration owner type. Value:
ACCOUNT. - region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective
Content EnforcedGuarding Guardrail Configuration Selective Content Guarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- config_
id str - Unique ID for the account enforced configuration.
- guardrail_
arn str - Guardrail ARN.
- guardrail_
id str - Unique ID of the guardrail.
- guardrail_
version str Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model_
enforcement EnforcedGuardrail Configuration Model Enforcement Args - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - owner str
- Configuration owner type. Value:
ACCOUNT. - region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective_
content_ Enforcedguarding Guardrail Configuration Selective Content Guarding Args - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
- config
Id String - Unique ID for the account enforced configuration.
- guardrail
Arn String - Guardrail ARN.
- guardrail
Id String - Unique ID of the guardrail.
- guardrail
Version String Numerical guardrail version. Must be a published version number (e.g.,
1,2).DRAFTis not supported.The following arguments are optional:
- model
Enforcement Property Map - Model-specific information for the enforced guardrail configuration. If not present, the configuration is enforced on all models. See
modelEnforcementBlock below. - owner String
- Configuration owner type. Value:
ACCOUNT. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- selective
Content Property MapGuarding - Selective content guarding controls for enforced guardrails. See
selectiveContentGuardingBlock below.
Supporting Types
EnforcedGuardrailConfigurationModelEnforcement, EnforcedGuardrailConfigurationModelEnforcementArgs
- Excluded
Models List<string> - List of models to exclude from enforcement of the guardrail.
- Included
Models List<string> - List of models to enforce the guardrail on. Use
ALLto enforce on all models.
- Excluded
Models []string - List of models to exclude from enforcement of the guardrail.
- Included
Models []string - List of models to enforce the guardrail on. Use
ALLto enforce on all models.
- excluded_
models list(string) - List of models to exclude from enforcement of the guardrail.
- included_
models list(string) - List of models to enforce the guardrail on. Use
ALLto enforce on all models.
- excluded
Models List<String> - List of models to exclude from enforcement of the guardrail.
- included
Models List<String> - List of models to enforce the guardrail on. Use
ALLto enforce on all models.
- excluded
Models string[] - List of models to exclude from enforcement of the guardrail.
- included
Models string[] - List of models to enforce the guardrail on. Use
ALLto enforce on all models.
- excluded_
models Sequence[str] - List of models to exclude from enforcement of the guardrail.
- included_
models Sequence[str] - List of models to enforce the guardrail on. Use
ALLto enforce on all models.
- excluded
Models List<String> - List of models to exclude from enforcement of the guardrail.
- included
Models List<String> - List of models to enforce the guardrail on. Use
ALLto enforce on all models.
EnforcedGuardrailConfigurationSelectiveContentGuarding, EnforcedGuardrailConfigurationSelectiveContentGuardingArgs
Import
Identity Schema
Required
configId(String) Configuration ID.
Optional
accountId(String) AWS Account where this resource is managed.region(String) Region where this resource is managed.
Using pulumi import, import Bedrock Enforced Guardrail Configuration using configId. For example:
$ pulumi import aws:bedrock/enforcedGuardrailConfiguration:EnforcedGuardrailConfiguration example TODO
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
published on Wednesday, Oct 28, 2026 by Pulumi