Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
LzAws is a PowerShell module for deploying and managing multi-tenant SaaS applications on AWS. It provides cmdlets for deploying system infrastructure, tenant resources, authentication systems, web applications, and static assets.
# Use the Import-LzAws.ps1 script during development .\Import-LzAws.ps1 # Or manually import Import-Module ./LzAws.psd1 -Force
# Install for current user .\Install-LzAws.ps1 -Scope CurrentUser # Install for all users (requires admin) .\Install-LzAws.ps1 -Scope AllUsers
These are the deployment commands, listed in their typical order of execution.
# Deploy system infrastructure (from Service/AwsTemplates folder) Deploy-SystemAws # Deploy policies (from Service/AwsTemplates folder) Deploy-PoliciesAws # Deploy permissions (from Service/AwsTemplates folder) Deploy-PermsAws # Deploy authentication resources (from Service/AwsTemplates folder) Deploy-AuthsAws # Deploy services (Lambda functions) (from Service/AwsTemplates folder) Deploy-ServiceAws -ServiceKey "myservice" # Deploy web application (from App's solution folder) Deploy-WebappAws # Deploy Assets to S3 (from Tenancies solution folder) Deploy-AssetsAws # Deploy all tenants (from Service/AwsTemplates folder) Deploy-TenantsAws # Or deploy a specific tenant Deploy-TenantAws -TenantKey "tenant1"
The module uses YAML configuration files (
systemconfig.yaml) that must include:
Configuration files are discovered by searching up the directory tree using
Find-FileUp.
Example error format:
$errorMessage = @" Error: Brief description of what went wrong Function: FunctionName Hints: - Check your AWS credentials - Verify the systemconfig.yaml exists - Ensure you have the necessary permissions "@
$script:LzAwsVerbosePreference: Controls verbosity separate from PowerShell's $VerbosePreference$script:awsModulesRemoved: Tracks if conflicting AWS modules have been removed$script:LzConfig: Cached configuration dataThe module includes test error deployment functionality:
Deploy-TestError # Tests error handling Get-TestError # Retrieves test error
Get-AwsCommands to see all available commandsGet-LzAwsHelp for detailed help on any commandInitialize-LzAwsModules$script:Config, $script:ProfileName)Get-SystemConfig at the start of functions to ensure configuration is loadedPrivate Functions MUST:
throw $errorMessage to propagate errors upPublic Functions MUST:
Write-Host ($_.Exception.Message)$false on error or use exit 1 for critical failures$true on success[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()], [ValidateSet()], [ValidatePattern()]$Value = $DefaultValue if($Config.ContainsKey('Property') -and ![string]::IsNullOrWhiteSpace($Config.Property)) { $Value = $Config.Property }
Find-FileUp to locate systemconfig.yaml from any directory$script:Config after first loadGet-StackOutputs and merged into parametersif ($null -eq $Config) before using configuration-ProfileName $script:ProfileName -Region $script:Region on AWS cmdletsConvertTo-ParameterOverridesFunctions:
Verb-NounAws (e.g., Deploy-SystemAws)Verb-Noun (e.g., Get-SystemConfig)Variables:
$TenantKey)$StackName)$script:profileName)Write-LzAwsVerbose function, NOT Write-VerboseSet-LzAwsVerbosity -Preference "Continue"/Public, private in /PrivateFunctionsToExport in LzAws.psd1 for new public functions-Verbose parameter - use the module's custom systemDeploy-TestError to verify error handling works correctlyFind-FileUp worksSet-LzAwsVerbosity -Preference "Continue"Required modules with minimum versions:
powershell-yaml: 0.4.2AWS.Tools.Common: 4.1.748AWS.Tools.S3: 4.1.748AWS.Tools.CloudFormation: 4.1.748AWS.Tools.CloudFrontKeyValueStore: 4.1.748AWS.Tools.DynamoDBv2: 4.1.136