1. Packages
  2. AWS Classic
  3. API Docs
  4. bedrockmodel
  5. InvocationLoggingConfiguration

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.36.0 published on Wednesday, May 15, 2024 by Pulumi

aws.bedrockmodel.InvocationLoggingConfiguration

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.36.0 published on Wednesday, May 15, 2024 by Pulumi

    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

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    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());
    
        }
    }
    
    resources:
      example:
        type: aws:s3:BucketV2
        properties:
          bucket: example
          forceDestroy: true
      exampleBucketPolicy:
        type: aws:s3:BucketPolicy
        name: example
        properties:
          bucket: ${example.bucket}
          policy: |
            {
              "Version": "2012-10-17",
              "Statement": [
                {
                  "Effect": "Allow",
                  "Principal": {
                    "Service": "bedrock.amazonaws.com"
                  },
                  "Action": [
                    "s3:*"
                  ],
                  "Resource": [
                    "${example.arn}/*"
                  ],
                  "Condition": {
                    "StringEquals": {
                      "aws:SourceAccount": "${current.accountId}"
                    },
                    "ArnLike": {
                      "aws:SourceArn": "arn:aws:bedrock:us-east-1:${current.accountId}:*"
                    }
                  }
                }
              ]
            }        
      exampleInvocationLoggingConfiguration:
        type: aws:bedrockmodel:InvocationLoggingConfiguration
        name: example
        properties:
          loggingConfig:
            - embeddingDataDeliveryEnabled: true
              imageDataDeliveryEnabled: true
              textDataDeliveryEnabled: true
              s3Config:
                - bucketName: ${example.id}
                  keyPrefix: bedrock
        options:
          dependson:
            - ${exampleBucketPolicy}
    variables:
      current:
        fn::invoke:
          Function: aws:getCallerIdentity
          Arguments: {}
    

    Create InvocationLoggingConfiguration Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new InvocationLoggingConfiguration(name: string, args?: InvocationLoggingConfigurationArgs, opts?: CustomResourceOptions);
    @overload
    def InvocationLoggingConfiguration(resource_name: str,
                                       args: Optional[InvocationLoggingConfigurationArgs] = None,
                                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def InvocationLoggingConfiguration(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       logging_config: Optional[InvocationLoggingConfigurationLoggingConfigArgs] = None)
    func NewInvocationLoggingConfiguration(ctx *Context, name string, args *InvocationLoggingConfigurationArgs, opts ...ResourceOption) (*InvocationLoggingConfiguration, error)
    public InvocationLoggingConfiguration(string name, InvocationLoggingConfigurationArgs? args = null, CustomResourceOptions? opts = null)
    public InvocationLoggingConfiguration(String name, InvocationLoggingConfigurationArgs args)
    public InvocationLoggingConfiguration(String name, InvocationLoggingConfigurationArgs args, CustomResourceOptions options)
    
    type: aws:bedrockmodel:InvocationLoggingConfiguration
    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 InvocationLoggingConfigurationArgs
    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 InvocationLoggingConfigurationArgs
    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 InvocationLoggingConfigurationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InvocationLoggingConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InvocationLoggingConfigurationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var invocationLoggingConfigurationResource = new Aws.BedrockModel.InvocationLoggingConfiguration("invocationLoggingConfigurationResource", new()
    {
        LoggingConfig = new Aws.BedrockModel.Inputs.InvocationLoggingConfigurationLoggingConfigArgs
        {
            EmbeddingDataDeliveryEnabled = false,
            ImageDataDeliveryEnabled = false,
            TextDataDeliveryEnabled = false,
            CloudwatchConfig = new Aws.BedrockModel.Inputs.InvocationLoggingConfigurationLoggingConfigCloudwatchConfigArgs
            {
                LargeDataDeliveryS3Config = new Aws.BedrockModel.Inputs.InvocationLoggingConfigurationLoggingConfigCloudwatchConfigLargeDataDeliveryS3ConfigArgs
                {
                    BucketName = "string",
                    KeyPrefix = "string",
                },
                LogGroupName = "string",
                RoleArn = "string",
            },
            S3Config = new Aws.BedrockModel.Inputs.InvocationLoggingConfigurationLoggingConfigS3ConfigArgs
            {
                BucketName = "string",
                KeyPrefix = "string",
            },
        },
    });
    
    example, err := bedrockmodel.NewInvocationLoggingConfiguration(ctx, "invocationLoggingConfigurationResource", &bedrockmodel.InvocationLoggingConfigurationArgs{
    	LoggingConfig: &bedrockmodel.InvocationLoggingConfigurationLoggingConfigArgs{
    		EmbeddingDataDeliveryEnabled: pulumi.Bool(false),
    		ImageDataDeliveryEnabled:     pulumi.Bool(false),
    		TextDataDeliveryEnabled:      pulumi.Bool(false),
    		CloudwatchConfig: &bedrockmodel.InvocationLoggingConfigurationLoggingConfigCloudwatchConfigArgs{
    			LargeDataDeliveryS3Config: &bedrockmodel.InvocationLoggingConfigurationLoggingConfigCloudwatchConfigLargeDataDeliveryS3ConfigArgs{
    				BucketName: pulumi.String("string"),
    				KeyPrefix:  pulumi.String("string"),
    			},
    			LogGroupName: pulumi.String("string"),
    			RoleArn:      pulumi.String("string"),
    		},
    		S3Config: &bedrockmodel.InvocationLoggingConfigurationLoggingConfigS3ConfigArgs{
    			BucketName: pulumi.String("string"),
    			KeyPrefix:  pulumi.String("string"),
    		},
    	},
    })
    
    var invocationLoggingConfigurationResource = new InvocationLoggingConfiguration("invocationLoggingConfigurationResource", InvocationLoggingConfigurationArgs.builder()        
        .loggingConfig(InvocationLoggingConfigurationLoggingConfigArgs.builder()
            .embeddingDataDeliveryEnabled(false)
            .imageDataDeliveryEnabled(false)
            .textDataDeliveryEnabled(false)
            .cloudwatchConfig(InvocationLoggingConfigurationLoggingConfigCloudwatchConfigArgs.builder()
                .largeDataDeliveryS3Config(InvocationLoggingConfigurationLoggingConfigCloudwatchConfigLargeDataDeliveryS3ConfigArgs.builder()
                    .bucketName("string")
                    .keyPrefix("string")
                    .build())
                .logGroupName("string")
                .roleArn("string")
                .build())
            .s3Config(InvocationLoggingConfigurationLoggingConfigS3ConfigArgs.builder()
                .bucketName("string")
                .keyPrefix("string")
                .build())
            .build())
        .build());
    
    invocation_logging_configuration_resource = aws.bedrockmodel.InvocationLoggingConfiguration("invocationLoggingConfigurationResource", logging_config=aws.bedrockmodel.InvocationLoggingConfigurationLoggingConfigArgs(
        embedding_data_delivery_enabled=False,
        image_data_delivery_enabled=False,
        text_data_delivery_enabled=False,
        cloudwatch_config=aws.bedrockmodel.InvocationLoggingConfigurationLoggingConfigCloudwatchConfigArgs(
            large_data_delivery_s3_config=aws.bedrockmodel.InvocationLoggingConfigurationLoggingConfigCloudwatchConfigLargeDataDeliveryS3ConfigArgs(
                bucket_name="string",
                key_prefix="string",
            ),
            log_group_name="string",
            role_arn="string",
        ),
        s3_config=aws.bedrockmodel.InvocationLoggingConfigurationLoggingConfigS3ConfigArgs(
            bucket_name="string",
            key_prefix="string",
        ),
    ))
    
    const invocationLoggingConfigurationResource = new aws.bedrockmodel.InvocationLoggingConfiguration("invocationLoggingConfigurationResource", {loggingConfig: {
        embeddingDataDeliveryEnabled: false,
        imageDataDeliveryEnabled: false,
        textDataDeliveryEnabled: false,
        cloudwatchConfig: {
            largeDataDeliveryS3Config: {
                bucketName: "string",
                keyPrefix: "string",
            },
            logGroupName: "string",
            roleArn: "string",
        },
        s3Config: {
            bucketName: "string",
            keyPrefix: "string",
        },
    }});
    
    type: aws:bedrockmodel:InvocationLoggingConfiguration
    properties:
        loggingConfig:
            cloudwatchConfig:
                largeDataDeliveryS3Config:
                    bucketName: string
                    keyPrefix: string
                logGroupName: string
                roleArn: string
            embeddingDataDeliveryEnabled: false
            imageDataDeliveryEnabled: false
            s3Config:
                bucketName: string
                keyPrefix: string
            textDataDeliveryEnabled: false
    

    InvocationLoggingConfiguration Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The InvocationLoggingConfiguration resource accepts the following input properties:

    LoggingConfig InvocationLoggingConfigurationLoggingConfig
    The logging configuration values to set.
    LoggingConfig InvocationLoggingConfigurationLoggingConfigArgs
    The logging configuration values to set.
    loggingConfig InvocationLoggingConfigurationLoggingConfig
    The logging configuration values to set.
    loggingConfig InvocationLoggingConfigurationLoggingConfig
    The logging configuration values to set.
    logging_config InvocationLoggingConfigurationLoggingConfigArgs
    The logging configuration values to set.
    loggingConfig Property Map
    The logging configuration values to set.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the InvocationLoggingConfiguration resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing InvocationLoggingConfiguration Resource

    Get an existing InvocationLoggingConfiguration resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: InvocationLoggingConfigurationState, opts?: CustomResourceOptions): InvocationLoggingConfiguration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            logging_config: Optional[InvocationLoggingConfigurationLoggingConfigArgs] = None) -> InvocationLoggingConfiguration
    func GetInvocationLoggingConfiguration(ctx *Context, name string, id IDInput, state *InvocationLoggingConfigurationState, opts ...ResourceOption) (*InvocationLoggingConfiguration, error)
    public static InvocationLoggingConfiguration Get(string name, Input<string> id, InvocationLoggingConfigurationState? state, CustomResourceOptions? opts = null)
    public static InvocationLoggingConfiguration get(String name, Output<String> id, InvocationLoggingConfigurationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    LoggingConfig InvocationLoggingConfigurationLoggingConfig
    The logging configuration values to set.
    LoggingConfig InvocationLoggingConfigurationLoggingConfigArgs
    The logging configuration values to set.
    loggingConfig InvocationLoggingConfigurationLoggingConfig
    The logging configuration values to set.
    loggingConfig InvocationLoggingConfigurationLoggingConfig
    The logging configuration values to set.
    logging_config InvocationLoggingConfigurationLoggingConfigArgs
    The logging configuration values to set.
    loggingConfig Property Map
    The logging configuration values to set.

    Supporting Types

    InvocationLoggingConfigurationLoggingConfig, InvocationLoggingConfigurationLoggingConfigArgs

    EmbeddingDataDeliveryEnabled bool
    Set to include embeddings data in the log delivery.
    ImageDataDeliveryEnabled bool
    Set to include image data in the log delivery.
    TextDataDeliveryEnabled bool
    Set to include text data in the log delivery.
    CloudwatchConfig InvocationLoggingConfigurationLoggingConfigCloudwatchConfig
    CloudWatch logging configuration.
    S3Config InvocationLoggingConfigurationLoggingConfigS3Config
    S3 configuration for storing log data.
    EmbeddingDataDeliveryEnabled bool
    Set to include embeddings data in the log delivery.
    ImageDataDeliveryEnabled bool
    Set to include image data in the log delivery.
    TextDataDeliveryEnabled bool
    Set to include text data in the log delivery.
    CloudwatchConfig InvocationLoggingConfigurationLoggingConfigCloudwatchConfig
    CloudWatch logging configuration.
    S3Config InvocationLoggingConfigurationLoggingConfigS3Config
    S3 configuration for storing log data.
    embeddingDataDeliveryEnabled Boolean
    Set to include embeddings data in the log delivery.
    imageDataDeliveryEnabled Boolean
    Set to include image data in the log delivery.
    textDataDeliveryEnabled Boolean
    Set to include text data in the log delivery.
    cloudwatchConfig InvocationLoggingConfigurationLoggingConfigCloudwatchConfig
    CloudWatch logging configuration.
    s3Config InvocationLoggingConfigurationLoggingConfigS3Config
    S3 configuration for storing log data.
    embeddingDataDeliveryEnabled boolean
    Set to include embeddings data in the log delivery.
    imageDataDeliveryEnabled boolean
    Set to include image data in the log delivery.
    textDataDeliveryEnabled boolean
    Set to include text data in the log delivery.
    cloudwatchConfig InvocationLoggingConfigurationLoggingConfigCloudwatchConfig
    CloudWatch logging configuration.
    s3Config InvocationLoggingConfigurationLoggingConfigS3Config
    S3 configuration for storing log data.
    embedding_data_delivery_enabled bool
    Set to include embeddings data in the log delivery.
    image_data_delivery_enabled bool
    Set to include image data in the log delivery.
    text_data_delivery_enabled bool
    Set to include text data in the log delivery.
    cloudwatch_config InvocationLoggingConfigurationLoggingConfigCloudwatchConfig
    CloudWatch logging configuration.
    s3_config InvocationLoggingConfigurationLoggingConfigS3Config
    S3 configuration for storing log data.
    embeddingDataDeliveryEnabled Boolean
    Set to include embeddings data in the log delivery.
    imageDataDeliveryEnabled Boolean
    Set to include image data in the log delivery.
    textDataDeliveryEnabled Boolean
    Set to include text data in the log delivery.
    cloudwatchConfig Property Map
    CloudWatch logging configuration.
    s3Config Property Map
    S3 configuration for storing log data.

    InvocationLoggingConfigurationLoggingConfigCloudwatchConfig, InvocationLoggingConfigurationLoggingConfigCloudwatchConfigArgs

    InvocationLoggingConfigurationLoggingConfigCloudwatchConfigLargeDataDeliveryS3Config, InvocationLoggingConfigurationLoggingConfigCloudwatchConfigLargeDataDeliveryS3ConfigArgs

    BucketName string
    KeyPrefix string
    BucketName string
    KeyPrefix string
    bucketName String
    keyPrefix String
    bucketName string
    keyPrefix string
    bucketName String
    keyPrefix String

    InvocationLoggingConfigurationLoggingConfigS3Config, InvocationLoggingConfigurationLoggingConfigS3ConfigArgs

    BucketName string
    KeyPrefix string
    BucketName string
    KeyPrefix string
    bucketName String
    keyPrefix String
    bucketName string
    keyPrefix string
    bucketName String
    keyPrefix String

    Import

    Using pulumi import, import Bedrock custom model using the id set to the AWS Region. For example:

    $ pulumi import aws:bedrockmodel/invocationLoggingConfiguration:InvocationLoggingConfiguration my_config us-east-1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.36.0 published on Wednesday, May 15, 2024 by Pulumi