All Projects → trussworks → terraform-aws-cloudtrail

trussworks / terraform-aws-cloudtrail

Licence: BSD-3-Clause license
Creates and configures AWS CloudTrail

Programming Languages

HCL
1544 projects
go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to terraform-aws-cloudtrail

terraform-aws-logs
Creates and configures an S3 bucket for storing AWS logs.
Stars: ✭ 69 (+72.5%)
Mutual labels:  aws-cloudtrail, terraform-modules
terraform-aws-enforce-mfa
A terraform module to enforce MFA for AWS groups and users
Stars: ✭ 24 (-40%)
Mutual labels:  terraform-modules
terraform-aws-iam-assumed-roles
Terraform Module for Assumed Roles on AWS with IAM Groups Requiring MFA
Stars: ✭ 33 (-17.5%)
Mutual labels:  terraform-modules
terraform-aws-cloudtrail-s3-bucket
S3 bucket with built in IAM policy to allow CloudTrail logs
Stars: ✭ 38 (-5%)
Mutual labels:  terraform-modules
terraform-aws-cognito-user-pool
A Terraform module to create and manage Cognito User Pools (Simple and Secure User Sign-Up, Sign-In, and Access Control) on Amazon Web Services (AWS). https://aws.amazon.com/cognito
Stars: ✭ 46 (+15%)
Mutual labels:  terraform-modules
terraform-aws-iam-system-user
Terraform Module to Provision a Basic IAM System User Suitable for CI/CD Systems (E.g. TravisCI, CircleCI)
Stars: ✭ 71 (+77.5%)
Mutual labels:  terraform-modules
terraform-aws-s3-anti-virus
Creates and configures Anti-Virus Scanning of S3 Buckets.
Stars: ✭ 31 (-22.5%)
Mutual labels:  terraform-modules
terraform-modules
Reusable Terraform modules
Stars: ✭ 12 (-70%)
Mutual labels:  terraform-modules
terraform-aws-lambda-function
A Terraform module for deploying and managing Lambda functions on Amazon Web Services (AWS). https://aws.amazon.com/lambda/
Stars: ✭ 37 (-7.5%)
Mutual labels:  terraform-modules
terraform-digitalocean-kubernetes
A terraform module for managing and creating a Kubernetes cluster on digital ocean
Stars: ✭ 11 (-72.5%)
Mutual labels:  terraform-modules
terraform-aws-acm-request-certificate
Terraform module to request an ACM certificate for a domain name and create a CNAME record in the DNS zone to complete certificate validation
Stars: ✭ 83 (+107.5%)
Mutual labels:  terraform-modules
db-sharding
Oracle Sharded database deployment automation and tools for use in client applications.
Stars: ✭ 30 (-25%)
Mutual labels:  terraform-modules
terraform-aws-minikube
Terraform module for single node Kubernetes instance bootstrapped using kubeadm
Stars: ✭ 58 (+45%)
Mutual labels:  terraform-modules
terraform-aws-route53
A Terraform module to create a Route53 Domain Name System (DNS) on Amazon Web Services (AWS). https://aws.amazon.com/route53/
Stars: ✭ 39 (-2.5%)
Mutual labels:  terraform-modules
terraform-modules
Terraform Modules by Peak
Stars: ✭ 16 (-60%)
Mutual labels:  terraform-modules
terraform-aws-route53-cluster-hostname
Terraform module to define a consistent AWS Route53 hostname
Stars: ✭ 44 (+10%)
Mutual labels:  terraform-modules
terraform-aws-redis-elasticache
A Terraform module to create an Amazon Web Services (AWS) Redis ElastiCache cluster.
Stars: ✭ 33 (-17.5%)
Mutual labels:  terraform-modules
terraform-aws-ec2-instance
Terraform module for provisioning a general purpose EC2 host
Stars: ✭ 123 (+207.5%)
Mutual labels:  terraform-modules
terraform-aws-vpc
A Terraform module to create an Amazon Web Services (AWS) Virtual Private Cloud (VPC).
Stars: ✭ 24 (-40%)
Mutual labels:  terraform-modules
terraform-aws-pritunl-vpn-server
Pritunl VPN Server for your public/private like VPC on AWS
Stars: ✭ 40 (+0%)
Mutual labels:  terraform-modules

Terraform AWS CloudTrail

This module creates AWS CloudTrail and configures it so that logs go to cloudwatch.

Terraform Versions

Terraform 0.13 and newer. Pin module version to ~> 4.X. Submit pull-requests to master branch.

Terraform 0.12. Pin module version to ~> 3.X. Submit pull-requests to terraform12 branch.

Usage

module "aws_cloudtrail" {
    source             = "trussworks/cloudtrail/aws"
    s3_bucket_name     = "my-company-cloudtrail-logs"
    log_retention_days = 90
}

Upgrade Instructions for v2 -> v3

Starting in v3, encryption is not optional and will be on for both logs delivered to S3 and Cloudwatch Logs. The KMS key resource created this module will be used to encrypt both S3 and Cloudwatch-based logs.

Because of this change, remove the encrypt_cloudtrail parameter from previous invocations of the module prior to upgrading the version.

Requirements

Name Version
terraform >= 0.13.0
aws >= 3.0

Providers

Name Version
aws >= 3.0

Modules

No modules.

Resources

Name Type
aws_cloudtrail.main resource
aws_cloudwatch_log_group.cloudtrail resource
aws_iam_policy.cloudtrail_cloudwatch_logs resource
aws_iam_policy_attachment.main resource
aws_iam_role.cloudtrail_cloudwatch_role resource
aws_kms_alias.cloudtrail resource
aws_kms_key.cloudtrail resource
aws_caller_identity.current data source
aws_iam_policy_document.cloudtrail_assume_role data source
aws_iam_policy_document.cloudtrail_cloudwatch_logs data source
aws_iam_policy_document.cloudtrail_kms_policy_doc data source
aws_partition.current data source
aws_region.current data source

Inputs

Name Description Type Default Required
cloudwatch_log_group_name The name of the CloudWatch Log Group that receives CloudTrail events. string "cloudtrail-events" no
enabled Enables logging for the trail. Defaults to true. Setting this to false will pause logging. bool true no
iam_policy_name Name for the CloudTrail IAM policy string "cloudtrail-cloudwatch-logs-policy" no
iam_role_name Name for the CloudTrail IAM role string "cloudtrail-cloudwatch-logs-role" no
key_deletion_window_in_days Duration in days after which the key is deleted after destruction of the resource, must be 7-30 days. Default 30 days. string 30 no
log_retention_days Number of days to keep AWS logs around in specific log group. string 90 no
org_trail Whether or not this is an organization trail. Only valid in master account. string "false" no
s3_bucket_name The name of the AWS S3 bucket. string n/a yes
s3_key_prefix S3 key prefix for CloudTrail logs string "cloudtrail" no
tags A mapping of tags to CloudTrail resources. map(string)
{
"Automation": "Terraform"
}
no
trail_name Name for the Cloudtrail string "cloudtrail" no

Outputs

Name Description
cloudtrail_arn CloudTrail ARN
cloudtrail_home_region CloudTrail Home Region
cloudtrail_id CloudTrail ID

Developer Setup

Install dependencies (macOS)

brew install pre-commit go terraform terraform-docs

Testing

Terratest is being used for automated testing with this module. Tests in the test folder can be run locally by running the following command:

make test

Or with aws-vault:

AWS_VAULT_KEYCHAIN_NAME=<NAME> aws-vault exec <PROFILE> -- make test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].