UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

120 lines 4.5 kB
"use strict"; // *** 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.InvocationLoggingConfiguration = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages Bedrock model invocation logging configuration. * * > Model invocation logging is configured per AWS region. To avoid overwriting settings, this resource should not be defined in multiple configurations. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getCallerIdentity({}); * const example = new aws.s3.Bucket("example", { * bucket: "example", * forceDestroy: true, * }); * const exampleBucketPolicy = new aws.s3.BucketPolicy("example", { * bucket: example.bucket, * policy: pulumi.all([example.arn, current, current]).apply(([arn, current, current1]) => `{ * "Version": "2012-10-17", * "Statement": [ * { * "Effect": "Allow", * "Principal": { * "Service": "bedrock.amazonaws.com" * }, * "Action": [ * "s3:*" * ], * "Resource": [ * "${arn}/*" * ], * "Condition": { * "StringEquals": { * "aws:SourceAccount": "${current.accountId}" * }, * "ArnLike": { * "aws:SourceArn": "arn:aws:bedrock:us-east-1:${current1.accountId}:*" * } * } * } * ] * } * `), * }); * const exampleInvocationLoggingConfiguration = new aws.bedrockmodel.InvocationLoggingConfiguration("example", {loggingConfig: { * embeddingDataDeliveryEnabled: true, * imageDataDeliveryEnabled: true, * textDataDeliveryEnabled: true, * videoDataDeliveryEnabled: true, * s3Config: { * bucketName: example.id, * keyPrefix: "bedrock", * }, * }}, { * dependsOn: [exampleBucketPolicy], * }); * ``` * * ## Import * * Using `pulumi import`, import Bedrock custom model using the `id` set to the AWS Region. For example: * * ```sh * $ pulumi import aws:bedrockmodel/invocationLoggingConfiguration:InvocationLoggingConfiguration my_config us-east-1 * ``` */ class InvocationLoggingConfiguration extends pulumi.CustomResource { /** * Get an existing InvocationLoggingConfiguration 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 InvocationLoggingConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of InvocationLoggingConfiguration. 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'] === InvocationLoggingConfiguration.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["loggingConfig"] = state ? state.loggingConfig : undefined; resourceInputs["region"] = state ? state.region : undefined; } else { const args = argsOrState; resourceInputs["loggingConfig"] = args ? args.loggingConfig : undefined; resourceInputs["region"] = args ? args.region : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(InvocationLoggingConfiguration.__pulumiType, name, resourceInputs, opts); } } exports.InvocationLoggingConfiguration = InvocationLoggingConfiguration; /** @internal */ InvocationLoggingConfiguration.__pulumiType = 'aws:bedrockmodel/invocationLoggingConfiguration:InvocationLoggingConfiguration'; //# sourceMappingURL=invocationLoggingConfiguration.js.map