CloudIntegration
Source:
src/Cloudflare/MagicCloudNetworking/CloudIntegration.ts
A Magic Cloud Networking cloud integration — registers an AWS, Azure, or GCP account with Cloudflare so Magic Cloud Networking can discover its networking resources (VPCs, subnets, gateways, …).
Creating an integration returns provider-side setup data; credential
wiring (awsArn, azureSubscriptionId/azureTenantId,
gcpProjectId/gcpServiceAccountEmail) is applied in place. Only
cloudType forces a replacement.
Magic Cloud Networking is an entitlement-gated add-on (Magic WAN family).
On accounts without the entitlement every API call fails with the typed
FeatureNotEnabled error (Cloudflare code 1012, “feature not enabled”).
Creating an integration
Section titled “Creating an integration”Register an AWS account
const aws = yield* Cloudflare.CloudIntegration("Discovery", { cloudType: "AWS", description: "production AWS account",});// aws.lifecycleState === "PENDING_SETUP" until credentials are wiredWire credentials after creating the IAM role
yield* Cloudflare.CloudIntegration("Discovery", { cloudType: "AWS", awsArn: "arn:aws:iam::123456789012:role/cloudflare-mcn-discovery",});yield* Cloudflare.CloudIntegration("GcpDiscovery", { cloudType: "GOOGLE", gcpProjectId: "my-project", gcpServiceAccountEmail: "mcn@my-project.iam.gserviceaccount.com",});