# ConfigurationContent

Defines the hosted configuration content.

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

## Example

```ts
declare const application: appconfig.Application;
declare const fn: lambda.Function;

new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
  application,
  content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
  validators: [
    appconfig.JsonSchemaValidator.fromFile('schema.json'),
    appconfig.LambdaValidator.fromFunction(fn),
  ],
});
```

## Initializer

```ts
new ConfigurationContent()
```

## Properties

- `content`: string — The configuration content.

- `contentType`: string — The configuration content type, specified as a standard MIME type. Supported examples include: - `text/plain` - `application/json` - `application/octet-stream` - `application/x-yaml`.

  For an up-to-date list of valid MIME types, see:
  https://www.iana.org/assignments/media-types/media-types.xhtml

## Methods

- `fromFile(inputPath: string, contentType?: string): ConfigurationContent // chainable` (static) — Defines the hosted configuration content from a file.

  **Parameters**

  - `inputPath` — The path to the file that defines configuration content.
  - `contentType` — The configuration content type, specified as a standard MIME type. Supported examples include: - `text/plain` - `application/json` - `application/octet-stream` - `application/x-yaml`.

- `fromInline(content: string, contentType?: string): ConfigurationContent // chainable` (static) — Defines the hosted configuration content from inline code.

  **Parameters**

  - `content` — The inline code that defines the configuration content.
  - `contentType` — The configuration content type, specified as a standard MIME type. Supported examples include: - `text/plain` - `application/json` - `application/octet-stream` - `application/x-yaml`.

- `fromInlineJson(content: string, contentType?: string): ConfigurationContent // chainable` (static) — Defines the hosted configuration content as JSON from inline code.

  **Parameters**

  - `content` — The inline code that defines the configuration content.
  - `contentType` — The configuration content type, specified as a standard MIME type. Supported examples include: - `text/plain` - `application/json` - `application/octet-stream` - `application/x-yaml`.

- `fromInlineText(content: string): ConfigurationContent // chainable` (static) — Defines the hosted configuration content as text from inline code.

  **Parameters**

  - `content` — The inline code that defines the configuration content.

- `fromInlineYaml(content: string): ConfigurationContent // chainable` (static) — Defines the hosted configuration content as YAML from inline code.

  **Parameters**

  - `content` — The inline code that defines the configuration content.
