# CfnEnvironmentProps

Properties for defining a `CfnEnvironment`.

Used as props by: [CfnEnvironment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.CfnEnvironment.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 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';
const cfnEnvironmentProps: appconfig.CfnEnvironmentProps = {
  applicationId: 'applicationId',
  name: 'name',

  // the properties below are optional
  deletionProtectionCheck: 'deletionProtectionCheck',
  description: 'description',
  monitors: [{
    alarmArn: 'alarmArn',
    alarmRoleArn: 'alarmRoleArn',
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# 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

cfn_environment_props = appconfig.CfnEnvironmentProps(
    application_id="applicationId",
    name="name",

    # the properties below are optional
    deletion_protection_check="deletionProtectionCheck",
    description="description",
    monitors=[appconfig.CfnEnvironment.MonitorsProperty(
        alarm_arn="alarmArn",
        alarm_role_arn="alarmRoleArn"
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

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

CfnEnvironmentProps cfnEnvironmentProps = CfnEnvironmentProps.builder()
        .applicationId("applicationId")
        .name("name")

        // the properties below are optional
        .deletionProtectionCheck("deletionProtectionCheck")
        .description("description")
        .monitors(List.of(MonitorsProperty.builder()
                .alarmArn("alarmArn")
                .alarmRoleArn("alarmRoleArn")
                .build()))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .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;

var cfnEnvironmentProps = new CfnEnvironmentProps {
    ApplicationId = "applicationId",
    Name = "name",

    // the properties below are optional
    DeletionProtectionCheck = "deletionProtectionCheck",
    Description = "description",
    Monitors = new [] { new MonitorsProperty {
        AlarmArn = "alarmArn",
        AlarmRoleArn = "alarmRoleArn"
    } },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

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"

cfnEnvironmentProps := &CfnEnvironmentProps{
	ApplicationId: jsii.String("applicationId"),
	Name: jsii.String("name"),

	// the properties below are optional
	DeletionProtectionCheck: jsii.String("deletionProtectionCheck"),
	Description: jsii.String("description"),
	Monitors: []interface{}{
		&MonitorsProperty{
			AlarmArn: jsii.String("alarmArn"),
			AlarmRoleArn: jsii.String("alarmRoleArn"),
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `applicationId`: string | [IApplicationRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_appconfig.IApplicationRef.html) (required) — The application ID.

- `deletionProtectionCheck`: string — A parameter to configure deletion protection.

  Deletion protection prevents a user from deleting an environment if your application called either [GetLatestConfiguration](https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html) or [GetConfiguration](https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_GetConfiguration.html) in the environment during the specified interval.

  This parameter supports the following values:

  - `BYPASS` : Instructs AWS AppConfig to bypass the deletion protection check and delete a configuration profile even if deletion protection would have otherwise prevented it.
  - `APPLY` : Instructs the deletion protection check to run, even if deletion protection is disabled at the account level. `APPLY` also forces the deletion protection check to run against resources created in the past hour, which are normally excluded from deletion protection checks.
  - `ACCOUNT_DEFAULT` : The default setting, which instructs AWS AppConfig to implement the deletion protection value specified in the `UpdateAccountSettings` API.

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

- `monitors`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEnvironment.MonitorsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.CfnEnvironment.MonitorsProperty.html)[] — Amazon CloudWatch alarms to monitor during the deployment process.

- `name`: string (required) — A name for the environment.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — Metadata to assign to the environment.

  Tags help organize and categorize your AWS AppConfig resources. Each tag consists of a key and an optional value, both of which you define.
