# EnvironmentOptions

Options for the Environment construct.

Used as argument in: [IApplication.addEnvironment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IApplication.html#addenvironment)

- Source: [`aws-appconfig/lib/environment.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-appconfig/lib/environment.ts#L167)
- Type last changed: v2.176.0 · 15 Jan 2025

## Example

TypeScript:

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

declare const monitor: appconfig.Monitor;
const environmentOptions: appconfig.EnvironmentOptions = {
  deletionProtectionCheck: appconfig.DeletionProtectionCheck.ACCOUNT_DEFAULT,
  description: 'description',
  environmentName: 'environmentName',
  monitors: [monitor],
};
```

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_appconfig as appconfig

# monitor: appconfig.Monitor

environment_options = appconfig.EnvironmentOptions(
    deletion_protection_check=appconfig.DeletionProtectionCheck.ACCOUNT_DEFAULT,
    description="description",
    environment_name="environmentName",
    monitors=[monitor]
)
```

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

Monitor monitor;

EnvironmentOptions environmentOptions = EnvironmentOptions.builder()
        .deletionProtectionCheck(DeletionProtectionCheck.ACCOUNT_DEFAULT)
        .description("description")
        .environmentName("environmentName")
        .monitors(List.of(monitor))
        .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.AppConfig;

Monitor monitor;

var environmentOptions = new EnvironmentOptions {
    DeletionProtectionCheck = DeletionProtectionCheck.ACCOUNT_DEFAULT,
    Description = "description",
    EnvironmentName = "environmentName",
    Monitors = new [] { monitor }
};
```

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"

var monitor Monitor

environmentOptions := &EnvironmentOptions{
	DeletionProtectionCheck: awscdk.Aws_appconfig.DeletionProtectionCheck_ACCOUNT_DEFAULT,
	Description: jsii.String("description"),
	EnvironmentName: jsii.String("environmentName"),
	Monitors: []Monitor{
		monitor,
	},
}
```

## Properties

- `deletionProtectionCheck`: [DeletionProtectionCheck](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.DeletionProtectionCheck.html) — A property to prevent accidental deletion of active environments.

  **Default:** undefined - AppConfig default is ACCOUNT_DEFAULT

- `description`: string — The description of the environment.

  **Default:** No description.

- `environmentName`: string — The name of the environment.

  **Default:** A name is generated.

- `monitors`: [Monitor](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.Monitor.html)[] — The monitors for the environment.

  **Default:** No monitors.
