AWS::RDS::OptionGroup - AWS CloudFormation
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

AWS::RDS::OptionGroup

AWS::RDS::OptionGroup 资源创建一个选项组,用于启用和配置特定于特定数据库引擎的功能。

语法

要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:

JSON

{ "Type" : "AWS::RDS::OptionGroup", "Properties" : { "EngineName" : String, "MajorEngineVersion" : String, "OptionConfigurations" : [ OptionConfiguration, ... ], "OptionGroupDescription" : String, "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::RDS::OptionGroup Properties: EngineName: String MajorEngineVersion: String OptionConfigurations: - OptionConfiguration OptionGroupDescription: String Tags: - Tag

属性

EngineName

指定此选项组应关联到的引擎的名称。

必需:是

类型:字符串

Update requires: Replacement

MajorEngineVersion

指定此选项组应关联到的引擎的主版本。

必需:是

类型:字符串

Update requires: Replacement

OptionConfigurations

所有可用选项的列表

必需:是

类型OptionConfiguration 的列表

Update requires: Replacement

OptionGroupDescription

选项组的描述。

必需:是

类型:字符串

Update requires: Replacement

Tags

要分配给选项组的标签。

必需:否

类型Tag 的列表

Update requires: No interruption

返回值

Ref

在将此资源的逻辑 ID 传递给内部 Ref 函数时,Ref 返回选项组的名称。

For more information about using the Ref function, see Ref.

示例

多个选项配置

以下示例创建具有两个选项配置(OEMAPEX)的选项组:有关这些选项的更多信息,请参阅 Amazon RDS 用户指南 中的 Oracle 数据库实例选项

JSON

{ "OracleOptionGroup": { "Type": "AWS::RDS::OptionGroup", "Properties": { "EngineName": "oracle-ee", "MajorEngineVersion": "12.1", "OptionGroupDescription": "A test option group", "OptionConfigurations": [ { "OptionName": "OEM", "DBSecurityGroupMemberships": [ "default" ], "Port": "5500" }, { "OptionName": "APEX" } ] } } }

YAML

--- OracleOptionGroup: Properties: EngineName: oracle-ee MajorEngineVersion: "12.1" OptionConfigurations: - DBSecurityGroupMemberships: - default OptionName: OEM Port: "5500" - OptionName: APEX OptionGroupDescription: "A test option group" Type: "AWS::RDS::OptionGroup"

多个设置

以下代码段创建一个为 MEMCACHED 选项指定两个选项设置的选项组:有关此选项的更多信息,请参阅 Amazon RDS 用户指南 中的 MySQL memcached 支持

JSON

{ "SQLOptionGroup": { "Type": "AWS::RDS::OptionGroup", "Properties": { "EngineName": "mysql", "MajorEngineVersion": "5.6", "OptionGroupDescription": "A test option group", "OptionConfigurations": [ { "OptionName": "MEMCACHED", "VpcSecurityGroupMemberships": [ "sg-a1238db7" ], "Port": "1234", "OptionSettings": [ { "Name": "CHUNK_SIZE", "Value": "32" }, { "Name": "BINDING_PROTOCOL", "Value": "ascii" } ] } ] } } }

YAML

--- SQLOptionGroup: Properties: EngineName: mysql MajorEngineVersion: "5.6" OptionConfigurations: - OptionName: MEMCACHED OptionSettings: - Name: CHUNK_SIZE Value: "32" - Name: BINDING_PROTOCOL Value: ascii Port: "1234" VpcSecurityGroupMemberships: - sg-a1238db7 OptionGroupDescription: "A test option group" Type: "AWS::RDS::OptionGroup"

Microsoft SQL Server 本机备份和还原选项

以下代码段创建选项组,指定 Microsoft SQL Server 本机备份和还原选项。有关此选项的更多信息,请参阅 Amazon RDS 用户指南 中的 SQL Server 中的本机备份和还原支持

JSON

{ "myOptionGroup": { "Type": "AWS::RDS::OptionGroup", "Properties": { "EngineName": "sqlserver-se", "MajorEngineVersion": "12.00", "OptionGroupDescription": "SQL Server Native Backup and Restore", "OptionConfigurations": [ { "OptionName": "SQLSERVER_BACKUP_RESTORE", "OptionSettings": [ { "Name": "IAM_ROLE_ARN", "Value": "arn:aws:iam::333333333333333:role/service-role/sqlserverrestore" } ] } ] } } }

YAML

--- myOptionGroup: Type: 'AWS::RDS::OptionGroup' Properties: EngineName: sqlserver-se MajorEngineVersion: '12.00' OptionGroupDescription: SQL Server Native Backup and Restore OptionConfigurations: - OptionName: SQLSERVER_BACKUP_RESTORE OptionSettings: - Name: IAM_ROLE_ARN Value: 'arn:aws:iam::333333333333333:role/service-role/sqlserverrestore'