import * as pulumi from "@pulumi/pulumi"; /** * Manages a resource-based policy (RBP) on an Amazon Bedrock guardrail or system-defined guardrail profile. * * Resource-based policies are required for organization-level enforced guardrails (an AWS Organizations policy of type `BEDROCK_POLICY`). Member accounts must be granted `bedrock:ApplyGuardrail` on the guardrail (and, when Cross-Region Inference is enabled, on the associated guardrail profile) that lives in the management account. * * ## Example Usage * * ### Guardrail RBP for Organization Enforcement * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.Guardrail("example", { * contentPolicyConfig: { * filtersConfigs: [{ * type: "VIOLENCE", * inputStrength: "HIGH", * outputStrength: "HIGH", * }], * }, * name: "org-guardrail", * blockedInputMessaging: "Blocked.", * blockedOutputsMessaging: "Blocked.", * }); * const current = aws.organizations.getOrganization({}); * const exampleGuardrailResourcePolicy = new aws.bedrock.GuardrailResourcePolicy("example", { * resourceArn: example.guardrailArn, * policy: pulumi.jsonStringify({ * Version: "2012-10-17", * Statement: [{ * Effect: "Allow", * Principal: "*", * Action: [ * "bedrock:GetGuardrail", * "bedrock:ApplyGuardrail", * ], * Resource: example.guardrailArn, * Condition: { * StringEquals: { * "aws:PrincipalOrgID": current.then(current => current.id), * }, * }, * }], * }), * }); * ``` * * ### Guardrail Profile RBP for Cross-Region Inference * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.Guardrail("example", { * contentPolicyConfig: { * filtersConfigs: [{ * type: "VIOLENCE", * inputStrength: "HIGH", * outputStrength: "HIGH", * }], * }, * crossRegionConfig: { * guardrailProfileIdentifier: "arn:aws:bedrock:us-east-1:123456789012:guardrail-profile/us.guardrail.v1:0", * }, * name: "org-guardrail", * blockedInputMessaging: "Blocked.", * blockedOutputsMessaging: "Blocked.", * }); * const current = aws.organizations.getOrganization({}); * const profile = new aws.bedrock.GuardrailResourcePolicy("profile", { * resourceArn: example.crossRegionConfig.apply(crossRegionConfig => crossRegionConfig?.guardrailProfileIdentifier), * policy: pulumi.jsonStringify({ * Version: "2012-10-17", * Statement: [{ * Effect: "Allow", * Principal: "*", * Action: ["bedrock:ApplyGuardrail"], * Resource: example.crossRegionConfig.apply(crossRegionConfig => crossRegionConfig?.guardrailProfileIdentifier), * Condition: { * StringEquals: { * "aws:PrincipalOrgID": current.then(current => current.id), * }, * }, * }], * }), * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * * `resourceArn` (String) ARN of the guardrail or guardrail profile to which the resource policy is attached. * * Using `pulumi import`, import Bedrock Guardrail Resource Policy using the `resourceArn`. For example: * * ```sh * $ pulumi import aws:bedrock/guardrailResourcePolicy:GuardrailResourcePolicy example arn:aws:bedrock:us-east-1:123456789012:guardrail/abc123 * ``` */ export declare class GuardrailResourcePolicy extends pulumi.CustomResource { /** * Get an existing GuardrailResourcePolicy 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: string, id: pulumi.Input, state?: GuardrailResourcePolicyState, opts?: pulumi.CustomResourceOptions): GuardrailResourcePolicy; /** * Check whether an existing GuardrailResourcePolicy resource with the given ID exists. * * @param id The _unique_ provider ID of the resource to check. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static exists(id: pulumi.Input, state?: GuardrailResourcePolicyState, opts?: pulumi.CustomResourceOptions): pulumi.Output; /** * Returns true if the given object is an instance of GuardrailResourcePolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is GuardrailResourcePolicy; /** * JSON policy document. This is a resource-based policy granting other principals (e.g., all principals in an AWS Organization) permission to call Bedrock APIs on this resource. */ readonly policy: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * ARN of the Bedrock resource to attach the policy to. This can be a guardrail ARN or a system-defined guardrail profile ARN. * * The following arguments are optional: */ readonly resourceArn: pulumi.Output; /** * Create a GuardrailResourcePolicy resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: GuardrailResourcePolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering GuardrailResourcePolicy resources. */ export interface GuardrailResourcePolicyState { /** * JSON policy document. This is a resource-based policy granting other principals (e.g., all principals in an AWS Organization) permission to call Bedrock APIs on this resource. */ policy?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of the Bedrock resource to attach the policy to. This can be a guardrail ARN or a system-defined guardrail profile ARN. * * The following arguments are optional: */ resourceArn?: pulumi.Input; } /** * The set of arguments for constructing a GuardrailResourcePolicy resource. */ export interface GuardrailResourcePolicyArgs { /** * JSON policy document. This is a resource-based policy granting other principals (e.g., all principals in an AWS Organization) permission to call Bedrock APIs on this resource. */ policy: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of the Bedrock resource to attach the policy to. This can be a guardrail ARN or a system-defined guardrail profile ARN. * * The following arguments are optional: */ resourceArn: pulumi.Input; } //# sourceMappingURL=guardrailResourcePolicy.d.ts.map