Skip to content

Commit cc7d22c

Browse files
committed
Add AWS Organization and Single Account Integration Examples
- Introduced example Terraform configurations for integrating AWS organizations and single accounts with Jit. - Created `organization_integration.tf` and `variables.tf` for organization integration, including necessary variables and module configurations. - Created `account_integration.tf` and `variables.tf` for single account integration, detailing the required variables and module settings. - Both examples include configurations for Jit API integration and AWS provider settings.
1 parent 61e7ad1 commit cc7d22c

4 files changed

Lines changed: 122 additions & 18 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Example: AWS Organization Integration with Jit
2+
# This example shows how to integrate an entire AWS organization with Jit
3+
4+
terraform {
5+
required_version = ">= 1.5"
6+
7+
required_providers {
8+
aws = {
9+
source = "hashicorp/aws"
10+
version = ">= 5.0"
11+
}
12+
}
13+
}
14+
15+
# Configure the AWS Provider
16+
provider "aws" {
17+
region = var.aws_region
18+
}
19+
20+
# Organization Integration Module
21+
module "jit_aws_org_integration" {
22+
source = "../../"
23+
24+
# Jit API Configuration
25+
jit_client_id = var.jit_client_id # Set via environment variable or terraform.tfvars
26+
jit_secret = var.jit_secret # Set via environment variable or terraform.tfvars
27+
jit_region = "us" # Use "eu" for European API endpoint
28+
29+
# Integration Configuration
30+
integration_type = "org"
31+
aws_regions_to_monitor = var.regions_to_monitor
32+
33+
# Organization Configuration
34+
organization_root_id = var.organization_root_id # Your AWS Organization Root ID
35+
should_include_root_account = var.should_include_root_account # Whether to include the management account
36+
37+
# Stack Configuration
38+
stack_name = "JitOrgIntegration"
39+
resource_name_prefix = "JitOrg" # Optional: Prefix for CloudFormation resources
40+
41+
# CloudFormation Configuration
42+
capabilities = ["CAPABILITY_NAMED_IAM"]
43+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
# Variables that should be defined in your root module or terraform.tfvars
3+
variable "jit_client_id" {
4+
description = "Jit API Client ID"
5+
type = string
6+
sensitive = true
7+
}
8+
9+
variable "jit_secret" {
10+
description = "Jit API Secret"
11+
type = string
12+
sensitive = true
13+
}
14+
15+
variable "organization_root_id" {
16+
description = "AWS Organization Root ID"
17+
type = string
18+
sensitive = true
19+
}
20+
21+
variable "should_include_root_account" {
22+
description = "Whether to include the root account in the monitoring."
23+
type = bool
24+
default = false
25+
}
26+
27+
variable "regions_to_monitor" {
28+
description = "AWS regions to monitor using Jit"
29+
type = list(string)
30+
default = ["us-east-1", "us-west-2"]
31+
}
32+
33+
variable "aws_region" {
34+
description = "AWS region to deploy the integration to"
35+
type = string
36+
default = "us-east-1"
37+
}

src/integrations/aws_integration_automation/examples/account_integration.tf renamed to src/integrations/aws_integration_automation/examples/single_account/account_integration.tf

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ terraform {
1414

1515
# Configure the AWS Provider
1616
provider "aws" {
17-
region = "us-east-1"
17+
region = var.aws_region
1818
}
1919

2020
# Single Account Integration Module
2121
module "jit_aws_account_integration" {
22-
source = "../"
22+
source = "../../"
2323

2424
# Jit API Configuration
2525
jit_client_id = var.jit_client_id # Set via environment variable or terraform.tfvars
@@ -28,26 +28,13 @@ module "jit_aws_account_integration" {
2828

2929
# Integration Configuration
3030
integration_type = "account"
31-
aws_regions_to_monitor = ["us-east-1", "us-west-2"]
31+
aws_regions_to_monitor = var.regions_to_monitor
3232

3333
# Stack Configuration
3434
stack_name = "JitAccountIntegration"
35-
account_name = "Production Account" # Optional: Display name in Jit platform
36-
resource_name_prefix = "JitProd" # Optional: Prefix for CloudFormation resources
35+
account_name = var.account_name # Optional: Display name in Jit platform
36+
resource_name_prefix = var.resource_name_prefix # Optional: Prefix for CloudFormation resources
3737

3838
# CloudFormation Configuration
3939
capabilities = ["CAPABILITY_NAMED_IAM"]
4040
}
41-
42-
# Variables that should be defined in your root module or terraform.tfvars
43-
variable "jit_client_id" {
44-
description = "Jit API Client ID"
45-
type = string
46-
sensitive = true
47-
}
48-
49-
variable "jit_secret" {
50-
description = "Jit API Secret"
51-
type = string
52-
sensitive = true
53-
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
# Variables that should be defined in your root module or terraform.tfvars
3+
variable "jit_client_id" {
4+
description = "Jit API Client ID"
5+
type = string
6+
sensitive = true
7+
}
8+
9+
variable "jit_secret" {
10+
description = "Jit API Secret"
11+
type = string
12+
sensitive = true
13+
}
14+
15+
variable "regions_to_monitor" {
16+
description = "AWS regions to monitor using Jit"
17+
type = list(string)
18+
default = ["us-east-1", "us-west-2"]
19+
}
20+
21+
variable "aws_region" {
22+
description = "AWS region to deploy the integration to"
23+
type = string
24+
default = "us-east-1"
25+
}
26+
27+
variable "account_name" {
28+
description = "Name of the account to monitor"
29+
type = string
30+
default = "Production Account"
31+
}
32+
33+
variable "resource_name_prefix" {
34+
description = "Prefix for the resource name"
35+
type = string
36+
default = "JitProd"
37+
}

0 commit comments

Comments
 (0)