Skip to content

(integ-tests-alpha): support granting additional permission #34052

Closed
@phuhung273

Description

@phuhung273

Describe the feature

IntegTest awsApiCall should accept an input to give more permission to the Deploy assert lambda.

public awsApiCall(service: string, api: string, parameters?: any, outputPaths?: string[]): IApiCall {

Use Case

For #32635, integ.assertions.awsApiCall('@aws-sdk/client-api-gateway', 'TestInvokeMethodCommand' automatically grants apigateway:TestInvokeMethodCommand

public addPolicyStatementFromSdkCall(service: string, api: string, resources?: string[]): void {
this.lambdaFunction.addPolicies([{
Action: [awsSdkToIamAction(service, api)],
Effect: 'Allow',
Resource: resources || ['*'],
}]);
}
}

But we need something like arn:aws:execute-api:region:account-id:api-id/stage-name/POST/path

If we can let user give more permission, this can fix not only #32635 but any kind of AWS service with complex permission systems

Proposed Solution

Support additionalPolicy to give more permission to Deploy assert Lambda

public awsApiCall(service: string, api: string, parameters?: any, outputPaths?: string[]): IApiCall {

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

latest

Environment details (OS name and version, etc.)

Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions