Experimental
@aws-cdk/integ-tests-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
AssertionsProvider
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';
import { aws_lambda as lambda } from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';
const assertionsProvider = new integ_tests_alpha.AssertionsProvider(this, 'MyAssertionsProvider', /* all optional props */ {
handler: 'handler',
logRetention: logs.RetentionDays.ONE_DAY,
providerLogLevel: lambda.ApplicationLogLevel.INFO,
uuid: 'uuid',
});
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.integ_tests_alpha as integ_tests_alpha
from aws_cdk import aws_lambda as lambda_
from aws_cdk import aws_logs as logs
assertions_provider = integ_tests_alpha.AssertionsProvider(self, "MyAssertionsProvider",
handler="handler",
log_retention=logs.RetentionDays.ONE_DAY,
provider_log_level=lambda_.ApplicationLogLevel.INFO,
uuid="uuid"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.integtests.alpha.*;
import software.amazon.awscdk.services.lambda.*;
import software.amazon.awscdk.services.logs.*;
AssertionsProvider assertionsProvider = AssertionsProvider.Builder.create(this, "MyAssertionsProvider")
.handler("handler")
.logRetention(RetentionDays.ONE_DAY)
.providerLogLevel(ApplicationLogLevel.INFO)
.uuid("uuid")
.build();
// Install: dotnet add package Amazon.CDK.IntegTests.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.IntegTests.Alpha;
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK.AWS.Logs;
var assertionsProvider = new AssertionsProvider(this, "MyAssertionsProvider", new AssertionsProviderProps {
Handler = "handler",
LogRetention = RetentionDays.ONE_DAY,
ProviderLogLevel = ApplicationLogLevel.INFO,
Uuid = "uuid"
});
// Install: go get github.com/aws/aws-cdk-go/awscdkintegtestsalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import integ_tests_alpha "github.com/aws/aws-cdk-go/awscdkintegtestsalpha"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
assertionsProvider := integ_tests_alpha.NewAssertionsProvider(this, jsii.String("MyAssertionsProvider"), &AssertionsProviderProps{
Handler: jsii.String("handler"),
LogRetention: awscdk.Aws_logs.RetentionDays_ONE_DAY,
ProviderLogLevel: awscdk.Aws_lambda.ApplicationLogLevel_INFO,
Uuid: jsii.String("uuid"),
})
Initializer
new AssertionsProvider(scope: Construct, id: string, props?: AssertionsProviderProps)
AssertionsProvider(scope: Construct, id: str, props: typing.Optional[AssertionsProviderProps] = None)
new AssertionsProvider(Construct scope, String id, AssertionsProviderProps props)
new AssertionsProvider(Construct scope, string id, AssertionsProviderProps? props = null)
NewAssertionsProvider(Scope Construct, Id *string, Props AssertionsProviderProps)
Construct Props
logRetentionRetentionDayslog_retentionRetentionDayslogRetentionRetentionDaysLogRetentionRetentionDaysLogRetentionRetentionDays= no retention days specified#providerLogLevelApplicationLogLevelprovider_log_levelApplicationLogLevelproviderLogLevelApplicationLogLevelProviderLogLevelApplicationLogLevelProviderLogLevelApplicationLogLevel= ApplicationLogLevel.FATAL#You should only need to provide something different here if you know that you need a separate provider
Properties
Methods
addPolicyStatementFromSdkCall(service: string, api: string, resources?: string[]): voiddef add_policy_statement_from_sdk_call(self, service: str, api: str, resources: typing.Optional[typing.List[str]] = None) -> Nonepublic void addPolicyStatementFromSdkCall(String service, String api, List<String> resources)public void AddPolicyStatementFromSdkCall(string service, string api, string[]? resources = null)func AddPolicyStatementFromSdkCall(Service *string, Api *string, Resources *[]*string)#addToRolePolicy(statement: any): voiddef add_to_role_policy(self, statement: Any) -> Nonepublic void addToRolePolicy(Object statement)public void AddToRolePolicy(object statement)func AddToRolePolicy(Statement interface{})#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: any): anydef encode(self, obj: Any) -> Anypublic Object encode(Object obj)public object Encode(object obj)func Encode(Obj interface{}) interface{}#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: string): voiddef grant_invoke(self, principal_arn: str) -> Nonepublic void grantInvoke(String principalArn)public void GrantInvoke(string principalArn)func GrantInvoke(PrincipalArn *string)#1 parameter
Parameters
principalArnprincipal_arnprincipalArnprincipalArnPrincipalArn— the ARN of the principal that should be given permission to invoke the assertion provider.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.
1 parameter · returns
Parameters
mixinsmixinsmixinsmixinsMixins— The mixins to apply.
Returns: This construct for chaining