project build: skip STS GetCallerIdentity when every deployment target already has an account
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- aws, typescript
- Área
- build-system, cli
Línea de trabajo
Comienza en lib/schemas/io/config-io.ts de la biblioteca construct y reproduce el caso de AWS_PROFILE con cuentas explícitas en aws-targets.json. Comprueba resolveRegionFallback() en el mismo método, revisa después el pin en src/assets/cdk/package.json y ejecuta scripts/sync-template-cdk.mjs junto con src/assets/tests/cdk-schema-compat.test.ts. Se considera terminado cuando los targets completamente poblados no activan STS durante la compilación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
agentcore project build is meant to be fully offline: it runs cdk synth only, and every stack's environment comes from agentcore/aws-targets.json. It currently isn't, when AWS_PROFILE is set.
Found by @aidandaly24 in review of #1970 (comment):
Non-blocking and fine as a follow-up: synthesis succeeds without credentials, but
AWS_PROFILEcurrently causes the pinnedConfigIO.readAWSDeploymentTargets()to call STS even when every target already has an account. I confirmed this by redirecting STS locally. The build still succeeded, but made sixGetCallerIdentityattempts and inherited the retry latency. Could we avoid that fallback when account values are already present so build is fully offline?
Cause
In @aws/[email protected], lib/schemas/io/config-io.ts:
// Only resolve account for targets that don't already have one saved
if (process.env.AWS_PROFILE) {
const account = await detectAwsAccount(); // <-- STS GetCallerIdentity
if (account) {
targets = targets.map(t => (t.account ? t : { ...t, account }));
}
}
The t.account ? t : ... guard is applied to the result. The STS call itself is gated only on AWS_PROFILE being set, so it fires even when it cannot change anything. detectAwsAccount() swallows failures, which is why the build still succeeds — but the SDK's default retry policy is paid first (the six attempts Aidan measured).
Suggested fix
Hoist the guard so the call is skipped when it would be a no-op:
if (process.env.AWS_PROFILE && targets.some(t => !t.account)) {
...
}
Worth reviewing resolveRegionFallback() in the same method too — it reads shared config files rather than calling a service, so it's cheap, but it runs unconditionally for the same reason.
Notes
- The fix lives in the construct library (
@aws/agentcore-cdk), not this CLI. Landing it here is then a version bump of the exact pin insrc/assets/cdk/package.json(currently0.1.0-alpha.45), whichscripts/sync-template-cdk.mjsandsrc/assets/__tests__/cdk-schema-compat.test.tscover. - No CLI-side workaround is needed in the meantime: build still succeeds, it's latency plus an unnecessary credential dependency.
- Repro: set
AWS_PROFILE, fill inaws-targets.jsonwith explicitaccountvalues, blackholests.*.amazonaws.com, then runagentcore project build.
cc @notgitika
- Lenguaje dominante
- TypeScript
- Estrellas
- 291
- Forks
- 96
- Merge medio
- 17 h 29 min
- PR fusionados (30 d)
- 193
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/agentcore-cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
aws/agentcore-cli#2395 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
aws/agentcore-cli#2392 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
aws/agentcore-cli#2267 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws/agentcore-cli#2258 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws/agentcore-cli#2176 ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws/agentcore-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/vscode-livepreview#876 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
JustJarethB/invoicer#54 ·
-
ICP 1.2.0 shows a scheduled task's interval in milliseconds under the label "Interval (In seconds)"AbiertoNeeds Triage Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
wso2/product-integrator#2585 ·
Los mantenedores suelen responder en 1 día
-
Add: Telemundo West sdAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
design
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MTES-MCT/monitor-field#119 ·
Los mantenedores suelen responder en 1 día