Skip to content

Commit 34fa181

Browse files
committed
feat(appconfig): add full CRUD for applications, environments, and configuration profiles
Adds get/update/delete for applications, environments, and configuration profiles, plus delete_hosted_configuration_version — 10 tools rounding out the integration to management-grade CRUD completeness.
1 parent 7f5dcf1 commit 34fa181

38 files changed

Lines changed: 2660 additions & 7 deletions

apps/docs/content/docs/en/tools/appconfig.mdx

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,71 @@ Create an application in AWS AppConfig
107107
| `name` | string | Name of the created application |
108108
| `description` | string | Description of the created application |
109109

110+
### `appconfig_get_application`
111+
112+
Get details about a single AWS AppConfig application
113+
114+
#### Input
115+
116+
| Parameter | Type | Required | Description |
117+
| --------- | ---- | -------- | ----------- |
118+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
119+
| `accessKeyId` | string | Yes | AWS access key ID |
120+
| `secretAccessKey` | string | Yes | AWS secret access key |
121+
| `applicationId` | string | Yes | The application ID to retrieve |
122+
123+
#### Output
124+
125+
| Parameter | Type | Description |
126+
| --------- | ---- | ----------- |
127+
| `id` | string | Application ID |
128+
| `name` | string | Application name |
129+
| `description` | string | Application description |
130+
131+
### `appconfig_update_application`
132+
133+
Update the name or description of an AWS AppConfig application
134+
135+
#### Input
136+
137+
| Parameter | Type | Required | Description |
138+
| --------- | ---- | -------- | ----------- |
139+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
140+
| `accessKeyId` | string | Yes | AWS access key ID |
141+
| `secretAccessKey` | string | Yes | AWS secret access key |
142+
| `applicationId` | string | Yes | The application ID to update |
143+
| `name` | string | No | New name for the application |
144+
| `description` | string | No | New description for the application |
145+
146+
#### Output
147+
148+
| Parameter | Type | Description |
149+
| --------- | ---- | ----------- |
150+
| `message` | string | Operation status message |
151+
| `id` | string | ID of the updated application |
152+
| `name` | string | Name of the updated application |
153+
| `description` | string | Description of the updated application |
154+
155+
### `appconfig_delete_application`
156+
157+
Delete an AWS AppConfig application
158+
159+
#### Input
160+
161+
| Parameter | Type | Required | Description |
162+
| --------- | ---- | -------- | ----------- |
163+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
164+
| `accessKeyId` | string | Yes | AWS access key ID |
165+
| `secretAccessKey` | string | Yes | AWS secret access key |
166+
| `applicationId` | string | Yes | The application ID to delete |
167+
168+
#### Output
169+
170+
| Parameter | Type | Description |
171+
| --------- | ---- | ----------- |
172+
| `message` | string | Operation status message |
173+
| `id` | string | ID of the deleted application |
174+
110175
### `appconfig_list_environments`
111176

112177
List environments for an AWS AppConfig application
@@ -160,6 +225,81 @@ Create an environment for an AWS AppConfig application
160225
| `name` | string | Name of the created environment |
161226
| `state` | string | State of the created environment |
162227

228+
### `appconfig_get_environment`
229+
230+
Get details about a single AWS AppConfig environment
231+
232+
#### Input
233+
234+
| Parameter | Type | Required | Description |
235+
| --------- | ---- | -------- | ----------- |
236+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
237+
| `accessKeyId` | string | Yes | AWS access key ID |
238+
| `secretAccessKey` | string | Yes | AWS secret access key |
239+
| `applicationId` | string | Yes | The application ID that owns the environment |
240+
| `environmentId` | string | Yes | The environment ID to retrieve |
241+
242+
#### Output
243+
244+
| Parameter | Type | Description |
245+
| --------- | ---- | ----------- |
246+
| `applicationId` | string | Owning application ID |
247+
| `id` | string | Environment ID |
248+
| `name` | string | Environment name |
249+
| `description` | string | Environment description |
250+
| `state` | string | Environment state |
251+
| `monitors` | array | CloudWatch alarms monitoring this environment |
252+
|`alarmArn` | string | CloudWatch alarm ARN |
253+
|`alarmRoleArn` | string | IAM role ARN for the alarm |
254+
255+
### `appconfig_update_environment`
256+
257+
Update the name or description of an AWS AppConfig environment
258+
259+
#### Input
260+
261+
| Parameter | Type | Required | Description |
262+
| --------- | ---- | -------- | ----------- |
263+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
264+
| `accessKeyId` | string | Yes | AWS access key ID |
265+
| `secretAccessKey` | string | Yes | AWS secret access key |
266+
| `applicationId` | string | Yes | The application ID that owns the environment |
267+
| `environmentId` | string | Yes | The environment ID to update |
268+
| `name` | string | No | New name for the environment |
269+
| `description` | string | No | New description for the environment |
270+
271+
#### Output
272+
273+
| Parameter | Type | Description |
274+
| --------- | ---- | ----------- |
275+
| `message` | string | Operation status message |
276+
| `applicationId` | string | Owning application ID |
277+
| `id` | string | ID of the updated environment |
278+
| `name` | string | Name of the updated environment |
279+
| `state` | string | State of the updated environment |
280+
281+
### `appconfig_delete_environment`
282+
283+
Delete an AWS AppConfig environment
284+
285+
#### Input
286+
287+
| Parameter | Type | Required | Description |
288+
| --------- | ---- | -------- | ----------- |
289+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
290+
| `accessKeyId` | string | Yes | AWS access key ID |
291+
| `secretAccessKey` | string | Yes | AWS secret access key |
292+
| `applicationId` | string | Yes | The application ID that owns the environment |
293+
| `environmentId` | string | Yes | The environment ID to delete |
294+
295+
#### Output
296+
297+
| Parameter | Type | Description |
298+
| --------- | ---- | ----------- |
299+
| `message` | string | Operation status message |
300+
| `applicationId` | string | Owning application ID |
301+
| `id` | string | ID of the deleted environment |
302+
163303
### `appconfig_list_configuration_profiles`
164304

165305
List configuration profiles for an AWS AppConfig application
@@ -218,6 +358,84 @@ Create a configuration profile in an AWS AppConfig application
218358
| `locationUri` | string | Location URI of the config |
219359
| `type` | string | Profile type |
220360

361+
### `appconfig_get_configuration_profile`
362+
363+
Get details about a single AWS AppConfig configuration profile
364+
365+
#### Input
366+
367+
| Parameter | Type | Required | Description |
368+
| --------- | ---- | -------- | ----------- |
369+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
370+
| `accessKeyId` | string | Yes | AWS access key ID |
371+
| `secretAccessKey` | string | Yes | AWS secret access key |
372+
| `applicationId` | string | Yes | The application ID that owns the configuration profile |
373+
| `configurationProfileId` | string | Yes | The configuration profile ID to retrieve |
374+
375+
#### Output
376+
377+
| Parameter | Type | Description |
378+
| --------- | ---- | ----------- |
379+
| `applicationId` | string | Owning application ID |
380+
| `id` | string | Configuration profile ID |
381+
| `name` | string | Configuration profile name |
382+
| `description` | string | Profile description |
383+
| `locationUri` | string | Location URI of the config |
384+
| `retrievalRoleArn` | string | IAM retrieval role ARN |
385+
| `type` | string | Profile type \(e.g., AWS.Freeform\) |
386+
| `validators` | array | Validators configured on the profile |
387+
|`type` | string | Validator type \(JSON_SCHEMA or LAMBDA\) |
388+
389+
### `appconfig_update_configuration_profile`
390+
391+
Update the name, description, or retrieval role of an AppConfig configuration profile
392+
393+
#### Input
394+
395+
| Parameter | Type | Required | Description |
396+
| --------- | ---- | -------- | ----------- |
397+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
398+
| `accessKeyId` | string | Yes | AWS access key ID |
399+
| `secretAccessKey` | string | Yes | AWS secret access key |
400+
| `applicationId` | string | Yes | The application ID that owns the configuration profile |
401+
| `configurationProfileId` | string | Yes | The configuration profile ID to update |
402+
| `name` | string | No | New name for the configuration profile |
403+
| `description` | string | No | New description for the configuration profile |
404+
| `retrievalRoleArn` | string | No | New ARN of the IAM role used to retrieve the configuration |
405+
406+
#### Output
407+
408+
| Parameter | Type | Description |
409+
| --------- | ---- | ----------- |
410+
| `message` | string | Operation status message |
411+
| `applicationId` | string | Owning application ID |
412+
| `id` | string | ID of the updated configuration profile |
413+
| `name` | string | Name of the updated configuration profile |
414+
| `description` | string | Description of the profile |
415+
| `type` | string | Profile type |
416+
417+
### `appconfig_delete_configuration_profile`
418+
419+
Delete an AWS AppConfig configuration profile
420+
421+
#### Input
422+
423+
| Parameter | Type | Required | Description |
424+
| --------- | ---- | -------- | ----------- |
425+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
426+
| `accessKeyId` | string | Yes | AWS access key ID |
427+
| `secretAccessKey` | string | Yes | AWS secret access key |
428+
| `applicationId` | string | Yes | The application ID that owns the configuration profile |
429+
| `configurationProfileId` | string | Yes | The configuration profile ID to delete |
430+
431+
#### Output
432+
433+
| Parameter | Type | Description |
434+
| --------- | ---- | ----------- |
435+
| `message` | string | Operation status message |
436+
| `applicationId` | string | Owning application ID |
437+
| `id` | string | ID of the deleted configuration profile |
438+
221439
### `appconfig_create_hosted_configuration_version`
222440

223441
Create a new hosted configuration version for an AppConfig configuration profile
@@ -305,6 +523,30 @@ List hosted configuration versions for an AWS AppConfig configuration profile
305523
| `nextToken` | string | Pagination token for the next page |
306524
| `count` | number | Number of versions returned |
307525

526+
### `appconfig_delete_hosted_configuration_version`
527+
528+
Delete a specific hosted configuration version from an AppConfig profile
529+
530+
#### Input
531+
532+
| Parameter | Type | Required | Description |
533+
| --------- | ---- | -------- | ----------- |
534+
| `region` | string | Yes | AWS region \(e.g., us-east-1\) |
535+
| `accessKeyId` | string | Yes | AWS access key ID |
536+
| `secretAccessKey` | string | Yes | AWS secret access key |
537+
| `applicationId` | string | Yes | The application ID that owns the configuration profile |
538+
| `configurationProfileId` | string | Yes | The configuration profile ID that owns the version |
539+
| `versionNumber` | number | Yes | The version number to delete |
540+
541+
#### Output
542+
543+
| Parameter | Type | Description |
544+
| --------- | ---- | ----------- |
545+
| `message` | string | Operation status message |
546+
| `applicationId` | string | Owning application ID |
547+
| `configurationProfileId` | string | Owning configuration profile ID |
548+
| `versionNumber` | number | Version number that was deleted |
549+
308550
### `appconfig_list_deployment_strategies`
309551

310552
List deployment strategies available in AWS AppConfig
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { createLogger } from '@sim/logger'
2+
import { getErrorMessage } from '@sim/utils/errors'
3+
import { generateId } from '@sim/utils/id'
4+
import { type NextRequest, NextResponse } from 'next/server'
5+
import { awsAppConfigDeleteApplicationContract } from '@/lib/api/contracts/tools/aws/appconfig-delete-application'
6+
import { parseToolRequest } from '@/lib/api/server'
7+
import { checkInternalAuth } from '@/lib/auth/hybrid'
8+
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
9+
import { createAppConfigClient, deleteApplication } from '../utils'
10+
11+
const logger = createLogger('AppConfigDeleteApplicationAPI')
12+
13+
export const POST = withRouteHandler(async (request: NextRequest) => {
14+
const requestId = generateId().slice(0, 8)
15+
16+
const auth = await checkInternalAuth(request)
17+
if (!auth.success || !auth.userId) {
18+
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
19+
}
20+
21+
try {
22+
const parsed = await parseToolRequest(awsAppConfigDeleteApplicationContract, request, {
23+
errorFormat: 'details',
24+
logger,
25+
})
26+
if (!parsed.success) return parsed.response
27+
const params = parsed.data.body
28+
29+
logger.info(`[${requestId}] Deleting AppConfig application ${params.applicationId}`)
30+
31+
const client = createAppConfigClient({
32+
region: params.region,
33+
accessKeyId: params.accessKeyId,
34+
secretAccessKey: params.secretAccessKey,
35+
})
36+
37+
try {
38+
const result = await deleteApplication(client, params.applicationId)
39+
logger.info(`[${requestId}] Deleted application`)
40+
return NextResponse.json(result)
41+
} finally {
42+
client.destroy()
43+
}
44+
} catch (error) {
45+
const errorMessage = getErrorMessage(error, 'Unknown error occurred')
46+
logger.error(`[${requestId}] Failed to delete application:`, error)
47+
return NextResponse.json(
48+
{ error: `Failed to delete application: ${errorMessage}` },
49+
{ status: 500 }
50+
)
51+
}
52+
})
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { createLogger } from '@sim/logger'
2+
import { getErrorMessage } from '@sim/utils/errors'
3+
import { generateId } from '@sim/utils/id'
4+
import { type NextRequest, NextResponse } from 'next/server'
5+
import { awsAppConfigDeleteConfigurationProfileContract } from '@/lib/api/contracts/tools/aws/appconfig-delete-configuration-profile'
6+
import { parseToolRequest } from '@/lib/api/server'
7+
import { checkInternalAuth } from '@/lib/auth/hybrid'
8+
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
9+
import { createAppConfigClient, deleteConfigurationProfile } from '../utils'
10+
11+
const logger = createLogger('AppConfigDeleteConfigurationProfileAPI')
12+
13+
export const POST = withRouteHandler(async (request: NextRequest) => {
14+
const requestId = generateId().slice(0, 8)
15+
16+
const auth = await checkInternalAuth(request)
17+
if (!auth.success || !auth.userId) {
18+
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
19+
}
20+
21+
try {
22+
const parsed = await parseToolRequest(awsAppConfigDeleteConfigurationProfileContract, request, {
23+
errorFormat: 'details',
24+
logger,
25+
})
26+
if (!parsed.success) return parsed.response
27+
const params = parsed.data.body
28+
29+
logger.info(
30+
`[${requestId}] Deleting AppConfig configuration profile ${params.configurationProfileId}`
31+
)
32+
33+
const client = createAppConfigClient({
34+
region: params.region,
35+
accessKeyId: params.accessKeyId,
36+
secretAccessKey: params.secretAccessKey,
37+
})
38+
39+
try {
40+
const result = await deleteConfigurationProfile(
41+
client,
42+
params.applicationId,
43+
params.configurationProfileId
44+
)
45+
logger.info(`[${requestId}] Deleted configuration profile`)
46+
return NextResponse.json(result)
47+
} finally {
48+
client.destroy()
49+
}
50+
} catch (error) {
51+
const errorMessage = getErrorMessage(error, 'Unknown error occurred')
52+
logger.error(`[${requestId}] Failed to delete configuration profile:`, error)
53+
return NextResponse.json(
54+
{ error: `Failed to delete configuration profile: ${errorMessage}` },
55+
{ status: 500 }
56+
)
57+
}
58+
})

0 commit comments

Comments
 (0)