You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance AWS integration documentation and examples
- Updated README.md to clarify the organization integration process, specifying that it creates a CloudFormation stack with internal StackSets.
- Revised module names in examples for better clarity, changing `jit_aws_integration` to `jit_aws_account_integration`.
- Added detailed explanations for required CloudFormation capabilities for both single account and organization integrations.
- Improved validation notes for parameters and added comprehensive examples for both integration types, ensuring users have clear guidance on usage.
@@ -5,20 +5,17 @@ A Terraform module for automating AWS integration with JIT (Just-in-Time) securi
5
5
## Features
6
6
7
7
-**Dual Integration Types**: Support for both single account and organization-wide deployments
8
-
-**Native Terraform**: Pure Terraform implementation using `data "http"` resources
9
-
-**Create-Only State Token**: Implements proper create-only behavior for JIT oauth/state-token using Terraform state
10
8
-**Multi-Region Support**: Monitor multiple AWS regions simultaneously
11
9
-**US/EU API Support**: Compatible with both US and EU JIT API endpoints
12
10
-**Error Handling**: Built-in validation and error handling with postconditions
13
-
-**State Management**: Pure Terraform state management without local file dependencies
14
11
15
12
## Integration Types
16
13
17
14
### Single Account Integration
18
15
Deploys JIT integration to a single AWS account using CloudFormation stack.
19
16
20
17
### Organization Integration
21
-
Deploys JIT integration across an entire AWS Organization using CloudFormation StackSet, automatically including all current and future accounts in the organization.
18
+
Deploys JIT integration across an entire AWS Organization using a CloudFormation stack that creates internal StackSets, automatically including all current and future accounts in the organization.
22
19
23
20
## Prerequisites
24
21
@@ -32,29 +29,27 @@ Deploys JIT integration across an entire AWS Organization using CloudFormation S
32
29
### Single Account Integration
33
30
34
31
```hcl
35
-
module "jit_aws_integration" {
32
+
module "jit_aws_account_integration" {
36
33
source = "path/to/aws_integration_automation"
37
34
38
35
# JIT Configuration
39
36
jit_client_id = var.jit_client_id
40
37
jit_secret = var.jit_secret
41
-
jit_region = "us"
38
+
jit_region = "us" # Use "eu" for European API endpoint
|`organization_root_id`| Organization Root ID (organization integration only) |
120
-
|`state_token_created`| Whether a new state token was created |
121
-
|`state_token_flag_created`| Whether state token flag is initialized in Terraform state |
122
-
|`state_token_stored`| Whether state token is stored in Terraform state |
123
101
124
102
## State Token Management
125
103
126
-
This module implements a **create-only** behavior for the JIT oauth/state-token endpoint using Terraform state management:
104
+
This module implements a **create-only** behavior for the JIT oauth/state-token endpoint using the REST API provider:
127
105
128
-
1.**First Run**: Creates a new state token and stores it in Terraform state using `terraform_data` resource
106
+
1.**First Run**: Creates a new state token via JIT API
129
107
2.**Subsequent Runs**: Reuses the existing state token from Terraform state
130
-
3.**No Updates**: The state token is never updated or regenerated unless the Terraform state is manually modified
108
+
3.**No Updates**: The state token is never updated or regenerated unless explicitly recreated
131
109
132
110
### State Token Implementation
133
111
134
-
The module uses three key resources for state token management:
112
+
The module uses the `restapi_object` resource for state token management:
135
113
136
-
-`terraform_data.state_token_flag`: Tracks whether a token has been created
137
-
-`data.http.jit_state_token`: Only executes when the flag indicates first creation
138
-
-`terraform_data.state_token_storage`: Stores the actual token value in Terraform state
114
+
-Creates state token via JIT API endpoint `/oauth/state-token`
115
+
-Stores token in Terraform state automatically
116
+
-Uses `ignore_changes` lifecycle rule to prevent updates
139
117
140
118
### Important Notes
141
119
142
-
- State token is managed entirely within Terraform state - no local files required
120
+
- State token is managed entirely within Terraform state
143
121
- Token persists across Terraform runs and is only created once
144
-
- To regenerate a state token, you must manually modify or destroy the relevant Terraform state resources
122
+
- To regenerate a state token, you must manually destroy and recreate the `restapi_object.jit_state_token` resource along with the created AWS stack.
123
+
-**External ID Persistence**: The state token (external_id) should be created only once. Changing AWS regions, account configurations, or other integration parameters will not affect the existing integration's configuration or regenerate the token
124
+
-**External ID Uniqueness**: The external_id is generated by JIT and cannot be reused across integrations. After a successful integration, changing or regenerating the external_id value will cause issues with the existing integration and may break the connection between JIT and your AWS environment
145
125
146
126
## CloudFormation Templates
147
127
@@ -150,13 +130,31 @@ The module automatically selects the appropriate CloudFormation template:
0 commit comments