# EnvironmentUtils

- Source: [`cx-api/lib/legacy-moved.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/cx-api/lib/legacy-moved.ts#L807)
- Type last changed: v2.238.0 · 9 Feb 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cx_api } from 'aws-cdk-lib';
const environmentUtils = new cx_api.EnvironmentUtils();
```

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 cx_api

environment_utils = cx_api.EnvironmentUtils()
```

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.cxapi.*;

EnvironmentUtils environmentUtils = new EnvironmentUtils();
```

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.CXAPI;

var environmentUtils = new EnvironmentUtils();
```

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"

environmentUtils := awscdk.Cx_api.NewEnvironmentUtils()
```

## Initializer

TypeScript:

```ts
new EnvironmentUtils()
```

Python:

```python
EnvironmentUtils()
```

Java:

```java
new EnvironmentUtils()
```

C# / .NET:

```csharp
new EnvironmentUtils()
```

Golang:

```go
NewEnvironmentUtils()
```

## Methods

- `format(account: string, region: string): string` (static) — Format an environment string from an account and region.

- `make(account: string, region: string): Environment` (static) — Build an environment object from an account and region.

- `parse(environment: string): Environment` (static)
