awscdkintegtestsalpha

package module
v2.173.2-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

integ-tests

---

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Overview

This library is meant to be used in combination with the integ-runner CLI to enable users to write and execute integration tests for AWS CDK Constructs.

An integration test should be defined as a CDK application, and there should be a 1:1 relationship between an integration test and a CDK application.

So for example, in order to create an integration test called my-function we would need to create a file to contain our integration test application.

test/integ.my-function.ts

app := awscdk.NewApp()
stack := awscdk.NewStack()
lambda.NewFunction(stack, jsii.String("MyFunction"), &FunctionProps{
	Runtime: lambda.Runtime_NODEJS_LATEST(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
})

This is a self contained CDK application which we could deploy by running

cdk deploy --app 'node test/integ.my-function.js'

In order to turn this into an integration test, all that is needed is to use the IntegTest construct.

var app app
var stack stack

awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})

You will notice that the stack is registered to the IntegTest as a test case. Each integration test can contain multiple test cases, which are just instances of a stack. See the Usage section for more details.

Usage

IntegTest

Suppose you have a simple stack, that only encapsulates a Lambda function with a certain handler:

type stackUnderTestProps struct {
	stackProps
	architecture architecture
}

type stackUnderTest struct {
	stack
}

func newStackUnderTest(scope construct, id *string, props stackUnderTestProps) *stackUnderTest {
	this := &stackUnderTest{}
	newStack_Override(this, scope, id, props)

	lambda.NewFunction(this, jsii.String("Handler"), &FunctionProps{
		Runtime: lambda.Runtime_NODEJS_LATEST(),
		Handler: jsii.String("index.handler"),
		Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
		Architecture: props.architecture,
	})
	return this
}

You may want to test this stack under different conditions. For example, we want this stack to be deployed correctly, regardless of the architecture we choose for the Lambda function. In particular, it should work for both ARM_64 and X86_64. So you can create an IntegTestCase that exercises both scenarios:

type stackUnderTestProps struct {
	stackProps
	architecture architecture
}

type stackUnderTest struct {
	stack
}

func newStackUnderTest(scope construct, id *string, props stackUnderTestProps) *stackUnderTest {
	this := &stackUnderTest{}
	newStack_Override(this, scope, id, props)

	lambda.NewFunction(this, jsii.String("Handler"), &FunctionProps{
		Runtime: lambda.Runtime_NODEJS_LATEST(),
		Handler: jsii.String("index.handler"),
		Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
		Architecture: props.architecture,
	})
	return this
}

// Beginning of the test suite
app := awscdk.NewApp()

awscdkintegtestsalpha.NewIntegTest(app, jsii.String("DifferentArchitectures"), &IntegTestProps{
	TestCases: []*stack{
		NewStackUnderTest(app, jsii.String("Stack1"), &stackUnderTestProps{
			architecture: lambda.*architecture_ARM_64(),
		}),
		NewStackUnderTest(app, jsii.String("Stack2"), &stackUnderTestProps{
			architecture: lambda.*architecture_X86_64(),
		}),
	},
})

This is all the instruction you need for the integration test runner to know which stacks to synthesize, deploy and destroy. But you may also need to customize the behavior of the runner by changing its parameters. For example:

app := awscdk.NewApp()

stackUnderTest := awscdk.NewStack(app, jsii.String("StackUnderTest"))

stack := awscdk.NewStack(app, jsii.String("stack"))

testCase := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("CustomizedDeploymentWorkflow"), &IntegTestProps{
	TestCases: []stack{
		stackUnderTest,
	},
	DiffAssets: jsii.Boolean(true),
	StackUpdateWorkflow: jsii.Boolean(true),
	CdkCommandOptions: &CdkCommands{
		Deploy: &DeployCommand{
			Args: &DeployOptions{
				RequireApproval: awscdklibcloudassemblyschema.RequireApproval_NEVER,
				Json: jsii.Boolean(true),
			},
		},
		Destroy: &DestroyCommand{
			Args: &DestroyOptions{
				Force: jsii.Boolean(true),
			},
		},
	},
})
IntegTestCaseStack

In the majority of cases an integration test will contain a single IntegTestCase. By default when you create an IntegTest an IntegTestCase is created for you and all of your test cases are registered to this IntegTestCase. The IntegTestCase and IntegTestCaseStack constructs are only needed when it is necessary to defined different options for individual test cases.

For example, you might want to have one test case where diffAssets is enabled.

var app app
var stackUnderTest stack

testCaseWithAssets := awscdkintegtestsalpha.NewIntegTestCaseStack(app, jsii.String("TestCaseAssets"), &IntegTestCaseStackProps{
	DiffAssets: jsii.Boolean(true),
})

awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stackUnderTest,
		testCaseWithAssets,
	},
})

Assertions

This library also provides a utility to make assertions against the infrastructure that the integration test deploys.

There are two main scenarios in which assertions are created.

  • Part of an integration test using integ-runner

In this case you would create an integration test using the IntegTest construct and then make assertions using the assert property. You should not utilize the assertion constructs directly, but should instead use the methods on IntegTest.assertions.

var app app
var stack stack


integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})
integ.Assertions.AwsApiCall(jsii.String("S3"), jsii.String("getObject"))

By default an assertions stack is automatically generated for you. You may however provide your own stack to use.

var app app
var stack stack
var assertionStack stack


integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
	AssertionStack: assertionStack,
})
integ.Assertions.AwsApiCall(jsii.String("S3"), jsii.String("getObject"))
  • Part of a normal CDK deployment

In this case you may be using assertions as part of a normal CDK deployment in order to make an assertion on the infrastructure before the deployment is considered successful. In this case you can utilize the assertions constructs directly.

var myAppStack stack


awscdkintegtestsalpha.NewAwsApiCall(myAppStack, jsii.String("GetObject"), &AwsApiCallProps{
	Service: jsii.String("S3"),
	Api: jsii.String("getObject"),
})
DeployAssert

Assertions are created by using the DeployAssert construct. This construct creates it's own Stack separate from any stacks that you create as part of your integration tests. This Stack is treated differently from other stacks by the integ-runner tool. For example, this stack will not be diffed by the integ-runner.

DeployAssert also provides utilities to register your own assertions.

var myCustomResource customResource
var stack stack
var app app


integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})
integ.Assertions.Expect(jsii.String("CustomAssertion"), awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"foo": jsii.String("bar"),
}), awscdkintegtestsalpha.ActualResult_FromCustomResource(myCustomResource, jsii.String("data")))

In the above example an assertion is created that will trigger a user defined CustomResource and assert that the data attribute is equal to { foo: 'bar' }.

API Calls

A common method to retrieve the "actual" results to compare with what is expected is to make an API call to receive some data. This library does this by utilizing CloudFormation custom resources which means that CloudFormation will call out to a Lambda Function which will make the API call.

HttpApiCall

Using the HttpApiCall will use the node-fetch JavaScript library to make the HTTP call.

This can be done by using the class directory (in the case of a normal deployment):

var stack stack


awscdkintegtestsalpha.NewHttpApiCall(stack, jsii.String("MyAsssertion"), &HttpCallProps{
	Url: jsii.String("https://example-api.com/abc"),
})

Or by using the httpApiCall method on DeployAssert (when writing integration tests):

var app app
var stack stack

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})
integ.Assertions.HttpApiCall(jsii.String("https://example-api.com/abc"))
AwsApiCall

Using the AwsApiCall construct will use the AWS JavaScript SDK to make the API call.

This can be done by using the class directory (in the case of a normal deployment):

var stack stack


awscdkintegtestsalpha.NewAwsApiCall(stack, jsii.String("MyAssertion"), &AwsApiCallProps{
	Service: jsii.String("SQS"),
	Api: jsii.String("receiveMessage"),
	Parameters: map[string]*string{
		"QueueUrl": jsii.String("url"),
	},
})

Or by using the awsApiCall method on DeployAssert (when writing integration tests):

var app app
var stack stack

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})
integ.Assertions.AwsApiCall(jsii.String("SQS"), jsii.String("receiveMessage"), map[string]*string{
	"QueueUrl": jsii.String("url"),
})

You must specify the service and the api when using The AwsApiCall construct. The service is the name of an AWS service, in one of the following forms:

  • An AWS SDK for JavaScript v3 package name (@aws-sdk/client-api-gateway)
  • An AWS SDK for JavaScript v3 client name (api-gateway)
  • An AWS SDK for JavaScript v2 constructor name (APIGateway)
  • A lowercase AWS SDK for JavaScript v2 constructor name (apigateway)

The api is the name of an AWS API call, in one of the following forms:

  • An API call name as found in the API Reference documentation (GetObject)
  • The API call name starting with a lowercase letter (getObject)
  • The AWS SDK for JavaScript v3 command class name (GetObjectCommand)

By default, the AwsApiCall construct will automatically add the correct IAM policies to allow the Lambda function to make the API call. It does this based on the service and api that is provided. In the above example the service is SQS and the api is receiveMessage so it will create a policy with Action: 'sqs:ReceiveMessage.

There are some cases where the permissions do not exactly match the service/api call, for example the S3 listObjectsV2 api. In these cases it is possible to add the correct policy by accessing the provider object.

var app app
var stack stack
var integ integTest


apiCall := integ.Assertions.AwsApiCall(jsii.String("S3"), jsii.String("listObjectsV2"), map[string]*string{
	"Bucket": jsii.String("mybucket"),
})

apiCall.Provider.AddToRolePolicy(map[string]interface{}{
	"Effect": jsii.String("Allow"),
	"Action": []*string{
		jsii.String("s3:GetObject"),
		jsii.String("s3:ListBucket"),
	},
	"Resource": []*string{
		jsii.String("*"),
	},
})

When executing waitForAssertion(), it is necessary to add an IAM policy using waiterProvider.addToRolePolicy(). Because IApiCall does not have a waiterProvider property, you need to cast it to AwsApiCall.

var integ integTest


apiCall := integ.Assertions.AwsApiCall(jsii.String("S3"), jsii.String("listObjectsV2"), map[string]*string{
	"Bucket": jsii.String("mybucket"),
}).WaitForAssertions().(awsApiCall)

apiCall.WaiterProvider.AddToRolePolicy(map[string]interface{}{
	"Effect": jsii.String("Allow"),
	"Action": []*string{
		jsii.String("s3:GetObject"),
		jsii.String("s3:ListBucket"),
	},
	"Resource": []*string{
		jsii.String("*"),
	},
})

Note that addToRolePolicy() uses direct IAM JSON policy blobs, not a iam.PolicyStatement object like you will see in the rest of the CDK.

EqualsAssertion

This library currently provides the ability to assert that two values are equal to one another by utilizing the EqualsAssertion class. This utilizes a Lambda backed CustomResource which in tern uses the Match utility from the @aws-cdk/assertions library.

var app app
var stack stack
var queue queue
var fn iFunction


integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})

integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	FunctionName: fn.FunctionName,
	InvocationType: awscdkintegtestsalpha.InvocationType_EVENT,
	Payload: jSON.stringify(map[string]*string{
		"status": jsii.String("OK"),
	}),
})

message := integ.Assertions.AwsApiCall(jsii.String("SQS"), jsii.String("receiveMessage"), map[string]interface{}{
	"QueueUrl": queue.queueUrl,
	"WaitTimeSeconds": jsii.Number(20),
})

message.AssertAtPath(jsii.String("Messages.0.Body"), awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"requestContext": map[string]*string{
		"condition": jsii.String("Success"),
	},
	"requestPayload": map[string]*string{
		"status": jsii.String("OK"),
	},
	"responseContext": map[string]*f64{
		"statusCode": jsii.Number(200),
	},
	"responsePayload": jsii.String("success"),
}))
Match

integ-tests also provides a Match utility similar to the @aws-cdk/assertions module. Match can be used to construct the ExpectedResult. While the utility is similar, only a subset of methods are currently available on the Match utility of this module: arrayWith, objectLike, stringLikeRegexp and serializedJson.

var message awsApiCall


message.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"Messages": awscdkintegtestsalpha.Match_arrayWith([]interface{}{
		map[string]map[string]map[string]interface{}{
			"Payload": awscdkintegtestsalpha.Match_serializedJson(map[string]interface{}{
				"key": jsii.String("value"),
			}),
		},
		map[string]map[string]map[string][]interface{}{
			"Body": map[string]map[string][]interface{}{
				"Values": awscdkintegtestsalpha.Match_arrayWith([]interface{}{
					map[string]*f64{
						"Asdf": jsii.Number(3),
					},
				}),
				"Message": awscdkintegtestsalpha.Match_stringLikeRegexp(jsii.String("message")),
			},
		},
	}),
}))
Examples
Invoke a Lambda Function

In this example there is a Lambda Function that is invoked and we assert that the payload that is returned is equal to '200'.

var lambdaFunction iFunction
var app app


stack := awscdk.NewStack(app, jsii.String("cdk-integ-lambda-bundling"))

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("IntegTest"), &IntegTestProps{
	TestCases: []stack{
		stack,
	},
})

invoke := integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	FunctionName: lambdaFunction.FunctionName,
})
invoke.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"Payload": jsii.String("200"),
}))

The above example will by default create a CloudWatch log group that's never expired. If you want to configure it with custom log retention days, you need to specify the logRetention property.

import logs "github.com/aws/aws-cdk-go/awscdk"

var lambdaFunction iFunction
var app app


stack := awscdk.NewStack(app, jsii.String("cdk-integ-lambda-bundling"))

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("IntegTest"), &IntegTestProps{
	TestCases: []stack{
		stack,
	},
})

invoke := integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	FunctionName: lambdaFunction.FunctionName,
	LogRetention: logs.RetentionDays_ONE_WEEK,
})
Make an AWS API Call

In this example there is a StepFunctions state machine that is executed and then we assert that the result of the execution is successful.

var app app
var stack stack
var sm iStateMachine


testCase := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("IntegTest"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})

// Start an execution
start := testCase.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("startExecution"), map[string]*string{
	"stateMachineArn": sm.stateMachineArn,
})

// describe the results of the execution
describe := testCase.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("describeExecution"), map[string]*string{
	"executionArn": start.getAttString(jsii.String("executionArn")),
})

// assert the results
describe.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"status": jsii.String("SUCCEEDED"),
}))
Chain ApiCalls

Sometimes it may be necessary to chain API Calls. Since each API call is its own resource, all you need to do is add a dependency between the calls. There is an helper method next that can be used.

var integ integTest


integ.Assertions.AwsApiCall(jsii.String("S3"), jsii.String("putObject"), map[string]*string{
	"Bucket": jsii.String("amzn-s3-demo-bucket"),
	"Key": jsii.String("my-key"),
	"Body": jsii.String("helloWorld"),
}).Next(integ.Assertions.AwsApiCall(jsii.String("S3"), jsii.String("getObject"), map[string]*string{
	"Bucket": jsii.String("amzn-s3-demo-bucket"),
	"Key": jsii.String("my-key"),
}))
Wait for results

A common use case when performing assertions is to wait for a condition to pass. Sometimes the thing that you are asserting against is not done provisioning by the time the assertion runs. In these cases it is possible to run the assertion asynchronously by calling the waitForAssertions() method.

Taking the example above of executing a StepFunctions state machine, depending on the complexity of the state machine, it might take a while for it to complete.

var app app
var stack stack
var sm iStateMachine


testCase := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("IntegTest"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})

// Start an execution
start := testCase.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("startExecution"), map[string]*string{
	"stateMachineArn": sm.stateMachineArn,
})

// describe the results of the execution
describe := testCase.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("describeExecution"), map[string]*string{
	"executionArn": start.getAttString(jsii.String("executionArn")),
}).Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"status": jsii.String("SUCCEEDED"),
})).WaitForAssertions()

When you call waitForAssertions() the assertion provider will continuously make the awsApiCall until the ExpectedResult is met. You can also control the parameters for waiting, for example:

var testCase integTest
var start iApiCall


describe := testCase.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("describeExecution"), map[string]*string{
	"executionArn": start.getAttString(jsii.String("executionArn")),
}).Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"status": jsii.String("SUCCEEDED"),
})).WaitForAssertions(&WaiterStateMachineOptions{
	TotalTimeout: awscdk.Duration_Minutes(jsii.Number(5)),
	Interval: awscdk.Duration_Seconds(jsii.Number(15)),
	BackoffRate: jsii.Number(3),
})

Documentation

Overview

CDK Integration Testing Constructs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiCallBase_IsConstruct

func ApiCallBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func AssertionsProvider_IsConstruct

func AssertionsProvider_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func AwsApiCall_IsConstruct

func AwsApiCall_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func EqualsAssertion_IsConstruct

func EqualsAssertion_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func HttpApiCall_IsConstruct

func HttpApiCall_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func IntegTestCaseStack_IsConstruct

func IntegTestCaseStack_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func IntegTestCaseStack_IsIntegTestCaseStack

func IntegTestCaseStack_IsIntegTestCaseStack(x interface{}) *bool

Returns whether the construct is a IntegTestCaseStack. Experimental.

func IntegTestCaseStack_IsStack

func IntegTestCaseStack_IsStack(x interface{}) *bool

Return whether the given object is a Stack.

We do attribute detection since we can't reliably use 'instanceof'. Experimental.

func IntegTestCaseStack_Of

func IntegTestCaseStack_Of(construct constructs.IConstruct) awscdk.Stack

Looks up the first stack scope in which `construct` is defined.

Fails if there is no stack up the tree. Experimental.

func IntegTestCase_IsConstruct

func IntegTestCase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func IntegTest_IsConstruct

func IntegTest_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func LambdaInvokeFunction_IsConstruct

func LambdaInvokeFunction_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func Match_ArrayWith

func Match_ArrayWith(pattern *[]interface{}) *map[string]*[]interface{}

Matches the specified pattern with the array found in the same relative path of the target.

The set of elements (or matchers) must be in the same order as would be found. Experimental.

func Match_ObjectLike

func Match_ObjectLike(pattern *map[string]interface{}) *map[string]*map[string]interface{}

Matches the specified pattern to an object found in the same relative path of the target.

The keys and their values (or matchers) must be present in the target but the target can be a superset. Experimental.

func Match_SerializedJson

func Match_SerializedJson(pattern *map[string]interface{}) *map[string]*map[string]interface{}

Matches any string-encoded JSON and applies the specified pattern after parsing it. Experimental.

func Match_StringLikeRegexp

func Match_StringLikeRegexp(pattern *string) *map[string]*string

Matches targets according to a regular expression. Experimental.

func NewActualResult_Override

func NewActualResult_Override(a ActualResult)

Experimental.

func NewApiCallBase_Override

func NewApiCallBase_Override(a ApiCallBase, scope constructs.Construct, id *string)

Experimental.

func NewAssertionsProvider_Override

func NewAssertionsProvider_Override(a AssertionsProvider, scope constructs.Construct, id *string, props *AssertionsProviderProps)

Experimental.

func NewAwsApiCall_Override

func NewAwsApiCall_Override(a AwsApiCall, scope constructs.Construct, id *string, props *AwsApiCallProps)

Experimental.

func NewEqualsAssertion_Override

func NewEqualsAssertion_Override(e EqualsAssertion, scope constructs.Construct, id *string, props *EqualsAssertionProps)

Experimental.

func NewExpectedResult_Override

func NewExpectedResult_Override(e ExpectedResult)

Experimental.

func NewHttpApiCall_Override

func NewHttpApiCall_Override(h HttpApiCall, scope constructs.Construct, id *string, props *HttpCallProps)

Experimental.

func NewIntegTestCaseStack_Override

func NewIntegTestCaseStack_Override(i IntegTestCaseStack, scope constructs.Construct, id *string, props *IntegTestCaseStackProps)

Experimental.

func NewIntegTestCase_Override

func NewIntegTestCase_Override(i IntegTestCase, scope constructs.Construct, id *string, props *IntegTestCaseProps)

Experimental.

func NewIntegTest_Override

func NewIntegTest_Override(i IntegTest, scope constructs.Construct, id *string, props *IntegTestProps)

Experimental.

func NewLambdaInvokeFunction_Override

func NewLambdaInvokeFunction_Override(l LambdaInvokeFunction, scope constructs.Construct, id *string, props *LambdaInvokeFunctionProps)

Experimental.

func NewMatch_Override

func NewMatch_Override(m Match)

Experimental.

func NewWaiterStateMachine_Override

func NewWaiterStateMachine_Override(w WaiterStateMachine, scope constructs.Construct, id *string, props *WaiterStateMachineProps)

Experimental.

func WaiterStateMachine_IsConstruct

func WaiterStateMachine_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

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.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

Types

type ActualResult

type ActualResult interface {
	// The actual results as a string.
	// Experimental.
	Result() *string
	// Experimental.
	SetResult(val *string)
}

Represents the "actual" results to compare.

Example:

var myCustomResource customResource
var stack stack
var app app

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})
integ.Assertions.Expect(jsii.String("CustomAssertion"), awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"foo": jsii.String("bar"),
}), awscdkintegtestsalpha.ActualResult_FromCustomResource(myCustomResource, jsii.String("data")))

Experimental.

func ActualResult_FromAwsApiCall

func ActualResult_FromAwsApiCall(query IApiCall, attribute *string) ActualResult

Get the actual results from a AwsApiCall. Experimental.

func ActualResult_FromCustomResource

func ActualResult_FromCustomResource(customResource awscdk.CustomResource, attribute *string) ActualResult

Get the actual results from a CustomResource. Experimental.

type ApiCallBase

type ApiCallBase interface {
	constructs.Construct
	IApiCall
	// Experimental.
	ApiCallResource() awscdk.CustomResource
	// Experimental.
	ExpectedResult() *string
	// Experimental.
	SetExpectedResult(val *string)
	// Experimental.
	FlattenResponse() *string
	// Experimental.
	SetFlattenResponse(val *string)
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Experimental.
	OutputPaths() *[]*string
	// Experimental.
	SetOutputPaths(val *[]*string)
	// access the AssertionsProvider.
	//
	// This can be used to add additional IAM policies
	// the the provider role policy.
	// Experimental.
	Provider() AssertionsProvider
	// Experimental.
	StateMachineArn() *string
	// Experimental.
	SetStateMachineArn(val *string)
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.
	//
	// Providing a path will filter the output of the initial API call.
	//
	// For example the SQS.receiveMessage api response would look
	// like:
	//
	// If you wanted to assert the value of `Body` you could do.
	// Experimental.
	AssertAtPath(path *string, expected ExpectedResult) IApiCall
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall.
	// Experimental.
	Expect(expected ExpectedResult) IApiCall
	// Returns the value of an attribute of the custom resource of an arbitrary type.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Returns the value of an attribute of the custom resource of type string.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	// Experimental.
	GetAttString(attributeName *string) *string
	// Allows you to chain IApiCalls. This adds an explicit dependency betweent the two resources.
	//
	// Returns the IApiCall provided as `next`.
	// Experimental.
	Next(next IApiCall) IApiCall
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Wait for the IApiCall to return the expected response.
	//
	// If no expected response is specified then it will wait for
	// the IApiCall to return a success.
	// Experimental.
	WaitForAssertions(options *WaiterStateMachineOptions) IApiCall
}

Base class for an ApiCall. Experimental.

type AssertionRequest

type AssertionRequest struct {
	// The actual value received.
	// Experimental.
	Actual interface{} `field:"required" json:"actual" yaml:"actual"`
	// The expected value to assert.
	// Experimental.
	Expected interface{} `field:"required" json:"expected" yaml:"expected"`
	// Set this to true if a failed assertion should result in a CloudFormation deployment failure.
	//
	// This is only necessary if assertions are being
	// executed outside of `integ-runner`.
	// Default: false.
	//
	// Experimental.
	FailDeployment *bool `field:"optional" json:"failDeployment" yaml:"failDeployment"`
}

A request to make an assertion that the actual value matches the expected.

Example:

// 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"

var actual interface{}
var expected interface{}

assertionRequest := &AssertionRequest{
	Actual: actual,
	Expected: expected,

	// the properties below are optional
	FailDeployment: jsii.Boolean(false),
}

Experimental.

type AssertionResult

type AssertionResult struct {
	// The result of an assertion.
	// Experimental.
	Assertion *string `field:"required" json:"assertion" yaml:"assertion"`
	// Whether or not the assertion failed.
	// Default: false.
	//
	// Experimental.
	Failed *bool `field:"optional" json:"failed" yaml:"failed"`
}

The result of an Assertion wrapping the actual result data in another struct.

Needed to access the whole message via getAtt() on the custom resource.

Example:

// 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"

assertionResult := &AssertionResult{
	Assertion: jsii.String("assertion"),

	// the properties below are optional
	Failed: jsii.Boolean(false),
}

Experimental.

type AssertionResultData

type AssertionResultData struct {
	// The status of the assertion, i.e. pass or fail.
	// Experimental.
	Status Status `field:"required" json:"status" yaml:"status"`
	// Any message returned with the assertion result typically this will be the diff if there is any.
	// Default: - none.
	//
	// Experimental.
	Message *string `field:"optional" json:"message" yaml:"message"`
}

The result of an assertion.

Example:

// 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"

assertionResultData := &AssertionResultData{
	Status: integ_tests_alpha.Status_PASS,

	// the properties below are optional
	Message: jsii.String("message"),
}

Experimental.

type AssertionType

type AssertionType string

The type of assertion to perform. Experimental.

const (
	// Assert that two values are equal.
	// Experimental.
	AssertionType_EQUALS AssertionType = "EQUALS"
	// The keys and their values must be present in the target but the target can be a superset.
	// Experimental.
	AssertionType_OBJECT_LIKE AssertionType = "OBJECT_LIKE"
	// Matches the specified pattern with the array The set of elements must be in the same order as would be found.
	// Experimental.
	AssertionType_ARRAY_WITH AssertionType = "ARRAY_WITH"
)

type AssertionsProvider

type AssertionsProvider interface {
	constructs.Construct
	// A reference to the provider Lambda Function execution Role ARN.
	// Experimental.
	HandlerRoleArn() awscdk.Reference
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// The ARN of the lambda function which can be used as a serviceToken to a CustomResource.
	// Experimental.
	ServiceToken() *string
	// Create a policy statement from a specific api call.
	// Experimental.
	AddPolicyStatementFromSdkCall(service *string, api *string, resources *[]*string)
	// 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:
	//   var provider assertionsProvider
	//
	//   provider.AddToRolePolicy(map[string]interface{}{
	//   	"Effect": jsii.String("Allow"),
	//   	"Action": []*string{
	//   		jsii.String("s3:GetObject"),
	//   	},
	//   	"Resource": []*string{
	//   		jsii.String("*"),
	//   	},
	//   })
	//
	// Experimental.
	AddToRolePolicy(statement interface{})
	// 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.
	// Experimental.
	Encode(obj interface{}) interface{}
	// Grant a principal access to invoke the assertion provider lambda function.
	// Experimental.
	GrantInvoke(principalArn *string)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

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 integ_tests_alpha "github.com/aws/aws-cdk-go/awscdkintegtestsalpha"
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,
	Uuid: jsii.String("uuid"),
})

Experimental.

func NewAssertionsProvider

func NewAssertionsProvider(scope constructs.Construct, id *string, props *AssertionsProviderProps) AssertionsProvider

Experimental.

type AssertionsProviderProps

type AssertionsProviderProps struct {
	// The handler to use for the lambda function.
	// Default: index.handler
	//
	// Experimental.
	Handler *string `field:"optional" json:"handler" yaml:"handler"`
	// How long, in days, the log contents will be retained.
	// Default: - no retention days specified.
	//
	// Experimental.
	LogRetention awslogs.RetentionDays `field:"optional" json:"logRetention" yaml:"logRetention"`
	// 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.
	//
	// Experimental.
	Uuid *string `field:"optional" json:"uuid" yaml:"uuid"`
}

Properties for defining an AssertionsProvider.

Example:

// 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"

assertionsProviderProps := &AssertionsProviderProps{
	Handler: jsii.String("handler"),
	LogRetention: awscdk.Aws_logs.RetentionDays_ONE_DAY,
	Uuid: jsii.String("uuid"),
}

Experimental.

type AwsApiCall

type AwsApiCall interface {
	ApiCallBase
	// Experimental.
	ApiCallResource() awscdk.CustomResource
	// Experimental.
	ExpectedResult() *string
	// Experimental.
	SetExpectedResult(val *string)
	// Experimental.
	FlattenResponse() *string
	// Experimental.
	SetFlattenResponse(val *string)
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Experimental.
	OutputPaths() *[]*string
	// Experimental.
	SetOutputPaths(val *[]*string)
	// access the AssertionsProvider.
	//
	// This can be used to add additional IAM policies
	// the the provider role policy.
	// Experimental.
	Provider() AssertionsProvider
	// Experimental.
	StateMachineArn() *string
	// Experimental.
	SetStateMachineArn(val *string)
	// access the AssertionsProvider for the waiter state machine.
	//
	// This can be used to add additional IAM policies
	// the the provider role policy.
	//
	// Example:
	//   var apiCall awsApiCall
	//
	//   apiCall.WaiterProvider.AddToRolePolicy(map[string]interface{}{
	//   	"Effect": jsii.String("Allow"),
	//   	"Action": []*string{
	//   		jsii.String("s3:GetObject"),
	//   	},
	//   	"Resource": []*string{
	//   		jsii.String("*"),
	//   	},
	//   })
	//
	// Experimental.
	WaiterProvider() AssertionsProvider
	// Experimental.
	SetWaiterProvider(val AssertionsProvider)
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.
	//
	// Providing a path will filter the output of the initial API call.
	//
	// For example the SQS.receiveMessage api response would look
	// like:
	//
	// If you wanted to assert the value of `Body` you could do.
	// Experimental.
	AssertAtPath(path *string, expected ExpectedResult) IApiCall
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall.
	// Experimental.
	Expect(expected ExpectedResult) IApiCall
	// Returns the value of an attribute of the custom resource of an arbitrary type.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Returns the value of an attribute of the custom resource of type string.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	// Experimental.
	GetAttString(attributeName *string) *string
	// Allows you to chain IApiCalls. This adds an explicit dependency betweent the two resources.
	//
	// Returns the IApiCall provided as `next`.
	// Experimental.
	Next(next IApiCall) IApiCall
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Wait for the IApiCall to return the expected response.
	//
	// If no expected response is specified then it will wait for
	// the IApiCall to return a success.
	// Experimental.
	WaitForAssertions(options *WaiterStateMachineOptions) IApiCall
}

Construct that creates a custom resource that will perform a query using the AWS SDK.

Example:

var stack stack

awscdkintegtestsalpha.NewAwsApiCall(stack, jsii.String("MyAssertion"), &AwsApiCallProps{
	Service: jsii.String("SQS"),
	Api: jsii.String("receiveMessage"),
	Parameters: map[string]*string{
		"QueueUrl": jsii.String("url"),
	},
})

Experimental.

func NewAwsApiCall

func NewAwsApiCall(scope constructs.Construct, id *string, props *AwsApiCallProps) AwsApiCall

Experimental.

type AwsApiCallOptions

type AwsApiCallOptions struct {
	// The api call to make, i.e. getBucketLifecycle.
	// Experimental.
	Api *string `field:"required" json:"api" yaml:"api"`
	// The AWS service, i.e. S3.
	// Experimental.
	Service *string `field:"required" json:"service" yaml:"service"`
	// Restrict the data returned by the API call to specific paths in the API response.
	//
	// Use this to limit the data returned by the custom
	// resource if working with API calls that could potentially result in custom
	// response objects exceeding the hard limit of 4096 bytes.
	// Default: - return all data.
	//
	// Experimental.
	OutputPaths *[]*string `field:"optional" json:"outputPaths" yaml:"outputPaths"`
	// Any parameters to pass to the api call.
	// Default: - no parameters.
	//
	// Experimental.
	Parameters interface{} `field:"optional" json:"parameters" yaml:"parameters"`
}

Options to perform an AWS JavaScript V2 API call.

Example:

// 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"

var parameters interface{}

awsApiCallOptions := &AwsApiCallOptions{
	Api: jsii.String("api"),
	Service: jsii.String("service"),

	// the properties below are optional
	OutputPaths: []*string{
		jsii.String("outputPaths"),
	},
	Parameters: parameters,
}

Experimental.

type AwsApiCallProps

type AwsApiCallProps struct {
	// The api call to make, i.e. getBucketLifecycle.
	// Experimental.
	Api *string `field:"required" json:"api" yaml:"api"`
	// The AWS service, i.e. S3.
	// Experimental.
	Service *string `field:"required" json:"service" yaml:"service"`
	// Restrict the data returned by the API call to specific paths in the API response.
	//
	// Use this to limit the data returned by the custom
	// resource if working with API calls that could potentially result in custom
	// response objects exceeding the hard limit of 4096 bytes.
	// Default: - return all data.
	//
	// Experimental.
	OutputPaths *[]*string `field:"optional" json:"outputPaths" yaml:"outputPaths"`
	// Any parameters to pass to the api call.
	// Default: - no parameters.
	//
	// Experimental.
	Parameters interface{} `field:"optional" json:"parameters" yaml:"parameters"`
}

Construct that creates a custom resource that will perform a query using the AWS SDK.

Example:

var myAppStack stack

awscdkintegtestsalpha.NewAwsApiCall(myAppStack, jsii.String("GetObject"), &AwsApiCallProps{
	Service: jsii.String("S3"),
	Api: jsii.String("getObject"),
})

Experimental.

type AwsApiCallRequest

type AwsApiCallRequest struct {
	// The AWS api call to make i.e. getBucketLifecycle.
	// Experimental.
	Api *string `field:"required" json:"api" yaml:"api"`
	// The AWS service i.e. S3.
	// Experimental.
	Service *string `field:"required" json:"service" yaml:"service"`
	// Whether or not to flatten the response from the api call.
	//
	// Valid values are 'true' or 'false' as strings
	//
	// Typically when using an SdkRequest you will be passing it as the
	// `actual` value to an assertion provider so this would be set
	// to 'false' (you want the actual response).
	//
	// If you are using the SdkRequest to perform more of a query to return
	// a single value to use, then this should be set to 'true'. For example,
	// you could make a StepFunctions.startExecution api call and retreive the
	// `executionArn` from the response.
	// Default: 'false'.
	//
	// Experimental.
	FlattenResponse *string `field:"optional" json:"flattenResponse" yaml:"flattenResponse"`
	// Restrict the data returned by the API call to specific paths in the API response.
	//
	// Use this to limit the data returned by the custom
	// resource if working with API calls that could potentially result in custom
	// response objects exceeding the hard limit of 4096 bytes.
	// Default: - return all data.
	//
	// Experimental.
	OutputPaths *[]*string `field:"optional" json:"outputPaths" yaml:"outputPaths"`
	// Any parameters to pass to the api call.
	// Default: - no parameters.
	//
	// Experimental.
	Parameters interface{} `field:"optional" json:"parameters" yaml:"parameters"`
}

A AWS JavaScript SDK V2 request.

Example:

// 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"

var parameters interface{}

awsApiCallRequest := &AwsApiCallRequest{
	Api: jsii.String("api"),
	Service: jsii.String("service"),

	// the properties below are optional
	FlattenResponse: jsii.String("flattenResponse"),
	OutputPaths: []*string{
		jsii.String("outputPaths"),
	},
	Parameters: parameters,
}

Experimental.

type AwsApiCallResult

type AwsApiCallResult struct {
	// The full api response.
	// Experimental.
	ApiCallResponse interface{} `field:"required" json:"apiCallResponse" yaml:"apiCallResponse"`
}

The result from a SdkQuery.

Example:

// 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"

var apiCallResponse interface{}

awsApiCallResult := &AwsApiCallResult{
	ApiCallResponse: apiCallResponse,
}

Experimental.

type EqualsAssertion

type EqualsAssertion interface {
	constructs.Construct
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// The result of the assertion.
	// Experimental.
	Result() *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Construct that creates a CustomResource to assert that two values are equal.

Example:

// 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"

var actualResult actualResult
var expectedResult expectedResult

equalsAssertion := integ_tests_alpha.NewEqualsAssertion(this, jsii.String("MyEqualsAssertion"), &EqualsAssertionProps{
	Actual: actualResult,
	Expected: expectedResult,

	// the properties below are optional
	FailDeployment: jsii.Boolean(false),
})

Experimental.

func NewEqualsAssertion

func NewEqualsAssertion(scope constructs.Construct, id *string, props *EqualsAssertionProps) EqualsAssertion

Experimental.

type EqualsAssertionProps

type EqualsAssertionProps struct {
	// The actual results to compare.
	// Experimental.
	Actual ActualResult `field:"required" json:"actual" yaml:"actual"`
	// The expected result to assert.
	// Experimental.
	Expected ExpectedResult `field:"required" json:"expected" yaml:"expected"`
	// Set this to true if a failed assertion should result in a CloudFormation deployment failure.
	//
	// This is only necessary if assertions are being
	// executed outside of `integ-runner`.
	// Default: false.
	//
	// Experimental.
	FailDeployment *bool `field:"optional" json:"failDeployment" yaml:"failDeployment"`
}

Options for an EqualsAssertion.

Example:

// 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"

var actualResult actualResult
var expectedResult expectedResult

equalsAssertionProps := &EqualsAssertionProps{
	Actual: actualResult,
	Expected: expectedResult,

	// the properties below are optional
	FailDeployment: jsii.Boolean(false),
}

Experimental.

type ExpectedResult

type ExpectedResult interface {
	// The expected results encoded as a string.
	// Experimental.
	Result() *string
	// Experimental.
	SetResult(val *string)
}

Represents the "expected" results to compare.

Example:

var app app
var integ integTest

integ.Assertions.AwsApiCall(jsii.String("SQS"), jsii.String("sendMessage"), map[string]*string{
	"QueueUrl": jsii.String("url"),
	"MessageBody": jsii.String("hello"),
})
message := integ.Assertions.AwsApiCall(jsii.String("SQS"), jsii.String("receiveMessage"), map[string]*string{
	"QueueUrl": jsii.String("url"),
})
message.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"Messages": []interface{}{
		map[string]*string{
			"Body": jsii.String("hello"),
		},
	},
}))

Experimental.

func ExpectedResult_ArrayWith

func ExpectedResult_ArrayWith(expected *[]interface{}) ExpectedResult

The actual results must be a list and must contain an item with the expected results.

Example:

// actual results
actual := []map[string]*string{
	map[string]*string{
		"stringParam": jsii.String("hello"),
	},
	map[string]*string{
		"stringParam": jsii.String("world"),
	},
}
// pass
awscdkintegtestsalpha.ExpectedResult_ArrayWith([]interface{}{
	map[string]*string{
		"stringParam": jsii.String("hello"),
	},
})

See: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html#static-arraywbrwithpattern

Experimental.

func ExpectedResult_Exact

func ExpectedResult_Exact(expected interface{}) ExpectedResult

The actual results must match exactly.

Missing data will result in a failure.

Example:

// actual results
actual := map[string]interface{}{
	"stringParam": jsii.String("hello"),
	"numberParam": jsii.Number(3),
	"booleanParam": jsii.Boolean(true),
}
// pass
awscdkintegtestsalpha.ExpectedResult_Exact(map[string]interface{}{
	"stringParam": jsii.String("hello"),
	"numberParam": jsii.Number(3),
	"booleanParam": jsii.Boolean(true),
})

// fail
awscdkintegtestsalpha.ExpectedResult_Exact(map[string]*string{
	"stringParam": jsii.String("hello"),
})

See: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html#static-exactpattern

Experimental.

func ExpectedResult_ObjectLike

func ExpectedResult_ObjectLike(expected *map[string]interface{}) ExpectedResult

The expected results must be a subset of the actual results.

Example:

// actual results
actual := map[string]interface{}{
	"stringParam": jsii.String("hello"),
	"numberParam": jsii.Number(3),
	"booleanParam": jsii.Boolean(true),
	"objectParam": map[string]*string{
		"prop1": jsii.String("value"),
		"prop2": jsii.String("value"),
	},
}
// pass
awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"stringParam": jsii.String("hello"),
	"objectParam": map[string]*string{
		"prop1": jsii.String("value"),
	},
})

See: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html#static-objectwbrlikepattern

Experimental.

func ExpectedResult_StringLikeRegexp

func ExpectedResult_StringLikeRegexp(expected *string) ExpectedResult

Actual results is a string that matches the Expected result regex.

Example:

// actual results
actual := "some string value"

// pass
awscdkintegtestsalpha.ExpectedResult_StringLikeRegexp(jsii.String("value"))

See: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html#static-stringwbrlikewbrregexppattern

Experimental.

type FetchOptions

type FetchOptions struct {
	// Request body.
	// Default: - no body.
	//
	// Experimental.
	Body *string `field:"optional" json:"body" yaml:"body"`
	// Optional request headers.
	// Default: no headers.
	//
	// Experimental.
	Headers *map[string]*string `field:"optional" json:"headers" yaml:"headers"`
	// HTTP method.
	// Default: GET.
	//
	// Experimental.
	Method *string `field:"optional" json:"method" yaml:"method"`
	// Optional port.
	// Default: default port for protocol.
	//
	// Experimental.
	Port *float64 `field:"optional" json:"port" yaml:"port"`
}

Options to pass to the JavaScript fetch api.

Example:

// 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"

fetchOptions := &FetchOptions{
	Body: jsii.String("body"),
	Headers: map[string]*string{
		"headersKey": jsii.String("headers"),
	},
	Method: jsii.String("method"),
	Port: jsii.Number(123),
}

Experimental.

type HttpApiCall

type HttpApiCall interface {
	ApiCallBase
	// Experimental.
	ApiCallResource() awscdk.CustomResource
	// Experimental.
	ExpectedResult() *string
	// Experimental.
	SetExpectedResult(val *string)
	// Experimental.
	FlattenResponse() *string
	// Experimental.
	SetFlattenResponse(val *string)
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Experimental.
	OutputPaths() *[]*string
	// Experimental.
	SetOutputPaths(val *[]*string)
	// access the AssertionsProvider.
	//
	// This can be used to add additional IAM policies
	// the the provider role policy.
	// Experimental.
	Provider() AssertionsProvider
	// Experimental.
	StateMachineArn() *string
	// Experimental.
	SetStateMachineArn(val *string)
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.
	//
	// Providing a path will filter the output of the initial API call.
	//
	// For example the SQS.receiveMessage api response would look
	// like:
	//
	// If you wanted to assert the value of `Body` you could do.
	// Experimental.
	AssertAtPath(_path *string, _expected ExpectedResult) IApiCall
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall.
	// Experimental.
	Expect(expected ExpectedResult) IApiCall
	// Returns the value of an attribute of the custom resource of an arbitrary type.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Returns the value of an attribute of the custom resource of type string.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	// Experimental.
	GetAttString(attributeName *string) *string
	// Allows you to chain IApiCalls. This adds an explicit dependency betweent the two resources.
	//
	// Returns the IApiCall provided as `next`.
	// Experimental.
	Next(next IApiCall) IApiCall
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Wait for the IApiCall to return the expected response.
	//
	// If no expected response is specified then it will wait for
	// the IApiCall to return a success.
	// Experimental.
	WaitForAssertions(options *WaiterStateMachineOptions) IApiCall
}

Construct that creates a custom resource that will perform an HTTP API Call.

Example:

var stack stack

awscdkintegtestsalpha.NewHttpApiCall(stack, jsii.String("MyAsssertion"), &HttpCallProps{
	Url: jsii.String("https://example-api.com/abc"),
})

Experimental.

func NewHttpApiCall

func NewHttpApiCall(scope constructs.Construct, id *string, props *HttpCallProps) HttpApiCall

Experimental.

type HttpCallProps

type HttpCallProps struct {
	// The url to fetch.
	// Experimental.
	Url *string `field:"required" json:"url" yaml:"url"`
	// Options for fetch.
	// Experimental.
	FetchOptions *FetchOptions `field:"optional" json:"fetchOptions" yaml:"fetchOptions"`
}

Options for creating an HttpApiCall provider.

Example:

var stack stack

awscdkintegtestsalpha.NewHttpApiCall(stack, jsii.String("MyAsssertion"), &HttpCallProps{
	Url: jsii.String("https://example-api.com/abc"),
})

Experimental.

type HttpRequest

type HttpRequest struct {
	// Parameters from the custom resource.
	// Experimental.
	Parameters *HttpRequestParameters `field:"required" json:"parameters" yaml:"parameters"`
}

Request to the HttpCall resource.

Example:

// 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"

httpRequest := &HttpRequest{
	Parameters: &HttpRequestParameters{
		Url: jsii.String("url"),

		// the properties below are optional
		FetchOptions: &FetchOptions{
			Body: jsii.String("body"),
			Headers: map[string]*string{
				"headersKey": jsii.String("headers"),
			},
			Method: jsii.String("method"),
			Port: jsii.Number(123),
		},
	},
}

Experimental.

type HttpRequestParameters

type HttpRequestParameters struct {
	// The url to fetch.
	// Experimental.
	Url *string `field:"required" json:"url" yaml:"url"`
	// Options for fetch.
	// Experimental.
	FetchOptions *FetchOptions `field:"optional" json:"fetchOptions" yaml:"fetchOptions"`
}

Example:

// 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"

httpRequestParameters := &HttpRequestParameters{
	Url: jsii.String("url"),

	// the properties below are optional
	FetchOptions: &FetchOptions{
		Body: jsii.String("body"),
		Headers: map[string]*string{
			"headersKey": jsii.String("headers"),
		},
		Method: jsii.String("method"),
		Port: jsii.Number(123),
	},
}

Experimental.

type HttpResponse

type HttpResponse struct {
	// The response, either as parsed JSON or a string literal.
	// Experimental.
	Body interface{} `field:"optional" json:"body" yaml:"body"`
	// Headers associated with the response.
	// Experimental.
	Headers *map[string]interface{} `field:"optional" json:"headers" yaml:"headers"`
	// Indicates whether the response was successful.
	//
	// status range 200-299.
	// Experimental.
	Ok *bool `field:"optional" json:"ok" yaml:"ok"`
	// Status code of the response.
	// Experimental.
	Status *float64 `field:"optional" json:"status" yaml:"status"`
	// The status message corresponding to the status code.
	// Experimental.
	StatusText *string `field:"optional" json:"statusText" yaml:"statusText"`
}

Response from fetch.

Example:

// 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"

var body interface{}
var headers interface{}

httpResponse := &HttpResponse{
	Body: body,
	Headers: map[string]interface{}{
		"headersKey": headers,
	},
	Ok: jsii.Boolean(false),
	Status: jsii.Number(123),
	StatusText: jsii.String("statusText"),
}

Experimental.

type HttpResponseWrapper

type HttpResponseWrapper struct {
	// The Response from the fetch request.
	// Experimental.
	ApiCallResponse *HttpResponse `field:"required" json:"apiCallResponse" yaml:"apiCallResponse"`
}

Response from the HttpCall resource.

Example:

// 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"

var body interface{}
var headers interface{}

httpResponseWrapper := &HttpResponseWrapper{
	ApiCallResponse: &HttpResponse{
		Body: body,
		Headers: map[string]interface{}{
			"headersKey": headers,
		},
		Ok: jsii.Boolean(false),
		Status: jsii.Number(123),
		StatusText: jsii.String("statusText"),
	},
}

Experimental.

type IApiCall

type IApiCall interface {
	constructs.IConstruct
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.
	//
	// Providing a path will filter the output of the initial API call.
	//
	// For example the SQS.receiveMessage api response would look
	// like:
	//
	// If you wanted to assert the value of `Body` you could do.
	//
	// Example:
	//   var integ integTest
	//   actual := map[string][]map[string]interface{}{
	//   	"Messages": []map[string]interface{}{
	//   		map[string]interface{}{
	//   			"MessageId": jsii.String(""),
	//   			"ReceiptHandle": jsii.String(""),
	//   			"MD5OfBody": jsii.String(""),
	//   			"Body": jsii.String("hello"),
	//   			"Attributes": map[string]interface{}{
	//   			},
	//   			"MD5OfMessageAttributes": map[string]interface{}{
	//   			},
	//   			"MessageAttributes": map[string]interface{}{
	//   			},
	//   		},
	//   	},
	//   }
	//   message := integ.Assertions.AwsApiCall(jsii.String("SQS"), jsii.String("receiveMessage"))
	//
	//   message.AssertAtPath(jsii.String("Messages.0.Body"), awscdkintegtestsalpha.ExpectedResult_StringLikeRegexp(jsii.String("hello")))
	//
	// Experimental.
	AssertAtPath(path *string, expected ExpectedResult) IApiCall
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall.
	//
	// Example:
	//   var integ integTest
	//
	//   invoke := integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	//   	FunctionName: jsii.String("my-func"),
	//   })
	//   invoke.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	//   	"Payload": jsii.String("OK"),
	//   }))
	//
	// Experimental.
	Expect(expected ExpectedResult) IApiCall
	// Returns the value of an attribute of the custom resource of an arbitrary type.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	//
	// Returns: a token for `Fn::GetAtt`. Use `Token.asXxx` to encode the returned `Reference` as a specific type or
	// use the convenience `getAttString` for string attributes.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Returns the value of an attribute of the custom resource of type string.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	//
	// Returns: a token for `Fn::GetAtt` encoded as a string.
	// Experimental.
	GetAttString(attributeName *string) *string
	// Allows you to chain IApiCalls. This adds an explicit dependency betweent the two resources.
	//
	// Returns the IApiCall provided as `next`.
	//
	// Example:
	//   var first iApiCall
	//   var second iApiCall
	//
	//
	//   first.Next(second)
	//
	// Experimental.
	Next(next IApiCall) IApiCall
	// Wait for the IApiCall to return the expected response.
	//
	// If no expected response is specified then it will wait for
	// the IApiCall to return a success.
	//
	// Example:
	//   var integ integTest
	//   var executionArn string
	//
	//   integ.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("describeExecution"), map[string]*string{
	//   	"executionArn": jsii.String(executionArn),
	//   }).WaitForAssertions()
	//
	// Experimental.
	WaitForAssertions(options *WaiterStateMachineOptions) IApiCall
	// access the AssertionsProvider.
	//
	// This can be used to add additional IAM policies
	// the the provider role policy.
	//
	// Example:
	//   var apiCall awsApiCall
	//
	//   apiCall.Provider.AddToRolePolicy(map[string]interface{}{
	//   	"Effect": jsii.String("Allow"),
	//   	"Action": []*string{
	//   		jsii.String("s3:GetObject"),
	//   	},
	//   	"Resource": []*string{
	//   		jsii.String("*"),
	//   	},
	//   })
	//
	// Experimental.
	Provider() AssertionsProvider
}

Represents an ApiCall. Experimental.

type IDeployAssert

type IDeployAssert interface {
	// Query AWS using JavaScript SDK API calls.
	//
	// This can be used to either
	// trigger an action or to return a result that can then be asserted against
	// an expected value
	//
	// The `service` is the name of an AWS service, in one of the following forms:
	// - An AWS SDK for JavaScript v3 package name (`@aws-sdk/client-api-gateway`)
	// - An AWS SDK for JavaScript v3 client name (`api-gateway`)
	// - An AWS SDK for JavaScript v2 constructor name (`APIGateway`)
	// - A lowercase AWS SDK for JavaScript v2 constructor name (`apigateway`)
	//
	// The `api` is the name of an AWS API call, in one of the following forms:
	// - An API call name as found in the API Reference documentation (`GetObject`)
	// - The API call name starting with a lowercase letter (`getObject`)
	// - The AWS SDK for JavaScript v3 command class name (`GetObjectCommand`).
	//
	// Example:
	//   var app app
	//   var integ integTest
	//
	//   integ.Assertions.AwsApiCall(jsii.String("SQS"), jsii.String("sendMessage"), map[string]*string{
	//   	"QueueUrl": jsii.String("url"),
	//   	"MessageBody": jsii.String("hello"),
	//   })
	//   message := integ.Assertions.AwsApiCall(jsii.String("SQS"), jsii.String("receiveMessage"), map[string]*string{
	//   	"QueueUrl": jsii.String("url"),
	//   })
	//   message.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	//   	"Messages": []interface{}{
	//   		map[string]*string{
	//   			"Body": jsii.String("hello"),
	//   		},
	//   	},
	//   }))
	//
	// Experimental.
	AwsApiCall(service *string, api *string, parameters interface{}, outputPaths *[]*string) IApiCall
	// Assert that the ExpectedResult is equal to the ActualResult.
	//
	// Example:
	//   var integ integTest
	//   var apiCall awsApiCall
	//
	//   integ.Assertions.Expect(jsii.String("invoke"), awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	//   	"Payload": jsii.String("OK"),
	//   }), awscdkintegtestsalpha.ActualResult_FromAwsApiCall(apiCall, jsii.String("Body")))
	//
	// Experimental.
	Expect(id *string, expected ExpectedResult, actual ActualResult)
	// Make an HTTP call to the provided endpoint.
	//
	// Example:
	//   var app app
	//   var integ integTest
	//
	//   call := integ.Assertions.HttpApiCall(jsii.String("https://example.com/test"))
	//   call.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	//   	"Message": jsii.String("Hello World!"),
	//   }))
	//
	// Experimental.
	HttpApiCall(url *string, options *FetchOptions) IApiCall
	// Invoke a lambda function and return the response which can be asserted.
	//
	// Example:
	//   var app app
	//   var integ integTest
	//
	//   invoke := integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	//   	FunctionName: jsii.String("my-function"),
	//   })
	//   invoke.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	//   	"Payload": jsii.String("200"),
	//   }))
	//
	// Experimental.
	InvokeFunction(props *LambdaInvokeFunctionProps) IApiCall
}

Interface that allows for registering a list of assertions that should be performed on a construct.

This is only necessary when writing integration tests. Experimental.

type IntegTest

type IntegTest interface {
	constructs.Construct
	// Make assertions on resources in this test case.
	// Experimental.
	Assertions() IDeployAssert
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

A collection of test cases.

Each test case file should contain exactly one instance of this class.

Example:

var lambdaFunction iFunction
var app app

stack := awscdk.NewStack(app, jsii.String("cdk-integ-lambda-bundling"))

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("IntegTest"), &IntegTestProps{
	TestCases: []stack{
		stack,
	},
})

invoke := integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	FunctionName: lambdaFunction.FunctionName,
})
invoke.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"Payload": jsii.String("200"),
}))

Experimental.

func NewIntegTest

func NewIntegTest(scope constructs.Construct, id *string, props *IntegTestProps) IntegTest

Experimental.

type IntegTestCase

type IntegTestCase interface {
	constructs.Construct
	// Make assertions on resources in this test case.
	// Experimental.
	Assertions() IDeployAssert
	// The integration test manifest for this test case.
	//
	// Manifests are used
	// by the integration test runner.
	// Experimental.
	Manifest() *cloudassemblyschema.IntegManifest
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

An integration test case. Allows the definition of test properties that apply to all stacks under this case.

It is recommended that you use the IntegTest construct since that will create a default IntegTestCase.

Example:

// 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 cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var stack stack

integTestCase := integ_tests_alpha.NewIntegTestCase(this, jsii.String("MyIntegTestCase"), &IntegTestCaseProps{
	Stacks: []*stack{
		stack,
	},

	// the properties below are optional
	AllowDestroy: []*string{
		jsii.String("allowDestroy"),
	},
	AssertionStack: stack,
	CdkCommandOptions: &CdkCommands{
		Deploy: &DeployCommand{
			Args: &DeployOptions{
				All: jsii.Boolean(false),
				App: jsii.String("app"),
				AssetMetadata: jsii.Boolean(false),
				CaBundlePath: jsii.String("caBundlePath"),
				ChangeSetName: jsii.String("changeSetName"),
				Ci: jsii.Boolean(false),
				Color: jsii.Boolean(false),
				Concurrency: jsii.Number(123),
				Context: map[string]*string{
					"contextKey": jsii.String("context"),
				},
				Debug: jsii.Boolean(false),
				Ec2Creds: jsii.Boolean(false),
				Exclusively: jsii.Boolean(false),
				Execute: jsii.Boolean(false),
				Force: jsii.Boolean(false),
				IgnoreErrors: jsii.Boolean(false),
				Json: jsii.Boolean(false),
				Lookups: jsii.Boolean(false),
				Notices: jsii.Boolean(false),
				NotificationArns: []*string{
					jsii.String("notificationArns"),
				},
				Output: jsii.String("output"),
				OutputsFile: jsii.String("outputsFile"),
				Parameters: map[string]*string{
					"parametersKey": jsii.String("parameters"),
				},
				PathMetadata: jsii.Boolean(false),
				Profile: jsii.String("profile"),
				Proxy: jsii.String("proxy"),
				RequireApproval: awscdk.Cloud_assembly_schema.RequireApproval_NEVER,
				ReuseAssets: []*string{
					jsii.String("reuseAssets"),
				},
				RoleArn: jsii.String("roleArn"),
				Rollback: jsii.Boolean(false),
				Stacks: []*string{
					jsii.String("stacks"),
				},
				Staging: jsii.Boolean(false),
				Strict: jsii.Boolean(false),
				ToolkitStackName: jsii.String("toolkitStackName"),
				Trace: jsii.Boolean(false),
				UsePreviousParameters: jsii.Boolean(false),
				Verbose: jsii.Boolean(false),
				VersionReporting: jsii.Boolean(false),
			},
			Enabled: jsii.Boolean(false),
			ExpectedMessage: jsii.String("expectedMessage"),
			ExpectError: jsii.Boolean(false),
		},
		Destroy: &DestroyCommand{
			Args: &DestroyOptions{
				All: jsii.Boolean(false),
				App: jsii.String("app"),
				AssetMetadata: jsii.Boolean(false),
				CaBundlePath: jsii.String("caBundlePath"),
				Color: jsii.Boolean(false),
				Context: map[string]*string{
					"contextKey": jsii.String("context"),
				},
				Debug: jsii.Boolean(false),
				Ec2Creds: jsii.Boolean(false),
				Exclusively: jsii.Boolean(false),
				Force: jsii.Boolean(false),
				IgnoreErrors: jsii.Boolean(false),
				Json: jsii.Boolean(false),
				Lookups: jsii.Boolean(false),
				Notices: jsii.Boolean(false),
				Output: jsii.String("output"),
				PathMetadata: jsii.Boolean(false),
				Profile: jsii.String("profile"),
				Proxy: jsii.String("proxy"),
				RoleArn: jsii.String("roleArn"),
				Stacks: []*string{
					jsii.String("stacks"),
				},
				Staging: jsii.Boolean(false),
				Strict: jsii.Boolean(false),
				Trace: jsii.Boolean(false),
				Verbose: jsii.Boolean(false),
				VersionReporting: jsii.Boolean(false),
			},
			Enabled: jsii.Boolean(false),
			ExpectedMessage: jsii.String("expectedMessage"),
			ExpectError: jsii.Boolean(false),
		},
	},
	DiffAssets: jsii.Boolean(false),
	Hooks: &Hooks{
		PostDeploy: []*string{
			jsii.String("postDeploy"),
		},
		PostDestroy: []*string{
			jsii.String("postDestroy"),
		},
		PreDeploy: []*string{
			jsii.String("preDeploy"),
		},
		PreDestroy: []*string{
			jsii.String("preDestroy"),
		},
	},
	Regions: []*string{
		jsii.String("regions"),
	},
	StackUpdateWorkflow: jsii.Boolean(false),
})

Experimental.

func NewIntegTestCase

func NewIntegTestCase(scope constructs.Construct, id *string, props *IntegTestCaseProps) IntegTestCase

Experimental.

type IntegTestCaseProps

type IntegTestCaseProps struct {
	// List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
	//
	// This list should only include resources that for this specific
	// integration test we are sure will not cause errors or an outage if
	// destroyed. For example, maybe we know that a new resource will be created
	// first before the old resource is destroyed which prevents any outage.
	//
	// e.g. ['AWS::IAM::Role']
	// Default: - do not allow destruction of any resources on update.
	//
	// Experimental.
	AllowDestroy *[]*string `field:"optional" json:"allowDestroy" yaml:"allowDestroy"`
	// Additional options to use for each CDK command.
	// Default: - runner default options.
	//
	// Experimental.
	CdkCommandOptions *cloudassemblyschema.CdkCommands `field:"optional" json:"cdkCommandOptions" yaml:"cdkCommandOptions"`
	// Whether or not to include asset hashes in the diff Asset hashes can introduces a lot of unneccessary noise into tests, but there are some cases where asset hashes _should_ be included.
	//
	// For example
	// any tests involving custom resources or bundling.
	// Default: false.
	//
	// Experimental.
	DiffAssets *bool `field:"optional" json:"diffAssets" yaml:"diffAssets"`
	// Additional commands to run at predefined points in the test workflow.
	//
	// e.g. { postDeploy: ['yarn', 'test'] }
	// Default: - no hooks.
	//
	// Experimental.
	Hooks *cloudassemblyschema.Hooks `field:"optional" json:"hooks" yaml:"hooks"`
	// Limit deployment to these regions.
	// Default: - can run in any region.
	//
	// Experimental.
	Regions *[]*string `field:"optional" json:"regions" yaml:"regions"`
	// Run update workflow on this test case This should only be set to false to test scenarios that are not possible to test as part of the update workflow.
	// Default: true.
	//
	// Experimental.
	StackUpdateWorkflow *bool `field:"optional" json:"stackUpdateWorkflow" yaml:"stackUpdateWorkflow"`
	// Stacks to be deployed during the test.
	// Experimental.
	Stacks *[]awscdk.Stack `field:"required" json:"stacks" yaml:"stacks"`
	// Specify a stack to use for assertions.
	// Default: - a stack is created for you.
	//
	// Experimental.
	AssertionStack awscdk.Stack `field:"optional" json:"assertionStack" yaml:"assertionStack"`
}

Properties of an integration test case.

Example:

// 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 cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var stack stack

integTestCaseProps := &IntegTestCaseProps{
	Stacks: []*stack{
		stack,
	},

	// the properties below are optional
	AllowDestroy: []*string{
		jsii.String("allowDestroy"),
	},
	AssertionStack: stack,
	CdkCommandOptions: &CdkCommands{
		Deploy: &DeployCommand{
			Args: &DeployOptions{
				All: jsii.Boolean(false),
				App: jsii.String("app"),
				AssetMetadata: jsii.Boolean(false),
				CaBundlePath: jsii.String("caBundlePath"),
				ChangeSetName: jsii.String("changeSetName"),
				Ci: jsii.Boolean(false),
				Color: jsii.Boolean(false),
				Concurrency: jsii.Number(123),
				Context: map[string]*string{
					"contextKey": jsii.String("context"),
				},
				Debug: jsii.Boolean(false),
				Ec2Creds: jsii.Boolean(false),
				Exclusively: jsii.Boolean(false),
				Execute: jsii.Boolean(false),
				Force: jsii.Boolean(false),
				IgnoreErrors: jsii.Boolean(false),
				Json: jsii.Boolean(false),
				Lookups: jsii.Boolean(false),
				Notices: jsii.Boolean(false),
				NotificationArns: []*string{
					jsii.String("notificationArns"),
				},
				Output: jsii.String("output"),
				OutputsFile: jsii.String("outputsFile"),
				Parameters: map[string]*string{
					"parametersKey": jsii.String("parameters"),
				},
				PathMetadata: jsii.Boolean(false),
				Profile: jsii.String("profile"),
				Proxy: jsii.String("proxy"),
				RequireApproval: awscdk.Cloud_assembly_schema.RequireApproval_NEVER,
				ReuseAssets: []*string{
					jsii.String("reuseAssets"),
				},
				RoleArn: jsii.String("roleArn"),
				Rollback: jsii.Boolean(false),
				Stacks: []*string{
					jsii.String("stacks"),
				},
				Staging: jsii.Boolean(false),
				Strict: jsii.Boolean(false),
				ToolkitStackName: jsii.String("toolkitStackName"),
				Trace: jsii.Boolean(false),
				UsePreviousParameters: jsii.Boolean(false),
				Verbose: jsii.Boolean(false),
				VersionReporting: jsii.Boolean(false),
			},
			Enabled: jsii.Boolean(false),
			ExpectedMessage: jsii.String("expectedMessage"),
			ExpectError: jsii.Boolean(false),
		},
		Destroy: &DestroyCommand{
			Args: &DestroyOptions{
				All: jsii.Boolean(false),
				App: jsii.String("app"),
				AssetMetadata: jsii.Boolean(false),
				CaBundlePath: jsii.String("caBundlePath"),
				Color: jsii.Boolean(false),
				Context: map[string]*string{
					"contextKey": jsii.String("context"),
				},
				Debug: jsii.Boolean(false),
				Ec2Creds: jsii.Boolean(false),
				Exclusively: jsii.Boolean(false),
				Force: jsii.Boolean(false),
				IgnoreErrors: jsii.Boolean(false),
				Json: jsii.Boolean(false),
				Lookups: jsii.Boolean(false),
				Notices: jsii.Boolean(false),
				Output: jsii.String("output"),
				PathMetadata: jsii.Boolean(false),
				Profile: jsii.String("profile"),
				Proxy: jsii.String("proxy"),
				RoleArn: jsii.String("roleArn"),
				Stacks: []*string{
					jsii.String("stacks"),
				},
				Staging: jsii.Boolean(false),
				Strict: jsii.Boolean(false),
				Trace: jsii.Boolean(false),
				Verbose: jsii.Boolean(false),
				VersionReporting: jsii.Boolean(false),
			},
			Enabled: jsii.Boolean(false),
			ExpectedMessage: jsii.String("expectedMessage"),
			ExpectError: jsii.Boolean(false),
		},
	},
	DiffAssets: jsii.Boolean(false),
	Hooks: &Hooks{
		PostDeploy: []*string{
			jsii.String("postDeploy"),
		},
		PostDestroy: []*string{
			jsii.String("postDestroy"),
		},
		PreDeploy: []*string{
			jsii.String("preDeploy"),
		},
		PreDestroy: []*string{
			jsii.String("preDestroy"),
		},
	},
	Regions: []*string{
		jsii.String("regions"),
	},
	StackUpdateWorkflow: jsii.Boolean(false),
}

Experimental.

type IntegTestCaseStack

type IntegTestCaseStack interface {
	awscdk.Stack
	// The AWS account into which this stack will be deployed.
	//
	// This value is resolved according to the following rules:
	//
	// 1. The value provided to `env.account` when the stack is defined. This can
	//    either be a concrete account (e.g. `585695031111`) or the
	//    `Aws.ACCOUNT_ID` token.
	// 3. `Aws.ACCOUNT_ID`, which represents the CloudFormation intrinsic reference
	//    `{ "Ref": "AWS::AccountId" }` encoded as a string token.
	//
	// Preferably, you should use the return value as an opaque string and not
	// attempt to parse it to implement your logic. If you do, you must first
	// check that it is a concrete value an not an unresolved token. If this
	// value is an unresolved token (`Token.isUnresolved(stack.account)` returns
	// `true`), this implies that the user wishes that this stack will synthesize
	// into a **account-agnostic template**. In this case, your code should either
	// fail (throw an error, emit a synth error using `Annotations.of(construct).addError()`) or
	// implement some other region-agnostic behavior.
	// Experimental.
	Account() *string
	// The ID of the cloud assembly artifact for this stack.
	// Experimental.
	ArtifactId() *string
	// Make assertions on resources in this test case.
	// Experimental.
	Assertions() IDeployAssert
	// Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.
	//
	// If the stack is environment-agnostic (either account and/or region are
	// tokens), this property will return an array with 2 tokens that will resolve
	// at deploy-time to the first two availability zones returned from CloudFormation's
	// `Fn::GetAZs` intrinsic function.
	//
	// If they are not available in the context, returns a set of dummy values and
	// reports them as missing, and let the CLI resolve them by calling EC2
	// `DescribeAvailabilityZones` on the target environment.
	//
	// To specify a different strategy for selecting availability zones override this method.
	// Experimental.
	AvailabilityZones() *[]*string
	// Indicates whether the stack requires bundling or not.
	// Experimental.
	BundlingRequired() *bool
	// Return the stacks this stack depends on.
	// Experimental.
	Dependencies() *[]awscdk.Stack
	// The environment coordinates in which this stack is deployed.
	//
	// In the form
	// `aws://account/region`. Use `stack.account` and `stack.region` to obtain
	// the specific values, no need to parse.
	//
	// You can use this value to determine if two stacks are targeting the same
	// environment.
	//
	// If either `stack.account` or `stack.region` are not concrete values (e.g.
	// `Aws.ACCOUNT_ID` or `Aws.REGION`) the special strings `unknown-account` and/or
	// `unknown-region` will be used respectively to indicate this stack is
	// region/account-agnostic.
	// Experimental.
	Environment() *string
	// Indicates if this is a nested stack, in which case `parentStack` will include a reference to it's parent.
	// Experimental.
	Nested() *bool
	// If this is a nested stack, returns it's parent stack.
	// Experimental.
	NestedStackParent() awscdk.Stack
	// If this is a nested stack, this represents its `AWS::CloudFormation::Stack` resource.
	//
	// `undefined` for top-level (non-nested) stacks.
	// Experimental.
	NestedStackResource() awscdk.CfnResource
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
	// Experimental.
	NotificationArns() *[]*string
	// The partition in which this stack is defined.
	// Experimental.
	Partition() *string
	// The AWS region into which this stack will be deployed (e.g. `us-west-2`).
	//
	// This value is resolved according to the following rules:
	//
	// 1. The value provided to `env.region` when the stack is defined. This can
	//    either be a concrete region (e.g. `us-west-2`) or the `Aws.REGION`
	//    token.
	// 3. `Aws.REGION`, which is represents the CloudFormation intrinsic reference
	//    `{ "Ref": "AWS::Region" }` encoded as a string token.
	//
	// Preferably, you should use the return value as an opaque string and not
	// attempt to parse it to implement your logic. If you do, you must first
	// check that it is a concrete value an not an unresolved token. If this
	// value is an unresolved token (`Token.isUnresolved(stack.region)` returns
	// `true`), this implies that the user wishes that this stack will synthesize
	// into a **region-agnostic template**. In this case, your code should either
	// fail (throw an error, emit a synth error using `Annotations.of(construct).addError()`) or
	// implement some other region-agnostic behavior.
	// Experimental.
	Region() *string
	// The ID of the stack.
	//
	// Example:
	//   // After resolving, looks like
	//   'arn:aws:cloudformation:us-west-2:123456789012:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123'
	//
	// Experimental.
	StackId() *string
	// The concrete CloudFormation physical stack name.
	//
	// This is either the name defined explicitly in the `stackName` prop or
	// allocated based on the stack's location in the construct tree. Stacks that
	// are directly defined under the app use their construct `id` as their stack
	// name. Stacks that are defined deeper within the tree will use a hashed naming
	// scheme based on the construct path to ensure uniqueness.
	//
	// If you wish to obtain the deploy-time AWS::StackName intrinsic,
	// you can use `Aws.STACK_NAME` directly.
	// Experimental.
	StackName() *string
	// Synthesis method for this stack.
	// Experimental.
	Synthesizer() awscdk.IStackSynthesizer
	// Tags to be applied to the stack.
	// Experimental.
	Tags() awscdk.TagManager
	// The name of the CloudFormation template file emitted to the output directory during synthesis.
	//
	// Example value: `MyStack.template.json`
	// Experimental.
	TemplateFile() *string
	// Options for CloudFormation template (like version, transform, description).
	// Experimental.
	TemplateOptions() awscdk.ITemplateOptions
	// Whether termination protection is enabled for this stack.
	// Experimental.
	TerminationProtection() *bool
	// Experimental.
	SetTerminationProtection(val *bool)
	// The Amazon domain suffix for the region in which this stack is defined.
	// Experimental.
	UrlSuffix() *string
	// Add a dependency between this stack and another stack.
	//
	// This can be used to define dependencies between any two stacks within an
	// app, and also supports nested stacks.
	// Experimental.
	AddDependency(target awscdk.Stack, reason *string)
	// Adds an arbitrary key-value pair, with information you want to record about the stack.
	//
	// These get translated to the Metadata section of the generated template.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template.
	//
	// Duplicate values are removed when stack is synthesized.
	//
	// Example:
	//   declare const stack: Stack;
	//
	//   stack.addTransform('AWS::Serverless-2016-10-31')
	//
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html
	//
	// Experimental.
	AddTransform(transform *string)
	// Returns the naming scheme used to allocate logical IDs.
	//
	// By default, uses
	// the `HashedAddressingScheme` but this method can be overridden to customize
	// this behavior.
	//
	// In order to make sure logical IDs are unique and stable, we hash the resource
	// construct tree path (i.e. toplevel/secondlevel/.../myresource) and add it as
	// a suffix to the path components joined without a separator (CloudFormation
	// IDs only allow alphanumeric characters).
	//
	// The result will be:
	//
	//   <path.join(”)><md5(path.join('/')>
	//     "human"      "hash"
	//
	// If the "human" part of the ID exceeds 240 characters, we simply trim it so
	// the total ID doesn't exceed CloudFormation's 255 character limit.
	//
	// We only take 8 characters from the md5 hash (0.000005 chance of collision).
	//
	// Special cases:
	//
	// - If the path only contains a single component (i.e. it's a top-level
	//   resource), we won't add the hash to it. The hash is not needed for
	//   disambiguation and also, it allows for a more straightforward migration an
	//   existing CloudFormation template to a CDK stack without logical ID changes
	//   (or renames).
	// - For aesthetic reasons, if the last components of the path are the same
	//   (i.e. `L1/L2/Pipeline/Pipeline`), they will be de-duplicated to make the
	//   resulting human portion of the ID more pleasing: `L1L2Pipeline<HASH>`
	//   instead of `L1L2PipelinePipeline<HASH>`
	// - If a component is named "Default" it will be omitted from the path. This
	//   allows refactoring higher level abstractions around constructs without affecting
	//   the IDs of already deployed resources.
	// - If a component is named "Resource" it will be omitted from the user-visible
	//   path, but included in the hash. This reduces visual noise in the human readable
	//   part of the identifier.
	// Experimental.
	AllocateLogicalId(cfnElement awscdk.CfnElement) *string
	// Create a CloudFormation Export for a string list value.
	//
	// Returns a string list representing the corresponding `Fn.importValue()`
	// expression for this Export. The export expression is automatically wrapped with an
	// `Fn::Join` and the import value with an `Fn::Split`, since CloudFormation can only
	// export strings. You can control the name for the export by passing the `name` option.
	//
	// If you don't supply a value for `name`, the value you're exporting must be
	// a Resource attribute (for example: `bucket.bucketName`) and it will be
	// given the same name as the automatic cross-stack reference that would be created
	// if you used the attribute in another Stack.
	//
	// One of the uses for this method is to *remove* the relationship between
	// two Stacks established by automatic cross-stack references. It will
	// temporarily ensure that the CloudFormation Export still exists while you
	// remove the reference from the consuming stack. After that, you can remove
	// the resource and the manual export.
	//
	// See `exportValue` for an example of this process.
	// Experimental.
	ExportStringListValue(exportedValue interface{}, options *awscdk.ExportValueOptions) *[]*string
	// Create a CloudFormation Export for a string value.
	//
	// Returns a string representing the corresponding `Fn.importValue()`
	// expression for this Export. You can control the name for the export by
	// passing the `name` option.
	//
	// If you don't supply a value for `name`, the value you're exporting must be
	// a Resource attribute (for example: `bucket.bucketName`) and it will be
	// given the same name as the automatic cross-stack reference that would be created
	// if you used the attribute in another Stack.
	//
	// One of the uses for this method is to *remove* the relationship between
	// two Stacks established by automatic cross-stack references. It will
	// temporarily ensure that the CloudFormation Export still exists while you
	// remove the reference from the consuming stack. After that, you can remove
	// the resource and the manual export.
	//
	// Here is how the process works. Let's say there are two stacks,
	// `producerStack` and `consumerStack`, and `producerStack` has a bucket
	// called `bucket`, which is referenced by `consumerStack` (perhaps because
	// an AWS Lambda Function writes into it, or something like that).
	//
	// It is not safe to remove `producerStack.bucket` because as the bucket is being
	// deleted, `consumerStack` might still be using it.
	//
	// Instead, the process takes two deployments:
	//
	// **Deployment 1: break the relationship**:
	//
	// - Make sure `consumerStack` no longer references `bucket.bucketName` (maybe the consumer
	//   stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just
	//   remove the Lambda Function altogether).
	// - In the `ProducerStack` class, call `this.exportValue(this.bucket.bucketName)`. This
	//   will make sure the CloudFormation Export continues to exist while the relationship
	//   between the two stacks is being broken.
	// - Deploy (this will effectively only change the `consumerStack`, but it's safe to deploy both).
	//
	// **Deployment 2: remove the bucket resource**:
	//
	// - You are now free to remove the `bucket` resource from `producerStack`.
	// - Don't forget to remove the `exportValue()` call as well.
	// - Deploy again (this time only the `producerStack` will be changed -- the bucket will be deleted).
	// Experimental.
	ExportValue(exportedValue interface{}, options *awscdk.ExportValueOptions) *string
	// Creates an ARN from components.
	//
	// If `partition`, `region` or `account` are not specified, the stack's
	// partition, region and account will be used.
	//
	// If any component is the empty string, an empty string will be inserted
	// into the generated ARN at the location that component corresponds to.
	//
	// The ARN will be formatted as follows:
	//
	//   arn:{partition}:{service}:{region}:{account}:{resource}{sep}{resource-name}
	//
	// The required ARN pieces that are omitted will be taken from the stack that
	// the 'scope' is attached to. If all ARN pieces are supplied, the supplied scope
	// can be 'undefined'.
	// Experimental.
	FormatArn(components *awscdk.ArnComponents) *string
	// Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.
	//
	// This method is called when a `CfnElement` is created and used to render the
	// initial logical identity of resources. Logical ID renames are applied at
	// this stage.
	//
	// This method uses the protected method `allocateLogicalId` to render the
	// logical ID for an element. To modify the naming scheme, extend the `Stack`
	// class and override this method.
	// Experimental.
	GetLogicalId(element awscdk.CfnElement) *string
	// Look up a fact value for the given fact for the region of this stack.
	//
	// Will return a definite value only if the region of the current stack is resolved.
	// If not, a lookup map will be added to the stack and the lookup will be done at
	// CDK deployment time.
	//
	// What regions will be included in the lookup map is controlled by the
	// `@aws-cdk/core:target-partitions` context value: it must be set to a list
	// of partitions, and only regions from the given partitions will be included.
	// If no such context key is set, all regions will be included.
	//
	// This function is intended to be used by construct library authors. Application
	// builders can rely on the abstractions offered by construct libraries and do
	// not have to worry about regional facts.
	//
	// If `defaultValue` is not given, it is an error if the fact is unknown for
	// the given region.
	// Experimental.
	RegionalFact(factName *string, defaultValue *string) *string
	// Rename a generated logical identities.
	//
	// To modify the naming scheme strategy, extend the `Stack` class and
	// override the `allocateLogicalId` method.
	// Experimental.
	RenameLogicalId(oldId *string, newId *string)
	// Indicate that a context key was expected.
	//
	// Contains instructions which will be emitted into the cloud assembly on how
	// the key should be supplied.
	// Experimental.
	ReportMissingContextKey(report *cloudassemblyschema.MissingContext)
	// Resolve a tokenized value in the context of the current stack.
	// Experimental.
	Resolve(obj interface{}) interface{}
	// Splits the provided ARN into its components.
	//
	// Works both if 'arn' is a string like 'arn:aws:s3:::bucket',
	// and a Token representing a dynamic CloudFormation expression
	// (in which case the returned components will also be dynamic CloudFormation expressions,
	// encoded as Tokens).
	// Experimental.
	SplitArn(arn *string, arnFormat awscdk.ArnFormat) *awscdk.ArnComponents
	// Convert an object, potentially containing tokens, to a JSON string.
	// Experimental.
	ToJsonString(obj interface{}, space *float64) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Convert an object, potentially containing tokens, to a YAML string.
	// Experimental.
	ToYamlString(obj interface{}) *string
}

An integration test case stack. Allows the definition of test properties that should apply to this stack.

This should be used if there are multiple stacks in the integration test and it is necessary to specify different test case option for each. Otherwise normal stacks should be added to IntegTest.

Example:

var app app
var stackUnderTest stack

testCaseWithAssets := awscdkintegtestsalpha.NewIntegTestCaseStack(app, jsii.String("TestCaseAssets"), &IntegTestCaseStackProps{
	DiffAssets: jsii.Boolean(true),
})

awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stackUnderTest,
		testCaseWithAssets,
	},
})

Experimental.

func NewIntegTestCaseStack

func NewIntegTestCaseStack(scope constructs.Construct, id *string, props *IntegTestCaseStackProps) IntegTestCaseStack

Experimental.

type IntegTestCaseStackProps

type IntegTestCaseStackProps struct {
	// List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
	//
	// This list should only include resources that for this specific
	// integration test we are sure will not cause errors or an outage if
	// destroyed. For example, maybe we know that a new resource will be created
	// first before the old resource is destroyed which prevents any outage.
	//
	// e.g. ['AWS::IAM::Role']
	// Default: - do not allow destruction of any resources on update.
	//
	// Experimental.
	AllowDestroy *[]*string `field:"optional" json:"allowDestroy" yaml:"allowDestroy"`
	// Additional options to use for each CDK command.
	// Default: - runner default options.
	//
	// Experimental.
	CdkCommandOptions *cloudassemblyschema.CdkCommands `field:"optional" json:"cdkCommandOptions" yaml:"cdkCommandOptions"`
	// Whether or not to include asset hashes in the diff Asset hashes can introduces a lot of unneccessary noise into tests, but there are some cases where asset hashes _should_ be included.
	//
	// For example
	// any tests involving custom resources or bundling.
	// Default: false.
	//
	// Experimental.
	DiffAssets *bool `field:"optional" json:"diffAssets" yaml:"diffAssets"`
	// Additional commands to run at predefined points in the test workflow.
	//
	// e.g. { postDeploy: ['yarn', 'test'] }
	// Default: - no hooks.
	//
	// Experimental.
	Hooks *cloudassemblyschema.Hooks `field:"optional" json:"hooks" yaml:"hooks"`
	// Limit deployment to these regions.
	// Default: - can run in any region.
	//
	// Experimental.
	Regions *[]*string `field:"optional" json:"regions" yaml:"regions"`
	// Run update workflow on this test case This should only be set to false to test scenarios that are not possible to test as part of the update workflow.
	// Default: true.
	//
	// Experimental.
	StackUpdateWorkflow *bool `field:"optional" json:"stackUpdateWorkflow" yaml:"stackUpdateWorkflow"`
	// Include runtime versioning information in this Stack.
	// Default: `analyticsReporting` setting of containing `App`, or value of
	// 'aws:cdk:version-reporting' context key.
	//
	// Experimental.
	AnalyticsReporting *bool `field:"optional" json:"analyticsReporting" yaml:"analyticsReporting"`
	// Enable this flag to allow native cross region stack references.
	//
	// Enabling this will create a CloudFormation custom resource
	// in both the producing stack and consuming stack in order to perform the export/import
	//
	// This feature is currently experimental.
	// Default: false.
	//
	// Experimental.
	CrossRegionReferences *bool `field:"optional" json:"crossRegionReferences" yaml:"crossRegionReferences"`
	// A description of the stack.
	// Default: - No description.
	//
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The AWS environment (account/region) where this stack will be deployed.
	//
	// Set the `region`/`account` fields of `env` to either a concrete value to
	// select the indicated environment (recommended for production stacks), or to
	// the values of environment variables
	// `CDK_DEFAULT_REGION`/`CDK_DEFAULT_ACCOUNT` to let the target environment
	// depend on the AWS credentials/configuration that the CDK CLI is executed
	// under (recommended for development stacks).
	//
	// If the `Stack` is instantiated inside a `Stage`, any undefined
	// `region`/`account` fields from `env` will default to the same field on the
	// encompassing `Stage`, if configured there.
	//
	// If either `region` or `account` are not set nor inherited from `Stage`, the
	// Stack will be considered "*environment-agnostic*"". Environment-agnostic
	// stacks can be deployed to any environment but may not be able to take
	// advantage of all features of the CDK. For example, they will not be able to
	// use environmental context lookups such as `ec2.Vpc.fromLookup` and will not
	// automatically translate Service Principals to the right format based on the
	// environment's AWS partition, and other such enhancements.
	//
	// Example:
	//   // Use a concrete account and region to deploy this stack to:
	//   // `.account` and `.region` will simply return these values.
	//   new Stack(app, 'Stack1', {
	//     env: {
	//       account: '123456789012',
	//       region: 'us-east-1'
	//     },
	//   });
	//
	//   // Use the CLI's current credentials to determine the target environment:
	//   // `.account` and `.region` will reflect the account+region the CLI
	//   // is configured to use (based on the user CLI credentials)
	//   new Stack(app, 'Stack2', {
	//     env: {
	//       account: process.env.CDK_DEFAULT_ACCOUNT,
	//       region: process.env.CDK_DEFAULT_REGION
	//     },
	//   });
	//
	//   // Define multiple stacks stage associated with an environment
	//   const myStage = new Stage(app, 'MyStage', {
	//     env: {
	//       account: '123456789012',
	//       region: 'us-east-1'
	//     }
	//   });
	//
	//   // both of these stacks will use the stage's account/region:
	//   // `.account` and `.region` will resolve to the concrete values as above
	//   new MyStack(myStage, 'Stack1');
	//   new YourStack(myStage, 'Stack2');
	//
	//   // Define an environment-agnostic stack:
	//   // `.account` and `.region` will resolve to `{ "Ref": "AWS::AccountId" }` and `{ "Ref": "AWS::Region" }` respectively.
	//   // which will only resolve to actual values by CloudFormation during deployment.
	//   new MyStack(app, 'Stack1');
	//
	// Default: - The environment of the containing `Stage` if available,
	// otherwise create the stack will be environment-agnostic.
	//
	// Experimental.
	Env *awscdk.Environment `field:"optional" json:"env" yaml:"env"`
	// SNS Topic ARNs that will receive stack events.
	// Default: - no notfication arns.
	//
	// Experimental.
	NotificationArns *[]*string `field:"optional" json:"notificationArns" yaml:"notificationArns"`
	// Options for applying a permissions boundary to all IAM Roles and Users created within this Stage.
	// Default: - no permissions boundary is applied.
	//
	// Experimental.
	PermissionsBoundary awscdk.PermissionsBoundary `field:"optional" json:"permissionsBoundary" yaml:"permissionsBoundary"`
	// Name to deploy the stack with.
	// Default: - Derived from construct path.
	//
	// Experimental.
	StackName *string `field:"optional" json:"stackName" yaml:"stackName"`
	// Enable this flag to suppress indentation in generated CloudFormation templates.
	//
	// If not specified, the value of the `@aws-cdk/core:suppressTemplateIndentation`
	// context key will be used. If that is not specified, then the
	// default value `false` will be used.
	// Default: - the value of `@aws-cdk/core:suppressTemplateIndentation`, or `false` if that is not set.
	//
	// Experimental.
	SuppressTemplateIndentation *bool `field:"optional" json:"suppressTemplateIndentation" yaml:"suppressTemplateIndentation"`
	// Synthesis method to use while deploying this stack.
	//
	// The Stack Synthesizer controls aspects of synthesis and deployment,
	// like how assets are referenced and what IAM roles to use. For more
	// information, see the README of the main CDK package.
	//
	// If not specified, the `defaultStackSynthesizer` from `App` will be used.
	// If that is not specified, `DefaultStackSynthesizer` is used if
	// `@aws-cdk/core:newStyleStackSynthesis` is set to `true` or the CDK major
	// version is v2. In CDK v1 `LegacyStackSynthesizer` is the default if no
	// other synthesizer is specified.
	// Default: - The synthesizer specified on `App`, or `DefaultStackSynthesizer` otherwise.
	//
	// Experimental.
	Synthesizer awscdk.IStackSynthesizer `field:"optional" json:"synthesizer" yaml:"synthesizer"`
	// Stack tags that will be applied to all the taggable resources and the stack itself.
	// Default: {}.
	//
	// Experimental.
	Tags *map[string]*string `field:"optional" json:"tags" yaml:"tags"`
	// Whether to enable termination protection for this stack.
	// Default: false.
	//
	// Experimental.
	TerminationProtection *bool `field:"optional" json:"terminationProtection" yaml:"terminationProtection"`
}

Properties of an integration test case stack.

Example:

var app app
var stackUnderTest stack

testCaseWithAssets := awscdkintegtestsalpha.NewIntegTestCaseStack(app, jsii.String("TestCaseAssets"), &IntegTestCaseStackProps{
	DiffAssets: jsii.Boolean(true),
})

awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stackUnderTest,
		testCaseWithAssets,
	},
})

Experimental.

type IntegTestProps

type IntegTestProps struct {
	// List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
	//
	// This list should only include resources that for this specific
	// integration test we are sure will not cause errors or an outage if
	// destroyed. For example, maybe we know that a new resource will be created
	// first before the old resource is destroyed which prevents any outage.
	//
	// e.g. ['AWS::IAM::Role']
	// Default: - do not allow destruction of any resources on update.
	//
	// Experimental.
	AllowDestroy *[]*string `field:"optional" json:"allowDestroy" yaml:"allowDestroy"`
	// Additional options to use for each CDK command.
	// Default: - runner default options.
	//
	// Experimental.
	CdkCommandOptions *cloudassemblyschema.CdkCommands `field:"optional" json:"cdkCommandOptions" yaml:"cdkCommandOptions"`
	// Whether or not to include asset hashes in the diff Asset hashes can introduces a lot of unneccessary noise into tests, but there are some cases where asset hashes _should_ be included.
	//
	// For example
	// any tests involving custom resources or bundling.
	// Default: false.
	//
	// Experimental.
	DiffAssets *bool `field:"optional" json:"diffAssets" yaml:"diffAssets"`
	// Additional commands to run at predefined points in the test workflow.
	//
	// e.g. { postDeploy: ['yarn', 'test'] }
	// Default: - no hooks.
	//
	// Experimental.
	Hooks *cloudassemblyschema.Hooks `field:"optional" json:"hooks" yaml:"hooks"`
	// Limit deployment to these regions.
	// Default: - can run in any region.
	//
	// Experimental.
	Regions *[]*string `field:"optional" json:"regions" yaml:"regions"`
	// Run update workflow on this test case This should only be set to false to test scenarios that are not possible to test as part of the update workflow.
	// Default: true.
	//
	// Experimental.
	StackUpdateWorkflow *bool `field:"optional" json:"stackUpdateWorkflow" yaml:"stackUpdateWorkflow"`
	// List of test cases that make up this test.
	// Experimental.
	TestCases *[]awscdk.Stack `field:"required" json:"testCases" yaml:"testCases"`
	// Specify a stack to use for assertions.
	// Default: - a stack is created for you.
	//
	// Experimental.
	AssertionStack awscdk.Stack `field:"optional" json:"assertionStack" yaml:"assertionStack"`
	// Enable lookups for this test.
	//
	// If lookups are enabled
	// then `stackUpdateWorkflow` must be set to false.
	// Lookups should only be enabled when you are explicitly testing
	// lookups.
	// Default: false.
	//
	// Experimental.
	EnableLookups *bool `field:"optional" json:"enableLookups" yaml:"enableLookups"`
}

Integration test properties.

Example:

var lambdaFunction iFunction
var app app

stack := awscdk.NewStack(app, jsii.String("cdk-integ-lambda-bundling"))

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("IntegTest"), &IntegTestProps{
	TestCases: []stack{
		stack,
	},
})

invoke := integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	FunctionName: lambdaFunction.FunctionName,
})
invoke.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"Payload": jsii.String("200"),
}))

Experimental.

type InvocationType

type InvocationType string

The type of invocation.

Default is REQUEST_RESPONSE.

Example:

var app app
var stack stack
var queue queue
var fn iFunction

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []*stack{
		stack,
	},
})

integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	FunctionName: fn.FunctionName,
	InvocationType: awscdkintegtestsalpha.InvocationType_EVENT,
	Payload: jSON.stringify(map[string]*string{
		"status": jsii.String("OK"),
	}),
})

message := integ.Assertions.AwsApiCall(jsii.String("SQS"), jsii.String("receiveMessage"), map[string]interface{}{
	"QueueUrl": queue.queueUrl,
	"WaitTimeSeconds": jsii.Number(20),
})

message.AssertAtPath(jsii.String("Messages.0.Body"), awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"requestContext": map[string]*string{
		"condition": jsii.String("Success"),
	},
	"requestPayload": map[string]*string{
		"status": jsii.String("OK"),
	},
	"responseContext": map[string]*f64{
		"statusCode": jsii.Number(200),
	},
	"responsePayload": jsii.String("success"),
}))

Experimental.

const (
	// Invoke the function asynchronously.
	//
	// Send events that fail multiple times to the function's
	// dead-letter queue (if it's configured).
	// The API response only includes a status code.
	// Experimental.
	InvocationType_EVENT InvocationType = "EVENT"
	// Invoke the function synchronously.
	//
	// Keep the connection open until the function returns a response or times out.
	// The API response includes the function response and additional data.
	// Experimental.
	InvocationType_REQUEST_RESPONSE InvocationType = "REQUEST_RESPONSE"
	// Validate parameter values and verify that the user or role has permission to invoke the function.
	// Experimental.
	InvocationType_DRY_RUN InvocationType = "DRY_RUN"
)

type LambdaFunctionProviderProps

type LambdaFunctionProviderProps struct {
	// The handler to use for the lambda function.
	// Default: index.handler
	//
	// Experimental.
	Handler *string `field:"optional" json:"handler" yaml:"handler"`
	// How long, in days, the log contents will be retained.
	// Default: - no retention days specified.
	//
	// Experimental.
	LogRetention awslogs.RetentionDays `field:"optional" json:"logRetention" yaml:"logRetention"`
}

Properties for a lambda function provider.

Example:

// 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"

lambdaFunctionProviderProps := &LambdaFunctionProviderProps{
	Handler: jsii.String("handler"),
	LogRetention: awscdk.Aws_logs.RetentionDays_ONE_DAY,
}

Experimental.

type LambdaInvokeFunction

type LambdaInvokeFunction interface {
	AwsApiCall
	// Experimental.
	ApiCallResource() awscdk.CustomResource
	// Experimental.
	ExpectedResult() *string
	// Experimental.
	SetExpectedResult(val *string)
	// Experimental.
	FlattenResponse() *string
	// Experimental.
	SetFlattenResponse(val *string)
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Experimental.
	OutputPaths() *[]*string
	// Experimental.
	SetOutputPaths(val *[]*string)
	// access the AssertionsProvider.
	//
	// This can be used to add additional IAM policies
	// the the provider role policy.
	// Experimental.
	Provider() AssertionsProvider
	// Experimental.
	StateMachineArn() *string
	// Experimental.
	SetStateMachineArn(val *string)
	// access the AssertionsProvider for the waiter state machine.
	//
	// This can be used to add additional IAM policies
	// the the provider role policy.
	//
	// Example:
	//   declare const apiCall: AwsApiCall;
	//   apiCall.waiterProvider?.addToRolePolicy({
	//     Effect: 'Allow',
	//     Action: ['s3:GetObject'],
	//     Resource: ['*'],
	//   });
	//
	// Experimental.
	WaiterProvider() AssertionsProvider
	// Experimental.
	SetWaiterProvider(val AssertionsProvider)
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.
	//
	// Providing a path will filter the output of the initial API call.
	//
	// For example the SQS.receiveMessage api response would look
	// like:
	//
	// If you wanted to assert the value of `Body` you could do.
	// Experimental.
	AssertAtPath(path *string, expected ExpectedResult) IApiCall
	// Assert that the ExpectedResult is equal to the result of the AwsApiCall.
	// Experimental.
	Expect(expected ExpectedResult) IApiCall
	// Returns the value of an attribute of the custom resource of an arbitrary type.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Returns the value of an attribute of the custom resource of type string.
	//
	// Attributes are returned from the custom resource provider through the
	// `Data` map where the key is the attribute name.
	// Experimental.
	GetAttString(attributeName *string) *string
	// Allows you to chain IApiCalls. This adds an explicit dependency betweent the two resources.
	//
	// Returns the IApiCall provided as `next`.
	// Experimental.
	Next(next IApiCall) IApiCall
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Wait for the IApiCall to return the expected response.
	//
	// If no expected response is specified then it will wait for
	// the IApiCall to return a success.
	// Experimental.
	WaitForAssertions(options *WaiterStateMachineOptions) IApiCall
}

An AWS Lambda Invoke function API call.

Use this instead of the generic AwsApiCall in order to invoke a lambda function. This will automatically create the correct permissions to invoke the function.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdkintegtestsalpha"
import "github.com/aws/aws-cdk-go/awscdk"

lambdaInvokeFunction := integ_tests_alpha.NewLambdaInvokeFunction(this, jsii.String("MyLambdaInvokeFunction"), &LambdaInvokeFunctionProps{
	FunctionName: jsii.String("functionName"),

	// the properties below are optional
	InvocationType: integ_tests_alpha.InvocationType_EVENT,
	LogRetention: awscdk.Aws_logs.RetentionDays_ONE_DAY,
	LogType: integ_tests_alpha.LogType_NONE,
	Payload: jsii.String("payload"),
})

Experimental.

func NewLambdaInvokeFunction

func NewLambdaInvokeFunction(scope constructs.Construct, id *string, props *LambdaInvokeFunctionProps) LambdaInvokeFunction

Experimental.

type LambdaInvokeFunctionProps

type LambdaInvokeFunctionProps struct {
	// The name of the function to invoke.
	// Experimental.
	FunctionName *string `field:"required" json:"functionName" yaml:"functionName"`
	// The type of invocation to use.
	// Default: InvocationType.REQUEST_RESPONSE
	//
	// Experimental.
	InvocationType InvocationType `field:"optional" json:"invocationType" yaml:"invocationType"`
	// How long, in days, the log contents will be retained.
	// Default: - no retention days specified.
	//
	// Experimental.
	LogRetention awslogs.RetentionDays `field:"optional" json:"logRetention" yaml:"logRetention"`
	// Whether to return the logs as part of the response.
	// Default: LogType.NONE
	//
	// Experimental.
	LogType LogType `field:"optional" json:"logType" yaml:"logType"`
	// Payload to send as part of the invoke.
	// Default: - no payload.
	//
	// Experimental.
	Payload *string `field:"optional" json:"payload" yaml:"payload"`
}

Options to pass to the Lambda invokeFunction API call.

Example:

var lambdaFunction iFunction
var app app

stack := awscdk.NewStack(app, jsii.String("cdk-integ-lambda-bundling"))

integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("IntegTest"), &IntegTestProps{
	TestCases: []stack{
		stack,
	},
})

invoke := integ.Assertions.InvokeFunction(&LambdaInvokeFunctionProps{
	FunctionName: lambdaFunction.FunctionName,
})
invoke.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"Payload": jsii.String("200"),
}))

Experimental.

type LogType

type LogType string

Set to Tail to include the execution log in the response.

Applies to synchronously invoked functions only. Experimental.

const (
	// The log messages are not returned in the response.
	// Experimental.
	LogType_NONE LogType = "NONE"
	// The log messages are returned in the response.
	// Experimental.
	LogType_TAIL LogType = "TAIL"
)

type Match

type Match interface {
}

Partial and special matching during assertions. Experimental.

type Status

type Status string

The status of the assertion. Experimental.

const (
	// The assertion passed.
	// Experimental.
	Status_PASS Status = "PASS"
	// The assertion failed.
	// Experimental.
	Status_FAIL Status = "FAIL"
)

type WaiterStateMachine

type WaiterStateMachine interface {
	constructs.Construct
	// The AssertionsProvide that handles async requests.
	// Experimental.
	IsCompleteProvider() AssertionsProvider
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// The IAM Role ARN of the role used by the state machine.
	// Experimental.
	RoleArn() *string
	// The ARN of the statemachine.
	// Experimental.
	StateMachineArn() *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

A very simple StateMachine construct highly customized to the provider framework.

This is so that this package does not need to depend on aws-stepfunctions module.

The state machine continuously calls the isCompleteHandler, until it succeeds or times out. The handler is called `maxAttempts` times with an `interval` duration and a `backoffRate` rate.

For example with: - maxAttempts = 360 (30 minutes) - interval = 5 - backoffRate = 1 (no backoff)

it will make the API Call every 5 seconds and fail after 360 failures.

If the backoff rate is changed to 2 (for example), it will - make the first call - wait 5 seconds - make the second call - wait 15 seconds - etc.

Example:

// 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"

waiterStateMachine := integ_tests_alpha.NewWaiterStateMachine(this, jsii.String("MyWaiterStateMachine"), &WaiterStateMachineProps{
	BackoffRate: jsii.Number(123),
	Interval: cdk.Duration_Minutes(jsii.Number(30)),
	TotalTimeout: cdk.Duration_*Minutes(jsii.Number(30)),
})

Experimental.

func NewWaiterStateMachine

func NewWaiterStateMachine(scope constructs.Construct, id *string, props *WaiterStateMachineProps) WaiterStateMachine

Experimental.

type WaiterStateMachineOptions

type WaiterStateMachineOptions struct {
	// Backoff between attempts.
	//
	// This is the multiplier by which the retry interval increases
	// after each retry attempt.
	//
	// By default there is no backoff. Each retry will wait the amount of time
	// specified by `interval`.
	// Default: 1 (no backoff).
	//
	// Experimental.
	BackoffRate *float64 `field:"optional" json:"backoffRate" yaml:"backoffRate"`
	// The interval (number of seconds) to wait between attempts.
	// Default: Duration.seconds(5)
	//
	// Experimental.
	Interval awscdk.Duration `field:"optional" json:"interval" yaml:"interval"`
	// The total time that the state machine will wait for a successful response.
	// Default: Duration.minutes(30)
	//
	// Experimental.
	TotalTimeout awscdk.Duration `field:"optional" json:"totalTimeout" yaml:"totalTimeout"`
}

Options for creating a WaiterStateMachine.

Example:

var testCase integTest
var start iApiCall

describe := testCase.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("describeExecution"), map[string]*string{
	"executionArn": start.getAttString(jsii.String("executionArn")),
}).Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"status": jsii.String("SUCCEEDED"),
})).WaitForAssertions(&WaiterStateMachineOptions{
	TotalTimeout: awscdk.Duration_Minutes(jsii.Number(5)),
	Interval: awscdk.Duration_Seconds(jsii.Number(15)),
	BackoffRate: jsii.Number(3),
})

Experimental.

type WaiterStateMachineProps

type WaiterStateMachineProps struct {
	// Backoff between attempts.
	//
	// This is the multiplier by which the retry interval increases
	// after each retry attempt.
	//
	// By default there is no backoff. Each retry will wait the amount of time
	// specified by `interval`.
	// Default: 1 (no backoff).
	//
	// Experimental.
	BackoffRate *float64 `field:"optional" json:"backoffRate" yaml:"backoffRate"`
	// The interval (number of seconds) to wait between attempts.
	// Default: Duration.seconds(5)
	//
	// Experimental.
	Interval awscdk.Duration `field:"optional" json:"interval" yaml:"interval"`
	// The total time that the state machine will wait for a successful response.
	// Default: Duration.minutes(30)
	//
	// Experimental.
	TotalTimeout awscdk.Duration `field:"optional" json:"totalTimeout" yaml:"totalTimeout"`
}

Props for creating a WaiterStateMachine.

Example:

// 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"

waiterStateMachineProps := &WaiterStateMachineProps{
	BackoffRate: jsii.Number(123),
	Interval: cdk.Duration_Minutes(jsii.Number(30)),
	TotalTimeout: cdk.Duration_*Minutes(jsii.Number(30)),
}

Experimental.

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL