Documentation
¶
Overview ¶
Package naming provides deterministic names and domains for Lesser deployments.
Index ¶
- Constants
- func GlobalResourceName(app string, stage Stage, resource string, accountID string, region string) string
- func IsLiveEnvironment(environment string) bool
- func IsLiveStage(stage Stage) bool
- func NormalizeAppName(app string) (string, error)
- func ResourceName(resource string, environment string) string
- func ResourceNameWithApp(app string, resource string, environment string) string
- func S3BucketName(app string, stage Stage, bucketPurpose string, accountID string, region string) string
- func ServiceDomain(service string, stage Stage, baseDomain string) string
- func SharedResourceName(app string, resource string) string
- func SharedStackName(app string) string
- func StageDomain(stage Stage, baseDomain string) string
- func StageResourceName(app string, stage Stage, resource string) string
- func StageStackName(app string, stage Stage) string
- type Stage
Constants ¶
const DefaultAppName = "lesser"
DefaultAppName is used when an explicit app name is not provided.
Variables ¶
This section is empty.
Functions ¶
func GlobalResourceName ¶
func GlobalResourceName(app string, stage Stage, resource string, accountID string, region string) string
GlobalResourceName returns "<app>-<stage>-<resource>-<account>-<region>".
func IsLiveEnvironment ¶
IsLiveEnvironment returns true when the provided environment maps to the live stage.
func IsLiveStage ¶
IsLiveStage returns true when the stage is live.
func NormalizeAppName ¶
NormalizeAppName validates and normalizes an app slug.
func ResourceName ¶
ResourceName returns "<default-app>-<stage>-<resource>" using a loosely-typed environment string.
func ResourceNameWithApp ¶
ResourceNameWithApp returns "<app>-<stage>-<resource>" using a loosely-typed environment string.
func S3BucketName ¶
func S3BucketName(app string, stage Stage, bucketPurpose string, accountID string, region string) string
S3BucketName returns a deterministic S3 bucket name, including account and region for global uniqueness.
func ServiceDomain ¶
ServiceDomain returns "<service>.<stage-domain>", where stage-domain is derived by StageDomain.
func SharedResourceName ¶
SharedResourceName returns "<app>-shared-<resource>".
func SharedStackName ¶
SharedStackName returns "<app>-shared".
func StageDomain ¶
StageDomain returns the stage domain. Live uses the base domain, other stages use "<stage>.<base-domain>".
func StageResourceName ¶
StageResourceName returns "<app>-<stage>-<resource>".
func StageStackName ¶
StageStackName returns "<app>-<stage>".
Types ¶
type Stage ¶
type Stage string
Stage identifies a deployment stage.
Supported deployment stages.
func StageForEnvironment ¶
StageForEnvironment maps common environment aliases to canonical deployment stages.