# GoalProperty

This structure contains the attributes that determine the goal of an SLO.

This includes the time period for evaluation and the attainment threshold.

- Source: Generated at build time
- Type last changed: v2.147.0 · 20 Jun 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_applicationsignals as applicationsignals } from 'aws-cdk-lib';
const goalProperty: applicationsignals.CfnServiceLevelObjective.GoalProperty = {
  attainmentGoal: 123,
  interval: {
    calendarInterval: {
      duration: 123,
      durationUnit: 'durationUnit',
      startTime: 123,
    },
    rollingInterval: {
      duration: 123,
      durationUnit: 'durationUnit',
    },
  },
  warningThreshold: 123,
};
```

Python:

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

goal_property = applicationsignals.CfnServiceLevelObjective.GoalProperty(
    attainment_goal=123,
    interval=applicationsignals.CfnServiceLevelObjective.IntervalProperty(
        calendar_interval=applicationsignals.CfnServiceLevelObjective.CalendarIntervalProperty(
            duration=123,
            duration_unit="durationUnit",
            start_time=123
        ),
        rolling_interval=applicationsignals.CfnServiceLevelObjective.RollingIntervalProperty(
            duration=123,
            duration_unit="durationUnit"
        )
    ),
    warning_threshold=123
)
```

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.services.applicationsignals.*;

GoalProperty goalProperty = GoalProperty.builder()
        .attainmentGoal(123)
        .interval(IntervalProperty.builder()
                .calendarInterval(CalendarIntervalProperty.builder()
                        .duration(123)
                        .durationUnit("durationUnit")
                        .startTime(123)
                        .build())
                .rollingInterval(RollingIntervalProperty.builder()
                        .duration(123)
                        .durationUnit("durationUnit")
                        .build())
                .build())
        .warningThreshold(123)
        .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.AWS.ApplicationSignals;

var goalProperty = new GoalProperty {
    AttainmentGoal = 123,
    Interval = new IntervalProperty {
        CalendarInterval = new CalendarIntervalProperty {
            Duration = 123,
            DurationUnit = "durationUnit",
            StartTime = 123
        },
        RollingInterval = new RollingIntervalProperty {
            Duration = 123,
            DurationUnit = "durationUnit"
        }
    },
    WarningThreshold = 123
};
```

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"

goalProperty := &GoalProperty{
	AttainmentGoal: jsii.Number(123),
	Interval: &IntervalProperty{
		CalendarInterval: &CalendarIntervalProperty{
			Duration: jsii.Number(123),
			DurationUnit: jsii.String("durationUnit"),
			StartTime: jsii.Number(123),
		},
		RollingInterval: &RollingIntervalProperty{
			Duration: jsii.Number(123),
			DurationUnit: jsii.String("durationUnit"),
		},
	},
	WarningThreshold: jsii.Number(123),
}
```

## Properties

- `attainmentGoal`: number — The threshold that determines if the goal is being met.

  If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.

  If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.

  If you omit this parameter, 99 is used to represent 99% as the attainment goal.

- `interval`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnServiceLevelObjective.IntervalProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_applicationsignals.CfnServiceLevelObjective.IntervalProperty.html) — The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.

  If you omit this parameter, a rolling interval of 7 days is used.

- `warningThreshold`: number — The percentage of remaining budget over total budget that you want to get warnings for.

  If you omit this parameter, the default of 50.0 is used.
