mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
added new files
This commit is contained in:
parent
ffb840da81
commit
203843c387
4 changed files with 76 additions and 0 deletions
14
infrastructure/terraform/lambda/address2UPRN/outputs.tf
Normal file
14
infrastructure/terraform/lambda/address2UPRN/outputs.tf
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
output "address2uprn_queue_url" {
|
||||
value = module.address2uprn.queue_url
|
||||
description = "URL of the address2UPRN SQS queue"
|
||||
}
|
||||
|
||||
output "address2uprn_queue_arn" {
|
||||
value = module.address2uprn.queue_arn
|
||||
description = "ARN of the address2UPRN SQS queue"
|
||||
}
|
||||
|
||||
output "address2uprn_lambda_arn" {
|
||||
value = module.address2uprn.lambda_arn
|
||||
description = "ARN of the address2UPRN Lambda function"
|
||||
}
|
||||
21
infrastructure/terraform/modules/general_iam_policy/main.tf
Normal file
21
infrastructure/terraform/modules/general_iam_policy/main.tf
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# IAM Policy with dynamic actions and resources
|
||||
resource "aws_iam_policy" "policy" {
|
||||
name = var.policy_name
|
||||
description = var.policy_description
|
||||
|
||||
policy = jsonencode({
|
||||
Version = "2012-10-17"
|
||||
Statement = [
|
||||
merge(
|
||||
{
|
||||
Effect = "Allow"
|
||||
Action = var.actions
|
||||
Resource = var.resources
|
||||
},
|
||||
var.conditions != null ? { Condition = var.conditions } : {}
|
||||
)
|
||||
]
|
||||
})
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
output "policy_arn" {
|
||||
value = aws_iam_policy.policy.arn
|
||||
description = "ARN of the created IAM policy"
|
||||
}
|
||||
|
||||
output "policy_name" {
|
||||
value = aws_iam_policy.policy.name
|
||||
description = "Name of the created IAM policy"
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
variable "policy_name" {
|
||||
description = "Name of the IAM policy"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "policy_description" {
|
||||
description = "Description of the IAM policy"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "actions" {
|
||||
description = "List of IAM actions allowed by this policy"
|
||||
type = list(string)
|
||||
}
|
||||
|
||||
variable "resources" {
|
||||
description = "List of AWS resources this policy applies to"
|
||||
type = list(string)
|
||||
}
|
||||
|
||||
variable "conditions" {
|
||||
description = "Optional IAM policy conditions"
|
||||
type = any
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "tags" {
|
||||
description = "Tags to apply to the policy"
|
||||
type = map(string)
|
||||
default = {}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue