# Transition

Describes when an object transitions to a specified storage class.

- Source: [`aws-s3/lib/rule.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-s3/lib/rule.ts#L151)
- Type last changed: v2.26.0 · 30 May 2022

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const storageClass: s3.StorageClass;
const transition: s3.Transition = {
  storageClass: storageClass,

  // the properties below are optional
  transitionAfter: cdk.Duration.minutes(30),
  transitionDate: new Date(),
};
```

Python:

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

# storage_class: s3.StorageClass

transition = s3.Transition(
    storage_class=storage_class,

    # the properties below are optional
    transition_after=cdk.Duration.minutes(30),
    transition_date=Date()
)
```

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.*;
import software.amazon.awscdk.services.s3.*;

StorageClass storageClass;

Transition transition = Transition.builder()
        .storageClass(storageClass)

        // the properties below are optional
        .transitionAfter(Duration.minutes(30))
        .transitionDate(new Date())
        .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;
using Amazon.CDK.AWS.S3;

StorageClass storageClass;

var transition = new Transition {
    StorageClass = storageClass,

    // the properties below are optional
    TransitionAfter = Duration.Minutes(30),
    TransitionDate = new Date()
};
```

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

var storageClass StorageClass

transition := &Transition{
	StorageClass: storageClass,

	// the properties below are optional
	TransitionAfter: cdk.Duration_Minutes(jsii.Number(30)),
	TransitionDate: NewDate(),
}
```

## Properties

- `storageClass`: [StorageClass](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.StorageClass.html) (required) — The storage class to which you want the object to transition.

- `transitionAfter`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Indicates the number of days after creation when objects are transitioned to the specified storage class.

  **Default:** No transition count.

- `transitionDate`: date — Indicates when objects are transitioned to the specified storage class.

  **Default:** No transition date.

  The date value must be in ISO 8601 format. The time is always midnight UTC.
