File tree Expand file tree Collapse file tree
src/integrations/aws_integration_automation/examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ terraform {
1414
1515# Configure the AWS Provider
1616provider "aws" {
17- region = " us-east-1 "
17+ region = var . aws_region
1818}
1919
2020# Single Account Integration Module
2121module "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- }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments