software.amazon.awscdk.integtests.alpha.AssertionsProvider Maven / Gradle / Ivy
Show all versions of cdk-integ-tests-alpha Show documentation
package software.amazon.awscdk.integtests.alpha;
/**
* (experimental) 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 software.amazon.awscdk.integtests.alpha.*;
* import software.amazon.awscdk.services.logs.*;
* AssertionsProvider assertionsProvider = AssertionsProvider.Builder.create(this, "MyAssertionsProvider")
* .handler("handler")
* .logRetention(RetentionDays.ONE_DAY)
* .uuid("uuid")
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-11T18:01:25.311Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.integtests.alpha.$Module.class, fqn = "@aws-cdk/integ-tests-alpha.AssertionsProvider")
public class AssertionsProvider extends software.constructs.Construct {
protected AssertionsProvider(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected AssertionsProvider(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public AssertionsProvider(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable software.amazon.awscdk.integtests.alpha.AssertionsProviderProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), props });
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public AssertionsProvider(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") });
}
/**
* (experimental) Create a policy statement from a specific api call.
*
* @param service This parameter is required.
* @param api This parameter is required.
* @param resources
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void addPolicyStatementFromSdkCall(final @org.jetbrains.annotations.NotNull java.lang.String service, final @org.jetbrains.annotations.NotNull java.lang.String api, final @org.jetbrains.annotations.Nullable java.util.List resources) {
software.amazon.jsii.Kernel.call(this, "addPolicyStatementFromSdkCall", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(service, "service is required"), java.util.Objects.requireNonNull(api, "api is required"), resources });
}
/**
* (experimental) Create a policy statement from a specific api call.
*
* @param service This parameter is required.
* @param api This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void addPolicyStatementFromSdkCall(final @org.jetbrains.annotations.NotNull java.lang.String service, final @org.jetbrains.annotations.NotNull java.lang.String api) {
software.amazon.jsii.Kernel.call(this, "addPolicyStatementFromSdkCall", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(service, "service is required"), java.util.Objects.requireNonNull(api, "api is required") });
}
/**
* (experimental) 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:
*
*
* AssertionsProvider provider;
* provider.addToRolePolicy(Map.of(
* "Effect", "Allow",
* "Action", List.of("s3:GetObject"),
* "Resource", List.of("*")));
*
*
* @param statement This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void addToRolePolicy(final @org.jetbrains.annotations.NotNull java.lang.Object statement) {
software.amazon.jsii.Kernel.call(this, "addToRolePolicy", software.amazon.jsii.NativeType.VOID, new Object[] { statement });
}
/**
* (experimental) 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
*
* @param obj This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.Object encode(final @org.jetbrains.annotations.NotNull java.lang.Object obj) {
return software.amazon.jsii.Kernel.call(this, "encode", software.amazon.jsii.NativeType.forClass(java.lang.Object.class), new Object[] { obj });
}
/**
* (experimental) Grant a principal access to invoke the assertion provider lambda function.
*
* @param principalArn the ARN of the principal that should be given permission to invoke the assertion provider. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void grantInvoke(final @org.jetbrains.annotations.NotNull java.lang.String principalArn) {
software.amazon.jsii.Kernel.call(this, "grantInvoke", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(principalArn, "principalArn is required") });
}
/**
* (experimental) A reference to the provider Lambda Function execution Role ARN.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.Reference getHandlerRoleArn() {
return software.amazon.jsii.Kernel.get(this, "handlerRoleArn", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Reference.class));
}
/**
* (experimental) The ARN of the lambda function which can be used as a serviceToken to a CustomResource.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getServiceToken() {
return software.amazon.jsii.Kernel.get(this, "serviceToken", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.integtests.alpha.AssertionsProvider}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private software.amazon.awscdk.integtests.alpha.AssertionsProviderProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
}
/**
* (experimental) The handler to use for the lambda function.
*
* Default: index.handler
*
* @return {@code this}
* @param handler The handler to use for the lambda function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder handler(final java.lang.String handler) {
this.props().handler(handler);
return this;
}
/**
* (experimental) How long, in days, the log contents will be retained.
*
* Default: - no retention days specified
*
* @return {@code this}
* @param logRetention How long, in days, the log contents will be retained. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder logRetention(final software.amazon.awscdk.services.logs.RetentionDays logRetention) {
this.props().logRetention(logRetention);
return this;
}
/**
* (experimental) 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
*
* Default: - the default uuid is used
*
* @return {@code this}
* @param uuid This determines the uniqueness of each AssertionsProvider. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder uuid(final java.lang.String uuid) {
this.props().uuid(uuid);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.integtests.alpha.AssertionsProvider}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.integtests.alpha.AssertionsProvider build() {
return new software.amazon.awscdk.integtests.alpha.AssertionsProvider(
this.scope,
this.id,
this.props != null ? this.props.build() : null
);
}
private software.amazon.awscdk.integtests.alpha.AssertionsProviderProps.Builder props() {
if (this.props == null) {
this.props = new software.amazon.awscdk.integtests.alpha.AssertionsProviderProps.Builder();
}
return this.props;
}
}
}