app.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env python3
  2. """
  3. Copyright (c) Contributors to the Open 3D Engine Project.
  4. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. SPDX-License-Identifier: Apache-2.0 OR MIT
  6. """
  7. from aws_cdk import (
  8. App, Environment
  9. )
  10. from aws_metrics.aws_metrics_construct import AWSMetrics
  11. import os
  12. """Configuration"""
  13. REGION = os.environ.get('O3DE_AWS_DEPLOY_REGION', os.environ['CDK_DEFAULT_REGION'])
  14. ACCOUNT = os.environ.get('O3DE_AWS_DEPLOY_ACCOUNT', os.environ['CDK_DEFAULT_ACCOUNT'])
  15. # Set the common prefix to group stacks in a project together. Defaults to LY-AWS<UUID>.
  16. PROJECT_NAME = os.environ.get('O3DE_AWS_PROJECT_NAME', f'O3DE-AWS-PROJECT').upper()
  17. # The name of this feature
  18. FEATURE_NAME = 'AWSMetrics'
  19. # The name of this CDK application
  20. PROJECT_FEATURE_NAME = f'{PROJECT_NAME}-{FEATURE_NAME}'
  21. """End of Configuration"""
  22. app = App()
  23. # Set-up regions to deploy stack to, or use default if not set
  24. env = Environment(
  25. account=ACCOUNT,
  26. region=REGION)
  27. feature_stack = AWSMetrics(
  28. app,
  29. id_=PROJECT_FEATURE_NAME,
  30. project_name=PROJECT_NAME,
  31. feature_name=FEATURE_NAME,
  32. env=env)
  33. app.synth()