@aws/nx-plugin-mcp 1.0.0-rc.16 → 1.0.0-rc.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -172,6 +172,37 @@ module "my_api" {
|
|
|
172
172
|
</Fragment>
|
|
173
173
|
</Infrastructure>
|
|
174
174
|
|
|
175
|
+
#### Customising Options Per-Operation
|
|
176
|
+
|
|
177
|
+
<Infrastructure>
|
|
178
|
+
<Fragment slot="cdk">
|
|
179
|
+
To customise the options used to create the default integration for _specific_ operations (without affecting the others), you can use the `withOperationOptions` method. For example, if you would like to increase the Lambda function timeout for just one operation:
|
|
180
|
+
|
|
181
|
+
```ts {4-6}
|
|
182
|
+
const api = new MyApi(this, 'MyApi', {
|
|
183
|
+
integrations: MyApi.defaultIntegrations(this)
|
|
184
|
+
.withOperationOptions({
|
|
185
|
+
sayHello: {
|
|
186
|
+
timeout: Duration.seconds(60),
|
|
187
|
+
},
|
|
188
|
+
})
|
|
189
|
+
.build(),
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// The selected operations remain default integrations, so they're still typed accordingly:
|
|
193
|
+
api.integrations.sayHello.handler.addToRolePolicy(new PolicyStatement({ ... }));
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The options you specify are merged with the default integration options (and any options set via `withDefaultOptions`). Note that you cannot specify options for operations which you have replaced via `withOverrides`, since these no longer use the default integration.
|
|
197
|
+
|
|
198
|
+
You will encounter a type error if the same operation is targeted by both `withOperationOptions` and `withOverrides`, regardless of the order in which you call them.
|
|
199
|
+
|
|
200
|
+
</Fragment>
|
|
201
|
+
<Fragment slot="terraform">
|
|
202
|
+
To customise options for specific operations with Terraform, you need to edit the generated Terraform module to configure individual Lambda functions per operation (see the [Explicit Integrations](#explicit-integrations) section below).
|
|
203
|
+
</Fragment>
|
|
204
|
+
</Infrastructure>
|
|
205
|
+
|
|
175
206
|
#### Overriding Integrations
|
|
176
207
|
|
|
177
208
|
<Infrastructure>
|