# EnvironmentProps

Properties for the Environment construct.

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

- 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#L200)
- Type last changed: v2.130.0 · 23 Feb 2024

## Example

TypeScript:

```ts
const app = new appconfig.Application(this, 'MyApp');
const env = new appconfig.Environment(this, 'MyEnv', {
  application: app,
});

new appconfig.HostedConfiguration(this, 'MyFirstHostedConfig', {
  application: app,
  deployTo: [env],
  content: appconfig.ConfigurationContent.fromInlineText('This is my first configuration content.'),
});

new appconfig.HostedConfiguration(this, 'MySecondHostedConfig', {
  application: app,
  deployTo: [env],
  content: appconfig.ConfigurationContent.fromInlineText('This is my second configuration content.'),
});
```

Python:

```python
app = appconfig.Application(self, "MyApp")
env = appconfig.Environment(self, "MyEnv",
    application=app
)

appconfig.HostedConfiguration(self, "MyFirstHostedConfig",
    application=app,
    deploy_to=[env],
    content=appconfig.ConfigurationContent.from_inline_text("This is my first configuration content.")
)

appconfig.HostedConfiguration(self, "MySecondHostedConfig",
    application=app,
    deploy_to=[env],
    content=appconfig.ConfigurationContent.from_inline_text("This is my second configuration content.")
)
```

Java:

```java
Application app = new Application(this, "MyApp");
Environment env = Environment.Builder.create(this, "MyEnv")
        .application(app)
        .build();

HostedConfiguration.Builder.create(this, "MyFirstHostedConfig")
        .application(app)
        .deployTo(List.of(env))
        .content(ConfigurationContent.fromInlineText("This is my first configuration content."))
        .build();

HostedConfiguration.Builder.create(this, "MySecondHostedConfig")
        .application(app)
        .deployTo(List.of(env))
        .content(ConfigurationContent.fromInlineText("This is my second configuration content."))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var app = new Application(this, "MyApp");
var env = new Environment(this, "MyEnv", new EnvironmentProps {
    Application = app
});

new HostedConfiguration(this, "MyFirstHostedConfig", new HostedConfigurationProps {
    Application = app,
    DeployTo = new [] { env },
    Content = ConfigurationContent.FromInlineText("This is my first configuration content.")
});

new HostedConfiguration(this, "MySecondHostedConfig", new HostedConfigurationProps {
    Application = app,
    DeployTo = new [] { env },
    Content = ConfigurationContent.FromInlineText("This is my second configuration content.")
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
app := appconfig.NewApplication(this, jsii.String("MyApp"))
env := appconfig.NewEnvironment(this, jsii.String("MyEnv"), &EnvironmentProps{
	Application: app,
})

appconfig.NewHostedConfiguration(this, jsii.String("MyFirstHostedConfig"), &HostedConfigurationProps{
	Application: app,
	DeployTo: []IEnvironment{
		env,
	},
	Content: appconfig.ConfigurationContent_FromInlineText(jsii.String("This is my first configuration content.")),
})

appconfig.NewHostedConfiguration(this, jsii.String("MySecondHostedConfig"), &HostedConfigurationProps{
	Application: app,
	DeployTo: []IEnvironment{
		env,
	},
	Content: appconfig.ConfigurationContent_*FromInlineText(jsii.String("This is my second configuration content.")),
})
```

## Properties

- `application`: [IApplication](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IApplication.html) (required) — The application to be associated with the environment.

- `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.
