Files
o3de/Gems/AWSClientAuth/cdk/aws_client_auth/client_auth_stack.py
T
Steve Pham b4a2edec6a Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
2021-06-30 19:51:55 -07:00

41 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)