Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix govcloud audit logging config #80

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,27 @@ resource "aws_s3_bucket_policy" "log_delivery" {
// IAM Role

// Assume Role Policy Log Delivery
data "databricks_aws_assume_role_policy" "log_delivery" {
external_id = var.databricks_account_id
for_log_delivery = true
data "aws_iam_policy_document" "passrole_for_log_delivery" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
identifiers = ["arn:aws-us-gov:iam::${var.databricks_prod_aws_account_id[var.databricks_gov_shard]}:SaasUsageDeliveryRole-prod-aws-gov-IAMRole-L4QM0RCHYQ1G"]
type = "AWS"
}
condition {
test = "StringEquals"
variable = "sts:ExternalId"
values = [var.databricks_account_id]
}
}
}


// Log Delivery IAM Role
resource "aws_iam_role" "log_delivery" {
name = "${var.resource_prefix}-log-delivery"
description = "(${var.resource_prefix}) Log Delivery Role"
assume_role_policy = data.databricks_aws_assume_role_policy.log_delivery.json
assume_role_policy = data.aws_iam_policy_document.passrole_for_log_delivery.json
tags = {
Name = "${var.resource_prefix}-log-delivery-role"
}
Expand Down Expand Up @@ -147,4 +157,4 @@ resource "databricks_mws_log_delivery" "audit_logs" {
depends_on = [
aws_s3_bucket_policy.log_delivery
]
}
}