Skip to content

Commit a51e4d6

Browse files
committed
refactor(terraform): apply terraform fmt
The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style. This command applies a subset of the Terraform language style conventions, along with other minor adjustments for readability. This commit apply terraform fmt command to fix deprecated interpolation syntax and code indentation. #12
1 parent 68a2827 commit a51e4d6

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

main.tf

+21-21
Original file line numberDiff line numberDiff line change
@@ -182,37 +182,37 @@ EOF
182182

183183
locals {
184184
lambda_logging_policy = {
185-
"Version": "2012-10-17",
186-
"Statement": [
185+
"Version" : "2012-10-17",
186+
"Statement" : [
187187
{
188-
"Action": [
188+
"Action" : [
189189
"logs:CreateLogStream",
190190
"logs:PutLogEvents"
191191
],
192-
"Resource": "${aws_cloudwatch_log_group.this.arn}",
193-
"Effect": "Allow"
192+
"Resource" : aws_cloudwatch_log_group.this.arn,
193+
"Effect" : "Allow"
194194
}
195195
]
196196
}
197197
lambda_logging_and_kms_policy = {
198-
"Version": "2012-10-17",
199-
"Statement": [
198+
"Version" : "2012-10-17",
199+
"Statement" : [
200200
{
201-
"Action": [
201+
"Action" : [
202202
"logs:CreateLogStream",
203203
"logs:PutLogEvents"
204204
],
205-
"Resource": "${aws_cloudwatch_log_group.this.arn}",
206-
"Effect": "Allow"
205+
"Resource" : aws_cloudwatch_log_group.this.arn,
206+
"Effect" : "Allow"
207207
},
208208
{
209-
"Action": [
209+
"Action" : [
210210
"kms:Encrypt",
211211
"kms:Decrypt",
212212
"kms:CreateGrant"
213213
],
214-
"Resource": "${var.kms_key_arn}",
215-
"Effect": "Allow"
214+
"Resource" : var.kms_key_arn,
215+
"Effect" : "Allow"
216216
}
217217
]
218218
}
@@ -235,18 +235,18 @@ resource "aws_iam_role_policy" "lambda_logging" {
235235
data "archive_file" "this" {
236236
type = "zip"
237237
source_dir = "${path.module}/package/"
238-
output_path = "${path.module}/aws-stop-start-resources-3.0.1.zip" # The version should match with the latest git tag
238+
output_path = "${path.module}/aws-stop-start-resources-3.0.1.zip" # The version should match with the latest git tag
239239
}
240240

241241
# Create Lambda function for stop or start aws resources
242242
resource "aws_lambda_function" "this" {
243-
filename = data.archive_file.this.output_path
244-
function_name = var.name
245-
role = var.custom_iam_role_arn == null ? aws_iam_role.this[0].arn : var.custom_iam_role_arn
246-
handler = "scheduler.main.lambda_handler"
247-
runtime = "python3.7"
248-
timeout = "600"
249-
kms_key_arn = var.kms_key_arn == null ? "" : var.kms_key_arn
243+
filename = data.archive_file.this.output_path
244+
function_name = var.name
245+
role = var.custom_iam_role_arn == null ? aws_iam_role.this[0].arn : var.custom_iam_role_arn
246+
handler = "scheduler.main.lambda_handler"
247+
runtime = "python3.7"
248+
timeout = "600"
249+
kms_key_arn = var.kms_key_arn == null ? "" : var.kms_key_arn
250250

251251
environment {
252252
variables = {

variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ variable "cloudwatch_alarm_schedule" {
7474

7575
variable "tags" {
7676
description = "Custom tags on lambda"
77-
type = map
78-
default = null
77+
type = map(any)
78+
default = null
7979
}

0 commit comments

Comments
 (0)