Skip to content

Commit

Permalink
fix attachment issues
Browse files Browse the repository at this point in the history
  • Loading branch information
timburke-hackit committed Oct 31, 2023
1 parent 64b7a8f commit b681cfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion terraform/modules/aws-lambda/30-lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ locals {

resource "aws_lambda_function" "lambda" {
function_name = lower("${var.identifier_prefix}-${var.lambda_name}")
role = var.lambda_role_arn == null ? aws_iam_role.lambda.arn : aws_iam_role.lambda.arnvar.lambda_role_arn
role = var.lambda_role_arn == null ? aws_iam_role.lambda_role.arn : var.lambda_role_arn
handler = var.handler
runtime = var.runtime
source_code_hash = data.archive_file.lambda.output_base64sha256
Expand Down
6 changes: 3 additions & 3 deletions terraform/modules/rds-snapshot-to-s3/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ data "aws_iam_policy_document" "lambda_assume_role" {

# RDS Snapshot to S3 lambda IAM
resource "aws_iam_role" "rds_snapshot_to_s3_lambda_role" {
name = "-rds-snapshot-to-s3-lambda-role"
name = "${var.identifier_prefix}-rds-snapshot-to-s3-lambda-role"
assume_role_policy = data.aws_iam_policy_document.lambda_assume_role.json
}

Expand Down Expand Up @@ -123,15 +123,15 @@ resource "aws_iam_policy" "rds_snapshot_to_s3_lambda_role_policy" {

resource "aws_iam_policy_attachment" "rds_snapshot_copier_attachment" {
name = "${var.identifier_prefix}-rds-snapshot-s3-to-s3-lambda-policy-attachment"
policy_arn = aws_iam_policy.rds_snapshot_s3_to_s3_copier_role_policy.arn
policy_arn = aws_iam_policy.rds_snapshot_to_s3_lambda_role_policy.arn
roles = [
aws_iam_role.rds_snapshot_to_s3_lambda_role.name
]
}

# S3 to S3 copier lambda IAM
resource "aws_iam_role" "rds_snapshot_s3_to_s3_copier_lambda_role" {
name = "-rds-snapshot-s3-to-s3-copier-lambda-role"
name = "${var.identifier_prefix}-rds-snapshot-s3-to-s3-copier-lambda-role"
assume_role_policy = data.aws_iam_policy_document.lambda_assume_role.json
}

Expand Down

0 comments on commit b681cfa

Please sign in to comment.