For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ja/api/latest/storage-management/enable-storage-management-for-a-bucket.md. A documentation index is available at /llms.txt.
Language
Datadog site

Enable Storage Management for a bucket

PUThttps://api.datadoghq.com/api/v2/cloudinventoryservice/syncconfigshttps://api.us3.datadoghq.com/api/v2/cloudinventoryservice/syncconfigshttps://api.us5.datadoghq.com/api/v2/cloudinventoryservice/syncconfigshttps://api.datadoghq.eu/api/v2/cloudinventoryservice/syncconfigshttps://api.ap1.datadoghq.com/api/v2/cloudinventoryservice/syncconfigshttps://api.ap2.datadoghq.com/api/v2/cloudinventoryservice/syncconfigshttps://api.uk1.datadoghq.com/api/v2/cloudinventoryservice/syncconfigshttps://api.ddog-gov.com/api/v2/cloudinventoryservice/syncconfigshttps://api.us2.ddog-gov.com/api/v2/cloudinventoryservice/syncconfigs

概要

Enable Storage Management for an S3 bucket, GCS bucket, or Azure container by registering the destination that holds its inventory reports. Set data.id to the cloud provider (aws, gcp, or azure) and provide the matching settings under data.attributes. Calling this endpoint with the same provider replaces the existing configuration.

This endpoint requires the aws_configurations_manage permission.

リクエスト

Body Data (required)

フィールド
タイプ
説明
data [required]
object

Storage Management configuration data for the create or update request.

応答

OK

Storage Management configuration returned after a create or update. Additional read-only fields appear on list and get responses.

フィールド
タイプ
説明
data [required]
object

Storage Management configuration data.

コード例

Enable Storage Management for a bucket
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "aws": {
        "aws_account_id": "123456789012",
        "destination_bucket_name": "my-inventory-bucket",
        "destination_bucket_region": "us-east-1",
        "destination_prefix": "logs/"
      }
    },
    "id": "aws",
    "type": "cloud_provider"
  }
}
EOF