Skip to content

Commit 280abc7

Browse files
BucketARN instead of FolderARN (#37)
1 parent cb9cf08 commit 280abc7

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

modules/integrations/cloud-logs/main.tf

+5-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ data "sysdig_secure_cloud_ingestion_assets" "assets" {
3939
locals {
4040
account_id_hash = substr(md5(data.aws_caller_identity.current.account_id), 0, 4)
4141
role_name = "${var.name}-${random_id.suffix.hex}-${local.account_id_hash}"
42-
bucket_arn = regex("^([^/]+)", var.folder_arn)[0]
4342
trusted_identity = var.is_gov_cloud_onboarding ? data.sysdig_secure_trusted_cloud_identity.trusted_identity.gov_identity : data.sysdig_secure_trusted_cloud_identity.trusted_identity.identity
4443

4544
topic_name = split(":", var.topic_arn)[5]
@@ -101,8 +100,8 @@ data "aws_iam_policy_document" "cloudlogs_s3_access" {
101100
]
102101

103102
resources = [
104-
local.bucket_arn,
105-
"${local.bucket_arn}/*"
103+
var.bucket_arn,
104+
"${var.bucket_arn}/*"
106105
]
107106
}
108107

@@ -116,8 +115,8 @@ data "aws_iam_policy_document" "cloudlogs_s3_access" {
116115
]
117116

118117
resources = [
119-
local.bucket_arn,
120-
"${local.bucket_arn}/*"
118+
var.bucket_arn,
119+
"${var.bucket_arn}/*"
121120
]
122121
}
123122
}
@@ -171,7 +170,7 @@ resource "sysdig_secure_cloud_auth_account_component" "aws_cloud_logs" {
171170
cloudtrailSns = {
172171
role_name = local.role_name
173172
topic_arn = var.topic_arn
174-
bucket_arn = local.bucket_arn
173+
bucket_arn = var.bucket_arn
175174
ingested_regions = var.regions
176175
routing_key = local.routing_key
177176
}

modules/integrations/cloud-logs/variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ variable "sysdig_secure_account_id" {
33
description = "ID of the Sysdig Cloud Account to enable Cloud Logs integration for (in case of organization, ID of the Sysdig management account)"
44
}
55

6-
variable "folder_arn" {
7-
description = "(Required) The ARN of your CloudTrail Bucket Folder"
6+
variable "bucket_arn" {
7+
description = "(Required) The ARN of your CloudTrail Bucket"
88
type = string
99
}
1010

0 commit comments

Comments
 (0)