For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/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

Descripción general

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.

Solicitud

Body Data (required)

Campo
Type
Descripción
data [required]
object

Storage Management configuration data for the create or update request.

Respuesta

OK

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

Campo
Type
Descripción
data [required]
object

Storage Management configuration data.

Ejemplo de código

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