| 338 | } |
| 339 | |
| 340 | export async function startDeployment( |
| 341 | client: AppConfigClient, |
| 342 | applicationId: string, |
| 343 | environmentId: string, |
| 344 | deploymentStrategyId: string, |
| 345 | configurationProfileId: string, |
| 346 | configurationVersion: string, |
| 347 | description?: string | null |
| 348 | ) { |
| 349 | const response = await client.send( |
| 350 | new StartDeploymentCommand({ |
| 351 | ApplicationId: applicationId, |
| 352 | EnvironmentId: environmentId, |
| 353 | DeploymentStrategyId: deploymentStrategyId, |
| 354 | ConfigurationProfileId: configurationProfileId, |
| 355 | ConfigurationVersion: configurationVersion, |
| 356 | ...(description ? { Description: description } : {}), |
| 357 | }) |
| 358 | ) |
| 359 | |
| 360 | return { |
| 361 | message: `Deployment ${response.DeploymentNumber ?? ''} started`, |
| 362 | deploymentNumber: response.DeploymentNumber ?? null, |
| 363 | state: response.State ?? null, |
| 364 | percentageComplete: response.PercentageComplete ?? null, |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | export async function getDeployment( |
| 369 | client: AppConfigClient, |