Use this module
module "appconfig" {
source = "registry.compliance.tf/terraform-aws-modules/appconfig/aws"
name = "example"
description = "AppConfig hosted configuration"
# environments
environments = {
nonprod = {
name = "nonprod"
description = "Non-production environment"
},
prod = {
name = "prod"
description = "Production environment"
}
}
# hosted config version
use_hosted_configuration = true
hosted_config_version_content_type = "application/json"
hosted_config_version_content = jsonencode({
isEnabled = false,
messageOption = "ItWorks!"
})
# configuration profile
config_profile_validator = [{
type = "JSON_SCHEMA"
content = jsonencode({
"$schema" = "http://json-schema.org/draft-04/schema#",
type = "object",
properties = {
isEnabled = {
type = "boolean"
},
messageOption = {
type = "string",
minimum = 0
}
},
additionalProperties = false,
required = ["isEnabled", "messageOption"]
}) }, {
type = "LAMBDA"
content = "arn:aws:lambda:us-east-1:123456789101:function:example-appconfig-hosted"
}]
tags = {
Terraform = "true"
Environment = "dev"
}
}The example from the module's README, with this page's source.
Key inputs
Required inputs first, then the inputs the README example sets.
- namestring, default ""
The name for the application. Must be between 1 and 64 characters in length
- descriptionstring, default null
The description of the application. Can be at most 1024 characters
- environmentsmap(any), default {}
Map of attributes for AppConfig environment resource(s)
- use_hosted_configurationbool, default false
Determines whether a hosted configuration is used
- hosted_config_version_content_typestring, default null
A standard MIME type describing the format of the configuration content. For more information, see [Content-Type](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17)
- hosted_config_version_contentstring, default null
The content of the configuration or the configuration data
- config_profile_validatorlist(map(any)), default []
A set of methods for validating the configuration. Maximum of 2
- tagsmap(string), default {}
A list of tag blocks. Each element should have keys named key, value, and propagate_at_launch