Skip to content

Commit ecf0774

Browse files
committed
feat(aws): use new lacework provider
Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
1 parent e6414b0 commit ecf0774

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

aws/main.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,24 @@ resource "aws_iam_role_policy_attachment" "lacework_crossaccount_iam_role_policy
240240
role = aws_iam_role.lacework_iam_role.name
241241
policy_arn = aws_iam_policy.cross_account_policy.arn
242242
}
243+
244+
provider "lacework" {
245+
account = var.lacework_account
246+
api_key = var.lacework_api_key
247+
api_secret = var.lacework_api_secret
248+
}
249+
250+
resource "lacework_integration_aws_cfg" "example" {
251+
name = var.lacework_integration_config_name
252+
credentials {
253+
role_arn = aws_iam_role.lacework_iam_role.arn
254+
external_id = var.external_id
255+
}
256+
depends_on = [
257+
aws_iam_role_policy_attachment.security_audit_iam_role_policy_attachment,
258+
aws_sns_topic_subscription.lacework_sns_topic_sub,
259+
aws_sqs_queue_policy.lacework_sqs_queue_policy,
260+
aws_iam_policy.cross_account_policy,
261+
aws_cloudtrail.lacework_cloudtrail
262+
]
263+
}

aws/variables.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
////////////////////////////////
2+
// Lacework
3+
//
4+
variable "lacework_account" {
5+
type = string
6+
}
7+
8+
variable "lacework_api_key" {
9+
type = string
10+
}
11+
12+
variable "lacework_api_secret" {
13+
type = string
14+
}
15+
16+
variable "lacework_integration_config_name" {
17+
type = string
18+
default = "AWS config"
19+
}
20+
21+
variable "lacework_integration_cloudtrail_name" {
22+
type = string
23+
default = "AWS cloundtrail"
24+
}
25+
126
////////////////////////////////
227
// AWS Connection
328

0 commit comments

Comments
 (0)