# HostedConfigurationOptions

Options for HostedConfiguration.

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

- Source: [`aws-appconfig/lib/configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts#L367)
- Type last changed: v2.130.0 · 23 Feb 2024

## 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';
import { aws_kms as kms } from 'aws-cdk-lib';
import { aws_appconfig as interfaces_appconfig } from 'aws-cdk-lib/interfaces';

declare const configurationContent: appconfig.ConfigurationContent;
declare const deploymentStrategyRef: interfaces_appconfig.IDeploymentStrategyRef;
declare const environment: appconfig.Environment;
declare const key: kms.Key;
declare const validator: appconfig.IValidator;
const hostedConfigurationOptions: appconfig.HostedConfigurationOptions = {
  content: configurationContent,

  // the properties below are optional
  deletionProtectionCheck: appconfig.DeletionProtectionCheck.ACCOUNT_DEFAULT,
  deploymentKey: key,
  deploymentStrategy: deploymentStrategyRef,
  deployTo: [environment],
  description: 'description',
  latestVersionNumber: 123,
  name: 'name',
  type: appconfig.ConfigurationType.FREEFORM,
  validators: [validator],
  versionLabel: 'versionLabel',
};
```

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
from aws_cdk import aws_kms as kms
from aws_cdk.interfaces import aws_appconfig as interfaces_appconfig

# configuration_content: appconfig.ConfigurationContent
# deployment_strategy_ref: interfaces_appconfig.IDeploymentStrategyRef
# environment: appconfig.Environment
# key: kms.Key
# validator: appconfig.IValidator

hosted_configuration_options = appconfig.HostedConfigurationOptions(
    content=configuration_content,

    # the properties below are optional
    deletion_protection_check=appconfig.DeletionProtectionCheck.ACCOUNT_DEFAULT,
    deployment_key=key,
    deployment_strategy=deployment_strategy_ref,
    deploy_to=[environment],
    description="description",
    latest_version_number=123,
    name="name",
    type=appconfig.ConfigurationType.FREEFORM,
    validators=[validator],
    version_label="versionLabel"
)
```

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

ConfigurationContent configurationContent;
IDeploymentStrategyRef deploymentStrategyRef;
Environment environment;
Key key;
IValidator validator;

HostedConfigurationOptions hostedConfigurationOptions = HostedConfigurationOptions.builder()
        .content(configurationContent)

        // the properties below are optional
        .deletionProtectionCheck(DeletionProtectionCheck.ACCOUNT_DEFAULT)
        .deploymentKey(key)
        .deploymentStrategy(deploymentStrategyRef)
        .deployTo(List.of(environment))
        .description("description")
        .latestVersionNumber(123)
        .name("name")
        .type(ConfigurationType.FREEFORM)
        .validators(List.of(validator))
        .versionLabel("versionLabel")
        .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;
using Amazon.CDK.AWS.KMS;
using Amazon.CDK.Interfaces.AppConfig;

ConfigurationContent configurationContent;
IDeploymentStrategyRef deploymentStrategyRef;
Environment environment;
Key key;
IValidator validator;

var hostedConfigurationOptions = new HostedConfigurationOptions {
    Content = configurationContent,

    // the properties below are optional
    DeletionProtectionCheck = DeletionProtectionCheck.ACCOUNT_DEFAULT,
    DeploymentKey = key,
    DeploymentStrategy = deploymentStrategyRef,
    DeployTo = new [] { environment },
    Description = "description",
    LatestVersionNumber = 123,
    Name = "name",
    Type = ConfigurationType.FREEFORM,
    Validators = new [] { validator },
    VersionLabel = "versionLabel"
};
```

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

var configurationContent ConfigurationContent
var deploymentStrategyRef IDeploymentStrategyRef
var environment Environment
var key Key
var validator IValidator

hostedConfigurationOptions := &HostedConfigurationOptions{
	Content: configurationContent,

	// the properties below are optional
	DeletionProtectionCheck: awscdk.Aws_appconfig.DeletionProtectionCheck_ACCOUNT_DEFAULT,
	DeploymentKey: key,
	DeploymentStrategy: deploymentStrategyRef,
	DeployTo: []IEnvironment{
		environment,
	},
	Description: jsii.String("description"),
	LatestVersionNumber: jsii.Number(123),
	Name: jsii.String("name"),
	Type: awscdk.*Aws_appconfig.ConfigurationType_FREEFORM,
	Validators: []IValidator{
		validator,
	},
	VersionLabel: jsii.String("versionLabel"),
}
```

## Properties

- `content`: [ConfigurationContent](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ConfigurationContent.html) (required) — The content of the hosted configuration.

- `deletionProtectionCheck`: [DeletionProtectionCheck](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.DeletionProtectionCheck.html) — A parameter to configure deletion protection.

  **Default:** DeletionProtectionCheck.ACCOUNT_DEFAULT

  Deletion protection prevents a user from deleting a configuration profile if your application has called
  either `GetLatestConfiguration` or `GetConfiguration` for the configuration profile during the specified interval.

- `deploymentKey`: [IKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) = None. — The deployment key of the configuration.

- `deploymentStrategy`: [IDeploymentStrategyRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_appconfig.IDeploymentStrategyRef.html) — The deployment strategy for the configuration.

  **Default:** A deployment strategy with the rollout strategy set to RolloutStrategy.CANARY_10_PERCENT_20_MINUTES

- `deployTo`: [IEnvironment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IEnvironment.html)[] = None. — The list of environments to deploy the configuration to.

  If this parameter is not specified, then there will be no
  deployment created alongside this configuration.

  Deployments can be added later using the `IEnvironment.addDeployment` or
  `IEnvironment.addDeployments` methods.

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

  **Default:** No description.

- `latestVersionNumber`: number = None. — The latest version number of the hosted configuration.

- `name`: string — The name of the configuration.

  **Default:** A name is generated.

- `type`: [ConfigurationType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ConfigurationType.html) = ConfigurationType.FREEFORM — The type of configuration.

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

  **Default:** No validators.

- `versionLabel`: string = None. — The version label of the hosted configuration.
