mz_env_util.py 830 B

1234567891011121314151617181920212223242526
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. """mz env util"""
  10. from materialize.mzcompose.composition import Composition
  11. from materialize.mzcompose.services.mz import Mz
  12. def get_cloud_hostname(
  13. c: Composition,
  14. app_password: str,
  15. region: str = "aws/us-east-1",
  16. environment: str = "production",
  17. quiet: bool = False,
  18. ) -> str:
  19. with c.override(
  20. Mz(region=region, environment=environment, app_password=app_password)
  21. ):
  22. return c.cloud_hostname(quiet=quiet)