Skip to content

Commit 16a1a62

Browse files
authored
chore(integ-tests): revert add waiterProvider to IApiCall (#28457)
Reverts #27844. This change broke the pipeline, pacmak fails with: ``` #STDOUT> /tmp/npm-packu6YRYj/Amazon.CDK.IntegTests.Alpha/Amazon/CDK/IntegTests/Alpha/ApiCallBase.cs(231,77): error CS0115: 'ApiCallBase._Proxy.WaiterProvider': no suitable method found to override [/tmp/npm-packu6YRYj/Amazon.CDK.IntegTests.Alpha/Amazon.CDK.IntegTests.Alpha.csproj] ```
1 parent 9ca7ba8 commit 16a1a62

12 files changed

+2
-1235
lines changed

packages/@aws-cdk/integ-tests-alpha/README.md

-29
Original file line numberDiff line numberDiff line change
@@ -522,32 +522,3 @@ const describe = testCase.assertions.awsApiCall('StepFunctions', 'describeExecut
522522
});
523523
```
524524

525-
When `waitForAssertions()` is used for the `awsApiCall`, the actual API call is executed
526-
by the `waiterProvider` assertion provider.
527-
528-
By default, the `AwsApiCall` construct will automatically add the correct IAM policies
529-
to allow the Lambda function to make the API call. It does this based on the `service`
530-
and `api` that is provided. In the above example the service is `SQS` and the api is
531-
`receiveMessage` so it will create a policy with `Action: 'sqs:ReceiveMessage`.
532-
533-
There are some cases where the permissions do not exactly match the service/api call, for
534-
example the S3 `listObjectsV2` api. In these cases it is possible to add the correct policy
535-
by accessing the `waiterProvider` object.
536-
537-
```ts
538-
declare const integ: IntegTest;
539-
540-
const apiCall = integ.assertions.awsApiCall('S3', 'listObjectsV2', {
541-
Bucket: 'mybucket',
542-
}).waitForAssertions({
543-
totalTimeout: Duration.minutes(5),
544-
interval: Duration.seconds(15),
545-
backoffRate: 3,
546-
});
547-
548-
apiCall.waiterProvider?.addToRolePolicy({
549-
Effect: 'Allow',
550-
Action: ['s3:GetObject', 's3:ListBucket'],
551-
Resource: ['*'],
552-
});
553-
```

packages/@aws-cdk/integ-tests-alpha/lib/assertions/api-call-base.ts

+2-17
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { WaiterStateMachineOptions } from './waiter-state-machine';
99
*/
1010
export interface IApiCall extends IConstruct {
1111
/**
12-
* Access the AssertionsProvider. This can be used to add additional IAM policies
13-
* to the provider role policy.
12+
* access the AssertionsProvider. This can be used to add additional IAM policies
13+
* the the provider role policy
1414
*
1515
* @example
1616
* declare const apiCall: AwsApiCall;
@@ -22,21 +22,6 @@ export interface IApiCall extends IConstruct {
2222
*/
2323
readonly provider: AssertionsProvider;
2424

25-
/**
26-
* Access the AssertionsProvider for the waiter state machine.
27-
* This can be used to add additional IAM policies
28-
* to the provider role policy.
29-
*
30-
* @example
31-
* declare const apiCall: AwsApiCall;
32-
* apiCall.waiterProvider?.addToRolePolicy({
33-
* Effect: 'Allow',
34-
* Action: ['s3:GetObject'],
35-
* Resource: ['*'],
36-
* });
37-
*/
38-
readonly waiterProvider?: AssertionsProvider;
39-
4025
/**
4126
* Returns the value of an attribute of the custom resource of an arbitrary
4227
* type. Attributes are returned from the custom resource provider through the

packages/@aws-cdk/integ-tests-alpha/test/assertions/providers/lambda-handler/integ.waiter-provider.js.snapshot/WaiterProviderStack.assets.json

-19
This file was deleted.

packages/@aws-cdk/integ-tests-alpha/test/assertions/providers/lambda-handler/integ.waiter-provider.js.snapshot/WaiterProviderStack.template.json

-64
This file was deleted.

packages/@aws-cdk/integ-tests-alpha/test/assertions/providers/lambda-handler/integ.waiter-provider.js.snapshot/WaiterProviderTestDefaultTestDeployAssertDADDA65F.assets.json

-32
This file was deleted.

0 commit comments

Comments
 (0)