You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/AWSGameLift/cdk/app.py

54 lines
1.7 KiB
Python

#!/usr/bin/env python3
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
import os
from aws_cdk import core
from aws_gamelift.aws_gamelift_construct import AWSGameLift
"""Configuration"""
REGION = os.environ.get('O3DE_AWS_DEPLOY_REGION', os.environ.get('CDK_DEFAULT_REGION'))
ACCOUNT = os.environ.get('O3DE_AWS_DEPLOY_ACCOUNT', os.environ.get('CDK_DEFAULT_ACCOUNT'))
# Set the common prefix to group stacks in a project together.
PROJECT_NAME = os.environ.get('O3DE_AWS_PROJECT_NAME', f'O3DE-AWS-PROJECT').upper()
# The name of this feature
FEATURE_NAME = 'AWSGameLift'
# The name of this CDK application
PROJECT_FEATURE_NAME = f'{PROJECT_NAME}-{FEATURE_NAME}'
# Standard Tag Key for project based tags
O3DE_PROJECT_TAG_NAME = 'O3DEProject'
# Standard Tag Key for feature based tags
O3DE_FEATURE_TAG_NAME = 'O3DEFeature'
"""End of Configuration"""
# Set-up regions to deploy stack to, or use default if not set
env = core.Environment(
account=ACCOUNT,
region=REGION)
app = core.App()
feature_struct = AWSGameLift(
app,
id_=PROJECT_FEATURE_NAME,
project_name=PROJECT_NAME,
feature_name=FEATURE_NAME,
tags={O3DE_PROJECT_TAG_NAME: PROJECT_NAME, O3DE_FEATURE_TAG_NAME: FEATURE_NAME},
env=env
)
app.synth()