-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
We currently do not support detecting dependencies to infer IAM Policies and automate environment variable/client instantiation if the dependency is contained within another function called by the closure.
- detect dependencies used by another function (declared outside of its scope)
const table = new Table(..);
function foo() {
return $AWS.DynamoDB.GetItem({
Table: table,
...
});
}
new Function(scope, id, () => {
return foo();
});- detect dependencies passed to a function as input
function foo(table: Table) {
return $AWS.DynamoDB.GetItem({
Table: table,
...
});
}
const table = new Table(..);
new Function(scope, id, () => {
// dependency passed to foo
return foo(table);
});- detect dependencies returned from another funciton
const table = new Table(..);
function getTable() {
return table;
}
new Function(scope, id, () => {
return $AWS.DynamoDB.GetItem({
// dependency returned by a function call
Table: getTable(),
...
});
});