Skip to content

Commit

Permalink
Updates to ChatOps - Automated commit (#33)
Browse files Browse the repository at this point in the history
## What
* Adds chatops commands
  - '/test all'
  - '/test bats'
  - '/test readme'
  - '/test terratest'
* Drops codefresh
* Drops slash-command-dispatch
* Removes codefresh badge
* Rebuilds README

## Why
* Change over from codefresh to GH Actions
* Facilitate testing of PRs from forks
  • Loading branch information
Gowiem authored Jul 14, 2020
1 parent 2205143 commit c68c2b4
Show file tree
Hide file tree
Showing 11 changed files with 235 additions and 131 deletions.
14 changes: 14 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Use this file to define individuals or teams that are responsible for code in a repository.
# Read more: <https://help.github.com/articles/about-codeowners/>
#
# Order is important: the last matching pattern takes the most precedence

# These owners will be the default owners for everything
* @cloudposse/engineering @cloudposse/contributors

# Cloud Posse must review any changes to Makefiles
**/Makefile @cloudposse/engineering
**/Makefile.* @cloudposse/engineering

# Cloud Posse must review any changes to GitHub actions
.github/* @cloudposse/engineering
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help.

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

## Describe the Bug
A clear and concise description of what the bug is.

## Expected Behavior
A clear and concise description of what you expected to happen.

## Steps to Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Run '....'
3. Enter '....'
4. See error

## Screenshots
If applicable, add screenshots or logs to help explain your problem.

## Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:
- OS: [e.g. Linux, OSX, WSL, etc]
- Version [e.g. 10.15]

## Additional Context
Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
blank_issues_enabled: false

contact_links:

- name: Community Slack Team
url: https://cloudposse.com/slack/
about: |-
Please ask and answer questions here.
- name: Office Hours
url: https://cloudposse.com/office-hours/
about: |-
Join us every Wednesday for FREE Office Hours (lunch & learn).
- name: DevOps Accelerator Program
url: https://cloudposse.com/accelerate/
about: |-
Own your infrastructure in record time. We build it. You drive it.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Feature Request
about: Suggest an idea for this project
title: ''
labels: 'feature request'
assignees: ''

---

Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

## Describe the Feature

A clear and concise description of what the bug is.

## Expected Behavior

A clear and concise description of what you expected to happen.

## Use Case

Is your feature request related to a problem/challenge you are trying to solve? Please provide some additional context of why this feature or capability will be valuable.

## Describe Ideal Solution

A clear and concise description of what you want to happen. If you don't know, that's okay.

## Alternatives Considered

Explain what alternative solutions or features you've considered.

## Additional Context

Add any other context or screenshots about the feature request here.
Empty file.
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## what
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
* Use bullet points to be concise and to the point.

## why
* Provide the justifications for the changes (e.g. business case).
* Describe why these changes were made (e.g. why do these commits fix the problem?)
* Use bullet points to be concise and to the point.

## references
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
* Use `closes #123`, if this PR closes a GitHub issue `#123`

37 changes: 37 additions & 0 deletions .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: chatops
on:
issue_comment:
types: [created]

jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Handle common commands"
uses: cloudposse/actions/github/[email protected]
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: cloudposse/actions
commands: rebuild-readme, terraform-fmt
permission: none
issue-type: pull-request

test:
runs-on: ubuntu-latest
steps:
- name: "Checkout commit"
uses: actions/checkout@v2
- name: "Run tests"
uses: cloudposse/actions/github/[email protected]
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: cloudposse/actions
commands: test
permission: none
issue-type: pull-request
reactions: false


66 changes: 43 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

[![Cloud Posse][logo]](https://cpco.io/homepage)

# terraform-aws-cloudtrail [![Codefresh Build Status](https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-aws-cloudtrail?type=cf-1)](https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d128233c6e335c15aa1317c) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-cloudtrail.svg)](https://travis-ci.org/cloudposse/terraform-aws-cloudtrail/releases) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
# terraform-aws-cloudtrail [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-cloudtrail.svg)](https://travis-ci.org/cloudposse/terraform-aws-cloudtrail/releases) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)


Terraform module to provision an AWS [CloudTrail](https://aws.amazon.com/cloudtrail/).
Expand Down Expand Up @@ -152,36 +152,51 @@ Available targets:
lint Lint terraform code
```
## Requirements

| Name | Version |
|------|---------|
| terraform | ~> 0.12.0 |
| aws | ~> 2.0 |
| local | ~> 1.2 |
| null | ~> 2.0 |

## Providers

| Name | Version |
|------|---------|
| aws | ~> 2.0 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| attributes | Additional attributes (e.g. `1`) | list(string) | `<list>` | no |
| cloud_watch_logs_group_arn | Specifies a log group name using an Amazon Resource Name (ARN), that represents the log group to which CloudTrail logs will be delivered | string | `` | no |
| cloud_watch_logs_role_arn | Specifies the role for the CloudWatch Logs endpoint to assume to write to a user’s log group | string | `` | no |
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `-` | no |
| enable_log_file_validation | Specifies whether log file integrity validation is enabled. Creates signed digest for validated contents of logs | bool | `true` | no |
| enable_logging | Enable logging for the trail | bool | `true` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no |
| event_selector | Specifies an event selector for enabling data event logging. See: https://www.terraform.io/docs/providers/aws/r/cloudtrail.html for details on this variable | object | `<list>` | no |
| include_global_service_events | Specifies whether the trail is publishing events from global services such as IAM to the log files | bool | `false` | no |
| is_multi_region_trail | Specifies whether the trail is created in the current region or in all regions | bool | `false` | no |
| is_organization_trail | The trail is an AWS Organizations trail | bool | `false` | no |
| kms_key_arn | Specifies the KMS key ARN to use to encrypt the logs delivered by CloudTrail | string | `` | no |
| name | Solution name, e.g. 'app' or 'jenkins' | string | `` | no |
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no |
| s3_bucket_name | S3 bucket name for CloudTrail logs | string | - | yes |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | map(string) | `<map>` | no |
|------|-------------|------|---------|:--------:|
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
| cloud\_watch\_logs\_group\_arn | Specifies a log group name using an Amazon Resource Name (ARN), that represents the log group to which CloudTrail logs will be delivered | `string` | `""` | no |
| cloud\_watch\_logs\_role\_arn | Specifies the role for the CloudWatch Logs endpoint to assume to write to a user’s log group | `string` | `""` | no |
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
| enable\_log\_file\_validation | Specifies whether log file integrity validation is enabled. Creates signed digest for validated contents of logs | `bool` | `true` | no |
| enable\_logging | Enable logging for the trail | `bool` | `true` | no |
| enabled | Set to false to prevent the module from creating any resources | `bool` | `true` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
| event\_selector | Specifies an event selector for enabling data event logging. See: https://www.terraform.io/docs/providers/aws/r/cloudtrail.html for details on this variable | <pre>list(object({<br> include_management_events = bool<br> read_write_type = string<br><br> data_resource = list(object({<br> type = string<br> values = list(string)<br> }))<br> }))</pre> | `[]` | no |
| include\_global\_service\_events | Specifies whether the trail is publishing events from global services such as IAM to the log files | `bool` | `false` | no |
| is\_multi\_region\_trail | Specifies whether the trail is created in the current region or in all regions | `bool` | `false` | no |
| is\_organization\_trail | The trail is an AWS Organizations trail | `bool` | `false` | no |
| kms\_key\_arn | Specifies the KMS key ARN to use to encrypt the logs delivered by CloudTrail | `string` | `""` | no |
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `""` | no |
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `""` | no |
| s3\_bucket\_name | S3 bucket name for CloudTrail logs | `string` | n/a | yes |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `""` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| cloudtrail_arn | The Amazon Resource Name of the trail |
| cloudtrail_home_region | The region in which the trail was created |
| cloudtrail_id | The name of the trail |
| cloudtrail\_arn | The Amazon Resource Name of the trail |
| cloudtrail\_home\_region | The region in which the trail was created |
| cloudtrail\_id | The name of the trail |



Expand Down Expand Up @@ -237,6 +252,10 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our

Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.

## Discourse Forums

Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account.

## Newsletter

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.
Expand Down Expand Up @@ -354,6 +373,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudtrail&utm_content=testimonial
[office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudtrail&utm_content=office_hours
[newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudtrail&utm_content=newsletter
[discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudtrail&utm_content=discourse
[email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudtrail&utm_content=email
[commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-cloudtrail&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-cloudtrail&utm_content=we_love_open_source
Expand Down
12 changes: 0 additions & 12 deletions README.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#

# Name of this project
name: terraform-aws-cloudtrail

# Logo for this project
#logo: docs/logo.png

# License of this project
license: "APACHE2"

# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-cloudtrail

# Badges to display
badges:
- name: "Codefresh Build Status"
image: "https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-aws-cloudtrail?type=cf-1"
url: "https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d128233c6e335c15aa1317c"
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-cloudtrail.svg"
url: "https://travis-ci.org/cloudposse/terraform-aws-cloudtrail/releases"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"

related:
- name: "terraform-aws-cloudtrail-cloudwatch-alarms"
description: "Terraform module for creating alarms for tracking important changes and occurances from cloudtrail."
Expand All @@ -38,7 +30,6 @@ related:
- name: "terraform-aws-s3-log-storage"
description: "This module creates an S3 bucket suitable for receiving logs from other AWS services such as S3, CloudFront, and CloudTrail"
url: "https://github.com/cloudposse/terraform-aws-s3-log-storage"

# Short description of this project
description: |-
Terraform module to provision an AWS [CloudTrail](https://aws.amazon.com/cloudtrail/).
Expand All @@ -51,7 +42,6 @@ description: |-
In this case, you create CloudTrail in the production environment (production AWS account),
while the S3 bucket to store the CloudTrail logs is created in the Audit AWS account, restricting access to the logs only to the users/groups from the Audit account.
# How to use this project
usage: |-
```hcl
Expand Down Expand Up @@ -95,11 +85,9 @@ usage: |-
```
For a complete example, see [examples/complete](examples/complete).
include:
- "docs/targets.md"
- "docs/terraform.md"

# Contributors to this project
contributors:
- name: "Erik Osterman"
Expand Down
Loading

0 comments on commit c68c2b4

Please sign in to comment.