Skip to content

Commit

Permalink
CMS-11964 Allow lambda security groups to be upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
JoryUK committed Jun 30, 2020
1 parent d946080 commit 0f0751f
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -63,7 +63,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -59,7 +59,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -59,7 +59,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -59,7 +59,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down
7 changes: 5 additions & 2 deletions apps/lambda_function_scheduled_vpc/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -64,7 +64,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down
7 changes: 5 additions & 2 deletions apps/lambda_function_sns/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -67,7 +67,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down
7 changes: 5 additions & 2 deletions apps/lambda_function_sns_no_vpc/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -63,7 +63,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down
5 changes: 4 additions & 1 deletion apps/lambda_function_sns_shared_vpc/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_shared_data.vpc_id}"

Expand Down
7 changes: 5 additions & 2 deletions apps/lambda_function_sqs_vpc/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -74,7 +74,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down
7 changes: 5 additions & 2 deletions apps/lambda_function_vpc/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_s3_bucket_object" {
tags = "${local.tags}"
providers = {
aws = "aws"
}
}
}

resource "aws_lambda_function" "app" {
Expand Down Expand Up @@ -42,7 +42,10 @@ resource "aws_iam_role_policy" "iam_policy_for_app" {
}

resource "aws_security_group" "sg_for_app" {
name = "${var.app_name}"
name_prefix = "${var.app_name}-"
lifecycle {
create_before_destroy = true
}
description = "Allow all inbound traffic for the scheduled lambda function"
vpc_id = "${module.aws_core_data.vpc_id}"

Expand Down

0 comments on commit 0f0751f

Please sign in to comment.