コンテンツにスキップ

Neptune.3

検証日: 2026-05-24 / リージョン: ap-northeast-1

概要

Neptune.3 はNeptune クラスタースナップショットがパブリック化されている場合に FAILED となる Security Hub CSPM コントロール。本記事では、Security Hub finding を EventBridge でフィルタし、カスタム SSM Automation ランブックを起動してスナップショットを自動的にプライベートに戻す構成を検証する。

RDS.1 との差分

RDS.1 自動修復 と異なり、AWS マネージドの SSM Automation ドキュメントが存在しないため、カスタムランブックを作成する。

項目RDS.1 自動修復Neptune.3 自動修復(本記事)
対象 APIrds:ModifyDBSnapshotAttributerds:ModifyDBClusterSnapshotAttribute
Config ルールsecurityhub-rds-snapshots-public-prohibited-<サフィックス>securityhub-neptune-cluster-snapshot-public-prohibited-<サフィックス>
Security Hub finding の Resource TypeAwsRdsDbSnapshotAwsRdsDbClusterSnapshot
Resource Details のスナップショット ID フィールドAwsRdsDbSnapshot.DbSnapshotIdentifier(フィールドなし。Resources[0].Id の ARN から取得)
SSM Automation ドキュメントAWSSupport-ModifyRDSSnapshotPermission(マネージド)カスタムランブック(本記事で作成)

DocumentDB.3 との関係

DocumentDB と Neptune はどちらも内部的に RDS の rds:ModifyDBClusterSnapshotAttribute API を使用するため、本記事で作成するカスタムランブック NeptuneSnapshotMakePrivateDocumentDB.3 自動修復 で作成する DocumentDBSnapshotMakePrivate と内容が同一。実運用では両方を別名で用意するより、サービス名に依存しない命名(例: RdsClusterSnapshotMakePrivate)で 1 つにまとめてもよい。本サイトでは各記事を独立して読めるよう、サービス名に揃えた別名で作成する方針を採る。

自動修復の構成

Neptune クラスタースナップショットがパブリック化
  → Config ルール securityhub-neptune-cluster-snapshot-public-prohibited-<サフィックス> が NON_COMPLIANT
  → Security Hub finding Neptune.3 が FAILED
  → EventBridge ルールが finding をフィルタ(Input Transformer でクラスタースナップショット ID 抽出)
  → カスタム SSM Automation ランブックを起動(rds:ModifyDBClusterSnapshotAttribute --values-to-remove all)
  → スナップショットがプライベートに戻る
  → Config 再評価 → COMPLIANT
  → Security Hub finding → PASSED

カスタムランブックの設計

シンプルな単一ステップのランブックを作成する。aws:executeAwsApirds:ModifyDBClusterSnapshotAttribute を直接呼ぶ。

パラメータ役割
ClusterSnapshotIdentifierString修復対象のクラスタースナップショット ID または ARN
AutomationAssumeRoleARNSSM Automation が rds:ModifyDBClusterSnapshotAttribute を呼ぶための IAM ロール

Security Hub finding 構造

Neptune クラスタースナップショットがパブリック化された finding には、Resources[0].Details.AwsRdsDbClusterSnapshot にスナップショットの詳細情報が含まれるが、RDS.1 自動修復 と異なり DbClusterSnapshotIdentifier フィールドは含まれない(実機検証で確認)。代わりに Resources[0].Id の ARN(例: arn:aws:rds:ap-northeast-1:<アカウント ID>:cluster-snapshot:<スナップショット ID>)を使用する。

{
  "Resources": [{
    "Type": "AwsRdsDbClusterSnapshot",
    "Id": "arn:aws:rds:<リージョン>:<アカウント ID>:cluster-snapshot:<スナップショット ID>",
    "Details": {
      "AwsRdsDbClusterSnapshot": {
        "Engine": "neptune",
        "SnapshotCreateTime": "...",
        ...
      }
    }
  }]
}

rds:ModifyDBClusterSnapshotAttribute API の --db-cluster-snapshot-identifier パラメータは ARN 形式を受け付けるため(実機検証で確認)、EventBridge Input Transformer では Resources[0].Id をそのままカスタムランブックの ClusterSnapshotIdentifier パラメータに渡す。

RDS.1 との差異: RDS DB インスタンススナップショットの finding(AwsRdsDbSnapshot)には DbSnapshotIdentifier フィールドが含まれるが、DocumentDB / Neptune などのクラスタースナップショット(AwsRdsDbClusterSnapshot)には対応する識別子フィールドが含まれない。これは ASFF の構造的な差異で、本サイトの検証時点(2026 年 5 月)で確認した挙動。

検証環境

検証環境の構成図

本記事のコマンドは、--profile 指定がない場合は Workload アカウントで実行する。事前に export AWS_PROFILE=Workload でデフォルトを設定しておくと便利。

結果

検証項目結果
カスタムランブック作成と動作確認✓ Active 即座、aws:executeAwsApirds:ModifyDBClusterSnapshotAttribute を実行
Security Hub finding(FAILED)から EventBridge へのトリガー✓ 状態変化(PASSED → FAILED)で発火確認
Input Transformer でクラスタースナップショット ARN 抽出Resources[0].Id から取得
カスタムランブック起動と修復実行✓ Status: Success
スナップショットのパブリック共有解除restore 属性が空
Config / Security Hub PASSED 復帰✓ Compliance: PASSED, Workflow: RESOLVED

実測時間:

  • スナップショット作成: 約 11 分
  • 設定変更 → Security Hub finding 反映: 約 3〜8 分
  • finding 発行 → EventBridge 発火 → SSM Automation 実行完了: 約 1 分以内
  • 修復完了 → Security Hub PASSED 復帰: 約 1.5 分

検証の流れ

    flowchart LR
    A[1. 事前確認] --> B[2. カスタムランブック作成]
    B --> C[3. 修復用 IAM ロール作成]
    C --> D[4. EventBridge ルール作成<br>DISABLED 状態]
    D --> E[5. Neptune クラスター・<br>スナップショット作成]
    E --> F[6.1 パブリック化<br>6.2 FAILED 観測]
    F --> G[6.3 プライベートに戻す<br>6.4 PASSED 観測]
    G --> H[6.5 EventBridge 有効化<br>6.6 再パブリック化]
    H --> I[7. 自動修復実行確認]
    I --> J[8. PASSED 復帰確認]
    J --> K[9. クリーンアップ]
  

1. 事前確認

Config ルールの存在確認

aws configservice describe-config-rules \
  --query "ConfigRules[?contains(ConfigRuleName, 'neptune-cluster-snapshot-public-prohibited')].ConfigRuleName" \
  --output text \
  --region ap-northeast-1
securityhub-neptune-cluster-snapshot-public-prohibited-<サフィックス>

既存の SSM Automation ドキュメント確認

aws ssm list-documents \
  --filters Key=Owner,Values=Self Key=Name,Values=NeptuneSnapshotMakePrivate \
  --region ap-northeast-1 \
  --query 'DocumentIdentifiers[].Name' \
  --output json
[]

既存の EventBridge ルール確認

aws events list-rules \
  --name-prefix "neptune-3-auto-remediation" \
  --region ap-northeast-1 \
  --query 'Rules[].Name' \
  --output json
[]

既存の IAM ロール確認

aws iam list-roles \
  --query "Roles[?starts_with(RoleName, 'neptune-3-')].RoleName" \
  --output json
[]

2. カスタムランブック作成

Neptune クラスタースナップショットをプライベートに戻す SSM Automation ドキュメントを作成する。

cat <<'EOF' > /tmp/neptune-snapshot-make-private.yaml
schemaVersion: "0.3"
description: "Modify DocumentDB / Neptune cluster snapshot to remove public access"
parameters:
  ClusterSnapshotIdentifier:
    type: String
    description: "(Required) The identifier or ARN of the cluster snapshot to make private."
  AutomationAssumeRole:
    type: AWS::IAM::Role::Arn
    description: "(Required) The IAM role ARN that the runbook assumes."
assumeRole: "{{ AutomationAssumeRole }}"
mainSteps:
  - name: ModifyClusterSnapshotAttribute
    action: aws:executeAwsApi
    inputs:
      Service: rds
      Api: ModifyDBClusterSnapshotAttribute
      DBClusterSnapshotIdentifier: "{{ ClusterSnapshotIdentifier }}"
      AttributeName: "restore"
      ValuesToRemove:
        - "all"
EOF

aws ssm create-document \
  --name NeptuneSnapshotMakePrivate \
  --document-type Automation \
  --document-format YAML \
  --content file:///tmp/neptune-snapshot-make-private.yaml \
  --region ap-northeast-1 \
  --query 'DocumentDescription.{Name:Name,Status:Status,DocumentType:DocumentType}' \
  --output json
{
    "Name": "NeptuneSnapshotMakePrivate",
    "Status": "Creating",
    "DocumentType": "Automation"
}

Active になるまで待機(数秒〜十数秒)。

while true; do
  STATUS=$(aws ssm describe-document \
    --name NeptuneSnapshotMakePrivate \
    --region ap-northeast-1 \
    --query 'Document.Status' \
    --output text)
  echo "$(date '+%H:%M:%S') status: $STATUS"
  case "$STATUS" in
    Active) break ;;
    Failed) echo "失敗"; break ;;
    *) sleep 5 ;;
  esac
done
HH:MM:SS status: Active

(即座に Active になる場合もある)

3. 修復用 IAM ロール作成

3.1 SSM Automation 実行ロール

cat <<'EOF' > /tmp/ssm-automation-trust.json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": {"Service": "ssm.amazonaws.com"},
    "Action": "sts:AssumeRole"
  }]
}
EOF

aws iam create-role \
  --role-name neptune-3-automation-role \
  --assume-role-policy-document file:///tmp/ssm-automation-trust.json \
  --query 'Role.Arn' \
  --output text
arn:aws:iam::<アカウント ID>:role/neptune-3-automation-role
cat <<'EOF' > /tmp/neptune-snapshot-policy.json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": [
      "rds:DescribeDBClusterSnapshots",
      "rds:DescribeDBClusterSnapshotAttributes",
      "rds:ModifyDBClusterSnapshotAttribute"
    ],
    "Resource": "*"
  }]
}
EOF

aws iam put-role-policy \
  --role-name neptune-3-automation-role \
  --policy-name neptune-snapshot-permission \
  --policy-document file:///tmp/neptune-snapshot-policy.json

(出力なし)

3.2 EventBridge から SSM Automation 起動するロール

cat <<'EOF' > /tmp/eventbridge-trust.json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": {"Service": "events.amazonaws.com"},
    "Action": "sts:AssumeRole"
  }]
}
EOF

aws iam create-role \
  --role-name neptune-3-eventbridge-role \
  --assume-role-policy-document file:///tmp/eventbridge-trust.json \
  --query 'Role.Arn' \
  --output text
arn:aws:iam::<アカウント ID>:role/neptune-3-eventbridge-role
cat <<'EOF' > /tmp/eventbridge-policy.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "ssm:StartAutomationExecution",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "arn:aws:iam::<アカウント ID>:role/neptune-3-automation-role",
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "ssm.amazonaws.com"
        }
      }
    }
  ]
}
EOF

aws iam put-role-policy \
  --role-name neptune-3-eventbridge-role \
  --policy-name eventbridge-ssm-automation \
  --policy-document file:///tmp/eventbridge-policy.json

(出力なし)

4. EventBridge ルール作成

4.1 ルール本体作成(DISABLED 状態)

Security Hub finding のうち、Neptune.3 で FAILED かつ Workflow.Status が NEW のものをフィルタする。最初は DISABLED 状態で作成し、ステップ 6.5 で有効化する。

cat <<'EOF' > /tmp/eventbridge-pattern.json
{
  "source": ["aws.securityhub"],
  "detail-type": ["Security Hub Findings - Imported"],
  "detail": {
    "findings": {
      "Compliance": {
        "SecurityControlId": ["Neptune.3"],
        "Status": ["FAILED"]
      },
      "Workflow": {
        "Status": ["NEW"]
      },
      "Resources": {
        "Type": ["AwsRdsDbClusterSnapshot"]
      }
    }
  }
}
EOF

aws events put-rule \
  --name neptune-3-auto-remediation \
  --event-pattern file:///tmp/eventbridge-pattern.json \
  --state DISABLED \
  --region ap-northeast-1 \
  --query 'RuleArn' \
  --output text
arn:aws:events:ap-northeast-1:<アカウント ID>:rule/neptune-3-auto-remediation

4.2 ターゲット設定(Input Transformer 付き)

EVENTBRIDGE_ROLE_ARN=$(aws iam get-role \
  --role-name neptune-3-eventbridge-role \
  --query 'Role.Arn' \
  --output text)

AUTOMATION_ROLE_ARN=$(aws iam get-role \
  --role-name neptune-3-automation-role \
  --query 'Role.Arn' \
  --output text)

cat <<EOF > /tmp/eventbridge-target.json
[
  {
    "Id": "ssm-automation-target",
    "Arn": "arn:aws:ssm:ap-northeast-1::automation-definition/NeptuneSnapshotMakePrivate:\$DEFAULT",
    "RoleArn": "$EVENTBRIDGE_ROLE_ARN",
    "InputTransformer": {
      "InputPathsMap": {
        "snapshotArn": "\$.detail.findings[0].Resources[0].Id"
      },
      "InputTemplate": "{\"ClusterSnapshotIdentifier\": [\"<snapshotArn>\"], \"AutomationAssumeRole\": [\"$AUTOMATION_ROLE_ARN\"]}"
    }
  }
]
EOF

aws events put-targets \
  --rule neptune-3-auto-remediation \
  --targets file:///tmp/eventbridge-target.json \
  --region ap-northeast-1
{
    "FailedEntryCount": 0,
    "FailedEntries": []
}

5. Neptune クラスター・スナップショット作成

5.1 Neptune クラスター作成

Neptune はフルマネージドのグラフデータベース(Property Graph / RDF 対応)。クラスター + 1 つのインスタンスで最小構成を作成する。

aws neptune create-db-cluster \
  --db-cluster-identifier neptune3-remediation-test \
  --engine neptune \
  --backup-retention-period 1 \
  --region ap-northeast-1 \
  --query 'DBCluster.{DBClusterIdentifier:DBClusterIdentifier,Status:Status}' \
  --output json
{
    "DBClusterIdentifier": "neptune3-remediation-test",
    "Status": "creating"
}
aws neptune create-db-instance \
  --db-instance-identifier neptune3-remediation-instance \
  --db-instance-class db.t3.medium \
  --engine neptune \
  --db-cluster-identifier neptune3-remediation-test \
  --region ap-northeast-1 \
  --query 'DBInstance.{DBInstanceIdentifier:DBInstanceIdentifier,Status:DBInstanceStatus}' \
  --output json
{
    "DBInstanceIdentifier": "neptune3-remediation-instance",
    "Status": "creating"
}

クラスター available 待ち(数秒〜数分)。

while true; do
  STATUS=$(aws neptune describe-db-clusters \
    --db-cluster-identifier neptune3-remediation-test \
    --query 'DBClusters[0].Status' \
    --output text \
    --region ap-northeast-1)
  echo "$(date '+%H:%M:%S') cluster: $STATUS"
  case "$STATUS" in
    available) break ;;
    failed) echo "失敗"; break ;;
    *) sleep 60 ;;
  esac
done
HH:MM:SS cluster: creating
(数分間 creating を繰り返す)
HH:MM:SS cluster: available

5.2 クラスタースナップショット作成

aws neptune create-db-cluster-snapshot \
  --db-cluster-identifier neptune3-remediation-test \
  --db-cluster-snapshot-identifier neptune3-remediation-snapshot \
  --region ap-northeast-1 \
  --query 'DBClusterSnapshot.{DBClusterSnapshotIdentifier:DBClusterSnapshotIdentifier,Status:Status}' \
  --output json
{
    "DBClusterSnapshotIdentifier": "neptune3-remediation-snapshot",
    "Status": "creating"
}

available 待ち(約 5〜15 分)。

while true; do
  STATUS=$(aws neptune describe-db-cluster-snapshots \
    --db-cluster-snapshot-identifier neptune3-remediation-snapshot \
    --query 'DBClusterSnapshots[0].Status' \
    --output text \
    --region ap-northeast-1)
  echo "$(date '+%H:%M:%S') snapshot: $STATUS"
  case "$STATUS" in
    available) break ;;
    failed) echo "失敗"; break ;;
    *) sleep 30 ;;
  esac
done
HH:MM:SS snapshot: creating
(数分間 creating を繰り返す)
HH:MM:SS snapshot: available

6. パブリック化と FAILED → 状態変化フロー

RDS.1 自動修復 と同様、Config 手動トリガーだけでは Security Hub finding の再 import が発火しないため、「PASSED → FAILED」の状態変化を起こして finding を新規 import させる必要がある。本番運用では EventBridge ルールが常時 ENABLED のため、新規パブリック化時の PASSED → FAILED で自然に発火する(本記事の検証手順は EventBridge を DISABLED で作成しているため、6.3〜6.6 の状態変化を起こす手順が必要となる)。詳細は RDS.1 自動修復の構成 の callout 参照。

6.1 スナップショットをパブリック化

aws neptune modify-db-cluster-snapshot-attribute \
  --db-cluster-snapshot-identifier neptune3-remediation-snapshot \
  --attribute-name restore \
  --values-to-add all \
  --region ap-northeast-1 \
  --query 'DBClusterSnapshotAttributesResult.DBClusterSnapshotAttributes' \
  --output json
[
    {
        "AttributeName": "restore",
        "AttributeValues": [
            "all"
        ]
    }
]

describe-db-cluster-snapshot-attributes で再確認。

aws neptune describe-db-cluster-snapshot-attributes \
  --db-cluster-snapshot-identifier neptune3-remediation-snapshot \
  --region ap-northeast-1 \
  --query 'DBClusterSnapshotAttributesResult.DBClusterSnapshotAttributes' \
  --output json
[
    {
        "AttributeName": "restore",
        "AttributeValues": [
            "all"
        ]
    }
]

6.2 Security Hub finding が FAILED になることを確認

Security Hub への反映には数分かかる。Compliance.StatusWorkflow.Status の両方を確認する。

sleep 300

aws securityhub get-findings \
  --filters '{"ComplianceSecurityControlId":[{"Comparison":"EQUALS","Value":"Neptune.3"}],"ComplianceStatus":[{"Comparison":"EQUALS","Value":"FAILED"}],"ResourceId":[{"Comparison":"PREFIX","Value":"arn:aws:rds:ap-northeast-1:<アカウント ID>:cluster-snapshot:neptune3-remediation-snapshot"}]}' \
  --region ap-northeast-1 \
  --query 'Findings[0].{Compliance:Compliance.Status,Workflow:Workflow.Status,SnapshotArn:Resources[0].Id}' \
  --output json
{
    "Compliance": "FAILED",
    "Workflow": "NEW",
    "SnapshotArn": "arn:aws:rds:ap-northeast-1:<アカウント ID>:cluster-snapshot:neptune3-remediation-snapshot"
}

6.3 一度プライベートに戻して finding の状態を変化させる

aws neptune modify-db-cluster-snapshot-attribute \
  --db-cluster-snapshot-identifier neptune3-remediation-snapshot \
  --attribute-name restore \
  --values-to-remove all \
  --region ap-northeast-1 \
  --query 'DBClusterSnapshotAttributesResult.DBClusterSnapshotAttributes' \
  --output json
[
    {
        "AttributeName": "restore",
        "AttributeValues": []
    }
]

6.4 PASSED を観測

sleep 300

aws securityhub get-findings \
  --filters '{"ComplianceSecurityControlId":[{"Comparison":"EQUALS","Value":"Neptune.3"}],"ResourceId":[{"Comparison":"PREFIX","Value":"arn:aws:rds:ap-northeast-1:<アカウント ID>:cluster-snapshot:neptune3-remediation-snapshot"}]}' \
  --region ap-northeast-1 \
  --query 'Findings[0].{Compliance:Compliance.Status,Workflow:Workflow.Status}' \
  --output json
{
    "Compliance": "PASSED",
    "Workflow": "RESOLVED"
}

6.5 EventBridge ルールを有効化

aws events enable-rule \
  --name neptune-3-auto-remediation \
  --region ap-northeast-1

aws events describe-rule \
  --name neptune-3-auto-remediation \
  --region ap-northeast-1 \
  --query 'State'
"ENABLED"

6.6 再度パブリック化(自動修復の起動)

aws neptune modify-db-cluster-snapshot-attribute \
  --db-cluster-snapshot-identifier neptune3-remediation-snapshot \
  --attribute-name restore \
  --values-to-add all \
  --region ap-northeast-1 \
  --query 'DBClusterSnapshotAttributesResult.DBClusterSnapshotAttributes' \
  --output json
[
    {
        "AttributeName": "restore",
        "AttributeValues": [
            "all"
        ]
    }
]

7. 自動修復の実行確認

EventBridge が finding を捕捉してカスタムランブックを起動するはず。SSM Automation の実行履歴を確認する。

sleep 300

aws ssm describe-automation-executions \
  --filters Key=DocumentNamePrefix,Values=NeptuneSnapshotMakePrivate \
  --max-results 5 \
  --region ap-northeast-1 \
  --query 'AutomationExecutionMetadataList[].{Status:AutomationExecutionStatus,ExecutionStartTime:ExecutionStartTime,ExecutionId:AutomationExecutionId}' \
  --output json
[
    {
        "Status": "Success",
        "ExecutionStartTime": "<開始時刻>",
        "ExecutionId": "<実行 ID>"
    }
]

8. PASSED 復帰確認

8.1 スナップショットがプライベートに戻ったことを確認

aws neptune describe-db-cluster-snapshot-attributes \
  --db-cluster-snapshot-identifier neptune3-remediation-snapshot \
  --region ap-northeast-1 \
  --query 'DBClusterSnapshotAttributesResult.DBClusterSnapshotAttributes' \
  --output json
[
    {
        "AttributeName": "restore",
        "AttributeValues": []
    }
]

8.2 Config / Security Hub finding 確認

sleep 120

aws securityhub get-findings \
  --filters '{"ComplianceSecurityControlId":[{"Comparison":"EQUALS","Value":"Neptune.3"}],"ResourceId":[{"Comparison":"PREFIX","Value":"arn:aws:rds:ap-northeast-1:<アカウント ID>:cluster-snapshot:neptune3-remediation-snapshot"}]}' \
  --region ap-northeast-1 \
  --query 'Findings[0].{Compliance:Compliance.Status,Workflow:Workflow.Status,UpdatedAt:UpdatedAt}' \
  --output json
{
    "Compliance": "PASSED",
    "Workflow": "RESOLVED",
    "UpdatedAt": "<更新時刻>"
}

9. クリーンアップ

Neptune クラスタースナップショット削除

aws neptune delete-db-cluster-snapshot \
  --db-cluster-snapshot-identifier neptune3-remediation-snapshot \
  --region ap-northeast-1 \
  --query 'DBClusterSnapshot.{DBClusterSnapshotIdentifier:DBClusterSnapshotIdentifier,Status:Status}' \
  --output json
{
    "DBClusterSnapshotIdentifier": "neptune3-remediation-snapshot",
    "Status": "available"
}

delete-db-cluster-snapshot の応答時の Status は削除実行時点の状態を返すため available が表示されるが、削除リクエストは受理されている。describe-db-cluster-snapshots で確認すると DBClusterSnapshotNotFoundFault が返り、削除完了を確認できる。

Neptune インスタンス・クラスター削除

aws neptune delete-db-instance \
  --db-instance-identifier neptune3-remediation-instance \
  --region ap-northeast-1 \
  --query 'DBInstance.{DBInstanceIdentifier:DBInstanceIdentifier,Status:DBInstanceStatus}' \
  --output json

インスタンス削除完了後、クラスターを削除する。

while true; do
  COUNT=$(aws neptune describe-db-instances \
    --query "length(DBInstances[?DBInstanceIdentifier=='neptune3-remediation-instance'])" \
    --output text \
    --region ap-northeast-1 2>/dev/null || echo 0)
  echo "$(date '+%H:%M:%S') 残存インスタンス数: $COUNT"
  [ "$COUNT" = "0" ] && echo "削除完了" && break
  sleep 60
done

aws neptune delete-db-cluster \
  --db-cluster-identifier neptune3-remediation-test \
  --skip-final-snapshot \
  --region ap-northeast-1 \
  --query 'DBCluster.{DBClusterIdentifier:DBClusterIdentifier,Status:Status}' \
  --output json

EventBridge ルール削除

aws events remove-targets \
  --rule neptune-3-auto-remediation \
  --ids ssm-automation-target \
  --region ap-northeast-1

aws events delete-rule \
  --name neptune-3-auto-remediation \
  --region ap-northeast-1

IAM ロール削除

aws iam delete-role-policy \
  --role-name neptune-3-automation-role \
  --policy-name neptune-snapshot-permission

aws iam delete-role \
  --role-name neptune-3-automation-role

aws iam delete-role-policy \
  --role-name neptune-3-eventbridge-role \
  --policy-name eventbridge-ssm-automation

aws iam delete-role \
  --role-name neptune-3-eventbridge-role

SSM Automation ドキュメント削除

aws ssm delete-document \
  --name NeptuneSnapshotMakePrivate \
  --region ap-northeast-1

(出力なし)

参考

Amazonアソシエイトリンク