Show / Hide Table of Contents

Class LogResourcePolicy

Provides a resource to manage a CloudWatch log resource policy.

Example Usage

Elasticsearch Log Publishing

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var elasticsearch_log_publishing_policyPolicyDocument = Output.Create(Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
    {
        Statements = 
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
            {
                Actions = 
                {
                    "logs:CreateLogStream",
                    "logs:PutLogEvents",
                    "logs:PutLogEventsBatch",
                },
                Principals = 
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalArgs
                    {
                        Identifiers = 
                        {
                            "es.amazonaws.com",
                        },
                        Type = "Service",
                    },
                },
                Resources = 
                {
                    "arn:aws:logs:*",
                },
            },
        },
    }));
    var elasticsearch_log_publishing_policyLogResourcePolicy = new Aws.CloudWatch.LogResourcePolicy("elasticsearch-log-publishing-policyLogResourcePolicy", new Aws.CloudWatch.LogResourcePolicyArgs
    {
        PolicyDocument = elasticsearch_log_publishing_policyPolicyDocument.Apply(elasticsearch_log_publishing_policyPolicyDocument => elasticsearch_log_publishing_policyPolicyDocument.Json),
        PolicyName = "elasticsearch-log-publishing-policy",
    });
}

}

Route53 Query Logging

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var route53_query_logging_policyPolicyDocument = Output.Create(Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
    {
        Statements = 
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
            {
                Actions = 
                {
                    "logs:CreateLogStream",
                    "logs:PutLogEvents",
                },
                Principals = 
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalArgs
                    {
                        Identifiers = 
                        {
                            "route53.amazonaws.com",
                        },
                        Type = "Service",
                    },
                },
                Resources = 
                {
                    "arn:aws:logs:*:*:log-group:/aws/route53/*",
                },
            },
        },
    }));
    var route53_query_logging_policyLogResourcePolicy = new Aws.CloudWatch.LogResourcePolicy("route53-query-logging-policyLogResourcePolicy", new Aws.CloudWatch.LogResourcePolicyArgs
    {
        PolicyDocument = route53_query_logging_policyPolicyDocument.Apply(route53_query_logging_policyPolicyDocument => route53_query_logging_policyPolicyDocument.Json),
        PolicyName = "route53-query-logging-policy",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
LogResourcePolicy
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.CloudWatch
Assembly: Pulumi.Aws.dll
Syntax
public class LogResourcePolicy : CustomResource

Constructors

View Source

LogResourcePolicy(String, LogResourcePolicyArgs, CustomResourceOptions)

Create a LogResourcePolicy resource with the given unique name, arguments, and options.

Declaration
public LogResourcePolicy(string name, LogResourcePolicyArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

LogResourcePolicyArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

PolicyDocument

Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.

Declaration
public Output<string> PolicyDocument { get; }
Property Value
Type Description
Output<System.String>
View Source

PolicyName

Name of the resource policy.

Declaration
public Output<string> PolicyName { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, LogResourcePolicyState, CustomResourceOptions)

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

Declaration
public static LogResourcePolicy Get(string name, Input<string> id, LogResourcePolicyState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

LogResourcePolicyState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
LogResourcePolicy
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.