The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import * as appconfig from "@distilled.cloud/aws/appconfig"; |
| 2 | import * as Output from "alchemy/Output"; |
| 3 | import type { Application } from "./Application.ts"; |
| 4 | import { makeAppConfigHttpBinding } from "./BindingHttp.ts"; |
| 5 | import type { ConfigurationProfile } from "./ConfigurationProfile.ts"; |
| 6 | import { CreateHostedConfigurationVersion } from "./CreateHostedConfigurationVersion.ts"; |
| 7 | |
| 8 | /** |
| 9 | * HTTP implementation of the {@link CreateHostedConfigurationVersion} |
| 10 | * binding. Calls `appconfig:CreateHostedConfigurationVersion` with the |
| 11 | * Lambda's IAM role, scoped to the bound configuration profile and its |
| 12 | * hosted versions. |
| 13 | */ |
| 14 | export const CreateHostedConfigurationVersionHttp = makeAppConfigHttpBinding( |
| 15 | CreateHostedConfigurationVersion, |
| 16 | { |
| 17 | operation: appconfig.createHostedConfigurationVersion, |
| 18 | spec: (application: Application, configurationProfile: ConfigurationProfile) => ({ |
| 19 | identifiers: { |
| 20 | ApplicationId: application.applicationId, |
| 21 | ConfigurationProfileId: configurationProfile.configurationProfileId, |
| 22 | }, |
| 23 | // Per the service authorization reference, the action is authorized |
| 24 | // against BOTH the application and the configuration profile. |
| 25 | iam: ({ region, accountId }) => ({ |
| 26 | actions: ["appconfig:CreateHostedConfigurationVersion"], |
| 27 | resources: [ |
| 28 | Output.interpolate`arn:aws:appconfig:${region}:${accountId}:application/${application.applicationId}`, |
| 29 | Output.interpolate`arn:aws:appconfig:${region}:${accountId}:application/${application.applicationId}/configurationprofile/${configurationProfile.configurationProfileId}`, |
| 30 | Output.interpolate`arn:aws:appconfig:${region}:${accountId}:application/${application.applicationId}/configurationprofile/${configurationProfile.configurationProfileId}/hostedconfigurationversion/*`, |
| 31 | ], |
| 32 | }), |
| 33 | }), |
| 34 | }, |
| 35 | ); |