@aws-cdk_integ-tests-alpha.AssertionsProvider

class AssertionsProvider (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.IntegTests.Alpha.AssertionsProvider
Gogithub.com/aws/aws-cdk-go/awscdkintegtestsalpha/v2#AssertionsProvider
Javasoftware.amazon.awscdk.integtests.alpha.AssertionsProvider
Pythonaws_cdk.integ_tests_alpha.AssertionsProvider
TypeScript (source)@aws-cdk/integ-tests-alpha ยป AssertionsProvider

Implements IConstruct, IDependable

Represents an assertions provider.

The creates a singletone Lambda Function that will create a single function per stack that serves as the custom resource provider for the various assertion providers

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as integ_tests_alpha from '@aws-cdk/integ-tests-alpha';
const assertionsProvider = new integ_tests_alpha.AssertionsProvider(this, 'MyAssertionsProvider', /* all optional props */ {
  handler: 'handler',
  uuid: 'uuid',
});

Initializer

new AssertionsProvider(scope: Construct, id: string, props?: AssertionsProviderProps)

Parameters

  • scope Construct
  • id string
  • props AssertionsProviderProps

Construct Props

NameTypeDescription
handler?๐Ÿ”นstringThe handler to use for the lambda function.
uuid?๐Ÿ”นstringThis determines the uniqueness of each AssertionsProvider.

handler?๐Ÿ”น

Type: string (optional, default: index.handler)

The handler to use for the lambda function.


uuid?๐Ÿ”น

Type: string (optional, default: the default uuid is used)

This determines the uniqueness of each AssertionsProvider.

You should only need to provide something different here if you know that you need a separate provider

Properties

NameTypeDescription
handlerRoleArn๐Ÿ”นReferenceA reference to the provider Lambda Function execution Role ARN.
node๐Ÿ”นNodeThe tree node.
serviceToken๐Ÿ”นstringThe ARN of the lambda function which can be used as a serviceToken to a CustomResource.

handlerRoleArn๐Ÿ”น

Type: Reference

A reference to the provider Lambda Function execution Role ARN.


node๐Ÿ”น

Type: Node

The tree node.


serviceToken๐Ÿ”น

Type: string

The ARN of the lambda function which can be used as a serviceToken to a CustomResource.

Methods

NameDescription
addPolicyStatementFromSdkCall(service, api, resources?)๐Ÿ”นCreate a policy statement from a specific api call.
addToRolePolicy(statement)๐Ÿ”นAdd an IAM policy statement to the inline policy of the lambdas function's role.
encode(obj)๐Ÿ”นEncode an object so it can be passed as custom resource parameters.
grantInvoke(principalArn)๐Ÿ”นGrant a principal access to invoke the assertion provider lambda function.
toString()๐Ÿ”นReturns a string representation of this construct.

addPolicyStatementFromSdkCall(service, api, resources?)๐Ÿ”น

public addPolicyStatementFromSdkCall(service: string, api: string, resources?: string[]): void

Parameters

  • service string
  • api string
  • resources string[]

Create a policy statement from a specific api call.


addToRolePolicy(statement)๐Ÿ”น

public addToRolePolicy(statement: any): void

Parameters

  • statement any

Add an IAM policy statement to the inline policy of the lambdas function's role.

Please note: this is a direct IAM JSON policy blob, not a iam.PolicyStatement object like you will see in the rest of the CDK. Example

declare const provider: AssertionsProvider;
provider.addToRolePolicy({
  Effect: 'Allow',
  Action: ['s3:GetObject'],
  Resource: ['*'],
});

encode(obj)๐Ÿ”น

public encode(obj: any): any

Parameters

  • obj any

Returns

  • any

Encode an object so it can be passed as custom resource parameters.

Custom resources will convert all input parameters to strings so we encode non-strings here so we can then decode them correctly in the provider function


grantInvoke(principalArn)๐Ÿ”น

public grantInvoke(principalArn: string): void

Parameters

  • principalArn string โ€” the ARN of the principal that should be given permission to invoke the assertion provider.

Grant a principal access to invoke the assertion provider lambda function.


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.