app.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 core
  8. from aws_metrics.aws_metrics_construct import AWSMetrics
  9. import os
  10. """Configuration"""
  11. REGION = os.environ.get('O3DE_AWS_DEPLOY_REGION', os.environ['CDK_DEFAULT_REGION'])
  12. ACCOUNT = os.environ.get('O3DE_AWS_DEPLOY_ACCOUNT', os.environ['CDK_DEFAULT_ACCOUNT'])
  13. # Set the common prefix to group stacks in a project together. Defaults to LY-AWS<UUID>.
  14. PROJECT_NAME = os.environ.get('O3DE_AWS_PROJECT_NAME', f'O3DE-AWS-PROJECT').upper()
  15. # The name of this feature
  16. FEATURE_NAME = 'AWSMetrics'
  17. # The name of this CDK application
  18. PROJECT_FEATURE_NAME = f'{PROJECT_NAME}-{FEATURE_NAME}'
  19. """End of Configuration"""
  20. app = core.App()
  21. # Set-up regions to deploy stack to, or use default if not set
  22. env = core.Environment(
  23. account=ACCOUNT,
  24. region=REGION)
  25. feature_stack = AWSMetrics(
  26. app,
  27. id_=PROJECT_FEATURE_NAME,
  28. project_name=PROJECT_NAME,
  29. feature_name=FEATURE_NAME,
  30. env=env)
  31. app.synth()