

Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 [AWS](https://github.com/awsdocs/aws-doc-sdk-examples)

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# を使用した Security Lake の例 AWS CLI
<a name="cli_2_securitylake_code_examples"></a>

次のコード例は、Security Lake AWS Command Line Interface で を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています。

*アクション*はより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。

各例には完全なソースコードへのリンクが含まれており、コードの設定方法と実行方法に関する手順を確認できます。

**Topics**
+ [アクション](#actions)

## アクション
<a name="actions"></a>

### `create-aws-log-source`
<a name="securitylake_CreateAwsLogSource_cli_2_topic"></a>

次のコード例は、`create-aws-log-source` を使用する方法を示しています。

**AWS CLI**  
**ネイティブにサポートされている Amazon Web Service を Amazon Security Lake ソースとして追加するには**  
次の `create-aws-logsource` の例では、指定されたアカウントとリージョンに Security Lake ソースとして VPC フローログを追加します。  

```
aws securitylake create-aws-log-source \
    --sources '[{"regions": ["us-east-1"], "accounts": ["123456789012"], "sourceName": "SH_FINDINGS", "sourceVersion": "2.0"}]'
```
出力:  

```
{
    "failed": [
        "123456789012"
    ]
}
```
詳細については、*「Amazon Security Lake ユーザーガイド*[」の「ソースとしての AWS サービスの追加](https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html#add-internal-sources)」を参照してください。  
+  API の詳細については、*AWS CLI コマンドリファレンス*の「[CreateAwsLogSource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/create-aws-log-source.html)」を参照してください。

### `create-custom-log-source`
<a name="securitylake_CreateCustomLogSource_cli_2_topic"></a>

次のコード例は、`create-custom-log-source` を使用する方法を示しています。

**AWS CLI**  
**Amazon Security Lake ソースとしてカスタムソースを追加するには**  
次の `create-custom-logsource` の例では、指定されたログプロバイダーアカウントと指定されたリージョンに、Security Lake ソースとしてカスタムソースを追加します。  

```
aws securitylake create-custom-log-source \
    --source-name "VPC_FLOW" \
    --event-classes '["DNS_ACTIVITY", "NETWORK_ACTIVITY"]' \
    --configuration '{"crawlerConfiguration": {"roleArn": "arn:aws:glue:eu-west-2:123456789012:crawler/E1WG1ZNPRXT0D4"},"providerIdentity": {"principal": "029189416600","externalId": "123456789012"}}' --region "us-east-1"
```
出力:  

```
{
    "customLogSource": {
        "attributes": {
            "crawlerArn": "arn:aws:glue:eu-west-2:123456789012:crawler/E1WG1ZNPRXT0D4",
            "databaseArn": "arn:aws:glue:eu-west-2:123456789012:database/E1WG1ZNPRXT0D4",
            "tableArn": "arn:aws:glue:eu-west-2:123456789012:table/E1WG1ZNPRXT0D4"
        },
        "provider": {
            "location": "amzn-s3-demo-bucket--usw2-az1--x-s3",
            "roleArn": "arn:aws:iam::123456789012:role/AmazonSecurityLake-Provider-testCustom2-eu-west-2"
        },
        "sourceName": "testCustom2"
        "sourceVersion": "2.0"
    }
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[カスタムソースの追加](https://docs.aws.amazon.com/security-lake/latest/userguide/custom-sources.html#adding-custom-sources)」を参照してください。  
+  API の詳細については、*AWS CLI コマンドリファレンス*の「[CreateCustomLogSource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/create-custom-log-source.html)」を参照してください。

### `create-data-lake-exception-subscription`
<a name="securitylake_CreateDataLakeExceptionSubscription_cli_2_topic"></a>

次のコード例は、`create-data-lake-exception-subscription` を使用する方法を示しています。

**AWS CLI**  
**Security Lake の例外の通知を送信するには**  
次の `create-data-lake-exception-subscription` の例では、Security Lake の例外の通知を SMS 配信を介して指定されたアカウントに送信します。例外メッセージは、指定された期間保持されます。  

```
aws securitylake create-data-lake-exception-subscription \
    --notification-endpoint "123456789012" \
    --exception-time-to-live 30 \
    --subscription-protocol "sms"
```
このコマンドでは何も出力されません。  
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Amazon Security Lake のトラブルシューティング](https://docs.aws.amazon.com/security-lake/latest/userguide/security-lake-troubleshoot.html#securitylake-data-lake-troubleshoot)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CreateDataLakeExceptionSubscription](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/create-data-lake-exception-subscription.html)」を参照してください。

### `create-data-lake-organization-configuration`
<a name="securitylake_CreateDataLakeOrganizationConfiguration_cli_2_topic"></a>

次のコード例は、`create-data-lake-organization-configuration` を使用する方法を示しています。

**AWS CLI**  
**新しい組織アカウントで Security Lake を設定するには**  
次の `create-data-lake-organization-configuration` の例では、Security Lake を有効にし、指定されたソースイベントとログを新しい組織アカウントで収集します。  

```
aws securitylake create-data-lake-organization-configuration \
    --auto-enable-new-account '[{"region":"us-east-1","sources":[{"sourceName":"SH_FINDINGS","sourceVersion": "1.0"}]}]'
```
このコマンドでは何も出力されません。  
詳細については、*「Amazon Security Lake ユーザーガイド*」の[AWS 「Organizations で複数のアカウントを管理する](https://docs.aws.amazon.com/security-lake/latest/userguide/multi-account-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CreateDataLakeOrganizationConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/create-data-lake-organization-configuration.html)」を参照してください。

### `create-data-lake`
<a name="securitylake_CreateDataLake_cli_2_topic"></a>

次のコード例は、`create-data-lake` を使用する方法を示しています。

**AWS CLI**  
**例 1: 複数のリージョンでデータレイクを設定するには**  
次の`create-data-lake`例では、複数の AWS リージョンで Amazon Security Lake を有効にし、データレイクを設定します。  

```
aws securitylake create-data-lake \
    --configurations '[{"encryptionConfiguration": {"kmsKeyId":"S3_MANAGED_KEY"},"region":"us-east-1","lifecycleConfiguration": {"expiration":{"days":365},"transitions":[{"days":60,"storageClass":"ONEZONE_IA"}]}}, {"encryptionConfiguration": {"kmsKeyId":"S3_MANAGED_KEY"},"region":"us-east-2","lifecycleConfiguration": {"expiration":{"days":365},"transitions":[{"days":60,"storageClass":"ONEZONE_IA"}]}}]' \
    --meta-store-manager-role-arn "arn:aws:iam:us-east-1:123456789012:role/service-role/AmazonSecurityLakeMetaStoreManager"
```
出力:  

```
{
    "dataLakes": [
        {
            "createStatus": "COMPLETED",
            "dataLakeArn": "arn:aws:securitylake:us-east-1:522481757177:data-lake/default",
            "encryptionConfiguration": {
                "kmsKeyId": "S3_MANAGED_KEY"
            },
            "lifecycleConfiguration": {
                "expiration": {
                    "days": 365
                },
                "transitions": [
                    {
                        "days": 60,
                        "storageClass": "ONEZONE_IA"
                    }
                ]
            },
            "region": "us-east-1",
            "replicationConfiguration": {
                "regions": [
                    "ap-northeast-3"
                ],
                "roleArn": "arn:aws:securitylake:ap-northeast-3:522481757177:data-lake/default"
            },
            "s3BucketArn": "arn:aws:s3:::aws-security-data-lake-us-east-1-gnevt6s8z7bzby8oi3uiaysbr8v2ml",
            "updateStatus": {
                "exception": {},
                "requestId": "f20a6450-d24a-4f87-a6be-1d4c075a59c2",
                "status": "INITIALIZED"
            }
        },
        {
            "createStatus": "COMPLETED",
            "dataLakeArn": "arn:aws:securitylake:us-east-2:522481757177:data-lake/default",
            "encryptionConfiguration": {
                "kmsKeyId": "S3_MANAGED_KEY"
            },
            "lifecycleConfiguration": {
                "expiration": {
                    "days": 365
                },
                "transitions": [
                    {
                        "days": 60,
                        "storageClass": "ONEZONE_IA"
                    }
                ]
            },
            "region": "us-east-2",
            "replicationConfiguration": {
                "regions": [
                    "ap-northeast-3"
                ],
                "roleArn": "arn:aws:securitylake:ap-northeast-3:522481757177:data-lake/default"
            },
            "s3BucketArn": "arn:aws:s3:::aws-security-data-lake-us-east-2-cehuifzl5rwmhm6m62h7zhvtseogr9",
            "updateStatus": {
                "exception": {},
                "requestId": "f20a6450-d24a-4f87-a6be-1d4c075a59c2",
                "status": "INITIALIZED"
            }
        }
    ]
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Getting started with Amazon Security Lake](https://docs.aws.amazon.com/security-lake/latest/userguide/getting-started.html)」を参照してください。  
**例 2: 1 つのリージョンでデータレイクを設定するには**  
次の`create-data-lake`例では、単一の AWS リージョンで Amazon Security Lake を有効にし、データレイクを設定します。  

```
aws securitylake create-data-lake \
    --configurations '[{"encryptionConfiguration": {"kmsKeyId":"1234abcd-12ab-34cd-56ef-1234567890ab"},"region":"us-east-2","lifecycleConfiguration": {"expiration":{"days":500},"transitions":[{"days":30,"storageClass":"GLACIER"}]}}]' \
    --meta-store-manager-role-arn "arn:aws:iam:us-east-1:123456789012:role/service-role/AmazonSecurityLakeMetaStoreManager"
```
出力:  

```
{
    "dataLakes": [
        {
            "createStatus": "COMPLETED",
            "dataLakeArn": "arn:aws:securitylake:us-east-2:522481757177:data-lake/default",
            "encryptionConfiguration": {
                "kmsKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
            },
            "lifecycleConfiguration": {
                "expiration": {
                    "days": 500
                },
                "transitions": [
                    {
                        "days": 30,
                        "storageClass": "GLACIER"
                    }
                ]
            },
            "region": "us-east-2",
            "replicationConfiguration": {
                "regions": [
                    "ap-northeast-3"
                ],
                "roleArn": "arn:aws:securitylake:ap-northeast-3:522481757177:data-lake/default"
            },
            "s3BucketArn": "arn:aws:s3:::aws-security-data-lake-us-east-2-cehuifzl5rwmhm6m62h7zhvtseogr9",
            "updateStatus": {
                "exception": {},
                "requestId": "77702a53-dcbf-493e-b8ef-518e362f3003",
                "status": "INITIALIZED"
            }
        }
    ]
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[ Amazon Security Lake の使用開始](https://docs.aws.amazon.com/security-lake/latest/userguide/getting-started.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CreateDataLake](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/create-data-lake.html)」を参照してください。

### `create-subscriber-notification`
<a name="securitylake_CreateSubscriberNotification_cli_2_topic"></a>

次のコード例は、`create-subscriber-notification` を使用する方法を示しています。

**AWS CLI**  
**サブスクライバー通知を作成するには**  
次の `create-subscriber-notification` の例は、サブスクライバー通知を指定して、新しいデータがデータレイクに書き込まれたときに通知を作成する方法を示します。  

```
aws securitylake create-subscriber-notification \
    --subscriber-id "12345ab8-1a34-1c34-1bd4-12345ab9012" \
    --configuration '{"httpsNotificationConfiguration": {"targetRoleArn":"arn:aws:iam::XXX:role/service-role/RoleName", "endpoint":"https://account-management.$3.$2.securitylake.aws.dev/v1/datalake"}}'
```
出力:  

```
{
    "subscriberEndpoint": [
        "https://account-management.$3.$2.securitylake.aws.dev/v1/datalake"
    ]
}
```
詳細については、*「Amazon Security Lake ユーザーガイド*」の「[サブスクライバー管理](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CreateSubscriberNotification](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/create-subscriber-notification.html)」を参照してください。

### `create-subscriber`
<a name="securitylake_CreateSubscriber_cli_2_topic"></a>

次のコード例は、`create-subscriber` を使用する方法を示しています。

**AWS CLI**  
**例 1: データにアクセスできるサブスクライバーを作成するには**  
次の の`create-subscriber`例では、 AWS ソースの指定されたサブスクライバー ID の現在の AWS リージョンのデータにアクセスできる、Security Lake にサブスクライバーを作成します。  

```
aws securitylake create-subscriber \
    --access-types "S3" \
    --sources '[{"awsLogSource": {"sourceName": "VPC_FLOW","sourceVersion": "2.0"}}]' \
    --subscriber-name 'opensearch-s3' \
    --subscriber-identity '{"principal": "029189416600","externalId": "123456789012"}'
```
出力:  

```
{
    "subscriber": {
        "accessTypes": [
            "S3"
        ],
        "createdAt": "2024-07-17T19:08:26.787000+00:00",
        "roleArn": "arn:aws:iam::773172568199:role/AmazonSecurityLake-896f218b-cfba-40be-a255-8b49a65d0407",
        "s3BucketArn": "arn:aws:s3:::aws-security-data-lake-us-east-1-um632ufwpvxkyz0bc5hkb64atycnf3",
        "sources": [
            {
                "awsLogSource": {
                    "sourceName": "VPC_FLOW",
                    "sourceVersion": "2.0"
                }
            }
        ],
        "subscriberArn": "arn:aws:securitylake:us-east-1:773172568199:subscriber/896f218b-cfba-40be-a255-8b49a65d0407",
        "subscriberId": "896f218b-cfba-40be-a255-8b49a65d0407",
        "subscriberIdentity": {
            "externalId": "123456789012",
            "principal": "029189416600"
        },
        "subscriberName": "opensearch-s3",
        "subscriberStatus": "ACTIVE",
        "updatedAt": "2024-07-17T19:08:27.133000+00:00"
    }
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[データアクセス権を持つサブスクライバーの作成](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-data-access.html#create-subscriber-data-access)」を参照してください。  
**例 2: クエリにアクセスできるサブスクライバーを作成するには**  
次の の`create-subscriber`例では、Security Lake に、指定されたサブスクライバー ID の現在の AWS リージョンでクエリアクセスを持つサブスクライバーを作成します。  

```
aws securitylake create-subscriber \
    --access-types "LAKEFORMATION" \
    --sources '[{"awsLogSource": {"sourceName": "VPC_FLOW","sourceVersion": "2.0"}}]' \
    --subscriber-name 'opensearch-s3' \
    --subscriber-identity '{"principal": "029189416600","externalId": "123456789012"}'
```
出力:  

```
{
    "subscriber": {
        "accessTypes": [
            "LAKEFORMATION"
        ],
        "createdAt": "2024-07-18T01:05:55.853000+00:00",
        "resourceShareArn": "arn:aws:ram:us-east-1:123456789012:resource-share/8c31da49-c224-4f1e-bb12-37ab756d6d8a",
        "resourceShareName": "LakeFormation-V2-NAMENAMENA-123456789012",
        "sources": [
            {
                "awsLogSource": {
                    "sourceName": "VPC_FLOW",
                    "sourceVersion": "2.0"
                }
            }
        ],
        "subscriberArn": "arn:aws:securitylake:us-east-1:123456789012:subscriber/e762aabb-ce3d-4585-beab-63474597845d",
        "subscriberId": "e762aabb-ce3d-4585-beab-63474597845d",
        "subscriberIdentity": {
            "externalId": "123456789012",
            "principal": "029189416600"
        },
        "subscriberName": "opensearch-s3",
        "subscriberStatus": "ACTIVE",
        "updatedAt": "2024-07-18T01:05:58.393000+00:00"
    }
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[クエリアクセス権を持つサブスクライバーの作成](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-query-access.html#create-query-subscriber-procedures)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドレットリファレンス*」の「[CreateSubscriber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/create-subscriber.html)」を参照してください。

### `delete-aws-log-source`
<a name="securitylake_DeleteAwsLogSource_cli_2_topic"></a>

次の例は、`delete-aws-log-source` を使用する方法を説明しています。

**AWS CLI**  
**ネイティブにサポートされている AWS サービスを削除するには。**  
次の `delete-aws-logsource` の例では、指定されたアカウントとリージョンの Security Lake ソースとして VPC フローログを削除します。  

```
aws securitylake delete-aws-log-source \
    --sources '[{"regions": ["us-east-1"], "accounts": ["123456789012"], "sourceName": "SH_FINDINGS", "sourceVersion": "2.0"}]'
```
出力:  

```
{
    "failed": [
        "123456789012"
    ]
}
```
詳細については、*「Amazon Security Lake* [ユーザーガイド」の「ソースとしての AWS サービス](https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html#remove-internal-sources)の削除」を参照してください。  
+  API の詳細については、*AWS CLI コマンドリファレンス*の「[DeleteAwsLogSource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-aws-log-source.html)」を参照してください。

### `delete-custom-log-source`
<a name="securitylake_DeleteCustomLogSource_cli_2_topic"></a>

次のコード例は、`delete-custom-log-source` を使用する方法を示しています。

**AWS CLI**  
**カスタムソースを削除するには。**  
次の `delete-custom-logsource` の例では、指定されたリージョンの指定されたログプロバイダーアカウントのカスタムソースを削除します。  

```
aws securitylake delete-custom-log-source \
    --source-name "CustomSourceName"
```
このコマンドでは何も出力されません。  
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[カスタムソースの削除](https://docs.aws.amazon.com/security-lake/latest/userguide/custom-sources.html#delete-custom-source)」を参照してください。  
+  API の詳細については、*AWS CLI コマンドリファレンス*の「[DeleteCustomLogSource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-custom-log-source.html)」を参照してください。

### `delete-data-lake-organization-configuration`
<a name="securitylake_DeleteDataLakeOrganizationConfiguration_cli_2_topic"></a>

次のコード例は、`delete-data-lake-organization-configuration` を使用する方法を示しています。

**AWS CLI**  
**メンバーアカウントのソースの自動収集を停止するには**  
次の`delete-data-lake-organization-configuration`例では、組織に参加する新しいメンバーアカウントからの AWS Security Hub の検出結果の自動収集を停止します。このコマンドを実行できるのは、委任された Security Lake 管理者のみです。これにより、新しいメンバーアカウントからデータレイクにデータが自動的に提供されることがなくなります。  

```
aws securitylake delete-data-lake-organization-configuration \
    --auto-enable-new-account '[{"region":"us-east-1","sources":[{"sourceName":"SH_FINDINGS"}]}]'
```
このコマンドでは何も出力されません。  
詳細については、*「Amazon Security Lake ユーザーガイド*」の[AWS 「Organizations で複数のアカウントを管理する](https://docs.aws.amazon.com/securityhub/latest/userguide/multi-account-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteDataLakeOrganizationConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-data-lake-organization-configuration.html)」を参照してください。

### `delete-data-lake`
<a name="securitylake_DeleteDataLake_cli_2_topic"></a>

次のコード例は、`delete-data-lake` を使用する方法を示しています。

**AWS CLI**  
**データレイクを無効にするには**  
次の の`delete-data-lake`例では、指定された AWS リージョンでデータレイクを無効にします。指定されたリージョンでは、ソースはデータレイクにデータを提供しなくなります。 AWS Organizations を利用する Security Lake デプロイの場合、組織内のアカウントの Security Lake を無効にすることができるのは、組織の委任 Security Lake 管理者のみです。  

```
aws securitylake delete-data-lake \
    --regions "ap-northeast-1" "eu-central-1"
```
このコマンドでは何も出力されません。  
詳細については、「*Amazon Security Lake ユーザーガイド*の「[Disabling Amazon Security Lake](https://docs.aws.amazon.com/securityhub/latest/userguide/disable-security-lake.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteDataLake](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-data-lake.html)」を参照してください。

### `delete-subscriber-notification`
<a name="securitylake_DeleteSubscriberNotification_cli_2_topic"></a>

次のコード例は、`delete-subscriber-notification` を使用する方法を示しています。

**AWS CLI**  
**サブスクライバー通知を削除するには**  
次の `delete-subscriber-notification` の例は、特定の Security Lake サブスクライバーのサブスクライバー通知を削除する方法を示しています。  

```
aws securitylake delete-subscriber-notification \
    --subscriber-id "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
```
このコマンドでは何も出力されません。  
詳細については、*「Amazon Security Lake ユーザーガイド*」の「[サブスクライバー管理](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteSubscriberNotification](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-subscriber-notification.html)」を参照してください。

### `delete-subscriber`
<a name="securitylake_DeleteSubscriber_cli_2_topic"></a>

次のコード例は、`delete-subscriber` を使用する方法を示しています。

**AWS CLI**  
**サブスクライバーを削除するには**  
次の `delete-subscriber` の例は、Security Lake からのデータをサブスクライバーに使用させたくない場合に、サブスクライバーを削除する方法を示します。  

```
aws securitylake delete-subscriber \
    --subscriber-id "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
```
このコマンドでは何も出力されません。  
詳細については、*「Amazon Security Lake ユーザーガイド*」の「[サブスクライバー管理](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteSubscriber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-subscriber.html)」を参照してください。

### `get-data-lake-exception-subscription`
<a name="securitylake_GetDataLakeExceptionSubscription_cli_2_topic"></a>

次のコード例は、`get-data-lake-exception-subscription` を使用する方法を示しています。

**AWS CLI**  
**例外サブスクリプションの詳細を取得するには**  
次の `get-data-lake-exception-subscription` の例は、Security Lake 例外サブスクリプションの詳細情報を示しています。この例では、指定された AWS アカウントのユーザーに SMS 配信を通じてエラーが通知されます。例外メッセージは、指定された期間、アカウント内に残ります。例外サブスクリプションは、リクエスタの優先プロトコルを通じて、Security Lake ユーザーにエラーを通知します。  

```
aws securitylake get-data-lake-exception-subscription
```
出力:  

```
{
    "exceptionTimeToLive": 30,
    "notificationEndpoint": "123456789012",
    "subscriptionProtocol": "sms"
}
```
詳細については、*「Amazon Security Lake ユーザーガイド*」の「[Troubleshooting data lake status](https://docs.aws.amazon.com/securityhub/latest/userguide/security-lake-troubleshoot.html#securitylake-data-lake-troubleshoot)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetDataLakeExceptionSubscription](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/get-data-lake-exception-subscription.html)」を参照してください。

### `get-data-lake-organization-configuration`
<a name="securitylake_GetDataLakeOrganizationConfiguration_cli_2_topic"></a>

次のコード例は、`get-data-lake-organization-configuration` を使用する方法を示しています。

**AWS CLI**  
**新しい組織アカウントの設定の詳細を取得するには**  
次の `get-data-lake-organization-configuration` の例では、Amazon Security Lake へのオンボーディング後に新しい組織アカウントが送信するソースログの詳細情報を取得します。  

```
aws securitylake get-data-lake-organization-configuration
```
出力:  

```
{
    "autoEnableNewAccount": [
        {
            "region": "us-east-1",
            "sources": [
                {
                    "sourceName": "VPC_FLOW",
                    "sourceVersion": "1.0"
                },
                {
                    "sourceName": "ROUTE53",
                    "sourceVersion": "1.0"
                },
                {
                    "sourceName": "SH_FINDINGS",
                    "sourceVersion": "1.0"
                }
            ]
        }
    ]
}
```
詳細については、*「Amazon Security Lake ユーザーガイド*」の[AWS 「Organizations で複数のアカウントを管理する](https://docs.aws.amazon.com/security-lake/latest/userguide/multi-account-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetDataLakeOrganizationConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/get-data-lake-organization-configuration.html)」を参照してください。

### `get-data-lake-sources`
<a name="securitylake_GetDataLakeSources_cli_2_topic"></a>

次のコード例は、`get-data-lake-sources` を使用する方法を示しています。

**AWS CLI**  
**ログ収集のステータスを取得するには**  
次の の`get-data-lake-sources`例では、現在の AWS リージョンで指定されたアカウントのログコレクションのスナップショットを取得します。アカウントでは Amazon Security Lake が有効になっています。  

```
aws securitylake get-data-lake-sources \
    --accounts "123456789012"
```
出力:  

```
{
    "dataLakeSources": [
        {
            "account": "123456789012",
            "sourceName": "SH_FINDINGS",
            "sourceStatuses": [
                {
                    "resource": "vpc-1234567890abcdef0",
                    "status": "COLLECTING"
                }
            ]
        },
        {
            "account": "123456789012",
            "sourceName": "VPC_FLOW",
            "sourceStatuses": [
                {
                    "resource": "vpc-1234567890abcdef0",
                    "status": "NOT_COLLECTING"
                }
            ]
        },
        {
            "account": "123456789012",
            "sourceName": "LAMBDA_EXECUTION",
            "sourceStatuses": [
                {
                    "resource": "vpc-1234567890abcdef0",
                    "status": "COLLECTING"
                }
            ]
        },
        {
            "account": "123456789012",
            "sourceName": "ROUTE53",
            "sourceStatuses": [
                {
                    "resource": "vpc-1234567890abcdef0",
                    "status": "COLLECTING"
                }
            ]
        },
        {
            "account": "123456789012",
            "sourceName": "CLOUD_TRAIL_MGMT",
            "sourceStatuses": [
                {
                    "resource": "vpc-1234567890abcdef0",
                    "status": "COLLECTING"
                }
            ]
        }
    ],
    "dataLakeArn": null
}
```
詳細については、*「Amazon Security Lake* [ユーザーガイド」の「 AWS のサービスからのデータ収集](https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetDataLakeSources](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/get-data-lake-sources.html)」を参照してください。

### `get-subscriber`
<a name="securitylake_GetSubscriber_cli_2_topic"></a>

次のコード例は、`get-subscriber` を使用する方法を示しています。

**AWS CLI**  
**サブスクリプション情報を取得するには**  
次の `get-subscriber` の例では、指定された Securiy Lake サブスクライバーのサブスクリプション情報を取得します。  

```
aws securitylake get-subscriber \
    --subscriber-id a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
```
出力:  

```
{
    "subscriber": {
        "accessTypes": [
            "LAKEFORMATION"
        ],
        "createdAt": "2024-04-19T15:19:44.421803+00:00",
        "resourceShareArn": "arn:aws:ram:eu-west-2:123456789012:resource-share/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "resourceShareName": "LakeFormation-V3-TKJGBHCKTZ-123456789012",
        "sources": [
            {
                "awsLogSource": {
                    "sourceName": "LAMBDA_EXECUTION",
                    "sourceVersion": "1.0"
                }
            },
            {
                "awsLogSource": {
                    "sourceName": "EKS_AUDIT",
                    "sourceVersion": "2.0"
                }
            },
            {
                "awsLogSource": {
                    "sourceName": "ROUTE53",
                    "sourceVersion": "1.0"
                }
            },
            {
                "awsLogSource": {
                    "sourceName": "SH_FINDINGS",
                    "sourceVersion": "1.0"
                }
            },
            {
                "awsLogSource": {
                    "sourceName": "VPC_FLOW",
                    "sourceVersion": "1.0"
                }
            },
            {
                "customLogSource": {
                    "attributes": {
                        "crawlerArn": "arn:aws:glue:eu-west-2:123456789012:crawler/testCustom2",
                        "databaseArn": "arn:aws:glue:eu-west-2:123456789012:database/amazon_security_lake_glue_db_eu_west_2",
                        "tableArn": "arn:aws:glue:eu-west-2:123456789012:table/amazon_security_lake_table_eu_west_2_ext_testcustom2"
                    },
                    "provider": {
                        "location": "s3://aws-security-data-lake-eu-west-2-8ugsus4ztnsfpjbldwbgf4vge98av9/ext/testCustom2/",
                        "roleArn": "arn:aws:iam::123456789012:role/AmazonSecurityLake-Provider-testCustom2-eu-west-2"
                    },
                    "sourceName": "testCustom2"
                }
            },
            {
                "customLogSource": {
                    "attributes": {
                        "crawlerArn": "arn:aws:glue:eu-west-2:123456789012:crawler/TestCustom",
                        "databaseArn": "arn:aws:glue:eu-west-2:123456789012:database/amazon_security_lake_glue_db_eu_west_2",
                        "tableArn": "arn:aws:glue:eu-west-2:123456789012:table/amazon_security_lake_table_eu_west_2_ext_testcustom"
                    },
                    "provider": {
                        "location": "s3://aws-security-data-lake-eu-west-2-8ugsus4ztnsfpjbldwbgf4vge98av9/ext/TestCustom/",
                        "roleArn": "arn:aws:iam::123456789012:role/AmazonSecurityLake-Provider-TestCustom-eu-west-2"
                    },
                    "sourceName": "TestCustom"
                }
            }
        ],
        "subscriberArn": "arn:aws:securitylake:eu-west-2:123456789012:subscriber/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "subscriberId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "subscriberIdentity": {
            "externalId": "123456789012",
            "principal": "123456789012"
        },
        "subscriberName": "test",
        "subscriberStatus": "ACTIVE",
        "updatedAt": "2024-04-19T15:19:55.230588+00:00"
    }
}
```
詳細については、*「Amazon Security Lake ユーザーガイド*」の「[サブスクライバー管理](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetSubscriber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/get-subscriber.html)」を参照してください。

### `list-data-lake-exceptions`
<a name="securitylake_ListDataLakeExceptions_cli_2_topic"></a>

次のコード例は、`list-data-lake-exceptions` を使用する方法を示しています。

**AWS CLI**  
**データレイクに影響する問題を一覧表示するには**  
次の の`list-data-lake-exceptions`例では、指定された AWS リージョンで過去 14 日間にデータレイクに影響を与えている問題を一覧表示します。  

```
aws securitylake list-data-lake-exceptions \
    --regions "us-east-1" "eu-west-3"
```
出力:  

```
{
    "exceptions": [
        {
            "exception": "The account does not have the required role permissions. Update your role permissions to use the new data source version.",
            "region": "us-east-1",
            "timestamp": "2024-02-29T12:24:15.641725+00:00"
        },
        {
            "exception": "The account does not have the required role permissions. Update your role permissions to use the new data source version.",
            "region": "eu-west-3",
            "timestamp": "2024-02-29T12:24:15.641725+00:00"
        }
    ]
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Amazon Security Lake のトラブルシューティング](https://docs.aws.amazon.com/security-lake/latest/userguide/security-lake-troubleshoot.html#securitylake-data-lake-troubleshoot)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListDataLakeExceptions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/list-data-lake-exceptions.html)」を参照してください。

### `list-data-lakes`
<a name="securitylake_ListDataLakes_cli_2_topic"></a>

次のコード例は、`list-data-lakes` を使用する方法を示しています。

**AWS CLI**  
**Security Lake 設定オブジェクトを一覧表示するには**  
次の の`list-data-lakes`例では、指定された AWS リージョンの Amazon Security Lake 設定オブジェクトを一覧表示します。このコマンドを使用して、指定されたリージョンで Security Lake が有効になっているかどうかを判断できます。  

```
aws securitylake list-data-lakes \
    --regions "us-east-1"
```
出力:  

```
{
    "dataLakes": [
        {
            "createStatus": "COMPLETED",
            "dataLakeArn": "arn:aws:securitylake:us-east-1:123456789012:data-lake/default",
            "encryptionConfiguration": {
                "kmsKeyId": "S3_MANAGED_KEY"
            },
            "lifecycleConfiguration": {
                "expiration": {
                    "days": 365
                },
                "transitions": [
                    {
                        "days": 60,
                        "storageClass": "ONEZONE_IA"
                    }
                ]
            },
            "region": "us-east-1",
            "replicationConfiguration": {
                "regions": [
                    "ap-northeast-3"
                ],
                "roleArn": "arn:aws:securitylake:ap-northeast-3:123456789012:data-lake/default"
            },
            "s3BucketArn": "arn:aws:s3:::aws-security-data-lake-us-east-1-1234567890abcdef0",
            "updateStatus": {
                "exception": {
                    "code": "software.amazon.awssdk.services.s3.model.S3Exception",
                    "reason": ""
                },
                "requestId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
                "status": "FAILED"
            }
        }
    ]
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[リージョンステータスの確認](https://docs.aws.amazon.com/security-lake/latest/userguide/manage-regions.html#check-region-status)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListDataLakes](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/list-data-lakes.html)」を参照してください。

### `list-log-sources`
<a name="securitylake_ListLogSources_cli_2_topic"></a>

次のコード例は、`list-log-sources` を使用する方法を示しています。

**AWS CLI**  
**Amazon Security Lake ログソースを取得するには**  
次の `list-log-sources` の例では、指定されたアカウントの Amazon Security Lake ログソースを一覧表示します。  

```
aws securitylake list-log-sources \
    --accounts "123456789012"
```
出力:  

```
{
    "account": "123456789012",
    "region": "xy-region-1",
    "sources": [
        {
               "awsLogSource": {
                "sourceName": "VPC_FLOW",
                "sourceVersion": "2.0"
            }
        },
        {
            "awsLogSource": {
                "sourceName": "SH_FINDINGS",
                "sourceVersion": "2.0"
            }
        }
    ]
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Source management in Security Lake](https://docs.aws.amazon.com/security-lake/latest/userguide/source-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListLogSources](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/list-log-sources.html)」を参照してください。

### `list-subscribers`
<a name="securitylake_ListSubscribers_cli_2_topic"></a>

次のコード例は、`list-subscribers` を使用する方法を示しています。

**AWS CLI**  
**Amazon Security Lake サブスクライバーを取得するには**  
次の `list-subscribers` の例では、特定のアカウントのすべての Amazon Security Lake サブスクライバーを一覧表示します。  

```
aws securitylake list-subscribers
```
出力:  

```
{
    "subscribers": [
        {
            "accessTypes": [
                "S3"
            ],
            "createdAt": "2024-06-04T15:02:28.921000+00:00",
            "roleArn": "arn:aws:iam::123456789012:role/AmazonSecurityLake-E1WG1ZNPRXT0D4",
            "s3BucketArn": "amzn-s3-demo-bucket--usw2-az1--x-s3",
            "sources": [
                {
                    "awsLogSource": {
                        "sourceName": "CLOUD_TRAIL_MGMT",
                        "sourceVersion": "2.0"
                    }
                },
                {
                    "awsLogSource": {
                        "sourceName": "LAMBDA_EXECUTION",
                        "sourceVersion": "1.0"
                    }
                },
                {
                    "customLogSource": {
                        "attributes": {
                            "crawlerArn": "arn:aws:glue:eu-west-2:123456789012:crawler/E1WG1ZNPRXT0D4",
                            "databaseArn": "arn:aws:glue:eu-west-2:123456789012:database/E1WG1ZNPRXT0D4",
                            "tableArn": "arn:aws:glue:eu-west-2:123456789012:table/E1WG1ZNPRXT0D4"
                        },
                        "provider": {
                            "location": "amzn-s3-demo-bucket--usw2-az1--x-s3",
                            "roleArn": "arn:aws:iam::123456789012:role/AmazonSecurityLake-E1WG1ZNPRXT0D4"
                        },
                        "sourceName": "testCustom2"
                    }
                }
            ],
            "subscriberArn": "arn:aws:securitylake:eu-west-2:123456789012:subscriber/E1WG1ZNPRXT0D4",
            "subscriberEndpoint": "arn:aws:sqs:eu-west-2:123456789012:AmazonSecurityLake-a1b2c3d4-5678-90ab-cdef-EXAMPLE11111-Main-Queue",
            "subscriberId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
            "subscriberIdentity": {
                "externalId": "ext123456789012",
                "principal": "123456789012"
            },
            "subscriberName": "Test",
            "subscriberStatus": "ACTIVE",
            "updatedAt": "2024-06-04T15:02:35.617000+00:00"
        }
    ]
}
```
詳細については、*「Amazon Security Lake ユーザーガイド*」の「[サブスクライバー管理](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListSubscribers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/list-subscribers.html)」を参照してください。

### `list-tags-for-resource`
<a name="securitylake_ListTagsForResource_cli_2_topic"></a>

次のコード例は、`list-tags-for-resource` を使用する方法を示しています。

**AWS CLI**  
**既存のリソースのタグを一覧表示するには**  
次の `list-tags-for-resource` の例では、指定された Amazon Security Lake サブスクライバーのタグを一覧表示します。この例で、所有者タグキーに関連するタグ値はありません。このオペレーションを使用して、他の既存の Security Lake リソースのタグを一覧表示することもできます。  

```
aws securitylake list-tags-for-resource \
    --resource-arn "arn:aws:securitylake:us-east-1:123456789012:subscriber/1234abcd-12ab-34cd-56ef-1234567890ab"
```
出力:  

```
{
    "tags": [
        {
            "key": "Environment",
            "value": "Cloud"
        },
        {
            "key": "CostCenter",
            "value": "12345"
        },
        {
            "key": "Owner",
            "value": ""
        }
    ]
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Tagging Security Lake resources](https://docs.aws.amazon.com/security-lake/latest/userguide/tagging-resources.html#tags-retrieve)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/list-tags-for-resource.html)」を参照してください。

### `register-data-lake-delegated-administrator`
<a name="securitylake_RegisterDataLakeDelegatedAdministrator_cli_2_topic"></a>

次のコード例は、`register-data-lake-delegated-administrator` を使用する方法を示しています。

**AWS CLI**  
**委任された管理者を指定するには**  
次の の`register-data-lake-delegated-administrator`例では、指定された AWS アカウントを委任 Amazon Security Lake 管理者として指定します。  

```
aws securitylake register-data-lake-delegated-administrator \
    --account-id 123456789012
```
このコマンドでは何も出力されません。  
詳細については、*「Amazon Security Lake ユーザーガイド*」の[AWS 「Organizations で複数のアカウントを管理する](https://docs.aws.amazon.com/security-lake/latest/userguide/multi-account-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス」の「[RegisterDataLakeDelegatedAdministrator](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/register-data-lake-delegated-administrator.html)*」を参照してください。

### `tag-resource`
<a name="securitylake_TagResource_cli_2_topic"></a>

次のコード例は、`tag-resource` を使用する方法を示しています。

**AWS CLI**  
**既存のリソースにタグを追加するには**  
次の`tag-resource`例では、既存のサブスクライバーリソースにタグを追加します。新しいリソースを作成して 1 つ以上のタグを追加する場合に、このオペレーションを使用しないでください。代わりに、作成するリソースのタイプに適した作成オペレーションを使用します。  

```
aws securitylake tag-resource \
    --resource-arn "arn:aws:securitylake:us-east-1:123456789012:subscriber/1234abcd-12ab-34cd-56ef-1234567890ab" \
    --tags key=Environment,value=Cloud
```
このコマンドでは何も出力されません。  
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Tagging Security Lake resources](https://docs.aws.amazon.com/security-lake/latest/userguide/tagging-resources.html#tags-retrieve)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/tag-resource.html)」を参照してください。

### `untag-resource`
<a name="securitylake_UntagResource_cli_2_topic"></a>

次のコード例は、`untag-resource` を使用する方法を示しています。

**AWS CLI**  
**既存のリソースからタグを削除するには**  
次の`untag-resource`例では、既存のサブスクライバーリソースから指定されたタグを削除します。  

```
aws securitylake untag-resource \
    --resource-arn "arn:aws:securitylake:us-east-1:123456789012:subscriber/1234abcd-12ab-34cd-56ef-1234567890ab" \
    --tags Environment Owner
```
このコマンドでは何も出力されません。  
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Tagging Security Lake resources](https://docs.aws.amazon.com/security-lake/latest/userguide/tagging-resources.html#tags-retrieve)」を参照してください。  
+  API の詳細については、「AWS CLI コマンドリファレンス」の「[UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/untag-resource.html)」を参照してください。

### `update-data-lake-exception-subscription`
<a name="securitylake_UpdateDataLakeExceptionSubscription_cli_2_topic"></a>

次のコード例は、`update-data-lake-exception-subscription` を使用する方法を示しています。

**AWS CLI**  
**Security Lake の例外の通知サブスクリプションを更新するには**  
次の `update-data-lake-exception-subscription` の例では、Security Lake の例外をユーザーに通知する通知サブスクリプションを更新します。  

```
aws securitylake update-data-lake-exception-subscription \
    --notification-endpoint "123456789012" \
    --exception-time-to-live 30 \
    --subscription-protocol "email"
```
このコマンドでは何も出力されません。  
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Amazon Security Lake のトラブルシューティング](https://docs.aws.amazon.com/security-lake/latest/userguide/security-lake-troubleshoot.html#securitylake-data-lake-troubleshoot)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateDataLakeExceptionSubscription](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/update-data-lake-exception-subscription.html)」を参照してください。

### `update-data-lake`
<a name="securitylake_UpdateDataLake_cli_2_topic"></a>

次のコード例は、`update-data-lake` を使用する方法を示しています。

**AWS CLI**  
**例 1: データレイク設定を更新するには**  
次の `update-data-lake` の例では、Amazon Security Lake データレイクの設定を更新します。このオペレーションを使用して、データ暗号化、ストレージ、ロールアップリージョンの設定を指定できます。  

```
aws securitylake update-data-lake \
    --configurations '[{"encryptionConfiguration": {"kmsKeyId":"S3_MANAGED_KEY"},"region":"us-east-1","lifecycleConfiguration": {"expiration":{"days":365},"transitions":[{"days":60,"storageClass":"ONEZONE_IA"}]}}, {"encryptionConfiguration": {"kmsKeyId":"S3_MANAGED_KEY"},"region":"us-east-2","lifecycleConfiguration": {"expiration":{"days":365},"transitions":[{"days":60,"storageClass":"ONEZONE_IA"}]}}]' \
    --meta-store-manager-role-arn "arn:aws:iam:us-east-1:123456789012:role/service-role/AmazonSecurityLakeMetaStoreManager"
```
出力:  

```
{
    "dataLakes": [
        {
            "createStatus": "COMPLETED",
            "dataLakeArn": "arn:aws:securitylake:us-east-1:522481757177:data-lake/default",
            "encryptionConfiguration": {
                "kmsKeyId": "S3_MANAGED_KEY"
            },
            "lifecycleConfiguration": {
                "expiration": {
                    "days": 365
                },
                "transitions": [
                    {
                        "days": 60,
                        "storageClass": "ONEZONE_IA"
                    }
                ]
            },
            "region": "us-east-1",
            "replicationConfiguration": {
                "regions": [
                    "ap-northeast-3"
                ],
                "roleArn": "arn:aws:securitylake:ap-northeast-3:522481757177:data-lake/default"
            },
            "s3BucketArn": "arn:aws:s3:::aws-security-data-lake-us-east-1-gnevt6s8z7bzby8oi3uiaysbr8v2ml",
            "updateStatus": {
                "exception": {},
                "requestId": "f20a6450-d24a-4f87-a6be-1d4c075a59c2",
                "status": "INITIALIZED"
            }
        },
        {
            "createStatus": "COMPLETED",
            "dataLakeArn": "arn:aws:securitylake:us-east-2:522481757177:data-lake/default",
            "encryptionConfiguration": {
                "kmsKeyId": "S3_MANAGED_KEY"
            },
            "lifecycleConfiguration": {
                "expiration": {
                    "days": 365
                },
                "transitions": [
                    {
                        "days": 60,
                        "storageClass": "ONEZONE_IA"
                    }
                ]
            },
            "region": "us-east-2",
            "replicationConfiguration": {
                "regions": [
                    "ap-northeast-3"
                ],
                "roleArn": "arn:aws:securitylake:ap-northeast-3:522481757177:data-lake/default"
            },
            "s3BucketArn": "arn:aws:s3:::aws-security-data-lake-us-east-2-cehuifzl5rwmhm6m62h7zhvtseogr9",
            "updateStatus": {
                "exception": {},
                "requestId": "f20a6450-d24a-4f87-a6be-1d4c075a59c2",
                "status": "INITIALIZED"
            }
        }
    ]
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Getting started with Amazon Security Lake](https://docs.aws.amazon.com/security-lake/latest/userguide/getting-started.html)」を参照してください。  
**例 2: 1 つのリージョンでデータレイクを設定するには**  
次の`create-data-lake`例では、単一の AWS リージョンで Amazon Security Lake を有効にし、データレイクを設定します。  

```
aws securitylake create-data-lake \
    --configurations '[{"encryptionConfiguration": {"kmsKeyId":"1234abcd-12ab-34cd-56ef-1234567890ab"},"region":"us-east-2","lifecycleConfiguration": {"expiration":{"days":500},"transitions":[{"days":30,"storageClass":"GLACIER"}]}}]' \
    --meta-store-manager-role-arn "arn:aws:iam:us-east-1:123456789012:role/service-role/AmazonSecurityLakeMetaStoreManager"
```
出力:  

```
{
    "dataLakes": [
        {
            "createStatus": "COMPLETED",
            "dataLakeArn": "arn:aws:securitylake:us-east-2:522481757177:data-lake/default",
            "encryptionConfiguration": {
                "kmsKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
            },
            "lifecycleConfiguration": {
                "expiration": {
                    "days": 500
                },
                "transitions": [
                    {
                        "days": 30,
                        "storageClass": "GLACIER"
                    }
                ]
            },
            "region": "us-east-2",
            "replicationConfiguration": {
                "regions": [
                    "ap-northeast-3"
                ],
                "roleArn": "arn:aws:securitylake:ap-northeast-3:522481757177:data-lake/default"
            },
            "s3BucketArn": "arn:aws:s3:::aws-security-data-lake-us-east-2-cehuifzl5rwmhm6m62h7zhvtseogr9",
            "updateStatus": {
                "exception": {},
                "requestId": "77702a53-dcbf-493e-b8ef-518e362f3003",
                "status": "INITIALIZED"
            }
        }
    ]
}
```
詳細については、「*Amazon Security Lake ユーザーガイド*」の「[Getting started with Amazon Security Lake](https://docs.aws.amazon.com/security-lake/latest/userguide/getting-started.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateDataLake](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/update-data-lake.html)」を参照してください。

### `update-subscriber-notification`
<a name="securitylake_UpdateSubscriberNotification_cli_2_topic"></a>

次のコード例は、`update-subscriber-notification` を使用する方法を示しています。

**AWS CLI**  
**サブスクライバー通知を更新するには**  
次の `update-subscriber-notification` の例では、サブスクライバーの通知方法を更新する方法を示しています。  

```
aws securitylake update-subscriber-notification \
    --subscriber-id "12345ab8-1a34-1c34-1bd4-12345ab9012" \
    --configuration '{"httpsNotificationConfiguration": {"targetRoleArn":"arn:aws:iam::XXX:role/service-role/RoleName", "endpoint":"https://account-management.$3.$2.securitylake.aws.dev/v1/datalake"}}'
```
出力:  

```
{
    "subscriberEndpoint": [
        "https://account-management.$3.$2.securitylake.aws.dev/v1/datalake"
    ]
}
```
詳細については、*「Amazon Security Lake ユーザーガイド*」の「[サブスクライバー管理](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateSubscriberNotification](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/update-subscriber-notification.html)」を参照してください。

### `update-subscriber`
<a name="securitylake_UpdateSubscriber_cli_2_topic"></a>

次のコード例は、`update-subscriber` を使用する方法を示しています。

**AWS CLI**  
**Amazon Security Lake サブスクライバーを更新するには。**  
次の `update-subscriber` の例では、特定の Security Lake サブスクライバーのセキュリティレイクデータソースを更新します。  

```
aws securitylake update-subscriber \
    --subscriber-id a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
```
出力:  

```
{
    "subscriber": {
        "accessTypes": [
            "LAKEFORMATION"
        ],
        "createdAt": "2024-04-19T15:19:44.421803+00:00",
        "resourceShareArn": "arn:aws:ram:eu-west-2:123456789012:resource-share/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "resourceShareName": "LakeFormation-V3-TKJGBHCKTZ-123456789012",
        "sources": [
            {
                "awsLogSource": {
                    "sourceName": "LAMBDA_EXECUTION",
                    "sourceVersion": "1.0"
                }
            },
            {
                "awsLogSource": {
                    "sourceName": "EKS_AUDIT",
                    "sourceVersion": "2.0"
                }
            },
            {
                "awsLogSource": {
                    "sourceName": "ROUTE53",
                    "sourceVersion": "1.0"
                }
            },
            {
                "awsLogSource": {
                    "sourceName": "SH_FINDINGS",
                    "sourceVersion": "1.0"
                }
            },
            {
                "awsLogSource": {
                    "sourceName": "VPC_FLOW",
                    "sourceVersion": "1.0"
                }
            },
            {
                "customLogSource": {
                    "attributes": {
                        "crawlerArn": "arn:aws:glue:eu-west-2:123456789012:crawler/E1WG1ZNPRXT0D4",
                        "databaseArn": "arn:aws:glue:eu-west-2:123456789012:database/E1WG1ZNPRXT0D4",
                        "tableArn": "arn:aws:glue:eu-west-2:123456789012:table/E1WG1ZNPRXT0D4"
                    },
                    "provider": {
                        "location": "amzn-s3-demo-bucket--usw2-az1--x-s3",
                        "roleArn": "arn:aws:iam::123456789012:role/AmazonSecurityLake-E1WG1ZNPRXT0D4"
                    },
                    "sourceName": "testCustom2"
                }
            }
        ],
        "subscriberArn": "arn:aws:securitylake:eu-west-2:123456789012:subscriber/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "subscriberId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "subscriberIdentity": {
            "externalId": "123456789012",
            "principal": "123456789012"
        },
        "subscriberName": "test",
        "subscriberStatus": "ACTIVE",
        "updatedAt": "2024-07-18T20:47:37.098000+00:00"
    }
}
```
詳細については、*「Amazon Security Lake ユーザーガイド*」の「[サブスクライバー管理](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateSubscriber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/update-subscriber.html)」を参照してください。