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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인