Skip to content

Commit

Permalink
removing inline policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-hoyle committed Dec 18, 2024
1 parent c23c632 commit e43d8b7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions root_draft_metadata.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ module "draft_metadata_api_gateway" {
resource "aws_iam_role" "draft_metadata_api_gateway_execution_role" {
name = "TDRMetadataChecksAPIGatewayExecutionRole${title(local.environment)}"
assume_role_policy = templatefile("./templates/iam_policy/assume_role_policy.json.tpl", { service = "apigateway.amazonaws.com" })
}

inline_policy {
name = "TDRMetadataChecksAPIGatewayStepFunctionExecutionPolicy${title(local.environment)}"
policy = templatefile("./templates/iam_policy/api_gateway_state_machine_policy.json.tpl", { account_id = data.aws_caller_identity.current.account_id, state_machine_arn = module.draft_metadata_checks.step_function_arn })
}
resource "aws_iam_role_policy" "api_gateway_execution_policy" {
name = "TDRMetadataChecksAPIGatewayStepFunctionExecutionPolicy${title(local.environment)}"
role = aws_iam_role.draft_metadata_api_gateway_execution_role.id
policy = templatefile(
"./templates/iam_policy/api_gateway_state_machine_policy.json.tpl",
{
account_id = data.aws_caller_identity.current.account_id,
state_machine_arn = module.draft_metadata_checks.step_function_arn
}
)
}

module "draft_metadata_bucket" {
Expand Down

0 comments on commit e43d8b7

Please sign in to comment.