0

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 :)

Pedro Alves
  • 1,004
  • 1
  • 21
  • 47

1 Answers1

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"}
}
Gin
  • 55
  • 7
  • I have already tried but gives me - Unknown options: secrets.backend_kwargs:, {connections_prefix, :, airflow/connections,, variables_prefix, :, airflow/variables}}, airflow.providers.amazon.aws.secrets.secrets_manager.SecretsManagerBackend, – Pedro Alves Apr 11 '23 at 08:19
  • 1
    I think you need to wrap the whole `{}` block in single quotes `'` eg: `'{ "secrets.backend": ... }'` – 0x26res Apr 12 '23 at 19:13