AWS::AppConfig::HostedConfigurationVersion
在 AppConfig 托管配置存储中创建新配置。配置必须为 64 KB 或更小。与其他配置存储选项相比,AppConfig 托管配置存储提供了以下好处。
-
您无需设置和配置其他服务,如 Amazon Simple Storage Service (Amazon S3) 或参数存储。
-
您无需配置 AWS Identity and Access Management (IAM) 权限即可使用配置存储。
-
您可以将配置存储在任何内容类型中。
-
使用存储不产生任何费用。
-
您可以创建配置并在创建配置文件时将其添加到存储。
语法
要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:
JSON
{ "Type" : "AWS::AppConfig::HostedConfigurationVersion", "Properties" : { "ApplicationId" :
String
, "ConfigurationProfileId" :String
, "Content" :String
, "ContentType" :String
, "Description" :String
, "LatestVersionNumber" :Double
} }
YAML
Type: AWS::AppConfig::HostedConfigurationVersion Properties: ApplicationId:
String
ConfigurationProfileId:String
Content:String
ContentType:String
Description:String
LatestVersionNumber:Double
属性
ApplicationId
-
应用程序 ID。
必需:是
类型:字符串
模式:
[a-z0-9]{4,7}
Update requires: Replacement
ConfigurationProfileId
-
配置文件 ID。
必需:是
类型:字符串
模式:
[a-z0-9]{4,7}
Update requires: Replacement
Content
-
配置或配置数据的内容。
必需:是
类型:字符串
Update requires: Replacement
ContentType
-
描述配置内容格式的标准 MIME 类型。有关更多信息,请参阅内容类型
。 必需:是
类型:字符串
最低:
1
最高:
255
Update requires: Replacement
Description
-
关于配置的描述。
必需:否
类型:字符串
最低:
0
最高:
1024
Update requires: Replacement
LatestVersionNumber
-
一种可选的锁定令牌,用于防止在创建新版本时竞争条件覆盖配置更新。要确保在连续快速创建多个托管配置版本时不会覆盖数据,请指定最新托管配置版本的版本号。
必需:否
类型:双精度
Update requires: Replacement
返回值
Ref
在将此资源的逻辑 ID 传递给内部 Ref
函数时,Ref
返回版本号。
示例
AWS AppConfig 托管配置
以下示例为名为 MyApplication
的应用程序创建一个名为 MyTestProfile
的 AWS AppConfig 配置文件。AppConfig 将此配置文件的配置数据存储在 AppConfig 托管的配置存储中。
JSON
{ "Resources": { "DependentApplication": { "Type": "AWS::AppConfig::Application", "Properties": { "Name": "MyApplication" } }, "DependentConfigurationProfile": { "Type": "AWS::AppConfig::ConfigurationProfile", "Properties": { "ApplicationId": "DependentApplication", "Name": "MyTestProfile", "LocationUri": "hosted" } }, "BasicHostedConfigurationVersion": { "Type": "AWS::AppConfig::HostedConfigurationVersion", "Properties": { "ApplicationId": "DependentApplication", "ConfigurationProfileId": "DependentConfigurationProfile", "Description": "A sample hosted configuration version", "Content": "My hosted configuration content", "ContentType": "text/plain" } } } }
YAML
Resources: DependentApplication: Type: AWS::AppConfig::Application Properties: Name: "MyApplication" DependentConfigurationProfile: Type: AWS::AppConfig::ConfigurationProfile Properties: ApplicationId: !Ref DependentApplication Name: "MyTestProfile" LocationUri: "hosted" BasicHostedConfigurationVersion: Type: AWS::AppConfig::HostedConfigurationVersion Properties: ApplicationId: !Ref DependentApplication ConfigurationProfileId: !Ref DependentConfigurationProfile Description: 'A sample hosted configuration version' Content: 'My hosted configuration content' ContentType: 'text/plain'