@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
169 lines • 7.29 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Guardrail = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an Amazon Bedrock Guardrail.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.bedrock.Guardrail("example", {
* name: "example",
* blockedInputMessaging: "example",
* blockedOutputsMessaging: "example",
* description: "example",
* contentPolicyConfig: {
* filtersConfigs: [{
* inputStrength: "MEDIUM",
* outputStrength: "MEDIUM",
* type: "HATE",
* }],
* tierConfigs: [{
* tierName: "STANDARD",
* }],
* },
* sensitiveInformationPolicyConfig: {
* piiEntitiesConfigs: [{
* action: "BLOCK",
* inputAction: "BLOCK",
* outputAction: "ANONYMIZE",
* inputEnabled: true,
* outputEnabled: true,
* type: "NAME",
* }],
* regexesConfigs: [{
* action: "BLOCK",
* inputAction: "BLOCK",
* outputAction: "BLOCK",
* inputEnabled: true,
* outputEnabled: false,
* description: "example regex",
* name: "regex_example",
* pattern: "^\\d{3}-\\d{2}-\\d{4}$",
* }],
* },
* topicPolicyConfig: {
* topicsConfigs: [{
* name: "investment_topic",
* examples: ["Where should I invest my money ?"],
* type: "DENY",
* definition: "Investment advice refers to inquiries, guidance, or recommendations regarding the management or allocation of funds or assets with the goal of generating returns .",
* }],
* tierConfigs: [{
* tierName: "CLASSIC",
* }],
* },
* wordPolicyConfig: {
* managedWordListsConfigs: [{
* type: "PROFANITY",
* }],
* wordsConfigs: [{
* text: "HATE",
* }],
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Amazon Bedrock Guardrail using using a comma-delimited string of `guardrail_id` and `version`. For example:
*
* ```sh
* $ pulumi import aws:bedrock/guardrail:Guardrail example guardrail-id-12345678,DRAFT
* ```
*/
class Guardrail extends pulumi.CustomResource {
/**
* Get an existing Guardrail resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new Guardrail(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Guardrail. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Guardrail.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["blockedInputMessaging"] = state?.blockedInputMessaging;
resourceInputs["blockedOutputsMessaging"] = state?.blockedOutputsMessaging;
resourceInputs["contentPolicyConfig"] = state?.contentPolicyConfig;
resourceInputs["contextualGroundingPolicyConfig"] = state?.contextualGroundingPolicyConfig;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["crossRegionConfig"] = state?.crossRegionConfig;
resourceInputs["description"] = state?.description;
resourceInputs["guardrailArn"] = state?.guardrailArn;
resourceInputs["guardrailId"] = state?.guardrailId;
resourceInputs["kmsKeyArn"] = state?.kmsKeyArn;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["sensitiveInformationPolicyConfig"] = state?.sensitiveInformationPolicyConfig;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["topicPolicyConfig"] = state?.topicPolicyConfig;
resourceInputs["version"] = state?.version;
resourceInputs["wordPolicyConfig"] = state?.wordPolicyConfig;
}
else {
const args = argsOrState;
if (args?.blockedInputMessaging === undefined && !opts.urn) {
throw new Error("Missing required property 'blockedInputMessaging'");
}
if (args?.blockedOutputsMessaging === undefined && !opts.urn) {
throw new Error("Missing required property 'blockedOutputsMessaging'");
}
resourceInputs["blockedInputMessaging"] = args?.blockedInputMessaging;
resourceInputs["blockedOutputsMessaging"] = args?.blockedOutputsMessaging;
resourceInputs["contentPolicyConfig"] = args?.contentPolicyConfig;
resourceInputs["contextualGroundingPolicyConfig"] = args?.contextualGroundingPolicyConfig;
resourceInputs["crossRegionConfig"] = args?.crossRegionConfig;
resourceInputs["description"] = args?.description;
resourceInputs["kmsKeyArn"] = args?.kmsKeyArn;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["sensitiveInformationPolicyConfig"] = args?.sensitiveInformationPolicyConfig;
resourceInputs["tags"] = args?.tags;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["topicPolicyConfig"] = args?.topicPolicyConfig;
resourceInputs["wordPolicyConfig"] = args?.wordPolicyConfig;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["guardrailArn"] = undefined /*out*/;
resourceInputs["guardrailId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Guardrail.__pulumiType, name, resourceInputs, opts);
}
}
exports.Guardrail = Guardrail;
/** @internal */
Guardrail.__pulumiType = 'aws:bedrock/guardrail:Guardrail';
//# sourceMappingURL=guardrail.js.map