Skip to content

Commit f27c439

Browse files
author
iru
committed
chore(example): add single-account-scanning
1 parent 58e851c commit f27c439

File tree

4 files changed

+135
-0
lines changed

4 files changed

+135
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
provider "aws" {
2+
region = var.region
3+
}
4+
5+
#-------------------------------------
6+
# general resources
7+
#-------------------------------------
8+
9+
module "resource_group_master" {
10+
source = "../../modules/infrastructure/resource-group"
11+
name = var.name
12+
tags = var.tags
13+
}
14+
15+
module "cloudtrail" {
16+
source = "../../modules/infrastructure/cloudtrail"
17+
name = var.name
18+
is_organizational = false
19+
is_multi_region_trail = var.cloudtrail_is_multi_region_trail
20+
cloudtrail_kms_enable = var.cloudtrail_kms_enable
21+
22+
tags = var.tags
23+
}
24+
25+
module "ecs_fargate_cluster" {
26+
source = "../../modules/infrastructure/ecs-fargate-cluster"
27+
name = var.name
28+
tags = var.tags
29+
}
30+
31+
32+
module "ssm" {
33+
source = "../../modules/infrastructure/ssm"
34+
name = var.name
35+
sysdig_secure_api_token = var.sysdig_secure_api_token
36+
}
37+
38+
39+
module "codebuild" {
40+
source = "../../modules/infrastructure/codebuild"
41+
name = var.name
42+
secure_api_token_secret_name = module.ssm.secure_api_token_secret_name
43+
44+
tags = var.tags
45+
# note. this is required to avoid racing conditions
46+
depends_on = [module.ssm]
47+
}
48+
49+
50+
module "cloud_scanning" {
51+
source = "../../modules/services/cloud-scanning"
52+
name = "${var.name}-cloudscanning"
53+
54+
sysdig_secure_endpoint = var.sysdig_secure_endpoint
55+
secure_api_token_secret_name = module.ssm.secure_api_token_secret_name
56+
57+
build_project_arn = module.codebuild.project_arn
58+
build_project_name = module.codebuild.project_name
59+
60+
sns_topic_arn = module.cloudtrail.sns_topic_arn
61+
62+
ecs_cluster = module.ecs_fargate_cluster.id
63+
vpc_id = module.ecs_fargate_cluster.vpc_id
64+
vpc_subnets = module.ecs_fargate_cluster.vpc_subnets
65+
66+
tags = var.tags
67+
# note. this is required to avoid racing conditions
68+
depends_on = [module.cloudtrail, module.ecs_fargate_cluster, module.codebuild, module.ssm]
69+
}

examples/single-account-scanning/outputs.tf

Whitespace-only changes.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
variable "sysdig_secure_api_token" {
2+
sensitive = true
3+
type = string
4+
description = "Sysdig Secure API token"
5+
}
6+
7+
8+
#---------------------------------
9+
# optionals - with defaults
10+
#---------------------------------
11+
12+
#
13+
# cloudtrail configuration
14+
#
15+
16+
variable "cloudtrail_is_multi_region_trail" {
17+
type = bool
18+
default = true
19+
description = "testing/economization purpose. true/false whether cloudtrail will ingest multiregional events"
20+
}
21+
22+
variable "cloudtrail_kms_enable" {
23+
type = bool
24+
default = true
25+
description = "testing/economization purpose. true/false whether s3 should be encrypted"
26+
}
27+
28+
29+
#
30+
# general
31+
#
32+
33+
variable "name" {
34+
type = string
35+
description = "Name for the Cloud Vision deployment"
36+
default = "sysdig-cloudvision"
37+
}
38+
39+
40+
variable "region" {
41+
type = string
42+
default = "eu-central-1"
43+
description = "Default region for resource creation in both organization master and cloudvision member account"
44+
}
45+
46+
variable "sysdig_secure_endpoint" {
47+
type = string
48+
default = "https://secure.sysdig.com"
49+
description = "Sysdig Secure API endpoint"
50+
}
51+
52+
variable "tags" {
53+
type = map(string)
54+
description = "sysdig cloudvision tags"
55+
default = {
56+
"product" = "sysdig-cloudvision"
57+
}
58+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
required_version = ">= 0.15.0"
3+
required_providers {
4+
aws = {
5+
version = ">= 3.50.0"
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)