import { ServerlessSpy } from 'serverless-spy'
new ServerlessSpy(scope: Construct, id: string, props?: ServerlessSpyProps)| Name | Type | Description |
|---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
ServerlessSpyProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: ServerlessSpyProps
| Name | Description |
|---|---|
toString |
Returns a string representation of this construct. |
with |
Applies one or more mixins to this construct. |
getConstructName |
No description. |
spy |
Initalize spying on resources. |
spyNodes |
Initalize spying on resources given as parameter. |
public toString(): stringReturns a string representation of this construct.
public with(mixins: ...IMixin[]): IConstructApplies 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.
- Type: ...constructs.IMixin[]
The mixins to apply.
public getConstructName(construct: IConstruct): string- Type: constructs.IConstruct
public spy(filter?: SpyFilter): voidInitalize spying on resources.
- Type: SpyFilter
Limit which resources to spy on.
public spyNodes(nodes: IConstruct[]): voidInitalize spying on resources given as parameter.
- Type: constructs.IConstruct[]
Which reources and their children to spy on.
| Name | Description |
|---|---|
isConstruct |
Checks if x is a construct. |
import { ServerlessSpy } from 'serverless-spy'
ServerlessSpy.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.
- Type: any
Any object.
| Name | Type | Description |
|---|---|---|
node |
constructs.Node |
The tree node. |
serviceKeys |
string[] |
No description. |
public readonly node: Node;- Type: constructs.Node
The tree node.
public readonly serviceKeys: string[];- Type: string[]
import { ServerlessSpyProps } from 'serverless-spy'
const serverlessSpyProps: ServerlessSpyProps = { ... }| Name | Type | Description |
|---|---|---|
debugMode |
boolean |
No description. |
generateSpyEventsFileLocation |
string |
No description. |
spySqsWithNoSubscriptionAndDropAllMessages |
boolean |
No description. |
public readonly debugMode: boolean;- Type: boolean
public readonly generateSpyEventsFileLocation: string;- Type: string
public readonly spySqsWithNoSubscriptionAndDropAllMessages: boolean;- Type: boolean
import { SpyFilter } from 'serverless-spy'
const spyFilter: SpyFilter = { ... }| Name | Type | Description |
|---|---|---|
spyDynamoDB |
boolean |
No description. |
spyEventBridge |
boolean |
No description. |
spyEventBridgeRule |
boolean |
No description. |
spyLambda |
boolean |
No description. |
spyS3 |
boolean |
No description. |
spySnsSubsription |
boolean |
No description. |
spySnsTopic |
boolean |
No description. |
spySqs |
boolean |
No description. |
public readonly spyDynamoDB: boolean;- Type: boolean
public readonly spyEventBridge: boolean;- Type: boolean
public readonly spyEventBridgeRule: boolean;- Type: boolean
public readonly spyLambda: boolean;- Type: boolean
public readonly spyS3: boolean;- Type: boolean
public readonly spySnsSubsription: boolean;- Type: boolean
public readonly spySnsTopic: boolean;- Type: boolean
public readonly spySqs: boolean;- Type: boolean