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
gefragt vor 2 Jahren472 Aufrufe
1 Antwort
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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen