From c018971ed0a36a7ec49063dbfbe498e109a08894 Mon Sep 17 00:00:00 2001 From: Sam Mingolelli Date: Thu, 21 Feb 2019 10:29:48 -0500 Subject: [PATCH 1/7] Fixes several warnings around wildcarding --- outputs.tf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/outputs.tf b/outputs.tf index dee0d37..73e36d6 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,10 +1,10 @@ output "log_group_arn" { - value = "${aws_cloudwatch_log_group.default.arn}" + value = "${aws_cloudwatch_log_group.default.*.arn}" description = "ARN of the log group" } output "vpc_flow_id" { - value = "${aws_flow_log.vpc.id}" + value = "${aws_flow_log.vpc.*.id}" description = "Flow Log IDs of VPCs" } @@ -19,21 +19,21 @@ output "eni_flow_ids" { } output "kinesis_id" { - value = "${aws_kinesis_stream.default.id}" + value = "${aws_kinesis_stream.default.*.id}" description = "Stream ID" } output "kinesis_name" { - value = "${aws_kinesis_stream.default.name}" + value = "${aws_kinesis_stream.default.*.name}" description = "Stream name" } output "kinesis_shard_count" { - value = "${aws_kinesis_stream.default.shard_count}" + value = "${aws_kinesis_stream.default.*.shard_count}" description = "Count of Shards for Stream" } output "kinesis_arn" { - value = "${aws_kinesis_stream.default.arn}" + value = "${aws_kinesis_stream.default.*.arn}" description = "ARN of Stream" } From 8f08185ca922adff11993ba04eea2f1545bcf35a Mon Sep 17 00:00:00 2001 From: Sam Mingolelli Date: Mon, 20 Jan 2020 21:47:52 -0500 Subject: [PATCH 2/7] Fixes outputs which return as lists --- README.md | 148 ++++++++++++++++++++++++++++++---------------- docs/terraform.md | 13 ++-- outputs.tf | 27 +++++---- 3 files changed, 117 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index 751477f..2785169 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,43 @@ - + [![README Header][readme_header_img]][readme_header_link] [![Cloud Posse][logo]](https://cpco.io/homepage) @@ -42,6 +81,11 @@ We literally have [*hundreds of terraform modules*][terraform_modules] that are ## Usage + +**IMPORTANT:** The `master` branch is used in `source` just as an example. In your code, do not pin to `master` because there may be breaking changes between releases. +Instead pin to the release tag (e.g. `?ref=tags/x.y.z`) of one of our [latest releases](https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs/releases). + + ```terraform module "flow_logs" { source = "git::https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs.git?ref=master" @@ -66,7 +110,6 @@ Available targets: lint Lint terraform code ``` - ## Inputs | Name | Description | Type | Default | Required | @@ -84,7 +127,7 @@ Available targets: | retention_in_days | Number of days you want to retain log events in the log group | string | `30` | no | | retention_period | Length of time data records are accessible after they are added to the stream | string | `48` | no | | shard_count | Number of shards that the stream will use | string | `1` | no | -| shard_level_metrics | List of shard-level CloudWatch metrics which can be enabled for the stream | string | `` | no | +| shard_level_metrics | List of shard-level CloudWatch metrics which can be enabled for the stream | list | `` | no | | stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes | | subnet_ids | IDs of subnets | list | `` | no | | tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`) | map | `` | no | @@ -96,13 +139,13 @@ Available targets: | Name | Description | |------|-------------| | eni_flow_ids | Flow Log IDs of ENIs | -| kinesis_arn | ARN of Stream | -| kinesis_id | Stream ID | -| kinesis_name | Stream name | -| kinesis_shard_count | Count of Shards for Stream | +| kinesis_arn | Kinesis Stream ARN | +| kinesis_id | Kinesis Stream ID | +| kinesis_name | Kinesis Stream name | +| kinesis_shard_count | Kinesis Stream Shard count | | log_group_arn | ARN of the log group | | subnet_flow_ids | Flow Log IDs of subnets | -| vpc_flow_id | Flow Log IDs of VPCs | +| vpc_flow_id | VPC Flow Log ID | @@ -137,34 +180,33 @@ Check out these related projects. ## Help -**Got a question?** +**Got a question?** We got answers. File a GitHub [issue](https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs/issues), send us an [email][email] or join our [Slack Community][slack]. [![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link] -## Commercial Support - -Work directly with our team of DevOps experts via email, slack, and video conferencing. - -We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer. - -[![E-Mail](https://img.shields.io/badge/email-hello@cloudposse.com-blue.svg)][email] +## DevOps Accelerator for Startups -- **Questions.** We'll use a Shared Slack channel between your team and ours. -- **Troubleshooting.** We'll help you triage why things aren't working. -- **Code Reviews.** We'll review your Pull Requests and provide constructive feedback. -- **Bug Fixes.** We'll rapidly work to fix any bugs in our projects. -- **Build New Terraform Modules.** We'll [develop original modules][module_development] to provision infrastructure. -- **Cloud Architecture.** We'll assist with your cloud strategy and design. -- **Implementation.** We'll provide hands-on support to implement our reference architectures. +We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us. +[![Learn More](https://img.shields.io/badge/learn%20more-success.svg?style=for-the-badge)][commercial_support] -## Terraform Module Development +Work directly with our team of DevOps experts via email, slack, and video conferencing. -Are you interested in custom Terraform module development? Submit your inquiry using [our form][module_development] today and we'll get back to you ASAP. +We deliver 10x the value for a fraction of the cost of a full-time engineer. Our track record is not even funny. If you want things done right and you need it done FAST, then we're your best bet. +- **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code. +- **Release Engineering.** You'll have end-to-end CI/CD with unlimited staging environments. +- **Site Reliability Engineering.** You'll have total visibility into your apps and microservices. +- **Security Baseline.** You'll have built-in governance with accountability and audit logs for all changes. +- **GitOps.** You'll be able to operate your infrastructure via Pull Requests. +- **Training.** You'll receive hands-on training so your team can operate what we build. +- **Questions.** You'll have a direct line of communication between our teams via a Shared Slack channel. +- **Troubleshooting.** You'll get help to triage when things aren't working. +- **Code Reviews.** You'll receive constructive feedback on Pull Requests. +- **Bug Fixes.** We'll rapidly work with you to fix any bugs in our projects. ## Slack Community @@ -172,7 +214,13 @@ Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Ou ## Newsletter -Signup for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover. +Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover. + +## Office Hours + +[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone! + +[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours] ## Contributing @@ -197,7 +245,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. ## Copyright -Copyright © 2017-2018 [Cloud Posse, LLC](https://cpco.io/copyright) +Copyright © 2017-2020 [Cloud Posse, LLC](https://cpco.io/copyright) @@ -256,35 +304,33 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply |---| [SweetOps_homepage]: https://github.com/SweetOps - [SweetOps_avatar]: https://github.com/SweetOps.png?size=150 - - + [SweetOps_avatar]: https://img.cloudposse.com/150x150/https://github.com/SweetOps.png [![README Footer][readme_footer_img]][readme_footer_link] [![Beacon][beacon]][website] [logo]: https://cloudposse.com/logo-300x69.svg - [docs]: https://cpco.io/docs - [website]: https://cpco.io/homepage - [github]: https://cpco.io/github - [jobs]: https://cpco.io/jobs - [hire]: https://cpco.io/hire - [slack]: https://cpco.io/slack - [linkedin]: https://cpco.io/linkedin - [twitter]: https://cpco.io/twitter - [testimonial]: https://cpco.io/leave-testimonial - [newsletter]: https://cpco.io/newsletter - [email]: https://cpco.io/email - [commercial_support]: https://cpco.io/commercial-support - [we_love_open_source]: https://cpco.io/we-love-open-source - [module_development]: https://cpco.io/module-development - [terraform_modules]: https://cpco.io/terraform-modules - [readme_header_img]: https://cloudposse.com/readme/header/img?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_header_link]: https://cloudposse.com/readme/header/link?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_footer_img]: https://cloudposse.com/readme/footer/img?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_footer_link]: https://cloudposse.com/readme/footer/link?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?repo=cloudposse/terraform-aws-cloudwatch-flow-logs + [docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=docs + [website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=website + [github]: https://cpco.io/github?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=github + [jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=jobs + [hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=hire + [slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=slack + [linkedin]: https://cpco.io/linkedin?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=linkedin + [twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=twitter + [testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=testimonial + [office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=office_hours + [newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=newsletter + [email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=email + [commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=commercial_support + [we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=we_love_open_source + [terraform_modules]: https://cpco.io/terraform-modules?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=terraform_modules + [readme_header_img]: https://cloudposse.com/readme/header/img + [readme_header_link]: https://cloudposse.com/readme/header/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=readme_header_link + [readme_footer_img]: https://cloudposse.com/readme/footer/img + [readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=readme_footer_link + [readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img + [readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=readme_commercial_support_link [share_twitter]: https://twitter.com/intent/tweet/?text=terraform-aws-cloudwatch-flow-logs&url=https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs [share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=terraform-aws-cloudwatch-flow-logs&url=https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs [share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs diff --git a/docs/terraform.md b/docs/terraform.md index ae79781..e9cad69 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -1,4 +1,3 @@ - ## Inputs | Name | Description | Type | Default | Required | @@ -16,7 +15,7 @@ | retention_in_days | Number of days you want to retain log events in the log group | string | `30` | no | | retention_period | Length of time data records are accessible after they are added to the stream | string | `48` | no | | shard_count | Number of shards that the stream will use | string | `1` | no | -| shard_level_metrics | List of shard-level CloudWatch metrics which can be enabled for the stream | string | `` | no | +| shard_level_metrics | List of shard-level CloudWatch metrics which can be enabled for the stream | list | `` | no | | stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes | | subnet_ids | IDs of subnets | list | `` | no | | tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`) | map | `` | no | @@ -28,11 +27,11 @@ | Name | Description | |------|-------------| | eni_flow_ids | Flow Log IDs of ENIs | -| kinesis_arn | ARN of Stream | -| kinesis_id | Stream ID | -| kinesis_name | Stream name | -| kinesis_shard_count | Count of Shards for Stream | +| kinesis_arn | Kinesis Stream ARN | +| kinesis_id | Kinesis Stream ID | +| kinesis_name | Kinesis Stream name | +| kinesis_shard_count | Kinesis Stream Shard count | | log_group_arn | ARN of the log group | | subnet_flow_ids | Flow Log IDs of subnets | -| vpc_flow_id | Flow Log IDs of VPCs | +| vpc_flow_id | VPC Flow Log ID | diff --git a/outputs.tf b/outputs.tf index 73e36d6..ca844f9 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,39 +1,40 @@ output "log_group_arn" { - value = "${aws_cloudwatch_log_group.default.*.arn}" + value = "${join("", aws_cloudwatch_log_group.default.*.arn)}" description = "ARN of the log group" } output "vpc_flow_id" { - value = "${aws_flow_log.vpc.*.id}" - description = "Flow Log IDs of VPCs" + value = "${join("", aws_flow_log.vpc.*.id)}" + description = "VPC Flow Log ID" + } output "subnet_flow_ids" { - value = "${aws_flow_log.subnets.*.id}" + value = "${join("", aws_flow_log.subnets.*.id)}" description = "Flow Log IDs of subnets" } output "eni_flow_ids" { - value = "${aws_flow_log.eni.*.id}" + value = "${join("", aws_flow_log.eni.*.id)}" description = "Flow Log IDs of ENIs" } output "kinesis_id" { - value = "${aws_kinesis_stream.default.*.id}" - description = "Stream ID" + value = "${join("", aws_kinesis_stream.default.*.id)}" + description = "Kinesis Stream ID" } output "kinesis_name" { - value = "${aws_kinesis_stream.default.*.name}" - description = "Stream name" + value = "${join("", aws_kinesis_stream.default.*.name)}" + description = "Kinesis Stream name" } output "kinesis_shard_count" { - value = "${aws_kinesis_stream.default.*.shard_count}" - description = "Count of Shards for Stream" + value = "${join("", aws_kinesis_stream.default.*.shard_count)}" + description = "Kinesis Stream Shard count" } output "kinesis_arn" { - value = "${aws_kinesis_stream.default.*.arn}" - description = "ARN of Stream" + value = "${join("", aws_kinesis_stream.default.*.arn)}" + description = "Kinesis Stream ARN" } From 8247e2d907b70b1daa621fecf1e0f513c1e9b994 Mon Sep 17 00:00:00 2001 From: Sam Mingolelli Date: Mon, 20 Jan 2020 22:09:04 -0500 Subject: [PATCH 3/7] =?UTF-8?q?Removes=20current=20=3D=20=E2=80=9Ctrue?= =?UTF-8?q?=E2=80=9D=20from=20aws=5Fregion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.tf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 10fdf93..05b15a2 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,4 @@ -data "aws_region" "default" { - current = "true" -} +data "aws_region" "default" {} module "log_group_label" { source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.1" From 34ba41a402e47923822a6a79991e93038071c5f4 Mon Sep 17 00:00:00 2001 From: Sam Mingolelli Date: Mon, 20 Jan 2020 22:09:04 -0500 Subject: [PATCH 4/7] =?UTF-8?q?Removes=20current=20=3D=20=E2=80=9Ctrue?= =?UTF-8?q?=E2=80=9D=20from=20aws=5Fregion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 138 ++++++++++++++++++++++++++++++---------------- docs/terraform.md | 3 +- main.tf | 4 +- 3 files changed, 94 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 751477f..43bd79a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,43 @@ - + [![README Header][readme_header_img]][readme_header_link] [![Cloud Posse][logo]](https://cpco.io/homepage) @@ -42,6 +81,11 @@ We literally have [*hundreds of terraform modules*][terraform_modules] that are ## Usage + +**IMPORTANT:** The `master` branch is used in `source` just as an example. In your code, do not pin to `master` because there may be breaking changes between releases. +Instead pin to the release tag (e.g. `?ref=tags/x.y.z`) of one of our [latest releases](https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs/releases). + + ```terraform module "flow_logs" { source = "git::https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs.git?ref=master" @@ -66,7 +110,6 @@ Available targets: lint Lint terraform code ``` - ## Inputs | Name | Description | Type | Default | Required | @@ -84,7 +127,7 @@ Available targets: | retention_in_days | Number of days you want to retain log events in the log group | string | `30` | no | | retention_period | Length of time data records are accessible after they are added to the stream | string | `48` | no | | shard_count | Number of shards that the stream will use | string | `1` | no | -| shard_level_metrics | List of shard-level CloudWatch metrics which can be enabled for the stream | string | `` | no | +| shard_level_metrics | List of shard-level CloudWatch metrics which can be enabled for the stream | list | `` | no | | stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes | | subnet_ids | IDs of subnets | list | `` | no | | tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`) | map | `` | no | @@ -137,34 +180,33 @@ Check out these related projects. ## Help -**Got a question?** +**Got a question?** We got answers. File a GitHub [issue](https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs/issues), send us an [email][email] or join our [Slack Community][slack]. [![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link] -## Commercial Support - -Work directly with our team of DevOps experts via email, slack, and video conferencing. - -We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer. - -[![E-Mail](https://img.shields.io/badge/email-hello@cloudposse.com-blue.svg)][email] +## DevOps Accelerator for Startups -- **Questions.** We'll use a Shared Slack channel between your team and ours. -- **Troubleshooting.** We'll help you triage why things aren't working. -- **Code Reviews.** We'll review your Pull Requests and provide constructive feedback. -- **Bug Fixes.** We'll rapidly work to fix any bugs in our projects. -- **Build New Terraform Modules.** We'll [develop original modules][module_development] to provision infrastructure. -- **Cloud Architecture.** We'll assist with your cloud strategy and design. -- **Implementation.** We'll provide hands-on support to implement our reference architectures. +We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us. +[![Learn More](https://img.shields.io/badge/learn%20more-success.svg?style=for-the-badge)][commercial_support] -## Terraform Module Development +Work directly with our team of DevOps experts via email, slack, and video conferencing. -Are you interested in custom Terraform module development? Submit your inquiry using [our form][module_development] today and we'll get back to you ASAP. +We deliver 10x the value for a fraction of the cost of a full-time engineer. Our track record is not even funny. If you want things done right and you need it done FAST, then we're your best bet. +- **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code. +- **Release Engineering.** You'll have end-to-end CI/CD with unlimited staging environments. +- **Site Reliability Engineering.** You'll have total visibility into your apps and microservices. +- **Security Baseline.** You'll have built-in governance with accountability and audit logs for all changes. +- **GitOps.** You'll be able to operate your infrastructure via Pull Requests. +- **Training.** You'll receive hands-on training so your team can operate what we build. +- **Questions.** You'll have a direct line of communication between our teams via a Shared Slack channel. +- **Troubleshooting.** You'll get help to triage when things aren't working. +- **Code Reviews.** You'll receive constructive feedback on Pull Requests. +- **Bug Fixes.** We'll rapidly work with you to fix any bugs in our projects. ## Slack Community @@ -172,7 +214,13 @@ Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Ou ## Newsletter -Signup for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover. +Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover. + +## Office Hours + +[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone! + +[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours] ## Contributing @@ -197,7 +245,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. ## Copyright -Copyright © 2017-2018 [Cloud Posse, LLC](https://cpco.io/copyright) +Copyright © 2017-2020 [Cloud Posse, LLC](https://cpco.io/copyright) @@ -256,35 +304,33 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply |---| [SweetOps_homepage]: https://github.com/SweetOps - [SweetOps_avatar]: https://github.com/SweetOps.png?size=150 - - + [SweetOps_avatar]: https://img.cloudposse.com/150x150/https://github.com/SweetOps.png [![README Footer][readme_footer_img]][readme_footer_link] [![Beacon][beacon]][website] [logo]: https://cloudposse.com/logo-300x69.svg - [docs]: https://cpco.io/docs - [website]: https://cpco.io/homepage - [github]: https://cpco.io/github - [jobs]: https://cpco.io/jobs - [hire]: https://cpco.io/hire - [slack]: https://cpco.io/slack - [linkedin]: https://cpco.io/linkedin - [twitter]: https://cpco.io/twitter - [testimonial]: https://cpco.io/leave-testimonial - [newsletter]: https://cpco.io/newsletter - [email]: https://cpco.io/email - [commercial_support]: https://cpco.io/commercial-support - [we_love_open_source]: https://cpco.io/we-love-open-source - [module_development]: https://cpco.io/module-development - [terraform_modules]: https://cpco.io/terraform-modules - [readme_header_img]: https://cloudposse.com/readme/header/img?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_header_link]: https://cloudposse.com/readme/header/link?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_footer_img]: https://cloudposse.com/readme/footer/img?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_footer_link]: https://cloudposse.com/readme/footer/link?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img?repo=cloudposse/terraform-aws-cloudwatch-flow-logs - [readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?repo=cloudposse/terraform-aws-cloudwatch-flow-logs + [docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=docs + [website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=website + [github]: https://cpco.io/github?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=github + [jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=jobs + [hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=hire + [slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=slack + [linkedin]: https://cpco.io/linkedin?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=linkedin + [twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=twitter + [testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=testimonial + [office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=office_hours + [newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=newsletter + [email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=email + [commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=commercial_support + [we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=we_love_open_source + [terraform_modules]: https://cpco.io/terraform-modules?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=terraform_modules + [readme_header_img]: https://cloudposse.com/readme/header/img + [readme_header_link]: https://cloudposse.com/readme/header/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=readme_header_link + [readme_footer_img]: https://cloudposse.com/readme/footer/img + [readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=readme_footer_link + [readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img + [readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudwatch-flow-logs&utm_content=readme_commercial_support_link [share_twitter]: https://twitter.com/intent/tweet/?text=terraform-aws-cloudwatch-flow-logs&url=https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs [share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=terraform-aws-cloudwatch-flow-logs&url=https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs [share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs diff --git a/docs/terraform.md b/docs/terraform.md index ae79781..eac54f6 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -1,4 +1,3 @@ - ## Inputs | Name | Description | Type | Default | Required | @@ -16,7 +15,7 @@ | retention_in_days | Number of days you want to retain log events in the log group | string | `30` | no | | retention_period | Length of time data records are accessible after they are added to the stream | string | `48` | no | | shard_count | Number of shards that the stream will use | string | `1` | no | -| shard_level_metrics | List of shard-level CloudWatch metrics which can be enabled for the stream | string | `` | no | +| shard_level_metrics | List of shard-level CloudWatch metrics which can be enabled for the stream | list | `` | no | | stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes | | subnet_ids | IDs of subnets | list | `` | no | | tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`) | map | `` | no | diff --git a/main.tf b/main.tf index 10fdf93..05b15a2 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,4 @@ -data "aws_region" "default" { - current = "true" -} +data "aws_region" "default" {} module "log_group_label" { source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.1" From 1dcecab16b7f0f6b143dd9e89443901b28e73474 Mon Sep 17 00:00:00 2001 From: Sam Mingolelli Date: Tue, 21 Jan 2020 22:37:06 -0500 Subject: [PATCH 5/7] Fixes deprecation of log_group_name -> log_destination --- main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 05b15a2..ae2aa8f 100644 --- a/main.tf +++ b/main.tf @@ -42,7 +42,7 @@ resource "aws_cloudwatch_log_group" "default" { resource "aws_flow_log" "vpc" { count = "${var.enabled == "true" ? 1 : 0}" - log_group_name = "${aws_cloudwatch_log_group.default.name}" + log_destination = "${aws_cloudwatch_log_group.default.arn}" iam_role_arn = "${aws_iam_role.log.arn}" vpc_id = "${var.vpc_id}" traffic_type = "${var.traffic_type}" @@ -50,7 +50,7 @@ resource "aws_flow_log" "vpc" { resource "aws_flow_log" "subnets" { count = "${var.enabled == "true" ? length(compact(var.subnet_ids)) : 0}" - log_group_name = "${aws_cloudwatch_log_group.default.name}" + log_destination = "${aws_cloudwatch_log_group.default.arn}" iam_role_arn = "${aws_iam_role.log.arn}" subnet_id = "${element(compact(var.subnet_ids), count.index)}" traffic_type = "${var.traffic_type}" @@ -58,7 +58,7 @@ resource "aws_flow_log" "subnets" { resource "aws_flow_log" "eni" { count = "${var.enabled == "true" ? length(compact(var.eni_ids)) : 0}" - log_group_name = "${aws_cloudwatch_log_group.default.name}" + log_destination = "${aws_cloudwatch_log_group.default.arn}" iam_role_arn = "${aws_iam_role.log.arn}" subnet_id = "${element(compact(var.eni_ids), count.index)}" traffic_type = "${var.traffic_type}" From 1a6f0de95856ead0efd4727dbd9334825ced7d89 Mon Sep 17 00:00:00 2001 From: Sam Mingolelli Date: Thu, 27 Feb 2020 21:55:57 -0500 Subject: [PATCH 6/7] Run fmt + make cmds --- main.tf | 24 ++++++++++++------------ outputs.tf | 1 - 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/main.tf b/main.tf index ae2aa8f..751d7b6 100644 --- a/main.tf +++ b/main.tf @@ -41,25 +41,25 @@ resource "aws_cloudwatch_log_group" "default" { } resource "aws_flow_log" "vpc" { - count = "${var.enabled == "true" ? 1 : 0}" + count = "${var.enabled == "true" ? 1 : 0}" log_destination = "${aws_cloudwatch_log_group.default.arn}" - iam_role_arn = "${aws_iam_role.log.arn}" - vpc_id = "${var.vpc_id}" - traffic_type = "${var.traffic_type}" + iam_role_arn = "${aws_iam_role.log.arn}" + vpc_id = "${var.vpc_id}" + traffic_type = "${var.traffic_type}" } resource "aws_flow_log" "subnets" { - count = "${var.enabled == "true" ? length(compact(var.subnet_ids)) : 0}" + count = "${var.enabled == "true" ? length(compact(var.subnet_ids)) : 0}" log_destination = "${aws_cloudwatch_log_group.default.arn}" - iam_role_arn = "${aws_iam_role.log.arn}" - subnet_id = "${element(compact(var.subnet_ids), count.index)}" - traffic_type = "${var.traffic_type}" + iam_role_arn = "${aws_iam_role.log.arn}" + subnet_id = "${element(compact(var.subnet_ids), count.index)}" + traffic_type = "${var.traffic_type}" } resource "aws_flow_log" "eni" { - count = "${var.enabled == "true" ? length(compact(var.eni_ids)) : 0}" + count = "${var.enabled == "true" ? length(compact(var.eni_ids)) : 0}" log_destination = "${aws_cloudwatch_log_group.default.arn}" - iam_role_arn = "${aws_iam_role.log.arn}" - subnet_id = "${element(compact(var.eni_ids), count.index)}" - traffic_type = "${var.traffic_type}" + iam_role_arn = "${aws_iam_role.log.arn}" + subnet_id = "${element(compact(var.eni_ids), count.index)}" + traffic_type = "${var.traffic_type}" } diff --git a/outputs.tf b/outputs.tf index ca844f9..7c16063 100644 --- a/outputs.tf +++ b/outputs.tf @@ -6,7 +6,6 @@ output "log_group_arn" { output "vpc_flow_id" { value = "${join("", aws_flow_log.vpc.*.id)}" description = "VPC Flow Log ID" - } output "subnet_flow_ids" { From f693e5cc9d5d728c2bc2881cd723522701349ade Mon Sep 17 00:00:00 2001 From: Sam Mingolelli Date: Thu, 27 Feb 2020 22:34:09 -0500 Subject: [PATCH 7/7] Fixes linting issue --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 8fe4a24..751d7b6 100644 --- a/main.tf +++ b/main.tf @@ -62,4 +62,4 @@ resource "aws_flow_log" "eni" { iam_role_arn = "${aws_iam_role.log.arn}" subnet_id = "${element(compact(var.eni_ids), count.index)}" traffic_type = "${var.traffic_type}" -} \ No newline at end of file +}