Class LogDestinationPolicy
Provides a CloudWatch Logs destination policy resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var testDestination = new Aws.CloudWatch.LogDestination("testDestination", new Aws.CloudWatch.LogDestinationArgs
{
RoleArn = aws_iam_role.Iam_for_cloudwatch.Arn,
TargetArn = aws_kinesis_stream.Kinesis_for_cloudwatch.Arn,
});
var testDestinationPolicyPolicyDocument = testDestination.Arn.Apply(arn => Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
{
Statements =
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
{
Actions =
{
"logs:PutSubscriptionFilter",
},
Effect = "Allow",
Principals =
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalArgs
{
Identifiers =
{
"123456789012",
},
Type = "AWS",
},
},
Resources =
{
arn,
},
},
},
}));
var testDestinationPolicyLogDestinationPolicy = new Aws.CloudWatch.LogDestinationPolicy("testDestinationPolicyLogDestinationPolicy", new Aws.CloudWatch.LogDestinationPolicyArgs
{
AccessPolicy = testDestinationPolicyPolicyDocument.Apply(testDestinationPolicyPolicyDocument => testDestinationPolicyPolicyDocument.Json),
DestinationName = testDestination.Name,
});
}
}
Inherited Members
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 LogDestinationPolicy : CustomResource
Constructors
View SourceLogDestinationPolicy(String, LogDestinationPolicyArgs, CustomResourceOptions)
Create a LogDestinationPolicy resource with the given unique name, arguments, and options.
Declaration
public LogDestinationPolicy(string name, LogDestinationPolicyArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| LogDestinationPolicyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAccessPolicy
The policy document. This is a JSON formatted string.
Declaration
public Output<string> AccessPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DestinationName
A name for the subscription filter
Declaration
public Output<string> DestinationName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, LogDestinationPolicyState, CustomResourceOptions)
Get an existing LogDestinationPolicy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static LogDestinationPolicy Get(string name, Input<string> id, LogDestinationPolicyState 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. |
| LogDestinationPolicyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| LogDestinationPolicy |