ConfigurationContent

class aws_cdk.aws_appconfig.ConfigurationContent

Bases: object

Defines the hosted configuration content.

ExampleMetadata:

infused

Example:

# 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)
    ]
)

Attributes

content

The configuration content.

content_type
  • 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

Type:

The configuration content type, specified as a standard MIME type. Supported examples include

Static Methods

classmethod from_file(input_path, content_type=None)

Defines the hosted configuration content from a file.

Parameters:
  • input_path (str) – The path to the file that defines configuration content.

  • content_type (Optional[str]) – 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

Return type:

ConfigurationContent

classmethod from_inline(content, content_type=None)

Defines the hosted configuration content from inline code.

Parameters:
  • content (str) – The inline code that defines the configuration content.

  • content_type (Optional[str]) – 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

Return type:

ConfigurationContent

classmethod from_inline_json(content, content_type=None)

Defines the hosted configuration content as JSON from inline code.

Parameters:
  • content (str) – The inline code that defines the configuration content.

  • content_type (Optional[str]) – 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

Return type:

ConfigurationContent

classmethod from_inline_text(content)

Defines the hosted configuration content as text from inline code.

Parameters:

content (str) – The inline code that defines the configuration content.

Return type:

ConfigurationContent

classmethod from_inline_yaml(content)

Defines the hosted configuration content as YAML from inline code.

Parameters:

content (str) – The inline code that defines the configuration content.

Return type:

ConfigurationContent