-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from zoitech/add_variables
Add variables
- Loading branch information
Showing
3 changed files
with
93 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# terraform-aws-config | ||
|
||
This is a terraform module for enabling and configuring AWS Config. | ||
|
||
## Description | ||
|
||
AWS Config rules will be set up in the account to check on the following things: | ||
|
||
* Resource Tagging | ||
* Checks if the resources in your account are tagged properly | ||
* Access Key Rotation | ||
* RDS Instances without backups enabled | ||
* EC2 Instances with Public IP addresses enabled | ||
* ElasticSearch outside a VPC | ||
* Logging enabled for all LoadBalancers | ||
* Root User with access and secret key | ||
* RDS Instances with Public access | ||
* S3 Buckets configured as a static WebServer | ||
* IAM Users with Console Login enabled | ||
|
||
## Usage | ||
|
||
The following default values are set: | ||
|
||
* accessKeyRotate_maxAccessKeyAge = 30 | ||
* dbInstanceBackupEnabled_RetentionPeriod = 30 | ||
* dbInstanceBackupEnabled_PreferredBackupWindow = "22:00-24:00" | ||
* dbInstanceBackupEnabled_CheckReadReplicas = true | ||
* elbLoggingEnabled_s3BucketNames = "backup" | ||
* lambda_timeout = 30 | ||
|
||
```hcl | ||
module "aws-config" { | ||
source = "git::https://github.com/zoitech/terraform-aws-config.git?ref=v1.0.0" | ||
accessKeyRotate_maxAccessKeyAge = 180 | ||
dbInstanceBackupEnabled_RetentionPeriod = 90 | ||
dbInstanceBackupEnabled_PreferredBackupWindow = "23:00-01:00" | ||
dbInstanceBackupEnabled_CheckReadReplicas = true | ||
elbLoggingEnabled_s3BucketNames = "backup" | ||
lambda_timeout = 60 | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# aws_config_organization_managed_rule - resourcesTagged | ||
variable required_tags { | ||
# https://docs.aws.amazon.com/config/latest/developerguide/required-tags.html | ||
description = "A map of the required tag keys and/or values to evaluate" | ||
type = map(string) | ||
default = { | ||
"tag1Key" : "owner" | ||
} | ||
} | ||
|
||
# aws_config_organization_managed_rule - accessKeyRotated | ||
variable accessKeyRotated_maxAccessKeyAge { | ||
description = "Every Access Key will be defined as Non-Compliant after exceeding the number of days defined in this variable" | ||
default = 30 | ||
} | ||
|
||
# aws_config_organization_managed_rule - dbInstanceBackupEnabled | ||
variable dbInstanceBackupEnabled_RetentionPeriod { | ||
description = "The retention period in days for the RDS Databases to check" | ||
default = 30 | ||
} | ||
|
||
variable dbInstanceBackupEnabled_PreferredBackupWindow { | ||
description = "The format is hh24:min-hh24:min. Example: 23:00-02:00" | ||
default = "22:00-24:00" | ||
} | ||
|
||
variable dbInstanceBackupEnabled_CheckReadReplicas { | ||
description = "Defines if AWS Config should Check if the RDS instance has backups enabled for the ReadReplicas" | ||
default = true | ||
} | ||
|
||
# aws_config_organization_managed_rule - elbLoggingEnabled | ||
variable elbLoggingEnabled_s3BucketNames { | ||
description = "Comma separated list of S3 bucket names for ELB to deliver the log files" | ||
default = "backup" | ||
} | ||
|
||
# aws_lambda_function - s3_webserver_buckets | ||
variable lambda_timeout { | ||
description = "The timeout for the custom lambda scripts which define more custom AWS Config rules" | ||
default = 30 | ||
} |