Skip to main content

Class: Environment

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:825

Create a Depot Environment

Extends

Constructors

Constructor

new Environment(scope, id, props): Environment

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:852

Parameters

scope

Construct

CDK Construct scope

id

string

Unique ID for the instance

props

StageDepotEnvironmentProps

Environment properties

Returns

Environment

the Depot Environment CDK node.

Example

// Create a simple Depot Environment:
new Environment(this, "ExampleEnvironment", {
account: { name: "example", id: Aws.ACCOUNT_ID },
name: "example",
idPrefix: "example-"
});

Overrides

IStageDepotEnvironment.constructor

Properties

accountId

readonly accountId: string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:828

Overrides

IStageDepotEnvironment.accountId


backendVersion

readonly backendVersion: string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:834


frontendVersion

readonly frontendVersion: string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:832


name

readonly name: string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:830


node

readonly node: Node

Defined in: node_modules/constructs/lib/construct.d.ts:289

The tree node.

Inherited from

IStageDepotEnvironment.node


platformCdkVersion

readonly platformCdkVersion: string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:836


s3TablesTableBucketName?

readonly optional s3TablesTableBucketName?: string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:645

Environment-level bucket name for all S3Tables locations. Overrides the default sdp-${environmentId}-data for every Location.S3Tables in this environment. Strongly discouraged — see S3TablesLocationProps.tableBucketName.

Inherited from

IStageDepotEnvironment.s3TablesTableBucketName

Accessors

alertsTopicArn

Get Signature

get alertsTopicArn(): string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:790

Returns the alert topic SNS ARN. Assumes that Alerts have been configured in the environment using StageDepotOpsAlarmsProps.

Returns

string

Inherited from

IStageDepotEnvironment.alertsTopicArn


environmentId

Get Signature

get environmentId(): string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:649

Returns

string

Set Signature

set environmentId(id): void

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:653

Parameters
id

string

Returns

void

Inherited from

IStageDepotEnvironment.environmentId


gatewayEndpoints

Get Signature

get gatewayEndpoints(): EnvironmentGateways

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:684

Provides Depot Environment gateway accessors.

Returns

EnvironmentGateways

Inherited from

IStageDepotEnvironment.gatewayEndpoints


iamEndpoint

Get Signature

get iamEndpoint(): string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:666

Returns

string

Inherited from

IStageDepotEnvironment.iamEndpoint


transactionOutputPattern

Get Signature

get transactionOutputPattern(): string

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:662

Returns

string

Inherited from

IStageDepotEnvironment.transactionOutputPattern


transactionQueue

Get Signature

get transactionQueue(): IQueue

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:657

Returns

IQueue

Inherited from

IStageDepotEnvironment.transactionQueue

Methods

getStaticGatewayEndpoints()

protected getStaticGatewayEndpoints(): StaticEnvironmentGateways

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:670

Returns

StaticEnvironmentGateways

Inherited from

IStageDepotEnvironment.getStaticGatewayEndpoints


onUpdate()

onUpdate(scope, id, ruleTargets): Rule

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:807

Parameters

scope

Construct

CDK Construct scope

id

string

rule id

ruleTargets

IRuleTarget[]

rule targets that will be invoked

Returns

Rule

aws rule cdk node.

Example

// Create on update rule:
import * as targets from '@aws-cdk/aws-events-targets';
...
const resourceUpdateHandler = new targets.LambdaFunction(new lambda.Function(....));
depotEnvironment.onUpdate(this, '-e2e-invoker', [resourceUpdateHandler]);

Inherited from

IStageDepotEnvironment.onUpdate


runTransaction()

runTransaction(scope, id, props): StepFunctionsStartExecution

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:748

Run a Depot Transaction from a step function context, as a sfnTasks.StepFunctionsStartExecution task to be made part of a sfn.StateMachine you own.

Parameters

scope

Construct

the CDK Construct into which to build the task

id

string

the ID of the task (must be unique within scope)

props

TransactionRequest & Omit<TaskStateBaseProps, "timeout" | "heartbeat"> & object

parameters for the task. This is a combination of Depot's TransactionRequest and CDK step functions' sfn.TaskStateBaseProps.

You can override all the standard Task properties if you need, but you most likely don't except perhaps for resultPath. By default, the task will be started synchronously and associated with the parent step function.

Returns

StepFunctionsStartExecution

Example

const doSomething = depot.runTransaction(this, "My Transaction", {
datasetId: "my-dataset",
actions: [
{
operation: TransactionRequest.Operation.MERGE,
source: "my.Source",
target: "my.Target",
}
],
resultPath: '$.myTransactionResult'
});

const myProcess = new sfn.StateMachine(this, 'My Process', {
stateMachineName: 'my-process',
definitionBody: sfn.Definition.fromChainable(doSomething)
});

Inherited from

IStageDepotEnvironment.runTransaction


toString()

toString(): string

Defined in: node_modules/constructs/lib/construct.d.ts:314

Returns a string representation of this construct.

Returns

string

Inherited from

IStageDepotEnvironment.toString


with()

with(...mixins): IConstruct

Defined in: node_modules/constructs/lib/construct.d.ts:310

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters

mixins

...IMixin[]

The mixins to apply

Returns

IConstruct

This construct for chaining

Inherited from

IStageDepotEnvironment.with


createNotificationsRole()

static createNotificationsRole(scope, id, props): Role

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:1200

Parameters

scope

Construct

id

string

props
accountId

string

topicArn

string

Returns

Role


fromEnvironmentProps()

static fromEnvironmentProps(scope, id, props): IStageDepotEnvironment

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:1153

Parameters

scope

Construct

The cdk scope

id

string

Unique resource ID

props

IStageDepotEnvironmentProps

account and environment id properties for the environment. If you have given your environment an id prefix, then then be sure to provide this optional.

Returns

IStageDepotEnvironment


getCognitoRoleArn()

static getCognitoRoleArn(scope, accountId, props): string | undefined

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:1171

Parameters

scope

Construct

accountId

string

props

StageDepotCognitoProps | { enabled: false; }

Returns

string | undefined


isConstruct()

static isConstruct(x): x is Construct

Defined in: node_modules/constructs/lib/construct.d.ts:285

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.

Parameters

x

any

Any object

Returns

x is Construct

true if x is an object created from a class which extends Construct.

Inherited from

IStageDepotEnvironment.isConstruct


toTaskSizeResource()

static toTaskSizeResource(taskSize, setDefault?): { TaskFargate?: undefined; TaskSize: StageDepotApplicationTaskSize | undefined; } | { TaskFargate: { Cpu: string; MemoryMiB: string; }; TaskSize?: undefined; }

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:1125

Parameters

taskSize

StageDepotApplicationTaskSizeProps | undefined

setDefault?

boolean = false

Returns

{ TaskFargate?: undefined; TaskSize: StageDepotApplicationTaskSize | undefined; } | { TaskFargate: { Cpu: string; MemoryMiB: string; }; TaskSize?: undefined; }


validateAthenaProps()

static validateAthenaProps(props): void

Defined in: packages/depot-cdk/src/stage-depot-environment.ts:1217

Parameters

props

StageDepotAthenaProps

Returns

void