formatting
This commit is contained in:
parent
df7ac2d51b
commit
73064bcb87
|
@ -95,8 +95,9 @@ func testAccCheckAwsLambdaAttributes(mapping *lambda.AliasConfiguration) resourc
|
||||||
|
|
||||||
const testAccAwsLambdaAliasConfig = `
|
const testAccAwsLambdaAliasConfig = `
|
||||||
resource "aws_iam_role" "iam_for_lambda" {
|
resource "aws_iam_role" "iam_for_lambda" {
|
||||||
name = "iam_for_lambda"
|
name = "iam_for_lambda"
|
||||||
assume_role_policy = <<EOF
|
|
||||||
|
assume_role_policy = <<EOF
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
"Statement": [
|
"Statement": [
|
||||||
|
@ -112,11 +113,13 @@ resource "aws_iam_role" "iam_for_lambda" {
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_iam_policy" "policy_for_role" {
|
resource "aws_iam_policy" "policy_for_role" {
|
||||||
name = "policy_for_role"
|
name = "policy_for_role"
|
||||||
path = "/"
|
path = "/"
|
||||||
description = "IAM policy for for Lamda alias testing"
|
description = "IAM policy for for Lamda alias testing"
|
||||||
policy = <<EOF
|
|
||||||
|
policy = <<EOF
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
"Statement": [
|
"Statement": [
|
||||||
|
@ -131,21 +134,24 @@ resource "aws_iam_policy" "policy_for_role" {
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_iam_policy_attachment" "policy_attachment_for_role" {
|
resource "aws_iam_policy_attachment" "policy_attachment_for_role" {
|
||||||
name = "policy_attachment_for_role"
|
name = "policy_attachment_for_role"
|
||||||
roles = ["${aws_iam_role.iam_for_lambda.name}"]
|
roles = ["${aws_iam_role.iam_for_lambda.name}"]
|
||||||
policy_arn = "${aws_iam_policy.policy_for_role.arn}"
|
policy_arn = "${aws_iam_policy.policy_for_role.arn}"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_lambda_function" "lambda_function_test_create" {
|
resource "aws_lambda_function" "lambda_function_test_create" {
|
||||||
filename = "test-fixtures/lambdatest.zip"
|
filename = "test-fixtures/lambdatest.zip"
|
||||||
function_name = "example_lambda_name_create"
|
function_name = "example_lambda_name_create"
|
||||||
role = "${aws_iam_role.iam_for_lambda.arn}"
|
role = "${aws_iam_role.iam_for_lambda.arn}"
|
||||||
handler = "exports.example"
|
handler = "exports.example"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_lambda_alias" "lambda_alias_test" {
|
resource "aws_lambda_alias" "lambda_alias_test" {
|
||||||
name = "testalias"
|
name = "testalias"
|
||||||
description = "a sample description"
|
description = "a sample description"
|
||||||
function_name = "${aws_lambda_function.lambda_function_test_create.arn}"
|
function_name = "${aws_lambda_function.lambda_function_test_create.arn}"
|
||||||
function_version = "$LATEST"
|
function_version = "$LATEST"
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in New Issue