Files
o3de/Gems/AWSClientAuth/cdk/aws_client_auth/client_auth_stack.py
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

42 lines
1.9 KiB
Python
Executable File

"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
from aws_cdk import (core)
from auth.cognito_user_pool_sms_role import CognitoUserPoolSMSRole
from cognito.cognito_user_pool import CognitoUserPool
from cognito.cognito_identity_pool import CognitoIdentityPool
from utils import name_utils
from utils.constants import *
class AWSClientAuthStack(core.Stack):
"""
Composes AWS resources required by AWSClientAuth gem to provide authentication and authorization.
"""
def __init__(self, scope: core.Construct, project_name: str, env: core.Environment,
**kwargs) -> None:
"""
:param scope: Construct role scope will be attached to.
:param project_name: Name of the project for resource.
:param env: Environment set up by App.
:param kwargs: -
"""
super().__init__(scope, id=name_utils.format_aws_resource_id(STACK_FEATURE_NAME, project_name, env,
core.Stack.__name__),
stack_name=name_utils.format_aws_resource_name(STACK_FEATURE_NAME, project_name, env,
core.Stack.__name__), env=env,
tags={'AWSProject': project_name, 'AWSFeature': STACK_FEATURE_NAME},
description=f'Deployed resources for the AWS Client Auth Gem for {project_name} project '
f'in {env.region} region',
**kwargs)
sms_role = CognitoUserPoolSMSRole(self, STACK_FEATURE_NAME, project_name, env)
cognito_user_pool = CognitoUserPool(self, STACK_FEATURE_NAME, project_name, env, sms_role)
CognitoIdentityPool(self, STACK_FEATURE_NAME, project_name, env, cognito_user_pool)