diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ac2d191..63ff487a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [0.6.4] - 2017-05-03 +### Changed +- Renamed improperly named file in the elasticache_redis module +- Updated main.tf in all modules to follow the same structure +- Added iam role arn output for all the lambda modules +#### Added +- added plain lambda function module + ## [0.6.3] - 2017-04-21 ### Added - Added variable for overriding the destruction of the rds resource flag protection @@ -131,7 +139,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - Initial commit -[Unreleased]: https://github.com/albumprinter/eops_tf_modules/compare/v0.6.3..HEAD +[Unreleased]: https://github.com/albumprinter/eops_tf_modules/compare/v0.6.4..HEAD +[0.6.3]: https://github.com/albumprinter/eops_tf_modules/compare/v0.6.3...v0.6.4 [0.6.3]: https://github.com/albumprinter/eops_tf_modules/compare/v0.6.2...v0.6.3 [0.6.2]: https://github.com/albumprinter/eops_tf_modules/compare/v0.6.1...v0.6.2 [0.6.1]: https://github.com/albumprinter/eops_tf_modules/compare/v0.6.0...v0.6.1 diff --git a/apps/elasticache_redis/ecs.tf b/apps/elasticache_redis/redis.tf similarity index 100% rename from apps/elasticache_redis/ecs.tf rename to apps/elasticache_redis/redis.tf diff --git a/apps/lambda_function/README.md b/apps/lambda_function/README.md new file mode 100644 index 00000000..afc76c2f --- /dev/null +++ b/apps/lambda_function/README.md @@ -0,0 +1,22 @@ +# Description +An example terraform module to build simple application as aws lambda function triggered by cloudwatch event scheduleder. + +## Code Example + +```hcl-terraform +module "lambda_app" { + source = "git@github.com:albumprinter/eops_tf_modules.git//apps/lambda_function_scheduled??ref={TAG_VERSION}" # for eg. {TAG_VERSION} = v0.3.0 + app_name = "sample_lambda_app_name" + description = "Description for this sample app" + handler = "myHandler" + filename = "filename.zip" + schedule_expression = "rate(5 minutes)" // optional For example, "rate(5 minutes)" or "cron(0 20 * * ? *)" + environment = "" + variables = "" // optional + runtime = "dotnetcore1.0" // optional default:nodejs | nodejs4.3 | java8 | python2.7 | dotnetcore1.0 | nodejs4.3-edge + memory_size = "128" //optional + timeout = "3" // optional + enabled = 1 // optional avail options: 1 | 0 + private = false // optional +} +``` \ No newline at end of file diff --git a/apps/lambda_function/lambda.tf b/apps/lambda_function/lambda.tf new file mode 100644 index 00000000..23ba5300 --- /dev/null +++ b/apps/lambda_function/lambda.tf @@ -0,0 +1,41 @@ +resource "aws_lambda_function" "app" { + function_name = "${var.app_name}" + description = "${var.description}" + role = "${aws_iam_role.iam_for_app.arn}" + s3_bucket = "cd-pipeline-${var.tags_team}-${var.account_type}" + s3_key = "builds/lambda/${var.app_name}.zip" + // s3_object_version = "$LATEST" + handler = "${var.handler}" + runtime = "${var.runtime}" + memory_size = "${var.memory_size}" + timeout = "${var.timeout}" + environment { + variables = "${var.variables}" + } + count = "${var.enabled}" +} + +resource "aws_iam_role" "iam_for_app" { + name = "${var.app_name}" + assume_role_policy = <