def get_local_configuration()

in lib/configuration.py [0:0]


def get_local_configuration(environment: str) -> dict:
    """
    Provides manually configured variables that are validated for quality and safety.
    @param: environment str: The environment used to retrieve corresponding configuration
    @raises: Exception: Throws an exception if the resource_name_prefix does not conform
    @raises: Exception: Throws an exception if the requested environment does not exist
    @return: dict:
    """
    local_mapping = {
        DEPLOYMENT: {
            ACCOUNT_ID: '',
            REGION: 'us-east-2',
            GITHUB_REPOSITORY_OWNER_NAME: '',
            GITHUB_REPOSITORY_NAME: '',
            # This is used in the Logical Id of CloudFormation resources.
            # We recommend Capital case for consistency.
            # Example: DataLakeCdkBlog
            LOGICAL_ID_PREFIX: '',
            # Important: This is used in resources that must be **globally** unique!
            # Resource names may only contain Alphanumeric and hyphens and cannot contain trailing hyphens.
            # Example: unique-identifier-data-lake
            RESOURCE_NAME_PREFIX: '',
        },
        DEV: {
            ACCOUNT_ID: '',
            REGION: 'us-east-2',
            VPC_CIDR: '10.20.0.0/24'
        },
        TEST: {
            ACCOUNT_ID: '',
            REGION: 'us-east-2',
            VPC_CIDR: '10.10.0.0/24'
        },
        PROD: {
            ACCOUNT_ID: '',
            REGION: 'us-east-2',
            VPC_CIDR: '10.0.0.0/24'
        }
    }

    resource_prefix = local_mapping[DEPLOYMENT][RESOURCE_NAME_PREFIX]
    if (
        not re.fullmatch('^[a-z|0-9|-]+', resource_prefix)
        or '-' in resource_prefix[-1:] or '-' in resource_prefix[1]
    ):
        raise Exception('Resource names may only contain lowercase Alphanumeric and hyphens '
                        'and cannot contain leading or trailing hyphens')

    if environment not in local_mapping:
        raise Exception(f'The requested environment: {environment} does not exist in local mappings')

    return local_mapping[environment]