Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tf_mod_aws_elasticsearch_cleanup
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_elasticsearch_cleanup
Commits
e3b32928
Commit
e3b32928
authored
Oct 28, 2020
by
Nicky White
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Terraform 0.12.29
parent
abda3911
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
59 additions
and
32 deletions
+59
-32
lock.json
.terraform/plugins/darwin_amd64/lock.json
+5
-0
terraform-provider-archive_v2.0.0_x5
...plugins/darwin_amd64/terraform-provider-archive_v2.0.0_x5
+0
-0
terraform-provider-aws_v3.12.0_x5
...rm/plugins/darwin_amd64/terraform-provider-aws_v3.12.0_x5
+0
-0
terraform-provider-template_v2.2.0_x4
...lugins/darwin_amd64/terraform-provider-template_v2.2.0_x4
+0
-0
cloudwatch.tf
cloudwatch.tf
+6
-5
iam.tf
iam.tf
+6
-4
lambda.tf
lambda.tf
+16
-15
variables.tf
variables.tf
+22
-8
versions.tf
versions.tf
+4
-0
No files found.
.terraform/plugins/darwin_amd64/lock.json
0 → 100755
View file @
e3b32928
{
"archive"
:
"2d74818e7deb7a1df699f3725399d058587c2bce45306360d7d210b871444d48"
,
"aws"
:
"42f7948de981929bc60f1a6e1c83b14944a2556a3748fb3f5ea03dbc02bdefc6"
,
"template"
:
"c141e1d7b44ba18a20d48dc1c4367422a1a14cffab3df43bfe5befeb3a20e89c"
}
\ No newline at end of file
.terraform/plugins/darwin_amd64/terraform-provider-archive_v2.0.0_x5
0 → 100755
View file @
e3b32928
File added
.terraform/plugins/darwin_amd64/terraform-provider-aws_v3.12.0_x5
0 → 100755
View file @
e3b32928
File added
.terraform/plugins/darwin_amd64/terraform-provider-template_v2.2.0_x4
0 → 100755
View file @
e3b32928
File added
cloudwatch.tf
View file @
e3b32928
resource
"aws_cloudwatch_event_rule"
"schedule"
{
resource
"aws_cloudwatch_event_rule"
"schedule"
{
name
=
"
${
var
.
prefix
}
es-cleanup-execution-schedule"
name
=
"
${
var
.
prefix
}
es-cleanup-execution-schedule"
description
=
"es-cleanup execution schedule"
description
=
"es-cleanup execution schedule"
schedule_expression
=
"
${
var
.
schedule
}
"
schedule_expression
=
var
.
schedule
}
}
resource
"aws_cloudwatch_event_target"
"es_cleanup"
{
resource
"aws_cloudwatch_event_target"
"es_cleanup"
{
target_id
=
"
${
var
.
prefix
}
lambda-es-cleanup"
target_id
=
"
${
var
.
prefix
}
lambda-es-cleanup"
rule
=
"
${
aws_cloudwatch_event_rule
.
schedule
.
name
}
"
rule
=
aws_cloudwatch_event_rule
.
schedule
.
name
arn
=
"
${
aws_lambda_function
.
es_cleanup
.
arn
}
"
arn
=
aws_lambda_function
.
es_cleanup
.
arn
}
}
resource
"aws_lambda_permission"
"allow_cloudwatch"
{
resource
"aws_lambda_permission"
"allow_cloudwatch"
{
statement_id
=
"AllowExecutionFromCloudWatch"
statement_id
=
"AllowExecutionFromCloudWatch"
action
=
"lambda:InvokeFunction"
action
=
"lambda:InvokeFunction"
function_name
=
"
${
aws_lambda_function
.
es_cleanup
.
arn
}
"
function_name
=
aws_lambda_function
.
es_cleanup
.
arn
principal
=
"events.amazonaws.com"
principal
=
"events.amazonaws.com"
source_arn
=
"
${
aws_cloudwatch_event_rule
.
schedule
.
arn
}
"
source_arn
=
aws_cloudwatch_event_rule
.
schedule
.
arn
}
}
iam.tf
View file @
e3b32928
data
"template_file"
"policy"
{
data
"template_file"
"policy"
{
template
=
"
${
file
(
"
${
path
.
module}
/files/es_policy.json"
)
}
"
template
=
file
(
"
${
path
.
module}
/files/es_policy.json"
)
}
}
resource
"aws_iam_policy"
"policy"
{
resource
"aws_iam_policy"
"policy"
{
name
=
"
${
var
.
prefix
}
es-cleanup"
name
=
"
${
var
.
prefix
}
es-cleanup"
path
=
"/"
path
=
"/"
description
=
"Policy for es-cleanup Lambda function"
description
=
"Policy for es-cleanup Lambda function"
policy
=
"
${data
.
template_file
.
policy
.
rendered
}
"
policy
=
data
.
template_file
.
policy
.
rendered
}
}
resource
"aws_iam_role"
"role"
{
resource
"aws_iam_role"
"role"
{
...
@@ -26,9 +26,11 @@ resource "aws_iam_role" "role" {
...
@@ -26,9 +26,11 @@ resource "aws_iam_role" "role" {
]
]
}
}
EOF
EOF
}
}
resource
"aws_iam_role_policy_attachment"
"policy_attachment"
{
resource
"aws_iam_role_policy_attachment"
"policy_attachment"
{
role
=
"
${
aws_iam_role
.
role
.
name
}
"
role
=
aws_iam_role
.
role
.
name
policy_arn
=
"
${
aws_iam_policy
.
policy
.
arn
}
"
policy_arn
=
aws_iam_policy
.
policy
.
arn
}
}
lambda.tf
View file @
e3b32928
...
@@ -5,21 +5,22 @@ data "archive_file" "es_cleanup_lambda" {
...
@@ -5,21 +5,22 @@ data "archive_file" "es_cleanup_lambda" {
}
}
resource
"aws_lambda_function"
"es_cleanup"
{
resource
"aws_lambda_function"
"es_cleanup"
{
filename
=
"
${
path
.
module}
/es-cleanup.zip"
filename
=
"
${
path
.
module}
/es-cleanup.zip"
function_name
=
"
${
var
.
prefix
}
es-cleanup"
function_name
=
"
${
var
.
prefix
}
es-cleanup"
timeout
=
300
timeout
=
300
runtime
=
"python
${
var
.
python_version
}
"
runtime
=
"python
${
var
.
python_version
}
"
role
=
"
${
aws_iam_role
.
role
.
arn
}
"
role
=
aws_iam_role
.
role
.
arn
handler
=
"es-cleanup.lambda_handler"
handler
=
"es-cleanup.lambda_handler"
source_code_hash
=
"
${data
.
archive_file
.
es_cleanup_lambda
.
output_base64sha256
}
"
source_code_hash
=
data
.
archive_file
.
es_cleanup_lambda
.
output_base64sha256
environment
{
environment
{
variables
=
{
variables
=
{
es_endpoint
=
"
${
var
.
es_endpoint
}
"
es_endpoint
=
var
.
es_endpoint
index
=
"
${
var
.
index
}
"
index
=
var
.
index
delete_after
=
"
${
var
.
delete_after
}
"
delete_after
=
var
.
delete_after
index_format
=
"
${
var
.
index_format
}
"
index_format
=
var
.
index_format
sns_alert
=
"
${
var
.
sns_alert
}
"
sns_alert
=
var
.
sns_alert
}
}
}
}
}
}
variables.tf
View file @
e3b32928
variable
"prefix"
{
default
=
""
}
variable
"prefix"
{
default
=
""
}
variable
"schedule"
{
default
=
"cron(0 3 * * ? *)"
}
variable
"schedule"
{
default
=
"cron(0 3 * * ? *)"
}
variable
"sns_alert"
{
default
=
""
}
variable
"sns_alert"
{
default
=
""
}
variable
"es_endpoint"
{}
variable
"es_endpoint"
{
}
variable
"index"
{}
variable
"index"
{
}
variable
"delete_after"
{
default
=
7
}
variable
"delete_after"
{
default
=
7
}
variable
"index_format"
{}
variable
"index_format"
{
}
variable
"python_version"
{
default
=
"2.7"
}
variable
"python_version"
{
default
=
"2.7"
}
versions.tf
0 → 100644
View file @
e3b32928
terraform
{
required_version
=
">= 0.12"
}
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