chore: import upstream snapshot with attribution
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
import type {
|
||||
CloudFormationCancelUpdateStackParams,
|
||||
CloudFormationCancelUpdateStackResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const cancelUpdateStackTool: ToolConfig<
|
||||
CloudFormationCancelUpdateStackParams,
|
||||
CloudFormationCancelUpdateStackResponse
|
||||
> = {
|
||||
id: 'cloudformation_cancel_update_stack',
|
||||
name: 'CloudFormation Cancel Update Stack',
|
||||
description: 'Cancel an in-progress stack update and roll back to the last known stable state',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name or ID of the stack whose update should be cancelled',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/cancel-update-stack',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to cancel CloudFormation stack update')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
message: data.output.message,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
message: { type: 'string', description: 'Operation status message' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import type {
|
||||
CloudFormationCreateChangeSetParams,
|
||||
CloudFormationCreateChangeSetResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const createChangeSetTool: ToolConfig<
|
||||
CloudFormationCreateChangeSetParams,
|
||||
CloudFormationCreateChangeSetResponse
|
||||
> = {
|
||||
id: 'cloudformation_create_change_set',
|
||||
name: 'CloudFormation Create Change Set',
|
||||
description: 'Preview the changes a stack create or update would make before applying them',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Name of the stack to create or update (new name for CREATE type, existing name for UPDATE)',
|
||||
},
|
||||
changeSetName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name for the new change set',
|
||||
},
|
||||
templateBody: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'The CloudFormation template body (JSON or YAML). Required unless usePreviousTemplate is true',
|
||||
},
|
||||
usePreviousTemplate: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Reuse the template currently associated with the stack (UPDATE change sets only)',
|
||||
},
|
||||
parameters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Template input parameters (e.g., [{"parameterKey": "InstanceType", "parameterValue": "t3.micro"}])',
|
||||
},
|
||||
capabilities: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Comma-separated capabilities to acknowledge (CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND)',
|
||||
},
|
||||
changeSetType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'CREATE (default, new stack), UPDATE (existing stack), or IMPORT (import existing resources)',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Description of the change set for reference',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/create-change-set',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
changeSetName: params.changeSetName,
|
||||
...(params.templateBody && { templateBody: params.templateBody }),
|
||||
...(params.usePreviousTemplate !== undefined && {
|
||||
usePreviousTemplate: params.usePreviousTemplate,
|
||||
}),
|
||||
...(params.parameters && { parameters: params.parameters }),
|
||||
...(params.capabilities && { capabilities: params.capabilities }),
|
||||
...(params.changeSetType && { changeSetType: params.changeSetType }),
|
||||
...(params.description && { description: params.description }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to create CloudFormation change set')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
changeSetId: data.output.changeSetId,
|
||||
stackId: data.output.stackId,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
changeSetId: { type: 'string', description: 'The unique ID of the created change set' },
|
||||
stackId: { type: 'string', description: 'The unique ID of the target stack' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import type {
|
||||
CloudFormationCreateStackParams,
|
||||
CloudFormationCreateStackResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const createStackTool: ToolConfig<
|
||||
CloudFormationCreateStackParams,
|
||||
CloudFormationCreateStackResponse
|
||||
> = {
|
||||
id: 'cloudformation_create_stack',
|
||||
name: 'CloudFormation Create Stack',
|
||||
description: 'Create a new CloudFormation stack from a template',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name for the new stack (must be unique in the Region)',
|
||||
},
|
||||
templateBody: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The CloudFormation template body (JSON or YAML)',
|
||||
},
|
||||
parameters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Template input parameters (e.g., [{"parameterKey": "InstanceType", "parameterValue": "t3.micro"}])',
|
||||
},
|
||||
capabilities: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Comma-separated capabilities to acknowledge (CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND) required when the template creates IAM resources or uses macros',
|
||||
},
|
||||
tags: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Tags to apply to the stack and its resources (e.g., [{"key": "env", "value": "prod"}])',
|
||||
},
|
||||
onFailure: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Action to take on creation failure: ROLLBACK (default), DELETE, or DO_NOTHING',
|
||||
},
|
||||
timeoutInMinutes: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Amount of time before the stack creation times out and rolls back',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/create-stack',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
templateBody: params.templateBody,
|
||||
...(params.parameters && { parameters: params.parameters }),
|
||||
...(params.capabilities && { capabilities: params.capabilities }),
|
||||
...(params.tags && { tags: params.tags }),
|
||||
...(params.onFailure && { onFailure: params.onFailure }),
|
||||
...(params.timeoutInMinutes !== undefined && { timeoutInMinutes: params.timeoutInMinutes }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to create CloudFormation stack')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stackId: data.output.stackId,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stackId: { type: 'string', description: 'The unique ID of the created stack' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import type {
|
||||
CloudFormationDeleteStackParams,
|
||||
CloudFormationDeleteStackResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const deleteStackTool: ToolConfig<
|
||||
CloudFormationDeleteStackParams,
|
||||
CloudFormationDeleteStackResponse
|
||||
> = {
|
||||
id: 'cloudformation_delete_stack',
|
||||
name: 'CloudFormation Delete Stack',
|
||||
description: 'Delete a CloudFormation stack and its resources',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name or ID of the stack to delete',
|
||||
},
|
||||
retainResources: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Comma-separated logical resource IDs to retain instead of deleting (only applies to stacks in DELETE_FAILED state)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/delete-stack',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
...(params.retainResources && { retainResources: params.retainResources }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to delete CloudFormation stack')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
message: data.output.message,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
message: { type: 'string', description: 'Operation status message' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
import type {
|
||||
CloudFormationDescribeChangeSetParams,
|
||||
CloudFormationDescribeChangeSetResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const describeChangeSetTool: ToolConfig<
|
||||
CloudFormationDescribeChangeSetParams,
|
||||
CloudFormationDescribeChangeSetResponse
|
||||
> = {
|
||||
id: 'cloudformation_describe_change_set',
|
||||
name: 'CloudFormation Describe Change Set',
|
||||
description: 'View the resource changes a change set would make and its execution status',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
changeSetName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name or ARN of the change set to describe',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Name or ID of the stack the change set belongs to (required if changeSetName is not an ARN)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/describe-change-set',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
changeSetName: params.changeSetName,
|
||||
...(params.stackName && { stackName: params.stackName }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to describe CloudFormation change set')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
changeSetName: data.output.changeSetName,
|
||||
changeSetId: data.output.changeSetId,
|
||||
stackId: data.output.stackId,
|
||||
stackName: data.output.stackName,
|
||||
description: data.output.description,
|
||||
executionStatus: data.output.executionStatus,
|
||||
status: data.output.status,
|
||||
statusReason: data.output.statusReason,
|
||||
creationTime: data.output.creationTime,
|
||||
capabilities: data.output.capabilities,
|
||||
changes: data.output.changes,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
changeSetName: { type: 'string', description: 'Name of the change set' },
|
||||
changeSetId: { type: 'string', description: 'The unique ID of the change set' },
|
||||
stackId: { type: 'string', description: 'The unique ID of the target stack' },
|
||||
stackName: { type: 'string', description: 'Name of the target stack' },
|
||||
description: { type: 'string', description: 'Description of the change set' },
|
||||
executionStatus: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Whether the change set can be executed (AVAILABLE, UNAVAILABLE, EXECUTE_IN_PROGRESS, EXECUTE_COMPLETE, EXECUTE_FAILED, OBSOLETE)',
|
||||
},
|
||||
status: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Current status of the change set (CREATE_PENDING, CREATE_IN_PROGRESS, CREATE_COMPLETE, DELETE_COMPLETE, FAILED)',
|
||||
},
|
||||
statusReason: {
|
||||
type: 'string',
|
||||
description: 'Reason for the current status, particularly if failed',
|
||||
},
|
||||
creationTime: { type: 'number', description: 'Timestamp the change set was created' },
|
||||
capabilities: { type: 'array', description: 'Capabilities required to execute the change set' },
|
||||
changes: {
|
||||
type: 'array',
|
||||
description:
|
||||
'List of resource changes (action, logical/physical resource ID, resource type, replacement)',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import type {
|
||||
CloudFormationDescribeStackDriftDetectionStatusParams,
|
||||
CloudFormationDescribeStackDriftDetectionStatusResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const describeStackDriftDetectionStatusTool: ToolConfig<
|
||||
CloudFormationDescribeStackDriftDetectionStatusParams,
|
||||
CloudFormationDescribeStackDriftDetectionStatusResponse
|
||||
> = {
|
||||
id: 'cloudformation_describe_stack_drift_detection_status',
|
||||
name: 'CloudFormation Describe Stack Drift Detection Status',
|
||||
description: 'Check the status of a stack drift detection operation',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackDriftDetectionId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The drift detection ID returned by Detect Stack Drift',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/describe-stack-drift-detection-status',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackDriftDetectionId: params.stackDriftDetectionId,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to describe stack drift detection status')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stackId: data.output.stackId,
|
||||
stackDriftDetectionId: data.output.stackDriftDetectionId,
|
||||
stackDriftStatus: data.output.stackDriftStatus,
|
||||
detectionStatus: data.output.detectionStatus,
|
||||
detectionStatusReason: data.output.detectionStatusReason,
|
||||
driftedStackResourceCount: data.output.driftedStackResourceCount,
|
||||
timestamp: data.output.timestamp,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stackId: { type: 'string', description: 'The stack ID' },
|
||||
stackDriftDetectionId: { type: 'string', description: 'The drift detection ID' },
|
||||
stackDriftStatus: {
|
||||
type: 'string',
|
||||
description: 'Drift status (DRIFTED, IN_SYNC, NOT_CHECKED)',
|
||||
},
|
||||
detectionStatus: {
|
||||
type: 'string',
|
||||
description: 'Detection status (DETECTION_IN_PROGRESS, DETECTION_COMPLETE, DETECTION_FAILED)',
|
||||
},
|
||||
detectionStatusReason: { type: 'string', description: 'Reason if detection failed' },
|
||||
driftedStackResourceCount: {
|
||||
type: 'number',
|
||||
description: 'Number of resources that have drifted',
|
||||
},
|
||||
timestamp: { type: 'number', description: 'Timestamp of the detection' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import type {
|
||||
CloudFormationDescribeStackEventsParams,
|
||||
CloudFormationDescribeStackEventsResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const describeStackEventsTool: ToolConfig<
|
||||
CloudFormationDescribeStackEventsParams,
|
||||
CloudFormationDescribeStackEventsResponse
|
||||
> = {
|
||||
id: 'cloudformation_describe_stack_events',
|
||||
name: 'CloudFormation Describe Stack Events',
|
||||
description: 'Get the event history for a CloudFormation stack',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Stack name or ID',
|
||||
},
|
||||
limit: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Maximum number of events to return (default: 50)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/describe-stack-events',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
...(params.limit !== undefined && { limit: params.limit }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to describe CloudFormation stack events')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
events: data.output.events,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
events: {
|
||||
type: 'array',
|
||||
description: 'List of stack events with resource status and timestamps',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import type {
|
||||
CloudFormationDescribeStacksParams,
|
||||
CloudFormationDescribeStacksResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const describeStacksTool: ToolConfig<
|
||||
CloudFormationDescribeStacksParams,
|
||||
CloudFormationDescribeStacksResponse
|
||||
> = {
|
||||
id: 'cloudformation_describe_stacks',
|
||||
name: 'CloudFormation Describe Stacks',
|
||||
description: 'List and describe CloudFormation stacks',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Stack name or ID to describe (omit to list all stacks)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/describe-stacks',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
...(params.stackName && { stackName: params.stackName }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to describe CloudFormation stacks')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stacks: data.output.stacks,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stacks: {
|
||||
type: 'array',
|
||||
description: 'List of CloudFormation stacks with status, outputs, and tags',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import type {
|
||||
CloudFormationDetectStackDriftParams,
|
||||
CloudFormationDetectStackDriftResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const detectStackDriftTool: ToolConfig<
|
||||
CloudFormationDetectStackDriftParams,
|
||||
CloudFormationDetectStackDriftResponse
|
||||
> = {
|
||||
id: 'cloudformation_detect_stack_drift',
|
||||
name: 'CloudFormation Detect Stack Drift',
|
||||
description: 'Initiate drift detection on a CloudFormation stack',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Stack name or ID to detect drift on',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/detect-stack-drift',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to detect CloudFormation stack drift')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stackDriftDetectionId: data.output.stackDriftDetectionId,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stackDriftDetectionId: {
|
||||
type: 'string',
|
||||
description: 'ID to use with Describe Stack Drift Detection Status to check results',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import type {
|
||||
CloudFormationExecuteChangeSetParams,
|
||||
CloudFormationExecuteChangeSetResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const executeChangeSetTool: ToolConfig<
|
||||
CloudFormationExecuteChangeSetParams,
|
||||
CloudFormationExecuteChangeSetResponse
|
||||
> = {
|
||||
id: 'cloudformation_execute_change_set',
|
||||
name: 'CloudFormation Execute Change Set',
|
||||
description: 'Apply a previously created and reviewed change set to its stack',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
changeSetName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name or ARN of the change set to execute',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Name or ID of the stack the change set belongs to (required if changeSetName is not an ARN)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/execute-change-set',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
changeSetName: params.changeSetName,
|
||||
...(params.stackName && { stackName: params.stackName }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to execute CloudFormation change set')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
message: data.output.message,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
message: { type: 'string', description: 'Operation status message' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import type {
|
||||
CloudFormationGetTemplateParams,
|
||||
CloudFormationGetTemplateResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getTemplateTool: ToolConfig<
|
||||
CloudFormationGetTemplateParams,
|
||||
CloudFormationGetTemplateResponse
|
||||
> = {
|
||||
id: 'cloudformation_get_template',
|
||||
name: 'CloudFormation Get Template',
|
||||
description: 'Retrieve the template body for a CloudFormation stack',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Stack name or ID',
|
||||
},
|
||||
templateStage: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Which template version to retrieve: Processed (default, with transforms applied) or Original (as submitted)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/get-template',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
...(params.templateStage && { templateStage: params.templateStage }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to get CloudFormation template')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
templateBody: data.output.templateBody,
|
||||
stagesAvailable: data.output.stagesAvailable,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
templateBody: { type: 'string', description: 'The template body as a JSON or YAML string' },
|
||||
stagesAvailable: { type: 'array', description: 'Available template stages' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
import type {
|
||||
CloudFormationGetTemplateSummaryParams,
|
||||
CloudFormationGetTemplateSummaryResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getTemplateSummaryTool: ToolConfig<
|
||||
CloudFormationGetTemplateSummaryParams,
|
||||
CloudFormationGetTemplateSummaryResponse
|
||||
> = {
|
||||
id: 'cloudformation_get_template_summary',
|
||||
name: 'CloudFormation Get Template Summary',
|
||||
description:
|
||||
'Get a summary of a template or deployed stack: resource types, required capabilities, and parameters, without full validation',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
templateBody: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'The CloudFormation template body (JSON or YAML). Required if stackName is not provided',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name or ID of a deployed stack to summarize instead of a template body',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/get-template-summary',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
...(params.templateBody && { templateBody: params.templateBody }),
|
||||
...(params.stackName && { stackName: params.stackName }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to get CloudFormation template summary')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
description: data.output.description,
|
||||
parameters: data.output.parameters,
|
||||
capabilities: data.output.capabilities,
|
||||
capabilitiesReason: data.output.capabilitiesReason,
|
||||
resourceTypes: data.output.resourceTypes,
|
||||
version: data.output.version,
|
||||
declaredTransforms: data.output.declaredTransforms,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
description: { type: 'string', description: 'Template description' },
|
||||
parameters: {
|
||||
type: 'array',
|
||||
description: 'Template parameters with types, defaults, and descriptions',
|
||||
},
|
||||
capabilities: { type: 'array', description: 'Required capabilities (e.g., CAPABILITY_IAM)' },
|
||||
capabilitiesReason: { type: 'string', description: 'Reason capabilities are required' },
|
||||
resourceTypes: {
|
||||
type: 'array',
|
||||
description: 'AWS resource types declared in the template (e.g., AWS::S3::Bucket)',
|
||||
},
|
||||
version: { type: 'string', description: 'Template format version' },
|
||||
declaredTransforms: {
|
||||
type: 'array',
|
||||
description: 'Transforms used in the template (e.g., AWS::Serverless-2016-10-31)',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
export * from './types'
|
||||
|
||||
import { cancelUpdateStackTool } from '@/tools/cloudformation/cancel_update_stack'
|
||||
import { createChangeSetTool } from '@/tools/cloudformation/create_change_set'
|
||||
import { createStackTool } from '@/tools/cloudformation/create_stack'
|
||||
import { deleteStackTool } from '@/tools/cloudformation/delete_stack'
|
||||
import { describeChangeSetTool } from '@/tools/cloudformation/describe_change_set'
|
||||
import { describeStackDriftDetectionStatusTool } from '@/tools/cloudformation/describe_stack_drift_detection_status'
|
||||
import { describeStackEventsTool } from '@/tools/cloudformation/describe_stack_events'
|
||||
import { describeStacksTool } from '@/tools/cloudformation/describe_stacks'
|
||||
import { detectStackDriftTool } from '@/tools/cloudformation/detect_stack_drift'
|
||||
import { executeChangeSetTool } from '@/tools/cloudformation/execute_change_set'
|
||||
import { getTemplateTool } from '@/tools/cloudformation/get_template'
|
||||
import { getTemplateSummaryTool } from '@/tools/cloudformation/get_template_summary'
|
||||
import { listStackResourcesTool } from '@/tools/cloudformation/list_stack_resources'
|
||||
import { updateStackTool } from '@/tools/cloudformation/update_stack'
|
||||
import { validateTemplateTool } from '@/tools/cloudformation/validate_template'
|
||||
|
||||
export const cloudformationDescribeStacksTool = describeStacksTool
|
||||
export const cloudformationListStackResourcesTool = listStackResourcesTool
|
||||
export const cloudformationDetectStackDriftTool = detectStackDriftTool
|
||||
export const cloudformationDescribeStackDriftDetectionStatusTool =
|
||||
describeStackDriftDetectionStatusTool
|
||||
export const cloudformationDescribeStackEventsTool = describeStackEventsTool
|
||||
export const cloudformationGetTemplateTool = getTemplateTool
|
||||
export const cloudformationValidateTemplateTool = validateTemplateTool
|
||||
export const cloudformationCreateStackTool = createStackTool
|
||||
export const cloudformationUpdateStackTool = updateStackTool
|
||||
export const cloudformationDeleteStackTool = deleteStackTool
|
||||
export const cloudformationCancelUpdateStackTool = cancelUpdateStackTool
|
||||
export const cloudformationCreateChangeSetTool = createChangeSetTool
|
||||
export const cloudformationDescribeChangeSetTool = describeChangeSetTool
|
||||
export const cloudformationExecuteChangeSetTool = executeChangeSetTool
|
||||
export const cloudformationGetTemplateSummaryTool = getTemplateSummaryTool
|
||||
@@ -0,0 +1,78 @@
|
||||
import type {
|
||||
CloudFormationListStackResourcesParams,
|
||||
CloudFormationListStackResourcesResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const listStackResourcesTool: ToolConfig<
|
||||
CloudFormationListStackResourcesParams,
|
||||
CloudFormationListStackResourcesResponse
|
||||
> = {
|
||||
id: 'cloudformation_list_stack_resources',
|
||||
name: 'CloudFormation List Stack Resources',
|
||||
description: 'List all resources in a CloudFormation stack',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Stack name or ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/list-stack-resources',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to list CloudFormation stack resources')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
resources: data.output.resources,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
resources: {
|
||||
type: 'array',
|
||||
description: 'List of stack resources with type, status, and drift information',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
import type { ToolResponse } from '@/tools/types'
|
||||
|
||||
interface CloudFormationConnectionConfig {
|
||||
awsRegion: string
|
||||
awsAccessKeyId: string
|
||||
awsSecretAccessKey: string
|
||||
}
|
||||
|
||||
export interface CloudFormationDescribeStacksParams extends CloudFormationConnectionConfig {
|
||||
stackName?: string
|
||||
}
|
||||
|
||||
export interface CloudFormationListStackResourcesParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
}
|
||||
|
||||
export interface CloudFormationDetectStackDriftParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
}
|
||||
|
||||
export interface CloudFormationDescribeStackDriftDetectionStatusParams
|
||||
extends CloudFormationConnectionConfig {
|
||||
stackDriftDetectionId: string
|
||||
}
|
||||
|
||||
export interface CloudFormationDescribeStackEventsParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
limit?: number
|
||||
}
|
||||
|
||||
export interface CloudFormationGetTemplateParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
templateStage?: 'Original' | 'Processed'
|
||||
}
|
||||
|
||||
export interface CloudFormationValidateTemplateParams extends CloudFormationConnectionConfig {
|
||||
templateBody: string
|
||||
}
|
||||
|
||||
interface CloudFormationParameterInput {
|
||||
parameterKey: string
|
||||
parameterValue?: string
|
||||
usePreviousValue?: boolean
|
||||
}
|
||||
|
||||
interface CloudFormationTagInput {
|
||||
key: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface CloudFormationCreateStackParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
templateBody: string
|
||||
parameters?: CloudFormationParameterInput[]
|
||||
capabilities?: string
|
||||
tags?: CloudFormationTagInput[]
|
||||
onFailure?: 'ROLLBACK' | 'DELETE' | 'DO_NOTHING'
|
||||
timeoutInMinutes?: number
|
||||
}
|
||||
|
||||
export interface CloudFormationUpdateStackParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
templateBody?: string
|
||||
usePreviousTemplate?: boolean
|
||||
parameters?: CloudFormationParameterInput[]
|
||||
capabilities?: string
|
||||
tags?: CloudFormationTagInput[]
|
||||
}
|
||||
|
||||
export interface CloudFormationDeleteStackParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
retainResources?: string
|
||||
}
|
||||
|
||||
export interface CloudFormationCancelUpdateStackParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
}
|
||||
|
||||
export interface CloudFormationCreateChangeSetParams extends CloudFormationConnectionConfig {
|
||||
stackName: string
|
||||
changeSetName: string
|
||||
templateBody?: string
|
||||
usePreviousTemplate?: boolean
|
||||
parameters?: CloudFormationParameterInput[]
|
||||
capabilities?: string
|
||||
changeSetType?: 'CREATE' | 'UPDATE' | 'IMPORT'
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface CloudFormationDescribeChangeSetParams extends CloudFormationConnectionConfig {
|
||||
changeSetName: string
|
||||
stackName?: string
|
||||
}
|
||||
|
||||
export interface CloudFormationExecuteChangeSetParams extends CloudFormationConnectionConfig {
|
||||
changeSetName: string
|
||||
stackName?: string
|
||||
}
|
||||
|
||||
export interface CloudFormationGetTemplateSummaryParams extends CloudFormationConnectionConfig {
|
||||
templateBody?: string
|
||||
stackName?: string
|
||||
}
|
||||
|
||||
export interface CloudFormationDescribeStacksResponse extends ToolResponse {
|
||||
output: {
|
||||
stacks: {
|
||||
stackName: string
|
||||
stackId: string
|
||||
stackStatus: string
|
||||
stackStatusReason: string | undefined
|
||||
creationTime: number | undefined
|
||||
lastUpdatedTime: number | undefined
|
||||
description: string | undefined
|
||||
enableTerminationProtection: boolean | undefined
|
||||
driftInformation: {
|
||||
stackDriftStatus: string | undefined
|
||||
lastCheckTimestamp: number | undefined
|
||||
} | null
|
||||
outputs: { outputKey: string; outputValue: string; description: string | undefined }[]
|
||||
tags: { key: string; value: string }[]
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationListStackResourcesResponse extends ToolResponse {
|
||||
output: {
|
||||
resources: {
|
||||
logicalResourceId: string
|
||||
physicalResourceId: string | undefined
|
||||
resourceType: string
|
||||
resourceStatus: string
|
||||
resourceStatusReason: string | undefined
|
||||
lastUpdatedTimestamp: number | undefined
|
||||
driftInformation: {
|
||||
stackResourceDriftStatus: string | undefined
|
||||
lastCheckTimestamp: number | undefined
|
||||
} | null
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationDetectStackDriftResponse extends ToolResponse {
|
||||
output: {
|
||||
stackDriftDetectionId: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationDescribeStackDriftDetectionStatusResponse extends ToolResponse {
|
||||
output: {
|
||||
stackId: string
|
||||
stackDriftDetectionId: string
|
||||
stackDriftStatus: string | undefined
|
||||
detectionStatus: string
|
||||
detectionStatusReason: string | undefined
|
||||
driftedStackResourceCount: number | undefined
|
||||
timestamp: number | undefined
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationDescribeStackEventsResponse extends ToolResponse {
|
||||
output: {
|
||||
events: {
|
||||
stackId: string
|
||||
eventId: string
|
||||
stackName: string
|
||||
logicalResourceId: string | undefined
|
||||
physicalResourceId: string | undefined
|
||||
resourceType: string | undefined
|
||||
resourceStatus: string | undefined
|
||||
resourceStatusReason: string | undefined
|
||||
timestamp: number | undefined
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationGetTemplateResponse extends ToolResponse {
|
||||
output: {
|
||||
templateBody: string
|
||||
stagesAvailable: string[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationValidateTemplateResponse extends ToolResponse {
|
||||
output: {
|
||||
description: string | undefined
|
||||
parameters: {
|
||||
parameterKey: string | undefined
|
||||
defaultValue: string | undefined
|
||||
noEcho: boolean | undefined
|
||||
description: string | undefined
|
||||
}[]
|
||||
capabilities: string[]
|
||||
capabilitiesReason: string | undefined
|
||||
declaredTransforms: string[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationCreateStackResponse extends ToolResponse {
|
||||
output: {
|
||||
stackId: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationUpdateStackResponse extends ToolResponse {
|
||||
output: {
|
||||
stackId: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationDeleteStackResponse extends ToolResponse {
|
||||
output: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationCancelUpdateStackResponse extends ToolResponse {
|
||||
output: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationCreateChangeSetResponse extends ToolResponse {
|
||||
output: {
|
||||
changeSetId: string
|
||||
stackId: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationDescribeChangeSetResponse extends ToolResponse {
|
||||
output: {
|
||||
changeSetName: string | undefined
|
||||
changeSetId: string | undefined
|
||||
stackId: string | undefined
|
||||
stackName: string | undefined
|
||||
description: string | undefined
|
||||
executionStatus: string | undefined
|
||||
status: string | undefined
|
||||
statusReason: string | undefined
|
||||
creationTime: number | undefined
|
||||
capabilities: string[]
|
||||
changes: {
|
||||
action: string | undefined
|
||||
logicalResourceId: string | undefined
|
||||
physicalResourceId: string | undefined
|
||||
resourceType: string | undefined
|
||||
replacement: string | undefined
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationExecuteChangeSetResponse extends ToolResponse {
|
||||
output: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface CloudFormationGetTemplateSummaryResponse extends ToolResponse {
|
||||
output: {
|
||||
description: string | undefined
|
||||
parameters: {
|
||||
parameterKey: string | undefined
|
||||
defaultValue: string | undefined
|
||||
parameterType: string | undefined
|
||||
noEcho: boolean | undefined
|
||||
description: string | undefined
|
||||
}[]
|
||||
capabilities: string[]
|
||||
capabilitiesReason: string | undefined
|
||||
resourceTypes: string[]
|
||||
version: string | undefined
|
||||
declaredTransforms: string[]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
import type {
|
||||
CloudFormationUpdateStackParams,
|
||||
CloudFormationUpdateStackResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const updateStackTool: ToolConfig<
|
||||
CloudFormationUpdateStackParams,
|
||||
CloudFormationUpdateStackResponse
|
||||
> = {
|
||||
id: 'cloudformation_update_stack',
|
||||
name: 'CloudFormation Update Stack',
|
||||
description: 'Update an existing CloudFormation stack with a new or previous template',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
stackName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name or ID of the stack to update',
|
||||
},
|
||||
templateBody: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'The new CloudFormation template body (JSON or YAML). Required unless usePreviousTemplate is true',
|
||||
},
|
||||
usePreviousTemplate: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Reuse the template currently associated with the stack instead of providing templateBody',
|
||||
},
|
||||
parameters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Template input parameters (e.g., [{"parameterKey": "InstanceType", "parameterValue": "t3.micro"}])',
|
||||
},
|
||||
capabilities: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Comma-separated capabilities to acknowledge (CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND)',
|
||||
},
|
||||
tags: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Tags to apply to the stack and its resources (e.g., [{"key": "env", "value": "prod"}])',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/update-stack',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
stackName: params.stackName,
|
||||
...(params.templateBody && { templateBody: params.templateBody }),
|
||||
...(params.usePreviousTemplate !== undefined && {
|
||||
usePreviousTemplate: params.usePreviousTemplate,
|
||||
}),
|
||||
...(params.parameters && { parameters: params.parameters }),
|
||||
...(params.capabilities && { capabilities: params.capabilities }),
|
||||
...(params.tags && { tags: params.tags }),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to update CloudFormation stack')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stackId: data.output.stackId,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stackId: { type: 'string', description: 'The unique ID of the updated stack' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import type {
|
||||
CloudFormationValidateTemplateParams,
|
||||
CloudFormationValidateTemplateResponse,
|
||||
} from '@/tools/cloudformation/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const validateTemplateTool: ToolConfig<
|
||||
CloudFormationValidateTemplateParams,
|
||||
CloudFormationValidateTemplateResponse
|
||||
> = {
|
||||
id: 'cloudformation_validate_template',
|
||||
name: 'CloudFormation Validate Template',
|
||||
description: 'Validate a CloudFormation template for syntax and structural correctness',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
awsRegion: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS region (e.g., us-east-1)',
|
||||
},
|
||||
awsAccessKeyId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS access key ID',
|
||||
},
|
||||
awsSecretAccessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'AWS secret access key',
|
||||
},
|
||||
templateBody: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The CloudFormation template body (JSON or YAML)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: '/api/tools/cloudformation/validate-template',
|
||||
method: 'POST',
|
||||
headers: () => ({
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
region: params.awsRegion,
|
||||
accessKeyId: params.awsAccessKeyId,
|
||||
secretAccessKey: params.awsSecretAccessKey,
|
||||
templateBody: params.templateBody,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || 'Failed to validate CloudFormation template')
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
description: data.output.description,
|
||||
parameters: data.output.parameters,
|
||||
capabilities: data.output.capabilities,
|
||||
capabilitiesReason: data.output.capabilitiesReason,
|
||||
declaredTransforms: data.output.declaredTransforms,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
description: { type: 'string', description: 'Template description' },
|
||||
parameters: {
|
||||
type: 'array',
|
||||
description: 'Template parameters with defaults and descriptions',
|
||||
},
|
||||
capabilities: { type: 'array', description: 'Required capabilities (e.g., CAPABILITY_IAM)' },
|
||||
capabilitiesReason: { type: 'string', description: 'Reason capabilities are required' },
|
||||
declaredTransforms: {
|
||||
type: 'array',
|
||||
description: 'Transforms used in the template (e.g., AWS::Serverless-2016-10-31)',
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user