AppRunner CLI error when setting RuntimeEnvironmentVariables

1

I'm trying to pass some environment variables to AppRunner on the command line. Here's my approximate command line:

aws apprunner create-service --service-name some_name --source-configuration '{"AuthenticationConfiguration": {...}, "ImageRepository": {"ImageIdentifier": "my-image:latest",
 "ImageConfiguration": {
    "Port": "8080", 
    "RuntimeEnvironmentVariables": [ { "ITERATIONS": "2000"} ]
},
  "ImageRepositoryType": "ECR"}}' --region us-east-1

When I call this, I get the following error: Parameter validation failed: Invalid type for parameter SourceConfiguration.ImageRepository.ImageConfiguration.RuntimeEnvironmentVariables, value: [OrderedDict([('ITERATIONS', '2000')])], type: <class 'list'>, valid types: <class 'dict'>

Looking at the create-service docs, I believe my usage is correct, so the OrderedDict error doesn't make too much sense. Can anyone spot something wrong with my CLI command, or anyone have an example of their use of the RuntimeEnvironmentVariables option?

howellz
preguntada hace 2 años472 visualizaciones
1 Respuesta
0

I removed the list from the value I was passing to RuntimeEnvironmentVariables & it worked. So specifically: "ImageConfiguration": {"Port": "8080", "RuntimeEnvironmentVariables": { "PI_ITERATIONS": "2000"} } rather than "RuntimeEnvironmentVariables": [{...}].

This does NOT look like the example given in the docs:

                    "RuntimeEnvironmentVariables": [
                        {
                            "NAME": "Jane"
                        }
                    ]

So I think either the docs or the CLI is wrong. I'm using CLI version aws-cli/2.4.6. I'd still appreciate some other answers of example usages of CLI commands if anyone has, since the doc ones seem to be wrong. I also haven't tried passing multiple environment variables yet.

howellz
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas