# CdkCommand

Represents a cdk command i.e. `synth`, `deploy`, & `destroy`.

- Source: [`lib/integ-tests/test-case.ts`](https://github.com/aws/aws-cdk-cli/blob/HEAD/packages/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.ts)
- Type last changed: v2.20.0 · 7 Apr 2022

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';
const cdkCommand: cloud_assembly_schema.CdkCommand = {
  enabled: false,
  expectedMessage: 'expectedMessage',
  expectError: false,
};
```

Python:

```python
from aws_cdk.cloud_assembly_schema import CdkCommand
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema

cdk_command = CdkCommand(
    enabled=False,
    expected_message="expectedMessage",
    expect_error=False
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cloud_assembly_schema.*;

CdkCommand cdkCommand = CdkCommand.builder()
        .enabled(false)
        .expectedMessage("expectedMessage")
        .expectError(false)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;

var cdkCommand = new CdkCommand {
    Enabled = false,
    ExpectedMessage = "expectedMessage",
    ExpectError = false
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// 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/awscdk"

cdkCommand := &CdkCommand{
	Enabled: jsii.Boolean(false),
	ExpectedMessage: jsii.String("expectedMessage"),
	ExpectError: jsii.Boolean(false),
}
```

## Properties

- `enabled`: boolean = true — Whether or not to run this command as part of the workflow This can be used if you only want to test some of the workflow for example enable `synth` and disable `deploy` & `destroy` in order to limit the test to synthesis.

- `expectedMessage`: string — This can be used in combination with `expectedError` to validate that a specific message is returned.

  **Default:** do not validate message

- `expectError`: boolean = false — If the runner should expect this command to fail.
