Skip to content
Start here

Create Cloud Integration

magic_cloud_networking.cloud_integrations.create(CloudIntegrationCreateParams**kwargs) -> CloudIntegrationCreateResponse
POST/accounts/{account_id}/magic/cloud/providers

Create a new Cloud Integration (Closed Beta).

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Magic WAN Write
ParametersExpand Collapse
account_id: str
cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"]
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
friendly_name: str
description: Optional[str]
forwarded: Optional[str]
ReturnsExpand Collapse
class CloudIntegrationCreateResponse:
id: str
formatuuid
cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"]
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
friendly_name: str
last_updated: str
lifecycle_state: Literal["ACTIVE", "PENDING_SETUP", "RETIRED"]
One of the following:
"ACTIVE"
"PENDING_SETUP"
"RETIRED"
state: Literal["UNSPECIFIED", "PENDING", "DISCOVERING", 2 more]
One of the following:
"UNSPECIFIED"
"PENDING"
"DISCOVERING"
"FAILED"
"SUCCEEDED"
state_v2: Literal["UNSPECIFIED", "PENDING", "DISCOVERING", 2 more]
One of the following:
"UNSPECIFIED"
"PENDING"
"DISCOVERING"
"FAILED"
"SUCCEEDED"
aws_arn: Optional[str]
azure_subscription_id: Optional[str]
azure_tenant_id: Optional[str]
description: Optional[str]
gcp_project_id: Optional[str]
gcp_service_account_email: Optional[str]
status: Optional[Status]
discovery_progress: StatusDiscoveryProgress
done: int
total: int
unit: str
discovery_progress_v2: StatusDiscoveryProgressV2
done: int
total: int
unit: str
last_discovery_status: Literal["UNSPECIFIED", "PENDING", "DISCOVERING", 2 more]
One of the following:
"UNSPECIFIED"
"PENDING"
"DISCOVERING"
"FAILED"
"SUCCEEDED"
last_discovery_status_v2: Literal["UNSPECIFIED", "PENDING", "DISCOVERING", 2 more]
One of the following:
"UNSPECIFIED"
"PENDING"
"DISCOVERING"
"FAILED"
"SUCCEEDED"
regions: List[str]
credentials_good_since: Optional[str]
credentials_missing_since: Optional[str]
credentials_rejected_since: Optional[str]
discovery_message: Optional[str]
discovery_message_v2: Optional[str]
in_use_by: Optional[List[StatusInUseBy]]
id: str
formatuuid
client_type: Literal["MAGIC_WAN_CLOUD_ONRAMP"]
name: str
last_discovery_completed_at: Optional[str]
last_discovery_completed_at_v2: Optional[str]
last_discovery_started_at: Optional[str]
last_discovery_started_at_v2: Optional[str]
last_updated: Optional[str]

Create Cloud Integration

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
cloud_integration = client.magic_cloud_networking.cloud_integrations.create(
    account_id="account_id",
    cloud_type="AWS",
    friendly_name="friendly_name",
)
print(cloud_integration.id)
{
  "errors": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "cloud_type": "AWS",
    "friendly_name": "friendly_name",
    "last_updated": "last_updated",
    "lifecycle_state": "ACTIVE",
    "state": "UNSPECIFIED",
    "state_v2": "UNSPECIFIED",
    "aws_arn": "aws_arn",
    "azure_subscription_id": "azure_subscription_id",
    "azure_tenant_id": "azure_tenant_id",
    "description": "description",
    "gcp_project_id": "gcp_project_id",
    "gcp_service_account_email": "gcp_service_account_email",
    "status": {
      "discovery_progress": {
        "done": 0,
        "total": 0,
        "unit": "unit"
      },
      "discovery_progress_v2": {
        "done": 0,
        "total": 0,
        "unit": "unit"
      },
      "last_discovery_status": "UNSPECIFIED",
      "last_discovery_status_v2": "UNSPECIFIED",
      "regions": [
        "string"
      ],
      "credentials_good_since": "credentials_good_since",
      "credentials_missing_since": "credentials_missing_since",
      "credentials_rejected_since": "credentials_rejected_since",
      "discovery_message": "discovery_message",
      "discovery_message_v2": "discovery_message_v2",
      "in_use_by": [
        {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "client_type": "MAGIC_WAN_CLOUD_ONRAMP",
          "name": "name"
        }
      ],
      "last_discovery_completed_at": "last_discovery_completed_at",
      "last_discovery_completed_at_v2": "last_discovery_completed_at_v2",
      "last_discovery_started_at": "last_discovery_started_at",
      "last_discovery_started_at_v2": "last_discovery_started_at_v2",
      "last_updated": "last_updated"
    }
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "cloud_type": "AWS",
    "friendly_name": "friendly_name",
    "last_updated": "last_updated",
    "lifecycle_state": "ACTIVE",
    "state": "UNSPECIFIED",
    "state_v2": "UNSPECIFIED",
    "aws_arn": "aws_arn",
    "azure_subscription_id": "azure_subscription_id",
    "azure_tenant_id": "azure_tenant_id",
    "description": "description",
    "gcp_project_id": "gcp_project_id",
    "gcp_service_account_email": "gcp_service_account_email",
    "status": {
      "discovery_progress": {
        "done": 0,
        "total": 0,
        "unit": "unit"
      },
      "discovery_progress_v2": {
        "done": 0,
        "total": 0,
        "unit": "unit"
      },
      "last_discovery_status": "UNSPECIFIED",
      "last_discovery_status_v2": "UNSPECIFIED",
      "regions": [
        "string"
      ],
      "credentials_good_since": "credentials_good_since",
      "credentials_missing_since": "credentials_missing_since",
      "credentials_rejected_since": "credentials_rejected_since",
      "discovery_message": "discovery_message",
      "discovery_message_v2": "discovery_message_v2",
      "in_use_by": [
        {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "client_type": "MAGIC_WAN_CLOUD_ONRAMP",
          "name": "name"
        }
      ],
      "last_discovery_completed_at": "last_discovery_completed_at",
      "last_discovery_completed_at_v2": "last_discovery_completed_at_v2",
      "last_discovery_started_at": "last_discovery_started_at",
      "last_discovery_started_at_v2": "last_discovery_started_at_v2",
      "last_updated": "last_updated"
    }
  },
  "success": true
}