Skip to content
v2.278.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),
  ],
});
python
# application: appconfig.Application
# fn: lambda.Function


appconfig.HostedConfiguration(self, "MyHostedConfiguration",
    application=application,
    content=appconfig.ConfigurationContent.from_inline_text("This is my configuration content."),
    validators=[
        appconfig.JsonSchemaValidator.from_file("schema.json"),
        appconfig.LambdaValidator.from_function(fn)
    ]
)
java
Application application;
Function fn;


HostedConfiguration.Builder.create(this, "MyHostedConfiguration")
        .application(application)
        .content(ConfigurationContent.fromInlineText("This is my configuration content."))
        .validators(List.of(JsonSchemaValidator.fromFile("schema.json"), LambdaValidator.fromFunction(fn)))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Application application;
Function fn;


new HostedConfiguration(this, "MyHostedConfiguration", new HostedConfigurationProps {
    Application = application,
    Content = ConfigurationContent.FromInlineText("This is my configuration content."),
    Validators = new [] { JsonSchemaValidator.FromFile("schema.json"), LambdaValidator.FromFunction(fn) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var application Application
var fn Function


appconfig.NewHostedConfiguration(this, jsii.String("MyHostedConfiguration"), &HostedConfigurationProps{
	Application: Application,
	Content: appconfig.ConfigurationContent_FromInlineText(jsii.String("This is my configuration content.")),
	Validators: []IValidator{
		appconfig.JsonSchemaValidator_FromFile(jsii.String("schema.json")),
		appconfig.LambdaValidator_FromFunction(fn),
	},
})

Initializer ​

ts
new ConfigurationContent()
python
ConfigurationContent()
java
new ConfigurationContent()
csharp
new ConfigurationContent()
go
NewConfigurationContent()

Properties ​

contentstringcontentstrcontentStringContentstringContent*string #
The configuration content.
contentTypestringcontent_typestrcontentTypeStringContentTypestringContentType*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@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) ConfigurationContent static #
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) ConfigurationContent static #
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) ConfigurationContent static #
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) ConfigurationContent static #
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) ConfigurationContent static #
Defines the hosted configuration content as YAML from inline code.
1 parameter

Parameters

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