Show / Hide Table of Contents

Class LogService

Provides a Log subscription for AWS Directory Service that pushes logs to cloudwatch.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var exampleLogGroup = new Aws.CloudWatch.LogGroup("exampleLogGroup", new Aws.CloudWatch.LogGroupArgs
    {
        RetentionInDays = 14,
    });
    var ad_log_policyPolicyDocument = exampleLogGroup.Arn.Apply(arn => Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
    {
        Statements = 
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
            {
                Actions = 
                {
                    "logs:CreateLogStream",
                    "logs:PutLogEvents",
                },
                Effect = "Allow",
                Principals = 
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalArgs
                    {
                        Identifiers = 
                        {
                            "ds.amazonaws.com",
                        },
                        Type = "Service",
                    },
                },
                Resources = 
                {
                    arn,
                },
            },
        },
    }));
    var ad_log_policyLogResourcePolicy = new Aws.CloudWatch.LogResourcePolicy("ad-log-policyLogResourcePolicy", new Aws.CloudWatch.LogResourcePolicyArgs
    {
        PolicyDocument = ad_log_policyPolicyDocument.Apply(ad_log_policyPolicyDocument => ad_log_policyPolicyDocument.Json),
        PolicyName = "ad-log-policy",
    });
    var exampleLogService = new Aws.DirectoryService.LogService("exampleLogService", new Aws.DirectoryService.LogServiceArgs
    {
        DirectoryId = aws_directory_service_directory.Example.Id,
        LogGroupName = exampleLogGroup.Name,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
LogService
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.DirectoryService
Assembly: Pulumi.Aws.dll
Syntax
public class LogService : CustomResource

Constructors

View Source

LogService(String, LogServiceArgs, CustomResourceOptions)

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

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

The unique name of the resource

LogServiceArgs 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

DirectoryId

The id of directory.

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

LogGroupName

Name of the cloudwatch log group to which the logs should be published. The log group should be already created and the directory service principal should be provided with required permission to create stream and publish logs. Changing this value would delete the current subscription and create a new one. A directory can only have one log subscription at a time.

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

Methods

View Source

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

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

Declaration
public static LogService Get(string name, Input<string> id, LogServiceState 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.

LogServiceState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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