| 523 | } |
| 524 | |
| 525 | export async function getEnvironment( |
| 526 | client: AppConfigClient, |
| 527 | applicationId: string, |
| 528 | environmentId: string |
| 529 | ) { |
| 530 | const response = await client.send( |
| 531 | new GetEnvironmentCommand({ ApplicationId: applicationId, EnvironmentId: environmentId }) |
| 532 | ) |
| 533 | |
| 534 | return { |
| 535 | applicationId: response.ApplicationId ?? applicationId, |
| 536 | id: response.Id ?? '', |
| 537 | name: response.Name ?? '', |
| 538 | description: response.Description ?? null, |
| 539 | state: response.State ?? null, |
| 540 | monitors: (response.Monitors ?? []).map((monitor) => ({ |
| 541 | alarmArn: monitor.AlarmArn ?? '', |
| 542 | alarmRoleArn: monitor.AlarmRoleArn ?? null, |
| 543 | })), |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | export async function updateEnvironment( |
| 548 | client: AppConfigClient, |