# CloudFormationStackDriftDetectionCheckProps

Construction properties for a CloudFormationStackDriftDetectionCheck.

Extends: [RuleProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.RuleProps.html)
Used as props by: [CloudFormationStackDriftDetectionCheck](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.CloudFormationStackDriftDetectionCheck.html)

- Source: [`aws-config/lib/managed-rules.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-config/lib/managed-rules.ts#L57)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

TypeScript:

```ts
// compliant if stack's status is 'IN_SYNC'
// non-compliant if the stack's drift status is 'DRIFTED'
new config.CloudFormationStackDriftDetectionCheck(this, 'Drift', {
  ownStackOnly: true, // checks only the stack containing the rule
});
```

Python:

```python
# compliant if stack's status is 'IN_SYNC'
# non-compliant if the stack's drift status is 'DRIFTED'
config.CloudFormationStackDriftDetectionCheck(self, "Drift",
    own_stack_only=True
)
```

Java:

```java
// compliant if stack's status is 'IN_SYNC'
// non-compliant if the stack's drift status is 'DRIFTED'
// compliant if stack's status is 'IN_SYNC'
// non-compliant if the stack's drift status is 'DRIFTED'
CloudFormationStackDriftDetectionCheck.Builder.create(this, "Drift")
        .ownStackOnly(true)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// compliant if stack's status is 'IN_SYNC'
// non-compliant if the stack's drift status is 'DRIFTED'
// compliant if stack's status is 'IN_SYNC'
// non-compliant if the stack's drift status is 'DRIFTED'
new CloudFormationStackDriftDetectionCheck(this, "Drift", new CloudFormationStackDriftDetectionCheckProps {
    OwnStackOnly = true
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// compliant if stack's status is 'IN_SYNC'
// non-compliant if the stack's drift status is 'DRIFTED'
// compliant if stack's status is 'IN_SYNC'
// non-compliant if the stack's drift status is 'DRIFTED'
config.NewCloudFormationStackDriftDetectionCheck(this, jsii.String("Drift"), &CloudFormationStackDriftDetectionCheckProps{
	OwnStackOnly: jsii.Boolean(true),
})
```

## Properties

- `configRuleName`: string — A name for the AWS Config rule.

  **Default:** CloudFormation generated name

- `description`: string — A description about this AWS Config rule.

  **Default:** No description

- `evaluationModes`: [EvaluationMode](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.EvaluationMode.html) — The modes the AWS Config rule can be evaluated in.

  **Default:** Detective evaluation mode only

  The valid values are distinct objects.

- `inputParameters`: { [key: string]: any } — Input parameter values that are passed to the AWS Config rule.

  **Default:** No input parameters

- `maximumExecutionFrequency`: [MaximumExecutionFrequency](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.MaximumExecutionFrequency.html) — The maximum frequency at which the AWS Config rule runs evaluations.

  **Default:** MaximumExecutionFrequency.TWENTY_FOUR_HOURS

- `ownStackOnly`: boolean = false — Whether to check only the stack where this rule is deployed.

- `role`: [IRoleRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) — The IAM role to use for this rule.

  **Default:** A role will be created

  It must have permissions to detect drift
  for AWS CloudFormation stacks. Ensure to attach `config.amazonaws.com` trusted
  permissions and `ReadOnlyAccess` policy permissions. For specific policy permissions,
  refer to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html.

- `ruleScope`: [RuleScope](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.RuleScope.html) — Defines which resources trigger an evaluation for an AWS Config rule.

  **Default:** evaluations for the rule are triggered when any resource in the recording group changes.
