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
質問済み 2年前472ビュー
1回答
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
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ