@plugins
Extend the functionality of your Architect app with @plugins
.
Architect’s plugin API exposes workflow lifecycle hooks (such filesystem events in the Sandbox) and interfaces for generating cloud resources (such as custom Lambdas, or environment variables).
Plugins can also be used to customize your AWS deployment via CloudFormation, enabling access to cloud resources outside of Architect’s built-ins.
Getting started
Create an inert plugin at src/plugins/my-plugin.js
by running npx arc init --plugin my-plugin
. Then add the @plugins
pragma to your project manifest:
arc
@app
testapp
@plugins
my-plugin
json
{
"app": "testapp",
"plugins": [
"my-plugin"
]
}
yaml
---
app: testapp
plugins:
- my-plugin
Plugin locations
Plugins can be private to your project, or installed as a dependency from npm. Architect will automatically attempt to find each named plugin in the following four locations:
src/plugins/{plugin name}.js
src/plugins/{plugin name}/index.js
node_modules/{plugin name}/
node_modules/@{plugin name}/
Plugin namespace
@plugins
can be used alongside @macros
in the same project, however they share the same namespace. Consequently, a plugin and macro cannot share the same name. For example, the following project would error upon startup:
@app
testapp
@plugins
s3-events
@macros
s3-events
Authoring plugins
Learn more about authoring (and using) plugins in the Architect plugins guide.