DB VPC セキュリティグループが削除できない

0

以下ドキュメントに記載されている、RDS の DB VPC セキュリティグループを私の AWS アカウントにて利用しています。

Amazon RDS セキュリティグループ - Amazon Relational Database Service: https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html#Overview.RDSSecurityGroups.DeleteDBVPCGroups

(ID などの値はマスク済みです)

$ aws rds describe-db-security-groups | jq '.DBSecurityGroups[1]'
{
  "OwnerId": "11111111111",
  "DBSecurityGroupName": "default:vpc-xxxxxxx",
  "DBSecurityGroupDescription": "default:vpc-xxxxxxx",
  "VpcId": "vpc-xxxxxxx",
  "EC2SecurityGroups": [],
  "IPRanges": [],
  "DBSecurityGroupArn": "arn:aws:rds:ap-northeast-1:11111111111:secgrp:default:vpc-xxxxxxx"
}

ドキュメントに記載されている通り、DB VPC セキュリティグループは廃止されたとのことなので、以下のコマンドを使って DB VPC セキュリティグループを削除しようとしましたが、削除出来ませんでした。

$ aws rds delete-db-security-group --db-security-group-name default:vpc-xxxxxxx

An error occurred (InvalidDBSecurityGroupState) when calling the DeleteDBSecurityGroup operation: You cannot delete the default:vpc-xxxxxxx DB security group before all DBSubnetGroups are deleted for this VPC.

エラーメッセージを見た限り、vpc-xxxxxxx VPC 内にある DB サブネットグループを全て削除しなければ、DB VPC セキュリティグループを削除出来ないとのことでした。

しかし、DB サブネットグループは本番環境の DB インスタンスで利用中のため、削除することは出来ません。

$ aws rds describe-db-instances --db-instance-identifier production | jq '.DBInstances[0].DBSubnetGroup'
{
  "DBSubnetGroupName": "xxxx",
  "DBSubnetGroupDescription": "xxxx",
  "VpcId": "vpc-xxxxxxx",
  "SubnetGroupStatus": "Complete",
  "Subnets": [
    {
      "SubnetIdentifier": "subnet-xxxxxxx",
      "SubnetAvailabilityZone": {
        "Name": "ap-northeast-1b"
      },
      "SubnetStatus": "Active"
    },
    {
      "SubnetIdentifier": "subnet-xxxxxxx",
      "SubnetAvailabilityZone": {
        "Name": "ap-northeast-1a"
      },
      "SubnetStatus": "Active"
    },
    {
      "SubnetIdentifier": "subnet-xxxxxxx",
      "SubnetAvailabilityZone": {
        "Name": "ap-northeast-1c"
      },
      "SubnetStatus": "Active"
    }
  ]
}

また、本番環境の DB インスタンスに DB VPC セキュリティグループに紐付いている状態です。

$ aws rds describe-db-instances --db-instance-identifier production | jq '.DBInstances[0] | .DBSecurityGroups,.VpcSecurityGroups'
[
  {
    "DBSecurityGroupName": "default:vpc-xxxxxxx",
    "Status": "active"
  }
]
[
  {
    "VpcSecurityGroupId": "sg-xxxxxxx",
    "Status": "active"
  }
]

この場合、DB VPC セキュリティグループを削除することは出来ないのでしょうか?

ちなみに、DB インスタンス側に紐付いている DB VPC セキュリティグループを削除しようとしましたが、こちらも出来ないようでした。

$ aws rds modify-db-instance --db-instance-identifier production-blue --db-security-groups

An error occurred (InvalidParameterCombination) when calling the ModifyDBInstance operation: No modifications were requested

Edited by: tsub on May 22, 2018 3:50 PM

tsub
gefragt vor 6 Jahren291 Aufrufe
1 Antwort
0

たまたま別の作業により RDS の DB インスタンスに紐づく VPC Security Group を作り直したところ、同時に DB VPC セキュリティグループが削除されていました。

自己解決したためクローズとします。

tsub
beantwortet vor 6 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen