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

aws.cloudwatch.LogDeliveryDestinationPolicy

Explore with Pulumi AI

Resource for managing an AWS CloudWatch Logs Delivery Destination Policy.

Example Usage

Basic Usage

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

const example = new aws.cloudwatch.LogDeliveryDestinationPolicy("example", {
    deliveryDestinationName: exampleAwsCloudwatchLogDeliveryDestination.name,
    deliveryDestinationPolicy: exampleAwsIamPolicyDocument.json,
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.cloudwatch.LogDeliveryDestinationPolicy("example",
    delivery_destination_name=example_aws_cloudwatch_log_delivery_destination["name"],
    delivery_destination_policy=example_aws_iam_policy_document["json"])
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.NewLogDeliveryDestinationPolicy(ctx, "example", &cloudwatch.LogDeliveryDestinationPolicyArgs{
			DeliveryDestinationName:   pulumi.Any(exampleAwsCloudwatchLogDeliveryDestination.Name),
			DeliveryDestinationPolicy: pulumi.Any(exampleAwsIamPolicyDocument.Json),
		})
		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 example = new Aws.CloudWatch.LogDeliveryDestinationPolicy("example", new()
    {
        DeliveryDestinationName = exampleAwsCloudwatchLogDeliveryDestination.Name,
        DeliveryDestinationPolicy = exampleAwsIamPolicyDocument.Json,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogDeliveryDestinationPolicy;
import com.pulumi.aws.cloudwatch.LogDeliveryDestinationPolicyArgs;
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 example = new LogDeliveryDestinationPolicy("example", LogDeliveryDestinationPolicyArgs.builder()
            .deliveryDestinationName(exampleAwsCloudwatchLogDeliveryDestination.name())
            .deliveryDestinationPolicy(exampleAwsIamPolicyDocument.json())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:cloudwatch:LogDeliveryDestinationPolicy
    properties:
      deliveryDestinationName: ${exampleAwsCloudwatchLogDeliveryDestination.name}
      deliveryDestinationPolicy: ${exampleAwsIamPolicyDocument.json}
Copy

Create LogDeliveryDestinationPolicy Resource

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

Constructor syntax

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

@overload
def LogDeliveryDestinationPolicy(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 delivery_destination_name: Optional[str] = None,
                                 delivery_destination_policy: Optional[str] = None)
func NewLogDeliveryDestinationPolicy(ctx *Context, name string, args LogDeliveryDestinationPolicyArgs, opts ...ResourceOption) (*LogDeliveryDestinationPolicy, error)
public LogDeliveryDestinationPolicy(string name, LogDeliveryDestinationPolicyArgs args, CustomResourceOptions? opts = null)
public LogDeliveryDestinationPolicy(String name, LogDeliveryDestinationPolicyArgs args)
public LogDeliveryDestinationPolicy(String name, LogDeliveryDestinationPolicyArgs args, CustomResourceOptions options)
type: aws:cloudwatch:LogDeliveryDestinationPolicy
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. LogDeliveryDestinationPolicyArgs
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. LogDeliveryDestinationPolicyArgs
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. LogDeliveryDestinationPolicyArgs
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. LogDeliveryDestinationPolicyArgs
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. LogDeliveryDestinationPolicyArgs
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 logDeliveryDestinationPolicyResource = new Aws.CloudWatch.LogDeliveryDestinationPolicy("logDeliveryDestinationPolicyResource", new()
{
    DeliveryDestinationName = "string",
    DeliveryDestinationPolicy = "string",
});
Copy
example, err := cloudwatch.NewLogDeliveryDestinationPolicy(ctx, "logDeliveryDestinationPolicyResource", &cloudwatch.LogDeliveryDestinationPolicyArgs{
	DeliveryDestinationName:   pulumi.String("string"),
	DeliveryDestinationPolicy: pulumi.String("string"),
})
Copy
var logDeliveryDestinationPolicyResource = new LogDeliveryDestinationPolicy("logDeliveryDestinationPolicyResource", LogDeliveryDestinationPolicyArgs.builder()
    .deliveryDestinationName("string")
    .deliveryDestinationPolicy("string")
    .build());
Copy
log_delivery_destination_policy_resource = aws.cloudwatch.LogDeliveryDestinationPolicy("logDeliveryDestinationPolicyResource",
    delivery_destination_name="string",
    delivery_destination_policy="string")
Copy
const logDeliveryDestinationPolicyResource = new aws.cloudwatch.LogDeliveryDestinationPolicy("logDeliveryDestinationPolicyResource", {
    deliveryDestinationName: "string",
    deliveryDestinationPolicy: "string",
});
Copy
type: aws:cloudwatch:LogDeliveryDestinationPolicy
properties:
    deliveryDestinationName: string
    deliveryDestinationPolicy: string
Copy

LogDeliveryDestinationPolicy 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 LogDeliveryDestinationPolicy resource accepts the following input properties:

DeliveryDestinationName This property is required. string
The name of the delivery destination to assign this policy to.
DeliveryDestinationPolicy This property is required. string
The contents of the policy.
DeliveryDestinationName This property is required. string
The name of the delivery destination to assign this policy to.
DeliveryDestinationPolicy This property is required. string
The contents of the policy.
deliveryDestinationName This property is required. String
The name of the delivery destination to assign this policy to.
deliveryDestinationPolicy This property is required. String
The contents of the policy.
deliveryDestinationName This property is required. string
The name of the delivery destination to assign this policy to.
deliveryDestinationPolicy This property is required. string
The contents of the policy.
delivery_destination_name This property is required. str
The name of the delivery destination to assign this policy to.
delivery_destination_policy This property is required. str
The contents of the policy.
deliveryDestinationName This property is required. String
The name of the delivery destination to assign this policy to.
deliveryDestinationPolicy This property is required. String
The contents of the policy.

Outputs

All input properties are implicitly available as output properties. Additionally, the LogDeliveryDestinationPolicy 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 LogDeliveryDestinationPolicy Resource

Get an existing LogDeliveryDestinationPolicy 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?: LogDeliveryDestinationPolicyState, opts?: CustomResourceOptions): LogDeliveryDestinationPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        delivery_destination_name: Optional[str] = None,
        delivery_destination_policy: Optional[str] = None) -> LogDeliveryDestinationPolicy
func GetLogDeliveryDestinationPolicy(ctx *Context, name string, id IDInput, state *LogDeliveryDestinationPolicyState, opts ...ResourceOption) (*LogDeliveryDestinationPolicy, error)
public static LogDeliveryDestinationPolicy Get(string name, Input<string> id, LogDeliveryDestinationPolicyState? state, CustomResourceOptions? opts = null)
public static LogDeliveryDestinationPolicy get(String name, Output<String> id, LogDeliveryDestinationPolicyState state, CustomResourceOptions options)
resources:  _:    type: aws:cloudwatch:LogDeliveryDestinationPolicy    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:
DeliveryDestinationName string
The name of the delivery destination to assign this policy to.
DeliveryDestinationPolicy string
The contents of the policy.
DeliveryDestinationName string
The name of the delivery destination to assign this policy to.
DeliveryDestinationPolicy string
The contents of the policy.
deliveryDestinationName String
The name of the delivery destination to assign this policy to.
deliveryDestinationPolicy String
The contents of the policy.
deliveryDestinationName string
The name of the delivery destination to assign this policy to.
deliveryDestinationPolicy string
The contents of the policy.
delivery_destination_name str
The name of the delivery destination to assign this policy to.
delivery_destination_policy str
The contents of the policy.
deliveryDestinationName String
The name of the delivery destination to assign this policy to.
deliveryDestinationPolicy String
The contents of the policy.

Import

Using pulumi import, import CloudWatch Logs Delivery Destination Policy using the delivery_destination_name. For example:

$ pulumi import aws:cloudwatch/logDeliveryDestinationPolicy:LogDeliveryDestinationPolicy example example
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.