本文へジャンプします。

ニフクラ ユーザーガイド

クラウド トップ>API> RDB> AuthorizeDBSecurityGroupIngress
本ページは2023/9/5をもって、新ページhttps://docs.nifcloud.com/rdb/api/AuthorizeDBSecurityGroupIngress.htmへ移行しました。 今後は新ページをご参照ください。

AuthorizeDBSecurityGroupIngress

処理概要

下記どちらかの方法でDBファイアウォールグループへの接続を許可します。

  • ニフクラのサーバーからのプライベートネットワーク経由でDBサーバーへアクセスしたい場合、ニフクラのファイアウォールグループからの接続を許可できます。

  • インターネット経由でDBサーバーへアクセスしたい場合、特定のIP帯からの接続を許可できます。

DBファイアウォールグループに対して、同一ゾーンのニフクラのファイアウォールグループからの接続許可は可能ですが、別ゾーンのニフクラのファイアウォールグループからの接続許可はできません。

このAPIアクションではCIDRIP(IP範囲)またはEC2SecurityGroupName(ニフクラのファイアウォールグループ名)を必ず指定する必要があります。

指定するパラメーター

パラメーター 説明 必須
CIDRIP string 許可するIP帯
○ (EC2SecurityGroupNameを指定しない場合)
DBSecurityGroupName string DBファイアウォールグループ名
EC2SecurityGroupId string ※指定不可
EC2SecurityGroupName string

許可するニフクラのファイアウォールグループ名

  • ※4バイト文字(絵文字や一部の漢字など)は使用できません

○ (CIDRIPを指定しない場合)
EC2SecurityGroupOwnerId string ※指定不可

応答フィールド

フィールド (項目) 説明
AuthorizeDBSecurityGroupIngressResponse structure ルート
AuthorizeDBSecurityGroupIngressResult structure 結果
DBSecurityGroup structure DBファイアウォールグループ情報
備考: DBSecurityGroupの子要素はDescribeDBSecurityGroupsで返却される要素をすべて記載しているためAPIによっては返却されない要素もあります。実際のレスポンスはレスポンスサンプルを参照してください。
DBSecurityGroupDescription string DBファイアウォールグループの説明
DBSecurityGroupName string DBファイアウォールグループ名
EC2SecurityGroups list ニフクラのファイアウォールグループ要素リスト
EC2SecurityGroup structure ニフクラのファイアウォールグループ要素
EC2SecurityGroupName string ニフクラのファイアウォールグループ名
EC2SecurityGroupOwnerId string ニフクラのファイアウォールグループを所有している ニフクラID
Status string

ニフクラのファイアウォールグループのステータス

  • 値:authorized(有効)|authorizing(追加中)|revoking(削除中)|auth-failed(追加エラー)|revoke-failed(削除エラー)|not-exists(追加エラー(グループが存在しません))

IPRanges list IP帯リスト
IPRange structure IP帯
CIDRIP string CIDR
Status string

IP帯のステータス

値:authorized(有効)|authorizing(追加中)|revoking(削除中)|auth-failed(追加エラー)|revoke-failed(削除エラー)|not-exists(追加エラー(グループが存在しません))


OwnerId string DB ファイアウォールグループを所有している ニフクラID
NiftyAvailabilityZone string DB ファイアウォールグループのゾーン
備考: ニフクラ独自仕様
ResponseMetadata structure 共通メタ情報
RequestId string リクエスト識別子

エラー

コード メッセージ タイプ HTTPステータスコード 説明
Client.InvalidParameterCannotSpecify.DBSecurityGroupName

DBSecurityGroupName must not contain leading or trailing spaces.

Sender 400 DBSecurityGroupNameの最初または最後にスペースを入力した場合
Client.InvalidParameterCombination.CidrIp.and.SecurityGroupName

If CIDRIP is specified, EC2SecurityGroupName must be omitted.

Sender 400 CIDRIPとEC2SecurityGroupNameの両方に値を指定した場合
CIDRIPとEC2SecurityGroupNameの両方に値を指定しなかった場合
Client.InvalidParameterDuplicate.CidrIp.or.SecurityGroupName

Authorization already exists: 192.168.1.1/32

Sender 400 すでに設定されているCIDRIPを指定した場合
EC2SecurityGroupNameにすでに設定されているニフクラのファイアウォールグループを指定した場合
Client.InvalidParameterFormat.CidrIp

Invalid CIDR format. Format must be B. B. B. B/M, where B is a number between 0 and 255, and M is a number between 0 and 32. For example: To authorize only the source address of this request (and no other address), pass 192.168.1.2 as the CIDRIP parameter.

Sender 400 CIDRIPの形式が無効な場合
Client.InvalidParameterFormat.DBSecurityGroupName

DBSecurityGroupName can contain only lowercase ASCII letters and digits, spaces, underscores, and hyphens.

Sender 400 DBSecurityGroupNameに無効な値(ハイフンから始まる 等)を指定した場合
Client.InvalidParameterIllegalInput.SecurityGroupName

EC2SecurityGroupName (4バイト文字) is not a valid parameter.

Sender 400 EC2SecurityGroupNameに4バイト文字を含む値を指定した場合
Client.InvalidParameterNotFound.DBSecurityGroup

DBSecurityGroup not found: aaa

Sender 404 存在しないDBSecurityGroupNameを指定した場合
Client.InvalidParameterRequired.DBSecurityGroupName

DBSecurityGroupName is required

Sender 400 必須のDBSecurityGroupNameを指定しなかった場合
Client.InvalidParameterTooLong.DBSecurityGroupName

DBSecurityGroupName can be no longer than 255 characters

Sender 400 DBSecurityGroupNameに255文字を超える値を指定した場合
Client.InvalidParameterTooLong.SecurityGroupName

SecurityGroupName can not be greater than 15 characters.

Sender 400 SecurityGroupNameに15文字を超える値を指定した場合
Client.InvalidParameterTooLong.SecurityGroupName

EC2SecurityGroupName can not be greater than 15 characters.

Sender 400 EC2SecurityGroupNameに15文字を超える値を指定した場合
Client.LimitExceeded.NumberOfDBSecurityGroupRule

Database security group authorization quota has been reached

Sender 400 作成可能なDBファイアウォールグループの上限に達している場合
Client.ResourceIncorrectState.DBInstance.Creating

Cannot authorize the DBSecurityGroup because DBInstance using the DBSecurityGroup is creating.

Sender 400 DBファイアウォールグループを使用しているDBサーバーのステータスが「creating」の場合
Client.ResourceIncorrectState.DBInstance.Processing

Cannot authorize the DBSecurityGroup because DBInstance using the DBSecurityGroup is modifying.

Sender 400 DBファイアウォールグループを使用しているDBサーバーのステータスが「modifying」の場合
Client.ResourceIncorrectState.DBSecurityGroup.Unavailable

The state of the DB Security Group does not allow deletion.

Sender 400 DBファイアウォールグループのステータスが有効な状態でない場合

リクエストサンプル

    https://jp-east-1.rdb.api.nifcloud.com/
  ?Action=AuthorizeDBSecurityGroupIngress
  &DBSecurityGroupName=mydbsecuritygroup
  &CIDRIP=0.0.0.0/0
  &SignatureVersion=2
  &SignatureMethod=HmacSHA256
  &Timestamp=2013-12-09T00:00:00.000Z
  &AWSAccessKeyId=<NIFCLOUD Access Key ID>
  &Signature=<Signature>

  

応答サンプル

    <AuthorizeDBSecurityGroupIngressResponse>
  <AuthorizeDBSecurityGroupIngressResult>
    <DBSecurityGroup>
      <DBSecurityGroupDescription>My new db security group</DBSecurityGroupDescription>
      <DBSecurityGroupName>mydbsecuritygroup</DBSecurityGroupName>
      <EC2SecurityGroups/>
      <IPRanges>
        <IPRange>
          <CIDRIP>0.0.0.0/0</CIDRIP>
          <Status>authorizing</Status>
        </IPRange>
      </IPRanges>
      <OwnerId>abc01234</OwnerId>
      <NiftyAvailabilityZone>east-13</NiftyAvailabilityZone>
    </DBSecurityGroup>
  </AuthorizeDBSecurityGroupIngressResult>
  <ResponseMetadata>
    <RequestId>d8abe8c0-2f82-4ed8-a050-2b1ddab9407e</RequestId>
  </ResponseMetadata>
</AuthorizeDBSecurityGroupIngressResponse>

  
  • ※本ページ記載の金額は、すべて税抜表示です。
  • ※本ページ記載の他社製品名および会社名などは、各社の商標または登録商標です。
  • ※本ページの内容は、2023年9月05日時点の情報です。

推奨画面サイズ 1024×768 以上