class ConfigurationContent
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AppConfig.ConfigurationContent |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsappconfig#ConfigurationContent |
![]() | software.amazon.awscdk.services.appconfig.ConfigurationContent |
![]() | aws_cdk.aws_appconfig.ConfigurationContent |
![]() | aws-cdk-lib » aws_appconfig » ConfigurationContent |
Defines the hosted configuration content.
Example
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
new ConfigurationContent()
Properties
Name | Type | Description |
---|---|---|
content | string | The configuration content. |
content | string | The configuration content type, specified as a standard MIME type. Supported examples include: - text/plain - application/json - application/octet-stream - application/x-yaml . |
content
Type:
string
The configuration content.
contentType
Type:
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
Name | Description |
---|---|
static from | Defines the hosted configuration content from a file. |
static from | Defines the hosted configuration content from inline code. |
static from | Defines the hosted configuration content as JSON from inline code. |
static from | Defines the hosted configuration content as text from inline code. |
static from | Defines the hosted configuration content as YAML from inline code. |
static fromFile(inputPath, contentType?)
public static fromFile(inputPath: string, contentType?: string): ConfigurationContent
Parameters
- inputPath
string
— The path to the file that defines 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
.
Returns
Defines the hosted configuration content from a file.
static fromInline(content, contentType?)
public static fromInline(content: string, contentType?: string): ConfigurationContent
Parameters
- content
string
— The inline code that defines 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
.
Returns
Defines the hosted configuration content from inline code.
static fromInlineJson(content, contentType?)
public static fromInlineJson(content: string, contentType?: string): ConfigurationContent
Parameters
- content
string
— The inline code that defines 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
.
Returns
Defines the hosted configuration content as JSON from inline code.
static fromInlineText(content)
public static fromInlineText(content: string): ConfigurationContent
Parameters
- content
string
— The inline code that defines the configuration content.
Returns
Defines the hosted configuration content as text from inline code.
static fromInlineYaml(content)
public static fromInlineYaml(content: string): ConfigurationContent
Parameters
- content
string
— The inline code that defines the configuration content.
Returns
Defines the hosted configuration content as YAML from inline code.