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
- Enhanced AI analysis with structured impact assessment including security concerns, configuration issues, operational impact, and recommendations
9
+
- Improved error handling and JSON parsing for Bedrock responses
10
+
- Better AMI analysis with direct technical output
11
+
12
+
### Changed
13
+
-**BREAKING**: Updated default Bedrock model from `anthropic.claude-3-sonnet-20240229-v1:0` to `global.anthropic.claude-sonnet-4-20250514-v1:0` (supports cross-region inference profiles)
14
+
- Increased default Lambda timeout from 120 seconds to 300 seconds for better performance with Claude 4.0
15
+
- Restructured AI prompts for more focused and technical analysis output
16
+
- Improved system prompts to reduce conversational language in responses
17
+
- Enhanced JSON response parsing with better error handling and fallback mechanisms
|<a name="input_bedrock_llm_model"></a> [bedrock\_llm\_model](#input\_bedrock\_llm\_model) | Bedrock LLM model to use | `string` | `"anthropic.claude-3-sonnet-20240229-v1:0"` | no |
202
+
|<a name="input_bedrock_llm_model"></a> [bedrock\_llm\_model](#input\_bedrock\_llm\_model) | Bedrock LLM model to use (supports cross-region inference profiles) | `string` | `"global.anthropic.claude-sonnet-4-20250514-v1:0"` | no |
203
203
|<a name="input_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#input\_cloudwatch\_log\_group\_name) | RunTask CloudWatch log group name | `string` | `"/hashicorp/terraform/runtask/"` | no |
204
204
|<a name="input_cloudwatch_log_group_retention"></a> [cloudwatch\_log\_group\_retention](#input\_cloudwatch\_log\_group\_retention) | Lambda CloudWatch log group retention period | `string` | `"365"` | no |
205
205
|<a name="input_deploy_waf"></a> [deploy\_waf](#input\_deploy\_waf) | Set to true to deploy CloudFront and WAF in front of the Lambda function URL | `string` | `false` | no |
206
206
|<a name="input_event_bus_name"></a> [event\_bus\_name](#input\_event\_bus\_name) | EventBridge event bus name | `string` | `"default"` | no |
207
207
|<a name="input_event_source"></a> [event\_source](#input\_event\_source) | EventBridge source name | `string` | `"app.terraform.io"` | no |
208
208
|<a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | Lambda architecture (arm64 or x86\_64) | `string` | `"x86_64"` | no |
209
-
|<a name="input_lambda_default_timeout"></a> [lambda\_default\_timeout](#input\_lambda\_default\_timeout) | Lambda default timeout in seconds | `number` | `120` | no |
209
+
|<a name="input_lambda_default_timeout"></a> [lambda\_default\_timeout](#input\_lambda\_default\_timeout) | Lambda default timeout in seconds | `number` | `300` | no |
|<a name="input_lambda_reserved_concurrency"></a> [lambda\_reserved\_concurrency](#input\_lambda\_reserved\_concurrency) | Maximum Lambda reserved concurrency, make sure your AWS quota is sufficient | `number` | `10` | no |
212
212
|<a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | Name to be used on all the resources as identifier. | `string` | `"runtask-tf-plan-analyzer"` | no |
"description": "A list of resources that will be created, modified or deleted"
54
-
}
55
-
}
56
-
}
57
-
</schema>
58
-
Here is an example of the output:
59
-
<example>
60
-
{
61
-
"thinking": "To list the resources that will be created, modified or deleted, I will go through the terraform plan and look for the 'actions' field in each resource change. If the actions include 'create', 'update', or 'delete', I will add that resource to the list. For AMI changes, I will include the old and new AMI ID.",
62
-
"resources": "The following resources will be modified: RESOURCES"
63
-
}
64
-
</example>
65
-
Now, list the resources that will be created, modified or deleted in the following terraform plan"""
37
+
You must respond with ONLY a JSON object. Do not include any explanatory text, conversation, or markdown formatting.
38
+
39
+
Analyze the terraform plan and return this exact JSON structure:
40
+
{"thinking": "brief analysis", "resources": "list of resources being created, modified, or deleted", "impact_analysis": "assessment formatted as markdown with sections: ## 🔍 Impact Analysis\n\n### 🚨 Security Concerns\n- **Critical/High/Medium**: Description\n- **Risk Level**: Assessment\n\n### ⚠️ Configuration Issues\n- **Issue Type**: Description\n- **Impact**: Consequence\n\n### 📊 Operational Impact\n- **Infrastructure**: What's being deployed\n- **Cost**: Cost implications\n\n### 💡 Recommendations\n- **Priority 1**: Most critical fix\n- **Priority 2**: Secondary concerns\n- **Warning**: Important warnings"}
logger.info("##### Evaluating AMI information #####")
100
-
prompt="""
101
-
Find additional details of infrastructure changes using the following rules
102
-
1. For Amazon machine image (AMI or image_id) modifications, compare the old AMI information against the new AMI, including linux kernel, docker and ecs agent using the get_ami_releases function.
103
-
2. Think step by step using "thinking" tags field
104
-
3. Use the following schema. Skip the preamble:
105
-
<output>
106
-
<thinking>
107
-
</thinking>
108
-
<result>
109
-
## Current AMI ID
110
-
* AMI name:
111
-
* OS Architecture:
112
-
* OS Name:
113
-
* kernel:
114
-
* docker version:
115
-
* ECS agent:
116
-
117
-
## New AMI ID
118
-
* AMI name:
119
-
* kernel:
120
-
* OS Architecture:
121
-
* OS Name:
122
-
* docker version:
123
-
* ECS agent:
124
-
</result>
125
-
<output>
126
-
Now, given the following analysis, compare any old with new AMIs:
127
-
"""
83
+
prompt=f"""
84
+
For any Amazon Machine Image (AMI) changes in this analysis, use the get_ami_releases function to compare old and new AMI details including kernel, docker, and ECS agent versions.
logger.info("Terraform plan summary: {}".format(description))
225
179
@@ -232,6 +186,12 @@ def eval(tf_plan_json):
232
186
results.append(generate_runtask_result(outcome_id="Plan-Summary", description="Summary of Terraform plan", result="Output omitted due to : {}".format(guardrail_response)))
results.append(generate_runtask_result(outcome_id="Impact-Analysis", description="Security and operational impact assessment", result=impact_analysis_text[:9000]))
192
+
else:
193
+
results.append(generate_runtask_result(outcome_id="Impact-Analysis", description="Security and operational impact assessment", result="Output omitted due to : {}".format(guardrail_response)))
0 commit comments