azure-native.cognitiveservices.RaiPolicy
Explore with Pulumi AI
Cognitive Services RaiPolicy.
Uses Azure REST API version 2024-10-01. In version 2.x of the Azure Native provider, it used API version 2023-10-01-preview.
Other available API versions: 2023-10-01-preview, 2024-04-01-preview, 2024-06-01-preview, 2025-04-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native cognitiveservices [ApiVersion]
. See the version guide for details.
Example Usage
PutRaiPolicy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var raiPolicy = new AzureNative.CognitiveServices.RaiPolicy("raiPolicy", new()
{
AccountName = "accountName",
Properties = new AzureNative.CognitiveServices.Inputs.RaiPolicyPropertiesArgs
{
BasePolicyName = "Microsoft.Default",
ContentFilters = new[]
{
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = false,
Enabled = false,
Name = "Hate",
SeverityThreshold = AzureNative.CognitiveServices.ContentLevel.High,
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Hate",
SeverityThreshold = AzureNative.CognitiveServices.ContentLevel.Medium,
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Sexual",
SeverityThreshold = AzureNative.CognitiveServices.ContentLevel.High,
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Sexual",
SeverityThreshold = AzureNative.CognitiveServices.ContentLevel.Medium,
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Selfharm",
SeverityThreshold = AzureNative.CognitiveServices.ContentLevel.High,
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Selfharm",
SeverityThreshold = AzureNative.CognitiveServices.ContentLevel.Medium,
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Violence",
SeverityThreshold = AzureNative.CognitiveServices.ContentLevel.Medium,
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Violence",
SeverityThreshold = AzureNative.CognitiveServices.ContentLevel.Medium,
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Jailbreak",
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Protected Material Text",
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Protected Material Code",
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
},
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = true,
Enabled = true,
Name = "Profanity",
Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
},
},
Mode = AzureNative.CognitiveServices.RaiPolicyMode.Asynchronous_filter,
},
RaiPolicyName = "raiPolicyName",
ResourceGroupName = "resourceGroupName",
});
});
package main
import (
cognitiveservices "github.com/pulumi/pulumi-azure-native-sdk/cognitiveservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cognitiveservices.NewRaiPolicy(ctx, "raiPolicy", &cognitiveservices.RaiPolicyArgs{
AccountName: pulumi.String("accountName"),
Properties: &cognitiveservices.RaiPolicyPropertiesArgs{
BasePolicyName: pulumi.String("Microsoft.Default"),
ContentFilters: cognitiveservices.RaiPolicyContentFilterArray{
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(false),
Enabled: pulumi.Bool(false),
Name: pulumi.String("Hate"),
SeverityThreshold: pulumi.String(cognitiveservices.ContentLevelHigh),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Hate"),
SeverityThreshold: pulumi.String(cognitiveservices.ContentLevelMedium),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Sexual"),
SeverityThreshold: pulumi.String(cognitiveservices.ContentLevelHigh),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Sexual"),
SeverityThreshold: pulumi.String(cognitiveservices.ContentLevelMedium),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Selfharm"),
SeverityThreshold: pulumi.String(cognitiveservices.ContentLevelHigh),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Selfharm"),
SeverityThreshold: pulumi.String(cognitiveservices.ContentLevelMedium),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Violence"),
SeverityThreshold: pulumi.String(cognitiveservices.ContentLevelMedium),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Violence"),
SeverityThreshold: pulumi.String(cognitiveservices.ContentLevelMedium),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Jailbreak"),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Protected Material Text"),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Protected Material Code"),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
},
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(true),
Enabled: pulumi.Bool(true),
Name: pulumi.String("Profanity"),
Source: pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
},
},
Mode: pulumi.String(cognitiveservices.RaiPolicyMode_Asynchronous_filter),
},
RaiPolicyName: pulumi.String("raiPolicyName"),
ResourceGroupName: pulumi.String("resourceGroupName"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.cognitiveservices.RaiPolicy;
import com.pulumi.azurenative.cognitiveservices.RaiPolicyArgs;
import com.pulumi.azurenative.cognitiveservices.inputs.RaiPolicyPropertiesArgs;
import java.util.List;
import java.util.ArrayList;
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 raiPolicy = new RaiPolicy("raiPolicy", RaiPolicyArgs.builder()
.accountName("accountName")
.properties(RaiPolicyPropertiesArgs.builder()
.basePolicyName("Microsoft.Default")
.contentFilters(
RaiPolicyContentFilterArgs.builder()
.blocking(false)
.enabled(false)
.name("Hate")
.severityThreshold("High")
.source("Prompt")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Hate")
.severityThreshold("Medium")
.source("Completion")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Sexual")
.severityThreshold("High")
.source("Prompt")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Sexual")
.severityThreshold("Medium")
.source("Completion")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Selfharm")
.severityThreshold("High")
.source("Prompt")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Selfharm")
.severityThreshold("Medium")
.source("Completion")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Violence")
.severityThreshold("Medium")
.source("Prompt")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Violence")
.severityThreshold("Medium")
.source("Completion")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Jailbreak")
.source("Prompt")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Protected Material Text")
.source("Completion")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Protected Material Code")
.source("Completion")
.build(),
RaiPolicyContentFilterArgs.builder()
.blocking(true)
.enabled(true)
.name("Profanity")
.source("Prompt")
.build())
.mode("Asynchronous_filter")
.build())
.raiPolicyName("raiPolicyName")
.resourceGroupName("resourceGroupName")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const raiPolicy = new azure_native.cognitiveservices.RaiPolicy("raiPolicy", {
accountName: "accountName",
properties: {
basePolicyName: "Microsoft.Default",
contentFilters: [
{
blocking: false,
enabled: false,
name: "Hate",
severityThreshold: azure_native.cognitiveservices.ContentLevel.High,
source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
},
{
blocking: true,
enabled: true,
name: "Hate",
severityThreshold: azure_native.cognitiveservices.ContentLevel.Medium,
source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
},
{
blocking: true,
enabled: true,
name: "Sexual",
severityThreshold: azure_native.cognitiveservices.ContentLevel.High,
source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
},
{
blocking: true,
enabled: true,
name: "Sexual",
severityThreshold: azure_native.cognitiveservices.ContentLevel.Medium,
source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
},
{
blocking: true,
enabled: true,
name: "Selfharm",
severityThreshold: azure_native.cognitiveservices.ContentLevel.High,
source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
},
{
blocking: true,
enabled: true,
name: "Selfharm",
severityThreshold: azure_native.cognitiveservices.ContentLevel.Medium,
source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
},
{
blocking: true,
enabled: true,
name: "Violence",
severityThreshold: azure_native.cognitiveservices.ContentLevel.Medium,
source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
},
{
blocking: true,
enabled: true,
name: "Violence",
severityThreshold: azure_native.cognitiveservices.ContentLevel.Medium,
source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
},
{
blocking: true,
enabled: true,
name: "Jailbreak",
source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
},
{
blocking: true,
enabled: true,
name: "Protected Material Text",
source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
},
{
blocking: true,
enabled: true,
name: "Protected Material Code",
source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
},
{
blocking: true,
enabled: true,
name: "Profanity",
source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
},
],
mode: azure_native.cognitiveservices.RaiPolicyMode.Asynchronous_filter,
},
raiPolicyName: "raiPolicyName",
resourceGroupName: "resourceGroupName",
});
import pulumi
import pulumi_azure_native as azure_native
rai_policy = azure_native.cognitiveservices.RaiPolicy("raiPolicy",
account_name="accountName",
properties={
"base_policy_name": "Microsoft.Default",
"content_filters": [
{
"blocking": False,
"enabled": False,
"name": "Hate",
"severity_threshold": azure_native.cognitiveservices.ContentLevel.HIGH,
"source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
},
{
"blocking": True,
"enabled": True,
"name": "Hate",
"severity_threshold": azure_native.cognitiveservices.ContentLevel.MEDIUM,
"source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
},
{
"blocking": True,
"enabled": True,
"name": "Sexual",
"severity_threshold": azure_native.cognitiveservices.ContentLevel.HIGH,
"source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
},
{
"blocking": True,
"enabled": True,
"name": "Sexual",
"severity_threshold": azure_native.cognitiveservices.ContentLevel.MEDIUM,
"source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
},
{
"blocking": True,
"enabled": True,
"name": "Selfharm",
"severity_threshold": azure_native.cognitiveservices.ContentLevel.HIGH,
"source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
},
{
"blocking": True,
"enabled": True,
"name": "Selfharm",
"severity_threshold": azure_native.cognitiveservices.ContentLevel.MEDIUM,
"source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
},
{
"blocking": True,
"enabled": True,
"name": "Violence",
"severity_threshold": azure_native.cognitiveservices.ContentLevel.MEDIUM,
"source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
},
{
"blocking": True,
"enabled": True,
"name": "Violence",
"severity_threshold": azure_native.cognitiveservices.ContentLevel.MEDIUM,
"source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
},
{
"blocking": True,
"enabled": True,
"name": "Jailbreak",
"source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
},
{
"blocking": True,
"enabled": True,
"name": "Protected Material Text",
"source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
},
{
"blocking": True,
"enabled": True,
"name": "Protected Material Code",
"source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
},
{
"blocking": True,
"enabled": True,
"name": "Profanity",
"source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
},
],
"mode": azure_native.cognitiveservices.RaiPolicyMode.ASYNCHRONOUS_FILTER,
},
rai_policy_name="raiPolicyName",
resource_group_name="resourceGroupName")
resources:
raiPolicy:
type: azure-native:cognitiveservices:RaiPolicy
properties:
accountName: accountName
properties:
basePolicyName: Microsoft.Default
contentFilters:
- blocking: false
enabled: false
name: Hate
severityThreshold: High
source: Prompt
- blocking: true
enabled: true
name: Hate
severityThreshold: Medium
source: Completion
- blocking: true
enabled: true
name: Sexual
severityThreshold: High
source: Prompt
- blocking: true
enabled: true
name: Sexual
severityThreshold: Medium
source: Completion
- blocking: true
enabled: true
name: Selfharm
severityThreshold: High
source: Prompt
- blocking: true
enabled: true
name: Selfharm
severityThreshold: Medium
source: Completion
- blocking: true
enabled: true
name: Violence
severityThreshold: Medium
source: Prompt
- blocking: true
enabled: true
name: Violence
severityThreshold: Medium
source: Completion
- blocking: true
enabled: true
name: Jailbreak
source: Prompt
- blocking: true
enabled: true
name: Protected Material Text
source: Completion
- blocking: true
enabled: true
name: Protected Material Code
source: Completion
- blocking: true
enabled: true
name: Profanity
source: Prompt
mode: Asynchronous_filter
raiPolicyName: raiPolicyName
resourceGroupName: resourceGroupName
Create RaiPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RaiPolicy(name: string, args: RaiPolicyArgs, opts?: CustomResourceOptions);
@overload
def RaiPolicy(resource_name: str,
args: RaiPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RaiPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
properties: Optional[RaiPolicyPropertiesArgs] = None,
rai_policy_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewRaiPolicy(ctx *Context, name string, args RaiPolicyArgs, opts ...ResourceOption) (*RaiPolicy, error)
public RaiPolicy(string name, RaiPolicyArgs args, CustomResourceOptions? opts = null)
public RaiPolicy(String name, RaiPolicyArgs args)
public RaiPolicy(String name, RaiPolicyArgs args, CustomResourceOptions options)
type: azure-native:cognitiveservices:RaiPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RaiPolicyArgs
- 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 RaiPolicyArgs
- 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 RaiPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RaiPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RaiPolicyArgs
- 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 raiPolicyResource = new AzureNative.CognitiveServices.RaiPolicy("raiPolicyResource", new()
{
AccountName = "string",
ResourceGroupName = "string",
Properties = new AzureNative.CognitiveServices.Inputs.RaiPolicyPropertiesArgs
{
BasePolicyName = "string",
ContentFilters = new[]
{
new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
{
Blocking = false,
Enabled = false,
Name = "string",
SeverityThreshold = "string",
Source = "string",
},
},
CustomBlocklists = new[]
{
new AzureNative.CognitiveServices.Inputs.CustomBlocklistConfigArgs
{
Blocking = false,
BlocklistName = "string",
Source = "string",
},
},
Mode = "string",
},
RaiPolicyName = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := cognitiveservices.NewRaiPolicy(ctx, "raiPolicyResource", &cognitiveservices.RaiPolicyArgs{
AccountName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Properties: &cognitiveservices.RaiPolicyPropertiesArgs{
BasePolicyName: pulumi.String("string"),
ContentFilters: cognitiveservices.RaiPolicyContentFilterArray{
&cognitiveservices.RaiPolicyContentFilterArgs{
Blocking: pulumi.Bool(false),
Enabled: pulumi.Bool(false),
Name: pulumi.String("string"),
SeverityThreshold: pulumi.String("string"),
Source: pulumi.String("string"),
},
},
CustomBlocklists: cognitiveservices.CustomBlocklistConfigArray{
&cognitiveservices.CustomBlocklistConfigArgs{
Blocking: pulumi.Bool(false),
BlocklistName: pulumi.String("string"),
Source: pulumi.String("string"),
},
},
Mode: pulumi.String("string"),
},
RaiPolicyName: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var raiPolicyResource = new com.pulumi.azurenative.cognitiveservices.RaiPolicy("raiPolicyResource", com.pulumi.azurenative.cognitiveservices.RaiPolicyArgs.builder()
.accountName("string")
.resourceGroupName("string")
.properties(RaiPolicyPropertiesArgs.builder()
.basePolicyName("string")
.contentFilters(RaiPolicyContentFilterArgs.builder()
.blocking(false)
.enabled(false)
.name("string")
.severityThreshold("string")
.source("string")
.build())
.customBlocklists(CustomBlocklistConfigArgs.builder()
.blocking(false)
.blocklistName("string")
.source("string")
.build())
.mode("string")
.build())
.raiPolicyName("string")
.tags(Map.of("string", "string"))
.build());
rai_policy_resource = azure_native.cognitiveservices.RaiPolicy("raiPolicyResource",
account_name="string",
resource_group_name="string",
properties={
"base_policy_name": "string",
"content_filters": [{
"blocking": False,
"enabled": False,
"name": "string",
"severity_threshold": "string",
"source": "string",
}],
"custom_blocklists": [{
"blocking": False,
"blocklist_name": "string",
"source": "string",
}],
"mode": "string",
},
rai_policy_name="string",
tags={
"string": "string",
})
const raiPolicyResource = new azure_native.cognitiveservices.RaiPolicy("raiPolicyResource", {
accountName: "string",
resourceGroupName: "string",
properties: {
basePolicyName: "string",
contentFilters: [{
blocking: false,
enabled: false,
name: "string",
severityThreshold: "string",
source: "string",
}],
customBlocklists: [{
blocking: false,
blocklistName: "string",
source: "string",
}],
mode: "string",
},
raiPolicyName: "string",
tags: {
string: "string",
},
});
type: azure-native:cognitiveservices:RaiPolicy
properties:
accountName: string
properties:
basePolicyName: string
contentFilters:
- blocking: false
enabled: false
name: string
severityThreshold: string
source: string
customBlocklists:
- blocking: false
blocklistName: string
source: string
mode: string
raiPolicyName: string
resourceGroupName: string
tags:
string: string
RaiPolicy 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 RaiPolicy resource accepts the following input properties:
- Account
Name string - The name of Cognitive Services account.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Properties
Pulumi.
Azure Native. Cognitive Services. Inputs. Rai Policy Properties - Properties of Cognitive Services RaiPolicy.
- Rai
Policy stringName - The name of the RaiPolicy associated with the Cognitive Services Account
- Dictionary<string, string>
- Resource tags.
- Account
Name string - The name of Cognitive Services account.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Properties
Rai
Policy Properties Args - Properties of Cognitive Services RaiPolicy.
- Rai
Policy stringName - The name of the RaiPolicy associated with the Cognitive Services Account
- map[string]string
- Resource tags.
- account
Name String - The name of Cognitive Services account.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- properties
Rai
Policy Properties - Properties of Cognitive Services RaiPolicy.
- rai
Policy StringName - The name of the RaiPolicy associated with the Cognitive Services Account
- Map<String,String>
- Resource tags.
- account
Name string - The name of Cognitive Services account.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- properties
Rai
Policy Properties - Properties of Cognitive Services RaiPolicy.
- rai
Policy stringName - The name of the RaiPolicy associated with the Cognitive Services Account
- {[key: string]: string}
- Resource tags.
- account_
name str - The name of Cognitive Services account.
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- properties
Rai
Policy Properties Args - Properties of Cognitive Services RaiPolicy.
- rai_
policy_ strname - The name of the RaiPolicy associated with the Cognitive Services Account
- Mapping[str, str]
- Resource tags.
- account
Name String - The name of Cognitive Services account.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- properties Property Map
- Properties of Cognitive Services RaiPolicy.
- rai
Policy StringName - The name of the RaiPolicy associated with the Cognitive Services Account
- Map<String>
- Resource tags.
Outputs
All input properties are implicitly available as output properties. Additionally, the RaiPolicy resource produces the following output properties:
- Azure
Api stringVersion - The Azure API version of the resource.
- Etag string
- Resource Etag.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource
- System
Data Pulumi.Azure Native. Cognitive Services. Outputs. System Data Response - Metadata pertaining to creation and last modification of the resource.
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- Azure
Api stringVersion - The Azure API version of the resource.
- Etag string
- Resource Etag.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource
- System
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure
Api StringVersion - The Azure API version of the resource.
- etag String
- Resource Etag.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource
- system
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure
Api stringVersion - The Azure API version of the resource.
- etag string
- Resource Etag.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the resource
- system
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure_
api_ strversion - The Azure API version of the resource.
- etag str
- Resource Etag.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the resource
- system_
data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- type str
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure
Api StringVersion - The Azure API version of the resource.
- etag String
- Resource Etag.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource
- system
Data Property Map - Metadata pertaining to creation and last modification of the resource.
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Supporting Types
ContentLevel, ContentLevelArgs
- Low
- Low
- Medium
- Medium
- High
- High
- Content
Level Low - Low
- Content
Level Medium - Medium
- Content
Level High - High
- Low
- Low
- Medium
- Medium
- High
- High
- Low
- Low
- Medium
- Medium
- High
- High
- LOW
- Low
- MEDIUM
- Medium
- HIGH
- High
- "Low"
- Low
- "Medium"
- Medium
- "High"
- High
CustomBlocklistConfig, CustomBlocklistConfigArgs
- Blocking bool
- If blocking would occur.
- Blocklist
Name string - Name of ContentFilter.
- Source
string | Pulumi.
Azure Native. Cognitive Services. Rai Policy Content Source - Content source to apply the Content Filters.
- Blocking bool
- If blocking would occur.
- Blocklist
Name string - Name of ContentFilter.
- Source
string | Rai
Policy Content Source - Content source to apply the Content Filters.
- blocking Boolean
- If blocking would occur.
- blocklist
Name String - Name of ContentFilter.
- source
String | Rai
Policy Content Source - Content source to apply the Content Filters.
- blocking boolean
- If blocking would occur.
- blocklist
Name string - Name of ContentFilter.
- source
string | Rai
Policy Content Source - Content source to apply the Content Filters.
- blocking bool
- If blocking would occur.
- blocklist_
name str - Name of ContentFilter.
- source
str | Rai
Policy Content Source - Content source to apply the Content Filters.
- blocking Boolean
- If blocking would occur.
- blocklist
Name String - Name of ContentFilter.
- source String | "Prompt" | "Completion"
- Content source to apply the Content Filters.
CustomBlocklistConfigResponse, CustomBlocklistConfigResponseArgs
- Blocking bool
- If blocking would occur.
- Blocklist
Name string - Name of ContentFilter.
- Source string
- Content source to apply the Content Filters.
- Blocking bool
- If blocking would occur.
- Blocklist
Name string - Name of ContentFilter.
- Source string
- Content source to apply the Content Filters.
- blocking Boolean
- If blocking would occur.
- blocklist
Name String - Name of ContentFilter.
- source String
- Content source to apply the Content Filters.
- blocking boolean
- If blocking would occur.
- blocklist
Name string - Name of ContentFilter.
- source string
- Content source to apply the Content Filters.
- blocking bool
- If blocking would occur.
- blocklist_
name str - Name of ContentFilter.
- source str
- Content source to apply the Content Filters.
- blocking Boolean
- If blocking would occur.
- blocklist
Name String - Name of ContentFilter.
- source String
- Content source to apply the Content Filters.
RaiPolicyContentFilter, RaiPolicyContentFilterArgs
- Blocking bool
- If blocking would occur.
- Enabled bool
- If the ContentFilter is enabled.
- Name string
- Name of ContentFilter.
- Severity
Threshold string | Pulumi.Azure Native. Cognitive Services. Content Level - Level at which content is filtered.
- Source
string | Pulumi.
Azure Native. Cognitive Services. Rai Policy Content Source - Content source to apply the Content Filters.
- Blocking bool
- If blocking would occur.
- Enabled bool
- If the ContentFilter is enabled.
- Name string
- Name of ContentFilter.
- Severity
Threshold string | ContentLevel - Level at which content is filtered.
- Source
string | Rai
Policy Content Source - Content source to apply the Content Filters.
- blocking Boolean
- If blocking would occur.
- enabled Boolean
- If the ContentFilter is enabled.
- name String
- Name of ContentFilter.
- severity
Threshold String | ContentLevel - Level at which content is filtered.
- source
String | Rai
Policy Content Source - Content source to apply the Content Filters.
- blocking boolean
- If blocking would occur.
- enabled boolean
- If the ContentFilter is enabled.
- name string
- Name of ContentFilter.
- severity
Threshold string | ContentLevel - Level at which content is filtered.
- source
string | Rai
Policy Content Source - Content source to apply the Content Filters.
- blocking bool
- If blocking would occur.
- enabled bool
- If the ContentFilter is enabled.
- name str
- Name of ContentFilter.
- severity_
threshold str | ContentLevel - Level at which content is filtered.
- source
str | Rai
Policy Content Source - Content source to apply the Content Filters.
- blocking Boolean
- If blocking would occur.
- enabled Boolean
- If the ContentFilter is enabled.
- name String
- Name of ContentFilter.
- severity
Threshold String | "Low" | "Medium" | "High" - Level at which content is filtered.
- source String | "Prompt" | "Completion"
- Content source to apply the Content Filters.
RaiPolicyContentFilterResponse, RaiPolicyContentFilterResponseArgs
- Blocking bool
- If blocking would occur.
- Enabled bool
- If the ContentFilter is enabled.
- Name string
- Name of ContentFilter.
- Severity
Threshold string - Level at which content is filtered.
- Source string
- Content source to apply the Content Filters.
- Blocking bool
- If blocking would occur.
- Enabled bool
- If the ContentFilter is enabled.
- Name string
- Name of ContentFilter.
- Severity
Threshold string - Level at which content is filtered.
- Source string
- Content source to apply the Content Filters.
- blocking Boolean
- If blocking would occur.
- enabled Boolean
- If the ContentFilter is enabled.
- name String
- Name of ContentFilter.
- severity
Threshold String - Level at which content is filtered.
- source String
- Content source to apply the Content Filters.
- blocking boolean
- If blocking would occur.
- enabled boolean
- If the ContentFilter is enabled.
- name string
- Name of ContentFilter.
- severity
Threshold string - Level at which content is filtered.
- source string
- Content source to apply the Content Filters.
- blocking bool
- If blocking would occur.
- enabled bool
- If the ContentFilter is enabled.
- name str
- Name of ContentFilter.
- severity_
threshold str - Level at which content is filtered.
- source str
- Content source to apply the Content Filters.
- blocking Boolean
- If blocking would occur.
- enabled Boolean
- If the ContentFilter is enabled.
- name String
- Name of ContentFilter.
- severity
Threshold String - Level at which content is filtered.
- source String
- Content source to apply the Content Filters.
RaiPolicyContentSource, RaiPolicyContentSourceArgs
- Prompt
- Prompt
- Completion
- Completion
- Rai
Policy Content Source Prompt - Prompt
- Rai
Policy Content Source Completion - Completion
- Prompt
- Prompt
- Completion
- Completion
- Prompt
- Prompt
- Completion
- Completion
- PROMPT
- Prompt
- COMPLETION
- Completion
- "Prompt"
- Prompt
- "Completion"
- Completion
RaiPolicyMode, RaiPolicyModeArgs
- Default
- Default
- Deferred
- Deferred
- Blocking
- Blocking
- Asynchronous_
filter - Asynchronous_filter
- Rai
Policy Mode Default - Default
- Rai
Policy Mode Deferred - Deferred
- Rai
Policy Mode Blocking - Blocking
- Rai
Policy Mode_Asynchronous_ filter - Asynchronous_filter
- Default
- Default
- Deferred
- Deferred
- Blocking
- Blocking
- Asynchronous_
filter - Asynchronous_filter
- Default
- Default
- Deferred
- Deferred
- Blocking
- Blocking
- Asynchronous_
filter - Asynchronous_filter
- DEFAULT
- Default
- DEFERRED
- Deferred
- BLOCKING
- Blocking
- ASYNCHRONOUS_FILTER
- Asynchronous_filter
- "Default"
- Default
- "Deferred"
- Deferred
- "Blocking"
- Blocking
- "Asynchronous_
filter" - Asynchronous_filter
RaiPolicyProperties, RaiPolicyPropertiesArgs
- Base
Policy stringName - Name of Rai policy.
- Content
Filters List<Pulumi.Azure Native. Cognitive Services. Inputs. Rai Policy Content Filter> - The list of Content Filters.
- Custom
Blocklists List<Pulumi.Azure Native. Cognitive Services. Inputs. Custom Blocklist Config> - The list of custom Blocklist.
- Mode
string | Pulumi.
Azure Native. Cognitive Services. Rai Policy Mode - Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- Base
Policy stringName - Name of Rai policy.
- Content
Filters []RaiPolicy Content Filter - The list of Content Filters.
- Custom
Blocklists []CustomBlocklist Config - The list of custom Blocklist.
- Mode
string | Rai
Policy Mode - Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- base
Policy StringName - Name of Rai policy.
- content
Filters List<RaiPolicy Content Filter> - The list of Content Filters.
- custom
Blocklists List<CustomBlocklist Config> - The list of custom Blocklist.
- mode
String | Rai
Policy Mode - Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- base
Policy stringName - Name of Rai policy.
- content
Filters RaiPolicy Content Filter[] - The list of Content Filters.
- custom
Blocklists CustomBlocklist Config[] - The list of custom Blocklist.
- mode
string | Rai
Policy Mode - Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- base_
policy_ strname - Name of Rai policy.
- content_
filters Sequence[RaiPolicy Content Filter] - The list of Content Filters.
- custom_
blocklists Sequence[CustomBlocklist Config] - The list of custom Blocklist.
- mode
str | Rai
Policy Mode - Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- base
Policy StringName - Name of Rai policy.
- content
Filters List<Property Map> - The list of Content Filters.
- custom
Blocklists List<Property Map> - The list of custom Blocklist.
- mode
String | "Default" | "Deferred" | "Blocking" | "Asynchronous_
filter" - Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
RaiPolicyPropertiesResponse, RaiPolicyPropertiesResponseArgs
- Type string
- Content Filters policy type.
- Base
Policy stringName - Name of Rai policy.
- Content
Filters List<Pulumi.Azure Native. Cognitive Services. Inputs. Rai Policy Content Filter Response> - The list of Content Filters.
- Custom
Blocklists List<Pulumi.Azure Native. Cognitive Services. Inputs. Custom Blocklist Config Response> - The list of custom Blocklist.
- Mode string
- Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- Type string
- Content Filters policy type.
- Base
Policy stringName - Name of Rai policy.
- Content
Filters []RaiPolicy Content Filter Response - The list of Content Filters.
- Custom
Blocklists []CustomBlocklist Config Response - The list of custom Blocklist.
- Mode string
- Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- type String
- Content Filters policy type.
- base
Policy StringName - Name of Rai policy.
- content
Filters List<RaiPolicy Content Filter Response> - The list of Content Filters.
- custom
Blocklists List<CustomBlocklist Config Response> - The list of custom Blocklist.
- mode String
- Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- type string
- Content Filters policy type.
- base
Policy stringName - Name of Rai policy.
- content
Filters RaiPolicy Content Filter Response[] - The list of Content Filters.
- custom
Blocklists CustomBlocklist Config Response[] - The list of custom Blocklist.
- mode string
- Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- type str
- Content Filters policy type.
- base_
policy_ strname - Name of Rai policy.
- content_
filters Sequence[RaiPolicy Content Filter Response] - The list of Content Filters.
- custom_
blocklists Sequence[CustomBlocklist Config Response] - The list of custom Blocklist.
- mode str
- Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
- type String
- Content Filters policy type.
- base
Policy StringName - Name of Rai policy.
- content
Filters List<Property Map> - The list of Content Filters.
- custom
Blocklists List<Property Map> - The list of custom Blocklist.
- mode String
- Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
SystemDataResponse, SystemDataResponseArgs
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - The type of identity that last modified the resource.
- created_
at str - The timestamp of resource creation (UTC).
- created_
by str - The identity that created the resource.
- created_
by_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:cognitiveservices:RaiPolicy raiPolicyName /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0