mirror of
https://github.com/inspec/inspec
synced 2024-12-13 14:52:39 +00:00
4394c5efc8
* Initial commit of new resource * Removes deprecated matcher in example * Adds a new terraform file for config resources * Fixes and clarifies documentation * Wraps calls to api in catch_aws_errors method * Changes the names of two matchers Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
36 lines
No EOL
861 B
HCL
36 lines
No EOL
861 B
HCL
#======================================================#
|
|
# Configuration Recorder
|
|
#======================================================#
|
|
|
|
resource "aws_config_configuration_recorder" "config_recorder" {
|
|
name = "config_recorder"
|
|
role_arn = "${aws_iam_role.role_for_config_recorder.arn}"
|
|
}
|
|
|
|
resource "aws_iam_role" "role_for_config_recorder" {
|
|
name = "role_for_config_recorder"
|
|
|
|
assume_role_policy = <<POLICY
|
|
{
|
|
"Version": "2012-10-17",
|
|
"Statement": [
|
|
{
|
|
"Action": "sts:AssumeRole",
|
|
"Principal": {
|
|
"Service": "config.amazonaws.com"
|
|
},
|
|
"Effect": "Allow",
|
|
"Sid": ""
|
|
}
|
|
]
|
|
}
|
|
POLICY
|
|
}
|
|
|
|
output "role_for_config_recorder_arn" {
|
|
value = "${aws_iam_role.role_for_config_recorder.arn}"
|
|
}
|
|
|
|
output "config_recorder_name" {
|
|
value = "${aws_config_configuration_recorder.config_recorder.name}"
|
|
} |