LogS3TableIntegrationSource class

Manages a CloudWatch Logs S3 Table Integration data source association. This resource associates a data source (such as a CloudWatch log type) with an S3 Table Integration, enabling CloudWatch logs to be automatically written to S3 Tables for analytics.

For more information, see the CloudWatch Logs S3 Tables integration documentation.

Example Usage

Associate All Sources (Wildcard)

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cloudwatch.LogS3TableIntegrationSource("example", {
    dataSource: {
        name: "*",
        type: "*",
    },
    integrationArn: exampleAwsObservabilityadminS3TableIntegration.arn,
});
import pulumi
import pulumi_aws as aws

example = aws.cloudwatch.LogS3TableIntegrationSource("example",
    data_source={
        "name": "*",
        "type": "*",
    },
    integration_arn=example_aws_observabilityadmin_s3_table_integration["arn"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.CloudWatch.LogS3TableIntegrationSource("example", new()
    {
        DataSource = new Aws.CloudWatch.Inputs.LogS3TableIntegrationSourceDataSourceArgs
        {
            Name = "*",
            Type = "*",
        },
        IntegrationArn = exampleAwsObservabilityadminS3TableIntegration.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudwatch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudwatch.NewLogS3TableIntegrationSource(ctx, "example", &cloudwatch.LogS3TableIntegrationSourceArgs{
			DataSource: &cloudwatch.LogS3TableIntegrationSourceDataSourceArgs{
				Name: pulumi.String("*"),
				Type: pulumi.String("*"),
			},
			IntegrationArn: pulumi.Any(exampleAwsObservabilityadminS3TableIntegration.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_cloudwatch_logs3tableintegrationsource" "example" {
  data_source = {
    name = "*"
    type = "*"
  }
  integration_arn = exampleAwsObservabilityadminS3TableIntegration.arn
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogS3TableIntegrationSource;
import com.pulumi.aws.cloudwatch.LogS3TableIntegrationSourceArgs;
import com.pulumi.aws.cloudwatch.inputs.LogS3TableIntegrationSourceDataSourceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new LogS3TableIntegrationSource("example", LogS3TableIntegrationSourceArgs.builder()
            .dataSource(LogS3TableIntegrationSourceDataSourceArgs.builder()
                .name("*")
                .type("*")
                .build())
            .integrationArn(exampleAwsObservabilityadminS3TableIntegration.arn())
            .build());

    }
}
resources:
  example:
    type: aws:cloudwatch:LogS3TableIntegrationSource
    properties:
      dataSource:
        name: '*'
        type: '*'
      integrationArn: ${exampleAwsObservabilityadminS3TableIntegration.arn}

Associate a Custom Data Source

To route log stream messages from a specific custom data source into a dedicated S3 Table, tag the CloudWatch log group with cw:datasource:name and cw:datasource:type. The integration then writes matching log streams into a table named {name}__{type} inside the aws-cloudwatch table bucket.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Tag the log group to declare it as a custom data source.
// Log stream messages are written to the "myapp__events" table
// in the aws-cloudwatch table bucket.
const example = new aws.cloudwatch.LogGroup("example", {
    name: "/example/myapp",
    tags: {
        "cw:datasource:name": "myapp",
        "cw:datasource:type": "events",
    },
});
const exampleLogS3TableIntegrationSource = new aws.cloudwatch.LogS3TableIntegrationSource("example", {
    dataSource: {
        name: "myapp",
        type: "events",
    },
    integrationArn: exampleAwsObservabilityadminS3TableIntegration.arn,
});
import pulumi
import pulumi_aws as aws

# Tag the log group to declare it as a custom data source.
# Log stream messages are written to the "myapp__events" table
# in the aws-cloudwatch table bucket.
example = aws.cloudwatch.LogGroup("example",
    name="/example/myapp",
    tags={
        "cw:datasource:name": "myapp",
        "cw:datasource:type": "events",
    })
example_log_s3_table_integration_source = aws.cloudwatch.LogS3TableIntegrationSource("example",
    data_source={
        "name": "myapp",
        "type": "events",
    },
    integration_arn=example_aws_observabilityadmin_s3_table_integration["arn"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    // Tag the log group to declare it as a custom data source.
    // Log stream messages are written to the "myapp__events" table
    // in the aws-cloudwatch table bucket.
    var example = new Aws.CloudWatch.LogGroup("example", new()
    {
        Name = "/example/myapp",
        Tags =
        {
            { "cw:datasource:name", "myapp" },
            { "cw:datasource:type", "events" },
        },
    });

    var exampleLogS3TableIntegrationSource = new Aws.CloudWatch.LogS3TableIntegrationSource("example", new()
    {
        DataSource = new Aws.CloudWatch.Inputs.LogS3TableIntegrationSourceDataSourceArgs
        {
            Name = "myapp",
            Type = "events",
        },
        IntegrationArn = exampleAwsObservabilityadminS3TableIntegration.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudwatch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Tag the log group to declare it as a custom data source.
		// Log stream messages are written to the "myapp__events" table
		// in the aws-cloudwatch table bucket.
		_, err := cloudwatch.NewLogGroup(ctx, "example", &cloudwatch.LogGroupArgs{
			Name: pulumi.String("/example/myapp"),
			Tags: pulumi.StringMap{
				"cw:datasource:name": pulumi.String("myapp"),
				"cw:datasource:type": pulumi.String("events"),
			},
		})
		if err != nil {
			return err
		}
		_, err = cloudwatch.NewLogS3TableIntegrationSource(ctx, "example", &cloudwatch.LogS3TableIntegrationSourceArgs{
			DataSource: &cloudwatch.LogS3TableIntegrationSourceDataSourceArgs{
				Name: pulumi.String("myapp"),
				Type: pulumi.String("events"),
			},
			IntegrationArn: pulumi.Any(exampleAwsObservabilityadminS3TableIntegration.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

# Tag the log group to declare it as a custom data source.
# Log stream messages are written to the "myapp__events" table
# in the aws-cloudwatch table bucket.
resource "aws_cloudwatch_loggroup" "example" {
  name = "/example/myapp"
  tags = {
    "cw:datasource:name" = "myapp"
    "cw:datasource:type" = "events"
  }
}
resource "aws_cloudwatch_logs3tableintegrationsource" "example" {
  data_source = {
    name = "myapp"
    type = "events"
  }
  integration_arn = exampleAwsObservabilityadminS3TableIntegration.arn
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogGroup;
import com.pulumi.aws.cloudwatch.LogGroupArgs;
import com.pulumi.aws.cloudwatch.LogS3TableIntegrationSource;
import com.pulumi.aws.cloudwatch.LogS3TableIntegrationSourceArgs;
import com.pulumi.aws.cloudwatch.inputs.LogS3TableIntegrationSourceDataSourceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        // Tag the log group to declare it as a custom data source.
        // Log stream messages are written to the "myapp__events" table
        // in the aws-cloudwatch table bucket.
        var example = new LogGroup("example", LogGroupArgs.builder()
            .name("/example/myapp")
            .tags(Map.ofEntries(
                Map.entry("cw:datasource:name", "myapp"),
                Map.entry("cw:datasource:type", "events")
            ))
            .build());

        var exampleLogS3TableIntegrationSource = new LogS3TableIntegrationSource("exampleLogS3TableIntegrationSource", LogS3TableIntegrationSourceArgs.builder()
            .dataSource(LogS3TableIntegrationSourceDataSourceArgs.builder()
                .name("myapp")
                .type("events")
                .build())
            .integrationArn(exampleAwsObservabilityadminS3TableIntegration.arn())
            .build());

    }
}
resources:
  # Tag the log group to declare it as a custom data source.
  # Log stream messages are written to the "myapp__events" table
  # in the aws-cloudwatch table bucket.
  example:
    type: aws:cloudwatch:LogGroup
    properties:
      name: /example/myapp
      tags:
        cw:datasource:name: myapp
        cw:datasource:type: events
  exampleLogS3TableIntegrationSource:
    type: aws:cloudwatch:LogS3TableIntegrationSource
    name: example
    properties:
      dataSource:
        name: myapp
        type: events
      integrationArn: ${exampleAwsObservabilityadminS3TableIntegration.arn}

Import

Identity Schema

Required

  • integrationArn (String) ARN of the integration.
  • id (String) ID of the association.

Optional

  • accountId (String) AWS Account where this resource is managed.
  • region (String) Region where this resource is managed.

Using pulumi import, import S3 Table Integration data source associations using integrationArn and id separated by a comma (,). For example:

$ pulumi import aws:cloudwatch/logS3TableIntegrationSource:LogS3TableIntegrationSource example arn:aws:observabilityadmin:us-west-2:123456789012:s3tableintegration/3g5043wqe54nmw5apiugwkn1a,a8928b36-ab82-4ae2-ae5c-fcb910ec4237

Constructors

LogS3TableIntegrationSource(String name, {LogS3TableIntegrationSourceArgs? args, CustomResourceOptions? options})
Creates a new LogS3TableIntegrationSource. name The Pulumi resource name. args Arguments used to configure this LogS3TableIntegrationSource. The set of arguments for LogS3TableIntegrationSource. options Resource options controlling this resource's behavior.
LogS3TableIntegrationSource.reference(String urn)
Creates a typed reference to an existing LogS3TableIntegrationSource resource.

Properties

childResources Set<Resource>
finalinherited
completionSources Map<String, IOutputCompletionSource>
latefinalinherited
dataSource ↔ Output<LogS3TableIntegrationSourceDataSource>
Data source to associate with the S3 Table Integration. See dataSource Block below.
latefinal
hashCode int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
integrationArn ↔ Output<String>
ARN of the aws.observabilityadmin.S3TableIntegration to associate the data source with.
latefinal
isCustom bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference bool
Whether this instance represents a resource value returned over RPC.
finalinherited
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeouts ↔ Output<LogS3TableIntegrationSourceTimeouts?>
latefinal
transformations List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() String
Returns this resource's logical name.
inherited
getResourceType() String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {LogS3TableIntegrationSourceState? state, CustomResourceOptions? options}) LogS3TableIntegrationSource
Gets an existing LogS3TableIntegrationSource resource's state with the given name and id.