diff --git a/aws/resource_aws_secretsmanager_secret_rotation_test.go b/aws/resource_aws_secretsmanager_secret_rotation_test.go index ce71a841111..df5f8892c68 100644 --- a/aws/resource_aws_secretsmanager_secret_rotation_test.go +++ b/aws/resource_aws_secretsmanager_secret_rotation_test.go @@ -124,15 +124,15 @@ resource "aws_lambda_function" "test1" { filename = "test-fixtures/lambdatest.zip" function_name = "%[1]s-1" handler = "exports.example" - role = "${aws_iam_role.iam_for_lambda.arn}" + role = aws_iam_role.iam_for_lambda.arn runtime = "nodejs12.x" } resource "aws_lambda_permission" "test1" { - action = "lambda:InvokeFunction" - function_name = "${aws_lambda_function.test1.function_name}" - principal = "secretsmanager.amazonaws.com" - statement_id = "AllowExecutionFromSecretsManager1" + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test1.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager1" } # Not a real rotation function @@ -140,15 +140,15 @@ resource "aws_lambda_function" "test2" { filename = "test-fixtures/lambdatest.zip" function_name = "%[1]s-2" handler = "exports.example" - role = "${aws_iam_role.iam_for_lambda.arn}" + role = aws_iam_role.iam_for_lambda.arn runtime = "nodejs12.x" } resource "aws_lambda_permission" "test2" { - action = "lambda:InvokeFunction" - function_name = "${aws_lambda_function.test2.function_name}" - principal = "secretsmanager.amazonaws.com" - statement_id = "AllowExecutionFromSecretsManager2" + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test2.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager2" } resource "aws_secretsmanager_secret" "test" { @@ -156,14 +156,14 @@ resource "aws_secretsmanager_secret" "test" { } resource "aws_secretsmanager_secret_rotation" "test" { - secret_id = "${aws_secretsmanager_secret.test.id}" - rotation_lambda_arn = "${aws_lambda_function.test1.arn}" + secret_id = aws_secretsmanager_secret.test.id + rotation_lambda_arn = aws_lambda_function.test1.arn - rotation_rules { + rotation_rules { automatically_after_days = %[2]d - } + } - depends_on = [aws_lambda_permission.test1] + depends_on = [aws_lambda_permission.test1] } `, rName, automaticallyAfterDays) } diff --git a/aws/resource_aws_secretsmanager_secret_test.go b/aws/resource_aws_secretsmanager_secret_test.go index bfeac1fc9cc..3a41718d422 100644 --- a/aws/resource_aws_secretsmanager_secret_test.go +++ b/aws/resource_aws_secretsmanager_secret_test.go @@ -555,7 +555,7 @@ resource "aws_kms_key" "test2" { } resource "aws_secretsmanager_secret" "test" { - kms_key_id = "${aws_kms_key.test1.id}" + kms_key_id = aws_kms_key.test1.id name = "%s" } `, rName) @@ -572,7 +572,7 @@ resource "aws_kms_key" "test2" { } resource "aws_secretsmanager_secret" "test" { - kms_key_id = "${aws_kms_key.test2.id}" + kms_key_id = aws_kms_key.test2.id name = "%s" } `, rName) @@ -591,7 +591,7 @@ func testAccAwsSecretsManagerSecretConfig_RotationLambdaARN(rName string) string return baseAccAWSLambdaConfig(rName, rName, rName) + fmt.Sprintf(` resource "aws_secretsmanager_secret" "test" { name = "%[1]s" - rotation_lambda_arn = "${aws_lambda_function.test1.arn}" + rotation_lambda_arn = aws_lambda_function.test1.arn depends_on = [aws_lambda_permission.test1] } @@ -601,15 +601,15 @@ resource "aws_lambda_function" "test1" { filename = "test-fixtures/lambdatest.zip" function_name = "%[1]s-1" handler = "exports.example" - role = "${aws_iam_role.iam_for_lambda.arn}" + role = aws_iam_role.iam_for_lambda.arn runtime = "nodejs12.x" } resource "aws_lambda_permission" "test1" { - action = "lambda:InvokeFunction" - function_name = "${aws_lambda_function.test1.function_name}" - principal = "secretsmanager.amazonaws.com" - statement_id = "AllowExecutionFromSecretsManager1" + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test1.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager1" } # Not a real rotation function @@ -617,15 +617,15 @@ resource "aws_lambda_function" "test2" { filename = "test-fixtures/lambdatest.zip" function_name = "%[1]s-2" handler = "exports.example" - role = "${aws_iam_role.iam_for_lambda.arn}" + role = aws_iam_role.iam_for_lambda.arn runtime = "nodejs12.x" } resource "aws_lambda_permission" "test2" { - action = "lambda:InvokeFunction" - function_name = "${aws_lambda_function.test2.function_name}" - principal = "secretsmanager.amazonaws.com" - statement_id = "AllowExecutionFromSecretsManager2" + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test2.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager2" } `, rName) } @@ -637,20 +637,20 @@ resource "aws_lambda_function" "test" { filename = "test-fixtures/lambdatest.zip" function_name = "%[1]s" handler = "exports.example" - role = "${aws_iam_role.iam_for_lambda.arn}" + role = aws_iam_role.iam_for_lambda.arn runtime = "nodejs12.x" } resource "aws_lambda_permission" "test" { - action = "lambda:InvokeFunction" - function_name = "${aws_lambda_function.test.function_name}" - principal = "secretsmanager.amazonaws.com" - statement_id = "AllowExecutionFromSecretsManager1" + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager1" } resource "aws_secretsmanager_secret" "test" { name = "%[1]s" - rotation_lambda_arn = "${aws_lambda_function.test.arn}" + rotation_lambda_arn = aws_lambda_function.test.arn rotation_rules { automatically_after_days = %[2]d @@ -701,9 +701,9 @@ resource "aws_secretsmanager_secret" "test" { func testAccAwsSecretsManagerSecretConfig_Policy(rName string) string { return fmt.Sprintf(` resource "aws_iam_role" "test" { - name = %[1]q + name = %[1]q - assume_role_policy = <