Skip to content
v2.274.0

ConfigurationContent Class ​

Defines the hosted configuration content.

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()
python
ConfigurationContent()
java
new ConfigurationContent()
csharp
new ConfigurationContent()
go
NewConfigurationContent()

Properties ​

contentstringcontentstrcontentStringContentstringContent*stringrequired#
The configuration content.
contentTypestringcontent_typestrcontentTypeStringContentTypestringContentType*stringrequired#
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@staticmethod def from_file(input_path: str, content_type: typing.Optional[str] = None) -> ConfigurationContentpublic static ConfigurationContent fromFile(String inputPath, String contentType)public static ConfigurationContent FromFile(string inputPath, string? contentType = null)func FromFile(InputPath *string, ContentType *string) ConfigurationContentstatic#
Defines the hosted configuration content from a file.
2 parameters

Parameters

  • inputPathinput_pathinputPathinputPathInputPath — The path to the file that defines configuration content.
  • contentTypecontent_typecontentTypecontentTypeContentType — 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@staticmethod def from_inline(content: str, content_type: typing.Optional[str] = None) -> ConfigurationContentpublic static ConfigurationContent fromInline(String content, String contentType)public static ConfigurationContent FromInline(string content, string? contentType = null)func FromInline(Content *string, ContentType *string) ConfigurationContentstatic#
Defines the hosted configuration content from inline code.
2 parameters

Parameters

  • contentcontentcontentcontentContent — The inline code that defines the configuration content.
  • contentTypecontent_typecontentTypecontentTypeContentType — 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@staticmethod def from_inline_json(content: str, content_type: typing.Optional[str] = None) -> ConfigurationContentpublic static ConfigurationContent fromInlineJson(String content, String contentType)public static ConfigurationContent FromInlineJson(string content, string? contentType = null)func FromInlineJson(Content *string, ContentType *string) ConfigurationContentstatic#
Defines the hosted configuration content as JSON from inline code.
2 parameters

Parameters

  • contentcontentcontentcontentContent — The inline code that defines the configuration content.
  • contentTypecontent_typecontentTypecontentTypeContentType — 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@staticmethod def from_inline_text(content: str) -> ConfigurationContentpublic static ConfigurationContent fromInlineText(String content)public static ConfigurationContent FromInlineText(string content)func FromInlineText(Content *string) ConfigurationContentstatic#
Defines the hosted configuration content as text from inline code.
1 parameter

Parameters

  • contentcontentcontentcontentContent — The inline code that defines the configuration content.
fromInlineYaml(content: string): ConfigurationContent // chainable@staticmethod def from_inline_yaml(content: str) -> ConfigurationContentpublic static ConfigurationContent fromInlineYaml(String content)public static ConfigurationContent FromInlineYaml(string content)func FromInlineYaml(Content *string) ConfigurationContentstatic#
Defines the hosted configuration content as YAML from inline code.
1 parameter

Parameters

  • contentcontentcontentcontentContent — The inline code that defines the configuration content.