Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tf_mod_aws_cloudtrail_ops
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
steamhaus
tf_mod_aws_cloudtrail_ops
Commits
a0d03932
Commit
a0d03932
authored
Dec 16, 2016
by
Chris Merrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup, added comments
parent
3cf85a3c
Pipeline
#775
passed with stage
in 6 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
main.tf
main.tf
+15
-0
No files found.
main.tf
View file @
a0d03932
#############################################################################################################
# Variables
#############################################################################################################
variable
"customer_name"
{
description
=
"Account canonical name"
}
...
...
@@ -12,6 +15,9 @@ variable "child_accounts" {
type
=
"list"
}
#############################################################################################################
# IAM Policy Documents
#############################################################################################################
data
"aws_iam_policy_document"
"main"
{
statement
{
sid
=
"AWSCloudTrailAclCheck"
...
...
@@ -62,18 +68,27 @@ data "aws_iam_policy_document" "main" {
}
}
#############################################################################################################
# S3
#############################################################################################################
resource
"aws_s3_bucket"
"main"
{
bucket
=
"
${
var
.
customer_name
}
-
${
var
.
environment
}
-cloudtrail"
force_destroy
=
true
policy
=
"
${data
.
aws_iam_policy_document
.
main
.
json
}
"
}
#############################################################################################################
# CloudTrail
#############################################################################################################
resource
"aws_cloudtrail"
"main"
{
name
=
"
${
var
.
customer_name
}
-
${
var
.
environment
}
-cloudtrail"
s3_bucket_name
=
"
${
aws_s3_bucket
.
main
.
id
}
"
include_global_service_events
=
true
}
#############################################################################################################
# Outputs
#############################################################################################################
output
"bucket_name"
{
value
=
"
${
aws_s3_bucket
.
main
.
id
}
"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment