AWS Cli – MWAA – 使用配置选项创建环境

huangapple go评论67阅读模式
英文:

AWS Cli - MWAA - Create environment with configuration options

问题

我通过AWS Cli的create-environment函数创建MWAA环境。我可以创建环境,但现在我尝试添加一个配置选项,以便我可以将AWS Secret Manager用作后端 (https://docs.aws.amazon.com/mwaa/latest/userguide/connections-secrets-manager.html)。我的命令是:

aws mwaa create-environment --name "my_mwaa_env" --airflow-configuration-options "secrets.backend": "airflow.providers.amazon.aws.secrets.secrets_manager.SecretsManagerBackend", "secrets.backend_kwargs": '{"connections_prefix" : "airflow/connections", "variables_prefix" : "airflow/variables"}'

我已经将参数airflow-configuration-options设置为String和Json,但我无法使用这些选项创建。使用这个版本,我得到了这个错误:

Unknown options: airflow/connections,, variables_prefix, :, airflow/variables}, :

是否有类似用例的示例?谢谢 AWS Cli – MWAA – 使用配置选项创建环境

英文:

I'm creating MWAA enviornments through AWS Cli with the create-environment function. I can create the environment without any problems but now I'm trying to add a configuration option so I can use AWS Secret Manager as the backend (https://docs.aws.amazon.com/mwaa/latest/userguide/connections-secrets-manager.html). My command is this:

aws mwaa create-environment --name "my_mwaa_env" --airflow-configuration-options "secrets.backend": "airflow.providers.amazon.aws.secrets.secrets_manager.SecretsManagerBackend", "secrets.backend_kwargs": '{"connections_prefix" : "airflow/connections", "variables_prefix" : "airflow/variables"}'

I already put the parameter airflow-configuration-options as String, Json, but I am not able to create with these options. With this version I'm getting this error:

Unknown options: airflow/connections,, variables_prefix, :, airflow/variables}, :

Does anyone have an example of a similar use case?
Thanks AWS Cli – MWAA – 使用配置选项创建环境

答案1

得分: 0

Looks like --airflow-configuration-options needs to be a map. You can refer to https://docs.aws.amazon.com/cli/latest/reference/mwaa/create-environment.html
So it's something like

aws mwaa create-environment --name "my_mwaa_env" --airflow-configuration-options {
  "secrets.backend": "airflow.providers.amazon.aws.secrets.secrets_manager.SecretsManagerBackend", "secrets.backend_kwargs": {"connections_prefix" : "airflow/connections", "variables_prefix" : "airflow/variables"}
}
英文:

Looks like --airflow-configuration-options needs to be a map. You can refer to https://docs.aws.amazon.com/cli/latest/reference/mwaa/create-environment.html
So it's something like

aws mwaa create-environment --name "my_mwaa_env" --airflow-configuration-options {
  "secrets.backend": "airflow.providers.amazon.aws.secrets.secrets_manager.SecretsManagerBackend", "secrets.backend_kwargs": {"connections_prefix" : "airflow/connections", "variables_prefix" : "airflow/variables"}
}

huangapple
  • 本文由 发表于 2023年4月11日 07:10:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/75981362.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定