1. Packages
  2. AWS
  3. API Docs
  4. cloudwatch
  5. LogDestination
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.cloudwatch.LogDestination

Explore with Pulumi AI

Provides a CloudWatch Logs destination resource.

Example Usage

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

const testDestination = new aws.cloudwatch.LogDestination("test_destination", {
    name: "test_destination",
    roleArn: iamForCloudwatch.arn,
    targetArn: kinesisForCloudwatch.arn,
});
Copy
import pulumi
import pulumi_aws as aws

test_destination = aws.cloudwatch.LogDestination("test_destination",
    name="test_destination",
    role_arn=iam_for_cloudwatch["arn"],
    target_arn=kinesis_for_cloudwatch["arn"])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudwatch.NewLogDestination(ctx, "test_destination", &cloudwatch.LogDestinationArgs{
			Name:      pulumi.String("test_destination"),
			RoleArn:   pulumi.Any(iamForCloudwatch.Arn),
			TargetArn: pulumi.Any(kinesisForCloudwatch.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var testDestination = new Aws.CloudWatch.LogDestination("test_destination", new()
    {
        Name = "test_destination",
        RoleArn = iamForCloudwatch.Arn,
        TargetArn = kinesisForCloudwatch.Arn,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogDestination;
import com.pulumi.aws.cloudwatch.LogDestinationArgs;
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) {
        var testDestination = new LogDestination("testDestination", LogDestinationArgs.builder()
            .name("test_destination")
            .roleArn(iamForCloudwatch.arn())
            .targetArn(kinesisForCloudwatch.arn())
            .build());

    }
}
Copy
resources:
  testDestination:
    type: aws:cloudwatch:LogDestination
    name: test_destination
    properties:
      name: test_destination
      roleArn: ${iamForCloudwatch.arn}
      targetArn: ${kinesisForCloudwatch.arn}
Copy

Create LogDestination Resource

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

Constructor syntax

new LogDestination(name: string, args: LogDestinationArgs, opts?: CustomResourceOptions);
@overload
def LogDestination(resource_name: str,
                   args: LogDestinationArgs,
                   opts: Optional[ResourceOptions] = None)

@overload
def LogDestination(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   role_arn: Optional[str] = None,
                   target_arn: Optional[str] = None,
                   name: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = None)
func NewLogDestination(ctx *Context, name string, args LogDestinationArgs, opts ...ResourceOption) (*LogDestination, error)
public LogDestination(string name, LogDestinationArgs args, CustomResourceOptions? opts = null)
public LogDestination(String name, LogDestinationArgs args)
public LogDestination(String name, LogDestinationArgs args, CustomResourceOptions options)
type: aws:cloudwatch:LogDestination
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. LogDestinationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. LogDestinationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. LogDestinationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. LogDestinationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. LogDestinationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

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

var logDestinationResource = new Aws.CloudWatch.LogDestination("logDestinationResource", new()
{
    RoleArn = "string",
    TargetArn = "string",
    Name = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := cloudwatch.NewLogDestination(ctx, "logDestinationResource", &cloudwatch.LogDestinationArgs{
	RoleArn:   pulumi.String("string"),
	TargetArn: pulumi.String("string"),
	Name:      pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var logDestinationResource = new LogDestination("logDestinationResource", LogDestinationArgs.builder()
    .roleArn("string")
    .targetArn("string")
    .name("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
log_destination_resource = aws.cloudwatch.LogDestination("logDestinationResource",
    role_arn="string",
    target_arn="string",
    name="string",
    tags={
        "string": "string",
    })
Copy
const logDestinationResource = new aws.cloudwatch.LogDestination("logDestinationResource", {
    roleArn: "string",
    targetArn: "string",
    name: "string",
    tags: {
        string: "string",
    },
});
Copy
type: aws:cloudwatch:LogDestination
properties:
    name: string
    roleArn: string
    tags:
        string: string
    targetArn: string
Copy

LogDestination Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The LogDestination resource accepts the following input properties:

RoleArn This property is required. string
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
TargetArn This property is required. string
The ARN of the target Amazon Kinesis stream resource for the destination.
Name Changes to this property will trigger replacement. string
A name for the log destination.
Tags Dictionary<string, string>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
RoleArn This property is required. string
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
TargetArn This property is required. string
The ARN of the target Amazon Kinesis stream resource for the destination.
Name Changes to this property will trigger replacement. string
A name for the log destination.
Tags map[string]string
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
roleArn This property is required. String
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
targetArn This property is required. String
The ARN of the target Amazon Kinesis stream resource for the destination.
name Changes to this property will trigger replacement. String
A name for the log destination.
tags Map<String,String>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
roleArn This property is required. string
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
targetArn This property is required. string
The ARN of the target Amazon Kinesis stream resource for the destination.
name Changes to this property will trigger replacement. string
A name for the log destination.
tags {[key: string]: string}
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
role_arn This property is required. str
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
target_arn This property is required. str
The ARN of the target Amazon Kinesis stream resource for the destination.
name Changes to this property will trigger replacement. str
A name for the log destination.
tags Mapping[str, str]
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
roleArn This property is required. String
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
targetArn This property is required. String
The ARN of the target Amazon Kinesis stream resource for the destination.
name Changes to this property will trigger replacement. String
A name for the log destination.
tags Map<String>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

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

Arn string
The Amazon Resource Name (ARN) specifying the log destination.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
The Amazon Resource Name (ARN) specifying the log destination.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The Amazon Resource Name (ARN) specifying the log destination.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
The Amazon Resource Name (ARN) specifying the log destination.
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
The Amazon Resource Name (ARN) specifying the log destination.
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The Amazon Resource Name (ARN) specifying the log destination.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing LogDestination Resource

Get an existing LogDestination 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?: LogDestinationState, opts?: CustomResourceOptions): LogDestination
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        name: Optional[str] = None,
        role_arn: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        target_arn: Optional[str] = None) -> LogDestination
func GetLogDestination(ctx *Context, name string, id IDInput, state *LogDestinationState, opts ...ResourceOption) (*LogDestination, error)
public static LogDestination Get(string name, Input<string> id, LogDestinationState? state, CustomResourceOptions? opts = null)
public static LogDestination get(String name, Output<String> id, LogDestinationState state, CustomResourceOptions options)
resources:  _:    type: aws:cloudwatch:LogDestination    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Arn string
The Amazon Resource Name (ARN) specifying the log destination.
Name Changes to this property will trigger replacement. string
A name for the log destination.
RoleArn string
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
Tags Dictionary<string, string>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TargetArn string
The ARN of the target Amazon Kinesis stream resource for the destination.
Arn string
The Amazon Resource Name (ARN) specifying the log destination.
Name Changes to this property will trigger replacement. string
A name for the log destination.
RoleArn string
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
Tags map[string]string
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TargetArn string
The ARN of the target Amazon Kinesis stream resource for the destination.
arn String
The Amazon Resource Name (ARN) specifying the log destination.
name Changes to this property will trigger replacement. String
A name for the log destination.
roleArn String
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
tags Map<String,String>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

targetArn String
The ARN of the target Amazon Kinesis stream resource for the destination.
arn string
The Amazon Resource Name (ARN) specifying the log destination.
name Changes to this property will trigger replacement. string
A name for the log destination.
roleArn string
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
tags {[key: string]: string}
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

targetArn string
The ARN of the target Amazon Kinesis stream resource for the destination.
arn str
The Amazon Resource Name (ARN) specifying the log destination.
name Changes to this property will trigger replacement. str
A name for the log destination.
role_arn str
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
tags Mapping[str, str]
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

target_arn str
The ARN of the target Amazon Kinesis stream resource for the destination.
arn String
The Amazon Resource Name (ARN) specifying the log destination.
name Changes to this property will trigger replacement. String
A name for the log destination.
roleArn String
The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target.
tags Map<String>
A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

targetArn String
The ARN of the target Amazon Kinesis stream resource for the destination.

Import

Using pulumi import, import CloudWatch Logs destinations using the name. For example:

$ pulumi import aws:cloudwatch/logDestination:LogDestination test_destination test_destination
Copy

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.