Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@ data "aws_iam_policy_document" "runtask_key" {
principals {
type = "Service"
identifiers = [
"logs.${data.aws_region.current_region.name}.amazonaws.com"
"logs.${data.aws_region.current_region.region}.amazonaws.com"
]
}
condition {
test = "ArnEquals"
variable = "kms:EncryptionContext:aws:logs:arn"
values = [
"arn:${data.aws_partition.current_partition.id}:logs:${data.aws_region.current_region.name}:${data.aws_caller_identity.current_account.account_id}:log-group:/aws/lambda/${local.solution_prefix}*",
"arn:${data.aws_partition.current_partition.id}:logs:${data.aws_region.current_region.name}:${data.aws_caller_identity.current_account.account_id}:log-group:/aws/state/${local.solution_prefix}*",
"arn:${data.aws_partition.current_partition.id}:logs:${data.aws_region.current_region.name}:${data.aws_caller_identity.current_account.account_id}:log-group:/aws/vendedlogs/states/${local.solution_prefix}*",
"arn:${data.aws_partition.current_partition.id}:logs:${data.aws_region.current_region.name}:${data.aws_caller_identity.current_account.account_id}:log-group:${var.cloudwatch_log_group_name}*"
"arn:${data.aws_partition.current_partition.id}:logs:${data.aws_region.current_region.region}:${data.aws_caller_identity.current_account.account_id}:log-group:/aws/lambda/${local.solution_prefix}*",
"arn:${data.aws_partition.current_partition.id}:logs:${data.aws_region.current_region.region}:${data.aws_caller_identity.current_account.account_id}:log-group:/aws/state/${local.solution_prefix}*",
"arn:${data.aws_partition.current_partition.id}:logs:${data.aws_region.current_region.region}:${data.aws_caller_identity.current_account.account_id}:log-group:/aws/vendedlogs/states/${local.solution_prefix}*",
"arn:${data.aws_partition.current_partition.id}:logs:${data.aws_region.current_region.region}:${data.aws_caller_identity.current_account.account_id}:log-group:${var.cloudwatch_log_group_name}*"
]
}
}
Expand All @@ -152,7 +152,7 @@ data "aws_iam_policy_document" "runtask_key" {
test = "StringEquals"
variable = "kms:ViaService"
values = [
"secretsmanager.${data.aws_region.current_region.name}.amazonaws.com"
"secretsmanager.${data.aws_region.current_region.region}.amazonaws.com"
]
}

Expand Down
2 changes: 1 addition & 1 deletion examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data "tfe_organization" "hcp_tf_org" {

module "hcp_tf_run_task" {
source = "../.."
aws_region = data.aws_region.current.name
aws_region = data.aws_region.current.region
hcp_tf_org = data.tfe_organization.hcp_tf_org.name
run_task_iam_roles = var.tf_run_task_logic_iam_roles
deploy_waf = true
Expand Down
6 changes: 3 additions & 3 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resource "aws_iam_role_policy" "runtask_eventbridge" {
name = "${local.solution_prefix}-runtask-eventbridge-policy"
role = aws_iam_role.runtask_eventbridge.id
policy = templatefile("${path.module}/templates/role-policies/runtask-eventbridge-lambda-role-policy.tpl", {
data_aws_region = data.aws_region.current_region.name
data_aws_region = data.aws_region.current_region.region
data_aws_account_id = data.aws_caller_identity.current_account.account_id
data_aws_partition = data.aws_partition.current_partition.partition
var_event_bus_name = var.event_bus_name
Expand Down Expand Up @@ -92,7 +92,7 @@ resource "aws_iam_role_policy" "runtask_fulfillment" {
name = "${local.solution_prefix}-runtask-fulfillment-policy"
role = aws_iam_role.runtask_fulfillment.id
policy = templatefile("${path.module}/templates/role-policies/runtask-fulfillment-lambda-role-policy.tpl", {
data_aws_region = data.aws_region.current_region.name
data_aws_region = data.aws_region.current_region.region
data_aws_account_id = data.aws_caller_identity.current_account.account_id
data_aws_partition = data.aws_partition.current_partition.partition
local_log_group_name = local.cloudwatch_log_group_name
Expand All @@ -110,7 +110,7 @@ resource "aws_iam_role_policy" "runtask_states" {
name = "${local.solution_prefix}-runtask-statemachine-policy"
role = aws_iam_role.runtask_states.id
policy = templatefile("${path.module}/templates/role-policies/runtask-state-role-policy.tpl", {
data_aws_region = data.aws_region.current_region.name
data_aws_region = data.aws_region.current_region.region
data_aws_account_id = data.aws_caller_identity.current_account.account_id
data_aws_partition = data.aws_partition.current_partition.partition
var_name_prefix = var.name_prefix
Expand Down