mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
combine s3 write policies into one and apply to pashub and magicplan lambdas
This commit is contained in:
parent
1243690d10
commit
aadf73ed87
3 changed files with 7 additions and 20 deletions
|
|
@ -17,7 +17,7 @@ locals {
|
||||||
|
|
||||||
resource "aws_iam_role_policy_attachment" "magic_plan_s3_write" {
|
resource "aws_iam_role_policy_attachment" "magic_plan_s3_write" {
|
||||||
role = module.lambda.role_name
|
role = module.lambda.role_name
|
||||||
policy_arn = data.terraform_remote_state.shared.outputs.magic_plan_s3_write_arn
|
policy_arn = data.terraform_remote_state.shared.outputs.energy_assessments_s3_write_arn
|
||||||
}
|
}
|
||||||
|
|
||||||
module "lambda" {
|
module "lambda" {
|
||||||
|
|
|
||||||
|
|
@ -54,5 +54,5 @@ module "lambda" {
|
||||||
|
|
||||||
resource "aws_iam_role_policy_attachment" "pashub_to_ara_s3_write" {
|
resource "aws_iam_role_policy_attachment" "pashub_to_ara_s3_write" {
|
||||||
role = module.lambda.role_name
|
role = module.lambda.role_name
|
||||||
policy_arn = data.terraform_remote_state.shared.outputs.pashub_to_ara_s3_write_arn
|
policy_arn = data.terraform_remote_state.shared.outputs.energy_assessments_s3_write_arn
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -568,18 +568,18 @@ module "pashub_to_ara_registry" {
|
||||||
stage = var.stage
|
stage = var.stage
|
||||||
}
|
}
|
||||||
|
|
||||||
module "pashub_to_ara_s3_write" {
|
module "energy_assessments_s3_write" {
|
||||||
source = "../modules/s3_iam_policy"
|
source = "../modules/s3_iam_policy"
|
||||||
|
|
||||||
policy_name = "PashubToAraWriteS3"
|
policy_name = "EnergyAssessmentsWriteS3"
|
||||||
policy_description = "Allow PasHub to ARA Lambda to write to retrofit energy assessments bucket"
|
policy_description = "Allow lambdas to write to retrofit energy assessments bucket"
|
||||||
bucket_arns = ["arn:aws:s3:::retrofit-energy-assessments-${var.stage}"]
|
bucket_arns = ["arn:aws:s3:::retrofit-energy-assessments-${var.stage}"]
|
||||||
actions = ["s3:PutObject", "s3:AbortMultipartUpload"]
|
actions = ["s3:PutObject", "s3:AbortMultipartUpload"]
|
||||||
resource_paths = ["/*"]
|
resource_paths = ["/*"]
|
||||||
}
|
}
|
||||||
|
|
||||||
output "pashub_to_ara_s3_write_arn" {
|
output "energy_assessments_s3_write_arn" {
|
||||||
value = module.pashub_to_ara_s3_write.policy_arn
|
value = module.energy_assessments_s3_write.policy_arn
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
|
|
@ -747,16 +747,3 @@ module "magic_plan_client_registry" {
|
||||||
stage = var.stage
|
stage = var.stage
|
||||||
}
|
}
|
||||||
|
|
||||||
module "magic_plan_s3_write" {
|
|
||||||
source = "../modules/s3_iam_policy"
|
|
||||||
|
|
||||||
policy_name = "MagicPlanWriteS3"
|
|
||||||
policy_description = "Allow MagicPlan Lambda to write to retrofit energy assessments bucket"
|
|
||||||
bucket_arns = ["arn:aws:s3:::retrofit-energy-assessments-${var.stage}"]
|
|
||||||
actions = ["s3:PutObject", "s3:AbortMultipartUpload"]
|
|
||||||
resource_paths = ["/*"]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "magic_plan_s3_write_arn" {
|
|
||||||
value = module.magic_plan_s3_write.policy_arn
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue