要在AWS App Runner中设置区域环境变量,您可以使用AWS CLI或AWS SDK进行操作。以下是使用AWS CLI的示例:
aws configure
my-app-runner-service
的App Runner服务:aws apprunner create-service --service-name my-app-runner-service --source-configuration file://source-config.json --region us-west-2
my-app-runner-environment
的环境变量:aws apprunner create-environment --service-arn --name my-app-runner-environment --region us-west-2 --variables MY_VARIABLE=my_value
其中,
是您在第2步中创建的App Runner服务的ARN。
aws apprunner describe-environment --service-arn --environment-name my-app-runner-environment --region us-west-2
aws apprunner update-environment --service-arn --environment-name my-app-runner-environment --region us-west-2 --variables MY_VARIABLE=new_value
这些示例将帮助您创建和管理App Runner服务中的区域环境变量。请根据您的实际需求修改示例代码。
上一篇:AWS App Runner - Django - 部署后迁移失败
下一篇:AWS App Runner构建失败:在Django项目中构建pycairo的wheel时找不到pkg-config。