Skip to main content

Class: Environment

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

Create a Depot Environment

Extends​

Constructors​

Constructor​

new Environment(scope, id, props): Environment

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

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:986

Overrides​

IStageDepotEnvironment.accountId


backendVersion​

readonly backendVersion: string

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


frontendVersion​

readonly frontendVersion: string

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


name​

readonly name: string

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


node​

readonly node: Node

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

The tree node.

Inherited from​

IStageDepotEnvironment.node


platformCdkVersion​

readonly platformCdkVersion: string

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


s3TablesTableBucketName?​

readonly optional s3TablesTableBucketName?: string

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

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:948

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:805

Returns​

string

Set Signature​

set environmentId(id): void

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

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:841

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:822

Returns​

string

Inherited from​

IStageDepotEnvironment.iamEndpoint


transactionOutputPattern​

Get Signature​

get transactionOutputPattern(): string

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

Returns​

string

Inherited from​

IStageDepotEnvironment.transactionOutputPattern


transactionQueue​

Get Signature​

get transactionQueue(): IQueue

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

Returns​

IQueue

Inherited from​

IStageDepotEnvironment.transactionQueue

Methods​

getStaticGatewayEndpoints()​

protected getStaticGatewayEndpoints(): StaticEnvironmentGateways

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

Returns​

StaticEnvironmentGateways

Inherited from​

IStageDepotEnvironment.getStaticGatewayEndpoints


onUpdate()​

onUpdate(scope, id, ruleTargets): Rule

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

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:905

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:350

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:346

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:1406

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:1359

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:1377

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:321

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:1331

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:1423

Parameters​

props​

StageDepotAthenaProps

Returns​

void