From a08fbcbadb0f55852eff7d07a02e9e3cd9ff15ea Mon Sep 17 00:00:00 2001 From: Matt Dainty Date: Tue, 14 Feb 2017 16:16:22 +0000 Subject: [PATCH] Add documentation --- .../cloudwatch_log_destination.html.markdown | 35 ++++++++++++ ...watch_log_destination_policy.html.markdown | 55 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 website/source/docs/providers/aws/r/cloudwatch_log_destination.html.markdown create mode 100644 website/source/docs/providers/aws/r/cloudwatch_log_destination_policy.html.markdown diff --git a/website/source/docs/providers/aws/r/cloudwatch_log_destination.html.markdown b/website/source/docs/providers/aws/r/cloudwatch_log_destination.html.markdown new file mode 100644 index 000000000..86ed2437f --- /dev/null +++ b/website/source/docs/providers/aws/r/cloudwatch_log_destination.html.markdown @@ -0,0 +1,35 @@ +--- +layout: "aws" +page_title: "AWS: aws_cloudwatch_log_destination" +sidebar_current: "docs-aws-resource-cloudwatch-log-destination" +description: |- + Provides a CloudWatch Logs destination. +--- + +# aws\_cloudwatch\_log\_destination + +Provides a CloudWatch Logs destination resource. + +## Example Usage + +``` +resource "aws_cloudwatch_log_destination" "test_destination" { + name = "test_destination" + role_arn = "${aws_iam_role.iam_for_cloudwatch.arn}" + target_arn = "${aws_kinesis_stream.kinesis_for_cloudwatch.arn}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) A name for the log destination +* `role_arn` - (Required) The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target +* `target_arn` - (Required) The ARN of the target Amazon Kinesis stream or Amazon Lambda resource for the destination + +## Attributes Reference + +The following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) specifying the log destination. diff --git a/website/source/docs/providers/aws/r/cloudwatch_log_destination_policy.html.markdown b/website/source/docs/providers/aws/r/cloudwatch_log_destination_policy.html.markdown new file mode 100644 index 000000000..ccb248a52 --- /dev/null +++ b/website/source/docs/providers/aws/r/cloudwatch_log_destination_policy.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "aws" +page_title: "AWS: aws_cloudwatch_log_destination_policy" +sidebar_current: "docs-aws-resource-cloudwatch-log-destination-policy" +description: |- + Provides a CloudWatch Logs destination policy. +--- + +# aws\_cloudwatch\_log\_destination\_policy + +Provides a CloudWatch Logs destination policy resource. + +## Example Usage + +``` +resource "aws_cloudwatch_log_destination" "test_destination" { + name = "test_destination" + role_arn = "${aws_iam_role.iam_for_cloudwatch.arn}" + target_arn = "${aws_kinesis_stream.kinesis_for_cloudwatch.arn}" +} + +data "aws_iam_policy_document" "test_destination_policy" { + statement { + effect = "Allow" + + principals = { + type = "AWS" + + identifiers = [ + "123456789012", + ] + } + + actions = [ + "logs:PutSubscriptionFilter", + ] + + resources = [ + "${aws_cloudwatch_log_destination.test_destination.arn}", + ] + } +} + +resource "aws_cloudwatch_log_destination_policy" "test_destination_policy" { + destination_name = "${aws_cloudwatch_log_destination.test_destination.name}" + access_policy = "${data.aws_iam_policy_document.test_destination_policy.json}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `destination_name` - (Required) A name for the subscription filter +* `access_policy` - (Required) The policy document. This is a JSON formatted string.