com.pulumi.aws.bedrockmodel.InvocationLoggingConfiguration Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.bedrockmodel;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.bedrockmodel.InvocationLoggingConfigurationArgs;
import com.pulumi.aws.bedrockmodel.inputs.InvocationLoggingConfigurationState;
import com.pulumi.aws.bedrockmodel.outputs.InvocationLoggingConfigurationLoggingConfig;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* 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
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.AwsFunctions;
* import com.pulumi.aws.inputs.GetCallerIdentityArgs;
* import com.pulumi.aws.s3.BucketV2;
* import com.pulumi.aws.s3.BucketV2Args;
* import com.pulumi.aws.s3.BucketPolicy;
* import com.pulumi.aws.s3.BucketPolicyArgs;
* import com.pulumi.aws.bedrockmodel.InvocationLoggingConfiguration;
* import com.pulumi.aws.bedrockmodel.InvocationLoggingConfigurationArgs;
* import com.pulumi.resources.CustomResourceOptions;
* 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) {
* final var current = AwsFunctions.getCallerIdentity();
*
* var example = new BucketV2("example", BucketV2Args.builder()
* .bucket("example")
* .forceDestroy(true)
* .build());
*
* var exampleBucketPolicy = new BucketPolicy("exampleBucketPolicy", BucketPolicyArgs.builder()
* .bucket(example.bucket())
* .policy(example.arn().applyValue(arn -> """
* {
* "Version": "2012-10-17",
* "Statement": [
* {
* "Effect": "Allow",
* "Principal": {
* "Service": "bedrock.amazonaws.com"
* },
* "Action": [
* "s3:*"
* ],
* "Resource": [
* "%s/*"
* ],
* "Condition": {
* "StringEquals": {
* "aws:SourceAccount": "%s"
* },
* "ArnLike": {
* "aws:SourceArn": "arn:aws:bedrock:us-east-1:%s:*"
* }
* }
* }
* ]
* }
* ", arn,current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()),current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))))
* .build());
*
* var exampleInvocationLoggingConfiguration = new InvocationLoggingConfiguration("exampleInvocationLoggingConfiguration", InvocationLoggingConfigurationArgs.builder()
* .loggingConfig(InvocationLoggingConfigurationLoggingConfigArgs.builder()
* .embeddingDataDeliveryEnabled(true)
* .imageDataDeliveryEnabled(true)
* .textDataDeliveryEnabled(true)
* .s3Config(InvocationLoggingConfigurationLoggingConfigS3ConfigArgs.builder()
* .bucketName(example.id())
* .keyPrefix("bedrock")
* .build())
* .build())
* .build(), CustomResourceOptions.builder()
* .dependsOn(exampleBucketPolicy)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## 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
* ```
*
*/
@ResourceType(type="aws:bedrockmodel/invocationLoggingConfiguration:InvocationLoggingConfiguration")
public class InvocationLoggingConfiguration extends com.pulumi.resources.CustomResource {
/**
* The logging configuration values to set.
*
*/
@Export(name="loggingConfig", refs={InvocationLoggingConfigurationLoggingConfig.class}, tree="[0]")
private Output* @Nullable */ InvocationLoggingConfigurationLoggingConfig> loggingConfig;
/**
* @return The logging configuration values to set.
*
*/
public Output> loggingConfig() {
return Codegen.optional(this.loggingConfig);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public InvocationLoggingConfiguration(java.lang.String name) {
this(name, InvocationLoggingConfigurationArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public InvocationLoggingConfiguration(java.lang.String name, @Nullable InvocationLoggingConfigurationArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public InvocationLoggingConfiguration(java.lang.String name, @Nullable InvocationLoggingConfigurationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:bedrockmodel/invocationLoggingConfiguration:InvocationLoggingConfiguration", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private InvocationLoggingConfiguration(java.lang.String name, Output id, @Nullable InvocationLoggingConfigurationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:bedrockmodel/invocationLoggingConfiguration:InvocationLoggingConfiguration", name, state, makeResourceOptions(options, id), false);
}
private static InvocationLoggingConfigurationArgs makeArgs(@Nullable InvocationLoggingConfigurationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? InvocationLoggingConfigurationArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host 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
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static InvocationLoggingConfiguration get(java.lang.String name, Output id, @Nullable InvocationLoggingConfigurationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new InvocationLoggingConfiguration(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy