Skip to content

Latest commit

 

History

History
3805 lines (2337 loc) · 114 KB

API.md

File metadata and controls

3805 lines (2337 loc) · 114 KB

API Reference

Constructs

AccountWrapper

Wrapper for account-level stacks.

Initializers

import { AccountWrapper } from '@alma-cdk/project'

new AccountWrapper(scope: Construct)
Name Type Description
scope constructs.Construct No description.

scopeRequired
  • Type: constructs.Construct

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { AccountWrapper } from '@alma-cdk/project'

AccountWrapper.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


EnvironmentWrapper

Wrapper for environmental stacks.

Initializers

import { EnvironmentWrapper } from '@alma-cdk/project'

new EnvironmentWrapper(scope: Construct)
Name Type Description
scope constructs.Construct No description.

scopeRequired
  • Type: constructs.Construct

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { EnvironmentWrapper } from '@alma-cdk/project'

EnvironmentWrapper.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


Project

High-level wrapper for cdk.App with specific requirements for props.

Use it like you would cdk.App and assign stacks into it.

Example

// new Project instead of new App
const project = new Project({
  name: 'my-cool-project',
  author: {
    organization: 'Acme Corp',
    name: 'Mad Scientists',
    email: '[email protected]',
  },
  defaultRegion: 'eu-west-1', // defaults to one of: $CDK_DEFAULT_REGION, $AWS_REGION or us-east-1
  accounts: {
    dev: {
      id: '111111111111',
      environments: ['development', 'feature/.*', 'staging'],
      config: {
        baseDomain: 'example.net',
      },
    },
    prod: {
      id: '222222222222',
      environments: ['production'],
      config: {
        baseDomain: 'example.com',
      },
    },
  },
})

Initializers

import { Project } from '@alma-cdk/project'

new Project(props: ProjectProps)
Name Type Description
props ProjectProps No description.

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
synth Synthesize this stage into a cloud assembly.
acknowledgeWarnings Acknowledge warnings for all stacks in the project.

toString
public toString(): string

Returns a string representation of this construct.

synth
public synth(options?: StageSynthesisOptions): CloudAssembly

Synthesize this stage into a cloud assembly.

Once an assembly has been synthesized, it cannot be modified. Subsequent calls will return the same assembly.

optionsOptional
  • Type: aws-cdk-lib.StageSynthesisOptions

acknowledgeWarnings
public acknowledgeWarnings(acknowledgements: Acknowledgeable[]): void

Acknowledge warnings for all stacks in the project.

acknowledgementsRequired

Static Functions

Name Description
isConstruct Checks if x is a construct.
isStage Test whether the given construct is a stage.
of Return the stage this construct is contained with, if available.
isApp Checks if an object is an instance of the App class.
getAccount Return account configuration.
getConfiguration Return the project configuration as given in ProjectProps.

isConstruct
import { Project } from '@alma-cdk/project'

Project.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isStage
import { Project } from '@alma-cdk/project'

Project.isStage(x: any)

Test whether the given construct is a stage.

xRequired
  • Type: any

of
import { Project } from '@alma-cdk/project'

Project.of(construct: IConstruct)

Return the stage this construct is contained with, if available.

If called on a nested stage, returns its parent.

constructRequired
  • Type: constructs.IConstruct

isApp
import { Project } from '@alma-cdk/project'

Project.isApp(obj: any)

Checks if an object is an instance of the App class.

objRequired
  • Type: any

The object to evaluate.


getAccount
import { Project } from '@alma-cdk/project'

Project.getAccount(scope: Construct, accountType: string)

Return account configuration.

scopeRequired
  • Type: constructs.Construct

accountTypeRequired
  • Type: string

getConfiguration
import { Project } from '@alma-cdk/project'

Project.getConfiguration(scope: Construct)

Return the project configuration as given in ProjectProps.

scopeRequired
  • Type: constructs.Construct

Properties

Name Type Description
node constructs.Node The tree node.
artifactId string Artifact ID of the assembly if it is a nested stage. The root stage (app) will return an empty string.
assetOutdir string The cloud assembly asset output directory.
outdir string The cloud assembly output directory.
policyValidationBeta1 aws-cdk-lib.IPolicyValidationPluginBeta1[] Validation plugins to run during synthesis.
stageName string The name of the stage.
account string The default account for all resources defined within this stage.
parentStage aws-cdk-lib.Stage The parent stage or undefined if this is the app.
region string The default region for all resources defined within this stage.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


artifactIdRequired
public readonly artifactId: string;
  • Type: string

Artifact ID of the assembly if it is a nested stage. The root stage (app) will return an empty string.

Derived from the construct path.


assetOutdirRequired
public readonly assetOutdir: string;
  • Type: string

The cloud assembly asset output directory.


outdirRequired
public readonly outdir: string;
  • Type: string

The cloud assembly output directory.


policyValidationBeta1Required
public readonly policyValidationBeta1: IPolicyValidationPluginBeta1[];
  • Type: aws-cdk-lib.IPolicyValidationPluginBeta1[]
  • Default: no validation plugins are used

Validation plugins to run during synthesis.

If any plugin reports any violation, synthesis will be interrupted and the report displayed to the user.


stageNameRequired
public readonly stageName: string;
  • Type: string

The name of the stage.

Based on names of the parent stages separated by hypens.


accountOptional
public readonly account: string;
  • Type: string

The default account for all resources defined within this stage.


parentStageOptional
public readonly parentStage: Stage;
  • Type: aws-cdk-lib.Stage

The parent stage or undefined if this is the app.


regionOptional
public readonly region: string;
  • Type: string

The default region for all resources defined within this stage.


Constants

Name Type Description
CONTEXT_SCOPE string Namespace/key how this tool internally keeps track of the project configuration.

CONTEXT_SCOPERequired
public readonly CONTEXT_SCOPE: string;
  • Type: string

Namespace/key how this tool internally keeps track of the project configuration.


SmartStack

Initializers

import { SmartStack } from '@alma-cdk/project'

new SmartStack(scope: Construct, id: string, props: StackProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props aws-cdk-lib.StackProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired
  • Type: aws-cdk-lib.StackProps

Methods

Name Description
toString Returns a string representation of this construct.
addDependency Add a dependency between this stack and another stack.
addMetadata Adds an arbitary key-value pair, with information you want to record about the stack.
addTransform Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template.
exportStringListValue Create a CloudFormation Export for a string list value.
exportValue Create a CloudFormation Export for a string value.
formatArn Creates an ARN from components.
getLogicalId Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.
regionalFact Look up a fact value for the given fact for the region of this stack.
renameLogicalId Rename a generated logical identities.
reportMissingContextKey Indicate that a context key was expected.
resolve Resolve a tokenized value in the context of the current stack.
splitArn Splits the provided ARN into its components.
toJsonString Convert an object, potentially containing tokens, to a JSON string.
toYamlString Convert an object, potentially containing tokens, to a YAML string.

toString
public toString(): string

Returns a string representation of this construct.

addDependency
public addDependency(target: Stack, reason?: string): void

Add a dependency between this stack and another stack.

This can be used to define dependencies between any two stacks within an app, and also supports nested stacks.

targetRequired
  • Type: aws-cdk-lib.Stack

reasonOptional
  • Type: string

addMetadata
public addMetadata(key: string, value: any): void

Adds an arbitary key-value pair, with information you want to record about the stack.

These get translated to the Metadata section of the generated template.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

keyRequired
  • Type: string

valueRequired
  • Type: any

addTransform
public addTransform(transform: string): void

Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template.

Duplicate values are removed when stack is synthesized.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html

Example

declare const stack: Stack;

stack.addTransform('AWS::Serverless-2016-10-31')
transformRequired
  • Type: string

The transform to add.


exportStringListValue
public exportStringListValue(exportedValue: any, options?: ExportValueOptions): string[]

Create a CloudFormation Export for a string list value.

Returns a string list representing the corresponding Fn.importValue() expression for this Export. The export expression is automatically wrapped with an Fn::Join and the import value with an Fn::Split, since CloudFormation can only export strings. You can control the name for the export by passing the name option.

If you don't supply a value for name, the value you're exporting must be a Resource attribute (for example: bucket.bucketName) and it will be given the same name as the automatic cross-stack reference that would be created if you used the attribute in another Stack.

One of the uses for this method is to remove the relationship between two Stacks established by automatic cross-stack references. It will temporarily ensure that the CloudFormation Export still exists while you remove the reference from the consuming stack. After that, you can remove the resource and the manual export.

See exportValue for an example of this process.

exportedValueRequired
  • Type: any

optionsOptional
  • Type: aws-cdk-lib.ExportValueOptions

exportValue
public exportValue(exportedValue: any, options?: ExportValueOptions): string

Create a CloudFormation Export for a string value.

Returns a string representing the corresponding Fn.importValue() expression for this Export. You can control the name for the export by passing the name option.

If you don't supply a value for name, the value you're exporting must be a Resource attribute (for example: bucket.bucketName) and it will be given the same name as the automatic cross-stack reference that would be created if you used the attribute in another Stack.

One of the uses for this method is to remove the relationship between two Stacks established by automatic cross-stack references. It will temporarily ensure that the CloudFormation Export still exists while you remove the reference from the consuming stack. After that, you can remove the resource and the manual export.

Example

Here is how the process works. Let's say there are two stacks, producerStack and consumerStack, and producerStack has a bucket called bucket, which is referenced by consumerStack (perhaps because an AWS Lambda Function writes into it, or something like that).

It is not safe to remove producerStack.bucket because as the bucket is being deleted, consumerStack might still be using it.

Instead, the process takes two deployments:

Deployment 1: break the relationship

  • Make sure consumerStack no longer references bucket.bucketName (maybe the consumer stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just remove the Lambda Function altogether).
  • In the ProducerStack class, call this.exportValue(this.bucket.bucketName). This will make sure the CloudFormation Export continues to exist while the relationship between the two stacks is being broken.
  • Deploy (this will effectively only change the consumerStack, but it's safe to deploy both).

Deployment 2: remove the bucket resource

  • You are now free to remove the bucket resource from producerStack.
  • Don't forget to remove the exportValue() call as well.
  • Deploy again (this time only the producerStack will be changed -- the bucket will be deleted).
exportedValueRequired
  • Type: any

optionsOptional
  • Type: aws-cdk-lib.ExportValueOptions

formatArn
public formatArn(components: ArnComponents): string

Creates an ARN from components.

If partition, region or account are not specified, the stack's partition, region and account will be used.

If any component is the empty string, an empty string will be inserted into the generated ARN at the location that component corresponds to.

The ARN will be formatted as follows:

arn:{partition}:{service}:{region}:{account}:{resource}{sep}{resource-name}

The required ARN pieces that are omitted will be taken from the stack that the 'scope' is attached to. If all ARN pieces are supplied, the supplied scope can be 'undefined'.

componentsRequired
  • Type: aws-cdk-lib.ArnComponents

getLogicalId
public getLogicalId(element: CfnElement): string

Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.

This method is called when a CfnElement is created and used to render the initial logical identity of resources. Logical ID renames are applied at this stage.

This method uses the protected method allocateLogicalId to render the logical ID for an element. To modify the naming scheme, extend the Stack class and override this method.

elementRequired
  • Type: aws-cdk-lib.CfnElement

The CloudFormation element for which a logical identity is needed.


regionalFact
public regionalFact(factName: string, defaultValue?: string): string

Look up a fact value for the given fact for the region of this stack.

Will return a definite value only if the region of the current stack is resolved. If not, a lookup map will be added to the stack and the lookup will be done at CDK deployment time.

What regions will be included in the lookup map is controlled by the @aws-cdk/core:target-partitions context value: it must be set to a list of partitions, and only regions from the given partitions will be included. If no such context key is set, all regions will be included.

This function is intended to be used by construct library authors. Application builders can rely on the abstractions offered by construct libraries and do not have to worry about regional facts.

If defaultValue is not given, it is an error if the fact is unknown for the given region.

factNameRequired
  • Type: string

defaultValueOptional
  • Type: string

renameLogicalId
public renameLogicalId(oldId: string, newId: string): void

Rename a generated logical identities.

To modify the naming scheme strategy, extend the Stack class and override the allocateLogicalId method.

oldIdRequired
  • Type: string

newIdRequired
  • Type: string

reportMissingContextKey
public reportMissingContextKey(report: MissingContext): void

Indicate that a context key was expected.

Contains instructions which will be emitted into the cloud assembly on how the key should be supplied.

reportRequired
  • Type: aws-cdk-lib.cloud_assembly_schema.MissingContext

The set of parameters needed to obtain the context.


resolve
public resolve(obj: any): any

Resolve a tokenized value in the context of the current stack.

objRequired
  • Type: any

splitArn
public splitArn(arn: string, arnFormat: ArnFormat): ArnComponents

Splits the provided ARN into its components.

Works both if 'arn' is a string like 'arn:aws:s3:::bucket', and a Token representing a dynamic CloudFormation expression (in which case the returned components will also be dynamic CloudFormation expressions, encoded as Tokens).

arnRequired
  • Type: string

the ARN to split into its components.


arnFormatRequired
  • Type: aws-cdk-lib.ArnFormat

the expected format of 'arn' - depends on what format the service 'arn' represents uses.


toJsonString
public toJsonString(obj: any, space?: number): string

Convert an object, potentially containing tokens, to a JSON string.

objRequired
  • Type: any

spaceOptional
  • Type: number

toYamlString
public toYamlString(obj: any): string

Convert an object, potentially containing tokens, to a YAML string.

objRequired
  • Type: any

Static Functions

Name Description
isConstruct Checks if x is a construct.
isStack Return whether the given object is a Stack.
of Looks up the first stack scope in which construct is defined.

isConstruct
import { SmartStack } from '@alma-cdk/project'

SmartStack.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isStack
import { SmartStack } from '@alma-cdk/project'

SmartStack.isStack(x: any)

Return whether the given object is a Stack.

We do attribute detection since we can't reliably use 'instanceof'.

xRequired
  • Type: any

of
import { SmartStack } from '@alma-cdk/project'

SmartStack.of(construct: IConstruct)

Looks up the first stack scope in which construct is defined.

Fails if there is no stack up the tree.

constructRequired
  • Type: constructs.IConstruct

The construct to start the search from.


Properties

Name Type Description
node constructs.Node The tree node.
account string The AWS account into which this stack will be deployed.
artifactId string The ID of the cloud assembly artifact for this stack.
availabilityZones string[] Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.
bundlingRequired boolean Indicates whether the stack requires bundling or not.
dependencies aws-cdk-lib.Stack[] Return the stacks this stack depends on.
environment string The environment coordinates in which this stack is deployed.
nested boolean Indicates if this is a nested stack, in which case parentStack will include a reference to it's parent.
notificationArns string[] Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
partition string The partition in which this stack is defined.
region string The AWS region into which this stack will be deployed (e.g. us-west-2).
stackId string The ID of the stack.
stackName string The concrete CloudFormation physical stack name.
synthesizer aws-cdk-lib.IStackSynthesizer Synthesis method for this stack.
tags aws-cdk-lib.TagManager Tags to be applied to the stack.
templateFile string The name of the CloudFormation template file emitted to the output directory during synthesis.
templateOptions aws-cdk-lib.ITemplateOptions Options for CloudFormation template (like version, transform, description).
urlSuffix string The Amazon domain suffix for the region in which this stack is defined.
nestedStackParent aws-cdk-lib.Stack If this is a nested stack, returns it's parent stack.
nestedStackResource aws-cdk-lib.CfnResource If this is a nested stack, this represents its AWS::CloudFormation::Stack resource.
terminationProtection boolean Whether termination protection is enabled for this stack.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


accountRequired
public readonly account: string;
  • Type: string

The AWS account into which this stack will be deployed.

This value is resolved according to the following rules:

  1. The value provided to env.account when the stack is defined. This can either be a concrete account (e.g. 585695031111) or the Aws.ACCOUNT_ID token.
  2. Aws.ACCOUNT_ID, which represents the CloudFormation intrinsic reference { "Ref": "AWS::AccountId" } encoded as a string token.

Preferably, you should use the return value as an opaque string and not attempt to parse it to implement your logic. If you do, you must first check that it is a concrete value an not an unresolved token. If this value is an unresolved token (Token.isUnresolved(stack.account) returns true), this implies that the user wishes that this stack will synthesize into a account-agnostic template. In this case, your code should either fail (throw an error, emit a synth error using Annotations.of(construct).addError()) or implement some other region-agnostic behavior.


artifactIdRequired
public readonly artifactId: string;
  • Type: string

The ID of the cloud assembly artifact for this stack.


availabilityZonesRequired
public readonly availabilityZones: string[];
  • Type: string[]

Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.

If the stack is environment-agnostic (either account and/or region are tokens), this property will return an array with 2 tokens that will resolve at deploy-time to the first two availability zones returned from CloudFormation's Fn::GetAZs intrinsic function.

If they are not available in the context, returns a set of dummy values and reports them as missing, and let the CLI resolve them by calling EC2 DescribeAvailabilityZones on the target environment.

To specify a different strategy for selecting availability zones override this method.


bundlingRequiredRequired
public readonly bundlingRequired: boolean;
  • Type: boolean

Indicates whether the stack requires bundling or not.


dependenciesRequired
public readonly dependencies: Stack[];
  • Type: aws-cdk-lib.Stack[]

Return the stacks this stack depends on.


environmentRequired
public readonly environment: string;
  • Type: string

The environment coordinates in which this stack is deployed.

In the form aws://account/region. Use stack.account and stack.region to obtain the specific values, no need to parse.

You can use this value to determine if two stacks are targeting the same environment.

If either stack.account or stack.region are not concrete values (e.g. Aws.ACCOUNT_ID or Aws.REGION) the special strings unknown-account and/or unknown-region will be used respectively to indicate this stack is region/account-agnostic.


nestedRequired
public readonly nested: boolean;
  • Type: boolean

Indicates if this is a nested stack, in which case parentStack will include a reference to it's parent.


notificationArnsRequired
public readonly notificationArns: string[];
  • Type: string[]

Returns the list of notification Amazon Resource Names (ARNs) for the current stack.


partitionRequired
public readonly partition: string;
  • Type: string

The partition in which this stack is defined.


regionRequired
public readonly region: string;
  • Type: string

The AWS region into which this stack will be deployed (e.g. us-west-2).

This value is resolved according to the following rules:

  1. The value provided to env.region when the stack is defined. This can either be a concrete region (e.g. us-west-2) or the Aws.REGION token.
  2. Aws.REGION, which is represents the CloudFormation intrinsic reference { "Ref": "AWS::Region" } encoded as a string token.

Preferably, you should use the return value as an opaque string and not attempt to parse it to implement your logic. If you do, you must first check that it is a concrete value an not an unresolved token. If this value is an unresolved token (Token.isUnresolved(stack.region) returns true), this implies that the user wishes that this stack will synthesize into a region-agnostic template. In this case, your code should either fail (throw an error, emit a synth error using Annotations.of(construct).addError()) or implement some other region-agnostic behavior.


stackIdRequired
public readonly stackId: string;
  • Type: string

The ID of the stack.


Example

// After resolving, looks like
'arn:aws:cloudformation:us-west-2:123456789012:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123'
stackNameRequired
public readonly stackName: string;
  • Type: string

The concrete CloudFormation physical stack name.

This is either the name defined explicitly in the stackName prop or allocated based on the stack's location in the construct tree. Stacks that are directly defined under the app use their construct id as their stack name. Stacks that are defined deeper within the tree will use a hashed naming scheme based on the construct path to ensure uniqueness.

If you wish to obtain the deploy-time AWS::StackName intrinsic, you can use Aws.STACK_NAME directly.


synthesizerRequired
public readonly synthesizer: IStackSynthesizer;
  • Type: aws-cdk-lib.IStackSynthesizer

Synthesis method for this stack.


tagsRequired
public readonly tags: TagManager;
  • Type: aws-cdk-lib.TagManager

Tags to be applied to the stack.


templateFileRequired
public readonly templateFile: string;
  • Type: string

The name of the CloudFormation template file emitted to the output directory during synthesis.

Example value: MyStack.template.json


templateOptionsRequired
public readonly templateOptions: ITemplateOptions;
  • Type: aws-cdk-lib.ITemplateOptions

Options for CloudFormation template (like version, transform, description).


urlSuffixRequired
public readonly urlSuffix: string;
  • Type: string

The Amazon domain suffix for the region in which this stack is defined.


nestedStackParentOptional
public readonly nestedStackParent: Stack;
  • Type: aws-cdk-lib.Stack

If this is a nested stack, returns it's parent stack.


nestedStackResourceOptional
public readonly nestedStackResource: CfnResource;
  • Type: aws-cdk-lib.CfnResource

If this is a nested stack, this represents its AWS::CloudFormation::Stack resource.

undefined for top-level (non-nested) stacks.


terminationProtectionRequired
public readonly terminationProtection: boolean;
  • Type: boolean

Whether termination protection is enabled for this stack.


Structs

Account

AWS account configuration.

Initializer

import { Account } from '@alma-cdk/project'

const account: Account = { ... }

Properties

Name Type Description
id string AWS Account ID.
config {[ key: string ]: any} AWS account specific configuration.
environments string[] List of accepted environments for the given account.

idRequired
public readonly id: string;
  • Type: string

AWS Account ID.


Example

'123456789012'
configOptional
public readonly config: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

AWS account specific configuration.

For example VPC IDs (for existing VPCs), Direct Connect Gateway IDs, apex domain names (for Route53 Zone lookups), etc. Basically configuration for resources that are defined outside of this CDK application.


Example

{
  dev: {
    id: '111111111111',
    config: {
      baseDomain: 'example.net',
    },
  },
  prod: {
    id: '222222222222',
    config: {
      baseDomain: 'example.com',
    },
  },
},
environmentsOptional
public readonly environments: string[];
  • Type: string[]

List of accepted environments for the given account.

List of strings or strings representing regexp initialization (passed onto new Regexp("^"+environment+"$", "i")).


Example

["development", "feature/.*"]

AccountConfiguration

Interface for a single account type configuration.

Initializer

import { AccountConfiguration } from '@alma-cdk/project'

const accountConfiguration: AccountConfiguration = { ... }

Properties

Name Type Description
id string No description.
config {[ key: string ]: any} No description.

idRequired
public readonly id: string;
  • Type: string

configOptional
public readonly config: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

AccountStrategyOneProps

Props AccountStrategy.one.

Initializer

import { AccountStrategyOneProps } from '@alma-cdk/project'

const accountStrategyOneProps: AccountStrategyOneProps = { ... }

Properties

Name Type Description
shared AccountConfiguration No description.
mock AccountConfiguration No description.

sharedRequired
public readonly shared: AccountConfiguration;

mockOptional
public readonly mock: AccountConfiguration;

AccountStrategyThreeProps

Props AccountStrategy.three.

Initializer

import { AccountStrategyThreeProps } from '@alma-cdk/project'

const accountStrategyThreeProps: AccountStrategyThreeProps = { ... }

Properties

Name Type Description
dev AccountConfiguration No description.
preprod AccountConfiguration No description.
prod AccountConfiguration No description.
mock AccountConfiguration No description.

devRequired
public readonly dev: AccountConfiguration;

preprodRequired
public readonly preprod: AccountConfiguration;

prodRequired
public readonly prod: AccountConfiguration;

mockOptional
public readonly mock: AccountConfiguration;

AccountStrategyTwoProps

Props AccountStrategy.two.

Initializer

import { AccountStrategyTwoProps } from '@alma-cdk/project'

const accountStrategyTwoProps: AccountStrategyTwoProps = { ... }

Properties

Name Type Description
dev AccountConfiguration No description.
prod AccountConfiguration No description.
mock AccountConfiguration No description.

devRequired
public readonly dev: AccountConfiguration;

prodRequired
public readonly prod: AccountConfiguration;

mockOptional
public readonly mock: AccountConfiguration;

Acknowledgeable

Interface for acknowledging warnings.

Initializer

import { Acknowledgeable } from '@alma-cdk/project'

const acknowledgeable: Acknowledgeable = { ... }

Properties

Name Type Description
id string No description.
message string No description.

idRequired
public readonly id: string;
  • Type: string

messageOptional
public readonly message: string;
  • Type: string

Author

Author information.

I.e. who owns/develops this project/service.

Initializer

import { Author } from '@alma-cdk/project'

const author: Author = { ... }

Properties

Name Type Description
name string Human-readable name for the team/contact responsible for this project/service.
email string Email address for the team/contact responsible for this project/service.
organization string Human-readable name for the organization responsible for this project/service.

nameRequired
public readonly name: string;
  • Type: string

Human-readable name for the team/contact responsible for this project/service.


Example

'Mad Scientists'
emailOptional
public readonly email: string;
  • Type: string

Email address for the team/contact responsible for this project/service.


Example

organizationOptional
public readonly organization: string;
  • Type: string

Human-readable name for the organization responsible for this project/service.


Example

'Acme Corp'

NameProps

Initializer

import { NameProps } from '@alma-cdk/project'

const nameProps: NameProps = { ... }

Properties

Name Type Description
maxLength number No description.
trim boolean No description.

maxLengthOptional
public readonly maxLength: number;
  • Type: number

trimOptional
public readonly trim: boolean;
  • Type: boolean

ProjectConfiguration

Initializer

import { ProjectConfiguration } from '@alma-cdk/project'

const projectConfiguration: ProjectConfiguration = { ... }

Properties

Name Type Description
accounts {[ key: string ]: Account} Dictionary of AWS account specific configuration.
author Author Author information.
name string Name of your project/service.
defaultRegion string Specify default region you wish to use.

accountsRequired
public readonly accounts: {[ key: string ]: Account};

Dictionary of AWS account specific configuration.

The key value can be anything (such as AWS Account alias), but it's recommended to keep it short such as dev or prod.


Example

accounts: {
  dev: {
    id: '111111111111',
    config: {
      baseDomain: 'example.net',
    },
  },
  prod: {
    id: '222222222222',
    config: {
      baseDomain: 'example.com',
    },
  },
},
authorRequired
public readonly author: Author;

Author information.

I.e. who owns/develops this project/service.


nameRequired
public readonly name: string;
  • Type: string

Name of your project/service.

Prefer hyphen-case.


Example

'my-cool-project'
defaultRegionOptional
public readonly defaultRegion: string;
  • Type: string

Specify default region you wish to use.

If left empty will default to one of the following in order:

  1. $CDK_DEFAULT_REGION
  2. $AWS_REGION
  3. 'us-east-1'

ProjectProps

Props given to Project.

I.e. custom props for this construct and the usual props given to cdk.App.

Initializer

import { ProjectProps } from '@alma-cdk/project'

const projectProps: ProjectProps = { ... }

Properties

Name Type Description
accounts {[ key: string ]: Account} Dictionary of AWS account specific configuration.
author Author Author information.
name string Name of your project/service.
defaultRegion string Specify default region you wish to use.
analyticsReporting boolean Include runtime versioning information in the Stacks of this app.
autoSynth boolean Automatically call synth() before the program exits.
context {[ key: string ]: any} Additional context values for the application.
defaultStackSynthesizer aws-cdk-lib.IReusableStackSynthesizer The stack synthesizer to use by default for all Stacks in the App.
outdir string The output directory into which to emit synthesized artifacts.
policyValidationBeta1 aws-cdk-lib.IPolicyValidationPluginBeta1[] Validation plugins to run after synthesis.
postCliContext {[ key: string ]: any} Additional context values for the application.
stackTraces boolean Include construct creation stack trace in the aws:cdk:trace metadata key of all constructs.
treeMetadata boolean Include construct tree metadata as part of the Cloud Assembly.

accountsRequired
public readonly accounts: {[ key: string ]: Account};

Dictionary of AWS account specific configuration.

The key value can be anything (such as AWS Account alias), but it's recommended to keep it short such as dev or prod.


Example

accounts: {
  dev: {
    id: '111111111111',
    config: {
      baseDomain: 'example.net',
    },
  },
  prod: {
    id: '222222222222',
    config: {
      baseDomain: 'example.com',
    },
  },
},
authorRequired
public readonly author: Author;

Author information.

I.e. who owns/develops this project/service.


nameRequired
public readonly name: string;
  • Type: string

Name of your project/service.

Prefer hyphen-case.


Example

'my-cool-project'
defaultRegionOptional
public readonly defaultRegion: string;
  • Type: string

Specify default region you wish to use.

If left empty will default to one of the following in order:

  1. $CDK_DEFAULT_REGION
  2. $AWS_REGION
  3. 'us-east-1'

analyticsReportingOptional
public readonly analyticsReporting: boolean;
  • Type: boolean
  • Default: Value of 'aws:cdk:version-reporting' context key

Include runtime versioning information in the Stacks of this app.


autoSynthOptional
public readonly autoSynth: boolean;
  • Type: boolean
  • Default: true if running via CDK CLI (CDK_OUTDIR is set), false otherwise

Automatically call synth() before the program exits.

If you set this, you don't have to call synth() explicitly. Note that this feature is only available for certain programming languages, and calling synth() is still recommended.


contextOptional
public readonly context: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: no additional context

Additional context values for the application.

Context set by the CLI or the context key in cdk.json has precedence.

Context can be read from any construct using node.getContext(key).


defaultStackSynthesizerOptional
public readonly defaultStackSynthesizer: IReusableStackSynthesizer;
  • Type: aws-cdk-lib.IReusableStackSynthesizer
  • Default: A DefaultStackSynthesizer with default settings

The stack synthesizer to use by default for all Stacks in the App.

The Stack Synthesizer controls aspects of synthesis and deployment, like how assets are referenced and what IAM roles to use. For more information, see the README of the main CDK package.


outdirOptional
public readonly outdir: string;
  • Type: string
  • Default: If this value is not set, considers the environment variable CDK_OUTDIR. If CDK_OUTDIR is not defined, uses a temp directory.

The output directory into which to emit synthesized artifacts.

You should never need to set this value. By default, the value you pass to the CLI's --output flag will be used, and if you change it to a different directory the CLI will fail to pick up the generated Cloud Assembly.

This property is intended for internal and testing use.


policyValidationBeta1Optional
public readonly policyValidationBeta1: IPolicyValidationPluginBeta1[];
  • Type: aws-cdk-lib.IPolicyValidationPluginBeta1[]
  • Default: no validation plugins

Validation plugins to run after synthesis.


postCliContextOptional
public readonly postCliContext: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: no additional context

Additional context values for the application.

Context provided here has precedence over context set by:

  • The CLI via --context
  • The context key in cdk.json
  • The AppProps.context property

This property is recommended over the AppProps.context property since you can make final decision over which context value to take in your app.

Context can be read from any construct using node.getContext(key).


Example

// context from the CLI and from `cdk.json` are stored in the
// CDK_CONTEXT env variable
const cliContext = JSON.parse(process.env.CDK_CONTEXT!);

// determine whether to take the context passed in the CLI or not
const determineValue = process.env.PROD ? cliContext.SOMEKEY : 'my-prod-value';
new App({
  postCliContext: {
    SOMEKEY: determineValue,
  },
});
stackTracesOptional
public readonly stackTraces: boolean;
  • Type: boolean
  • Default: true stack traces are included unless aws:cdk:disable-stack-trace is set in the context.

Include construct creation stack trace in the aws:cdk:trace metadata key of all constructs.


treeMetadataOptional
public readonly treeMetadata: boolean;
  • Type: boolean
  • Default: true

Include construct tree metadata as part of the Cloud Assembly.


Classes

AccountContext

Initializers

import { AccountContext } from '@alma-cdk/project'

new AccountContext()
Name Type Description

Static Functions

Name Description
getAccountConfig No description.
getAccountId No description.
getAccountType No description.
isDev No description.
isMock No description.
isPreProd No description.
isProd No description.
isShared No description.

getAccountConfig
import { AccountContext } from '@alma-cdk/project'

AccountContext.getAccountConfig(scope: Construct, key: string)
scopeRequired
  • Type: constructs.Construct

keyRequired
  • Type: string

getAccountId
import { AccountContext } from '@alma-cdk/project'

AccountContext.getAccountId(scope: Construct)
scopeRequired
  • Type: constructs.Construct

getAccountType
import { AccountContext } from '@alma-cdk/project'

AccountContext.getAccountType(scope: Construct)
scopeRequired
  • Type: constructs.Construct

isDev
import { AccountContext } from '@alma-cdk/project'

AccountContext.isDev(scope: Construct)
scopeRequired
  • Type: constructs.Construct

isMock
import { AccountContext } from '@alma-cdk/project'

AccountContext.isMock(scope: Construct)
scopeRequired
  • Type: constructs.Construct

isPreProd
import { AccountContext } from '@alma-cdk/project'

AccountContext.isPreProd(scope: Construct)
scopeRequired
  • Type: constructs.Construct

isProd
import { AccountContext } from '@alma-cdk/project'

AccountContext.isProd(scope: Construct)
scopeRequired
  • Type: constructs.Construct

isShared
import { AccountContext } from '@alma-cdk/project'

AccountContext.isShared(scope: Construct)
scopeRequired
  • Type: constructs.Construct

AccountStrategy

Use static methods of AccountStrategy abstract class to define your account strategy.

Available strategies are:

  • One Account: shared
  • Two Accounts: dev+prodrecommended
  • Three Accounts: dev+preprod+prod

Initializers

import { AccountStrategy } from '@alma-cdk/project'

new AccountStrategy()
Name Type Description

Static Functions

Name Description
one Enables single account strategy.
three Enables triple account strategy.
two Enables dual account strategy.

one
import { AccountStrategy } from '@alma-cdk/project'

AccountStrategy.one(props: AccountStrategyOneProps)

Enables single account strategy.

  1. shared account with environments:
    • development
    • feature/*
    • test
    • qaN
    • staging
    • preproduction
    • production

Example

AccountStrategy.one({
  shared: {
    id: '111111111111',
  },
}),
propsRequired

three
import { AccountStrategy } from '@alma-cdk/project'

AccountStrategy.three(props: AccountStrategyThreeProps)

Enables triple account strategy.

  1. dev account with environments:
    • development
    • feature/*
    • test
    • staging
  2. preprod account with environments:
    • qaN
    • preproduction
  3. prod account with environments:
    • production

Example

AccountStrategy.three({
  dev: {
    id: '111111111111',
  },
  preprod: {
    id: '222222222222',
  },
  prod: {
    id: '333333333333',
  },
}),
propsRequired

two
import { AccountStrategy } from '@alma-cdk/project'

AccountStrategy.two(props: AccountStrategyTwoProps)

Enables dual account strategy.

  1. dev account with environments:
    • development
    • feature/*
    • test
    • qaN
    • staging
  2. prod account with environments:
    • preproduction
    • production

Example

AccountStrategy.two({
  dev: {
    id: '111111111111',
  },
  prod: {
    id: '222222222222',
  },
}),
propsRequired

AccountType

Internal class to handle set/get operations for Account Type.

Initializers

import { AccountType } from '@alma-cdk/project'

new AccountType()
Name Type Description

Static Functions

Name Description
get No description.
matchFromEnvironment No description.
set No description.

get
import { AccountType } from '@alma-cdk/project'

AccountType.get(scope: Construct)
scopeRequired
  • Type: constructs.Construct

matchFromEnvironment
import { AccountType } from '@alma-cdk/project'

AccountType.matchFromEnvironment(scope: Construct, accounts: {[ key: string ]: Account}, environmentType: string)
scopeRequired
  • Type: constructs.Construct

accountsRequired

environmentTypeRequired
  • Type: string

set
import { AccountType } from '@alma-cdk/project'

AccountType.set(scope: Construct, accountType: string)
scopeRequired
  • Type: constructs.Construct

accountTypeRequired
  • Type: string

EnvironmentContext

Initializers

import { EnvironmentContext } from '@alma-cdk/project'

new EnvironmentContext()
Name Type Description

Static Functions

Name Description
getCategory Get Environment Category.
getFeatureInfo Get Feature Info.
getLabel Get Environment Label.
getName Get Environment Name.
getUrlName Get Environment URL/DNS Compatible Name.
isDevelopment Check if Environment is part of development category.
isFeature Check if Environment is part of feature category.
isMock Check if Environment is part of mock category.
isStable Check if Environment is part of stable category.
isVerification Check if Environment is part of verification category.

getCategory
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.getCategory(scope: Construct)

Get Environment Category.

Categories are useful grouping to make distinction between stable environments (staging & production) from feature or verification environments (such as test or preproduction).

Example

'mock'
'development'
'feature'
'verification'
'stable'
scopeRequired
  • Type: constructs.Construct

Construct.


getFeatureInfo
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.getFeatureInfo(scope: Construct)

Get Feature Info.

If environment belongs to feature category, this will return a string describing the feature (sting after feature/-prefix).

If environment is not a feature environment, will return an empty string.

scopeRequired
  • Type: constructs.Construct

Construct.


getLabel
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.getLabel(scope: Construct)

Get Environment Label.

Labels are useful since Environment Name can be complex, such as feature/foo-bar or qa3, but we need to be able to “label” all feature/* and qaN environments as either feature or qa.

Example

'mock'
'development'
'feature'
'test'
'staging'
'qa'
'preproduction'
'production'
scopeRequired
  • Type: constructs.Construct

Construct.


getName
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.getName(scope: Construct)

Get Environment Name.

Example

'mock1'
'mock2'
'mock3'
'development'
'feature/foo-bar'
'feature/ABC-123/new-stuff'
'test'
'staging'
'qa1'
'qa2'
'qa3'
'preproduction'
'production'
scopeRequired
  • Type: constructs.Construct

Construct.


getUrlName
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.getUrlName(scope: Construct)

Get Environment URL/DNS Compatible Name.

Example

'mock1'
'mock2'
'mock3'
'development'
'feature-foo-bar'
'feature-abc-123-new-stuff'
'test'
'staging'
'qa1'
'qa2'
'qa3'
'preproduction'
'production'
scopeRequired
  • Type: constructs.Construct

Construct.


isDevelopment
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.isDevelopment(scope: Construct)

Check if Environment is part of development category.

Returns true for development, otherwise false.

scopeRequired
  • Type: constructs.Construct

Construct.


isFeature
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.isFeature(scope: Construct)

Check if Environment is part of feature category.

Returns true for environments with name beginning with feature/-prefix, otherwise false.

scopeRequired
  • Type: constructs.Construct

Construct.


isMock
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.isMock(scope: Construct)

Check if Environment is part of mock category.

scopeRequired
  • Type: constructs.Construct

Construct.


isStable
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.isStable(scope: Construct)

Check if Environment is part of stable category.

Returns true for staging & production, otherwise false.

scopeRequired
  • Type: constructs.Construct

Construct.


isVerification
import { EnvironmentContext } from '@alma-cdk/project'

EnvironmentContext.isVerification(scope: Construct)

Check if Environment is part of verification category.

Returns true for test & preproduction, otherwise false.

scopeRequired
  • Type: constructs.Construct

Construct.


EnvironmentType

Internal class to handle set/get operations for Environment Type.

Initializers

import { EnvironmentType } from '@alma-cdk/project'

new EnvironmentType()
Name Type Description

Static Functions

Name Description
get No description.
set No description.
tryGet No description.

get
import { EnvironmentType } from '@alma-cdk/project'

EnvironmentType.get(scope: Construct, allowedEnvironments: string[])
scopeRequired
  • Type: constructs.Construct

allowedEnvironmentsRequired
  • Type: string[]

set
import { EnvironmentType } from '@alma-cdk/project'

EnvironmentType.set(scope: Construct, environmentType: string)
scopeRequired
  • Type: constructs.Construct

environmentTypeRequired
  • Type: string

tryGet
import { EnvironmentType } from '@alma-cdk/project'

EnvironmentType.tryGet(scope: Construct)
scopeRequired
  • Type: constructs.Construct

EnvRegExp

Initializers

import { EnvRegExp } from '@alma-cdk/project'

new EnvRegExp(base: string)
Name Type Description
base string No description.

baseRequired
  • Type: string

Methods

Name Description
test No description.

test
public test(value: string): boolean
valueRequired
  • Type: string

Name

Initializers

import { Name } from '@alma-cdk/project'

new Name()
Name Type Description

Static Functions

Name Description
globally PascalCase naming with global prefixes (org, project…).
it No description.
withProject No description.

globally
import { Name } from '@alma-cdk/project'

Name.globally(scope: Construct, baseName: string, props?: NameProps)

PascalCase naming with global prefixes (org, project…).

scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

it
import { Name } from '@alma-cdk/project'

Name.it(scope: Construct, baseName: string, props?: NameProps)
scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

withProject
import { Name } from '@alma-cdk/project'

Name.withProject(scope: Construct, baseName: string, props?: NameProps)
scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

PathName

Initializers

import { PathName } from '@alma-cdk/project'

new PathName()
Name Type Description

Static Functions

Name Description
globally PascalCase naming with global prefixes (org, project…).
it No description.
withProject No description.

globally
import { PathName } from '@alma-cdk/project'

PathName.globally(scope: Construct, baseName: string, props?: NameProps)

PascalCase naming with global prefixes (org, project…).

scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

it
import { PathName } from '@alma-cdk/project'

PathName.it(scope: Construct, baseName: string, props?: NameProps)
scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

withProject
import { PathName } from '@alma-cdk/project'

PathName.withProject(scope: Construct, baseName: string, props?: NameProps)
scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

ProjectContext

Initializers

import { ProjectContext } from '@alma-cdk/project'

new ProjectContext()
Name Type Description

Static Functions

Name Description
getAccountConfig No description.
getAccountId No description.
getAccountType Returns the account type given in runtime/CLI context.
getAllowedEnvironments No description.
getAuthorEmail No description.
getAuthorName No description.
getAuthorOrganization No description.
getDefaultRegion No description.
getEnvironment No description.
getName No description.
tryGetEnvironment No description.

getAccountConfig
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getAccountConfig(scope: Construct, key: string, defaultValue?: any)
scopeRequired
  • Type: constructs.Construct

keyRequired
  • Type: string

defaultValueOptional
  • Type: any

getAccountId
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getAccountId(scope: Construct)
scopeRequired
  • Type: constructs.Construct

getAccountType
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getAccountType(scope: Construct)

Returns the account type given in runtime/CLI context.

scopeRequired
  • Type: constructs.Construct

getAllowedEnvironments
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getAllowedEnvironments(scope: Construct)
scopeRequired
  • Type: constructs.Construct

getAuthorEmail
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getAuthorEmail(scope: Construct)
scopeRequired
  • Type: constructs.Construct

getAuthorName
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getAuthorName(scope: Construct)
scopeRequired
  • Type: constructs.Construct

getAuthorOrganization
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getAuthorOrganization(scope: Construct)
scopeRequired
  • Type: constructs.Construct

getDefaultRegion
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getDefaultRegion(scope: Construct)
scopeRequired
  • Type: constructs.Construct

getEnvironment
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getEnvironment(scope: Construct)
scopeRequired
  • Type: constructs.Construct

getName
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.getName(scope: Construct)
scopeRequired
  • Type: constructs.Construct

tryGetEnvironment
import { ProjectContext } from '@alma-cdk/project'

ProjectContext.tryGetEnvironment(scope: Construct)
scopeRequired
  • Type: constructs.Construct

UrlName

Initializers

import { UrlName } from '@alma-cdk/project'

new UrlName()
Name Type Description

Static Functions

Name Description
globally PascalCase naming with global prefixes (org, project…).
it No description.
withProject No description.

globally
import { UrlName } from '@alma-cdk/project'

UrlName.globally(scope: Construct, baseName: string, props?: NameProps)

PascalCase naming with global prefixes (org, project…).

scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

it
import { UrlName } from '@alma-cdk/project'

UrlName.it(scope: Construct, baseName: string, props?: NameProps)
scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

withProject
import { UrlName } from '@alma-cdk/project'

UrlName.withProject(scope: Construct, baseName: string, props?: NameProps)
scopeRequired
  • Type: constructs.Construct

baseNameRequired
  • Type: string

propsOptional

Enums

EnvironmentCategory

Availalbe Enviroment Categories.

Categories are useful grouping to make distinction between stable environments (staging & production) from feature or verification environments (such as test or preproduction).

Members

Name Description
MOCK No description.
DEVELOPMENT No description.
FEATURE No description.
VERIFICATION No description.
STABLE No description.

MOCK

DEVELOPMENT

FEATURE

VERIFICATION

STABLE

EnvironmentLabel

Available Environment Labels.

Labels are useful since Environment Name can be complex, such as feature/foo-bar or qa3, but we need to be able to “label” all feature/* and qaN environments as either feature or qa.

Members

Name Description
MOCK No description.
DEVELOPMENT No description.
FEATURE No description.
TEST No description.
STAGING No description.
QA No description.
PREPRODUCTION No description.
PRODUCTION No description.

MOCK

DEVELOPMENT

FEATURE

TEST

STAGING

QA

PREPRODUCTION

PRODUCTION