We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @pulumi/azure.trafficmanager function in @pulumi/azure

To help you get started, we’ve selected a few @pulumi/azure examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulumi / examples / azure-ts-serverless-url-shortener-global / index.ts View on Github external
// HTTP redirect for known URLs
                            ? { status: 301, headers: { location: response.resource.url }, body: "" }
                            // 404 for malformed documents
                            : { status: 404, body: "" };
                } catch (e) {
                    // Cosmos SDK throws an error for non-existing documents
                    return { status: 404, body: "" };
                }
            };
        },
    });

    const app = fn.functionApp;

    // An endpoint per region for Traffic Manager, link to the corresponding Function App
    const endpoint = new azure.trafficmanager.Endpoint(`tme${location}`, {
        resourceGroupName: resourceGroup.name,
        profileName: profile.name,
        type: "azureEndpoints",
        targetResourceId: app.id,
        target: app.defaultHostname,
        endpointLocation: app.location,
    });
}

export const endpoint = profile.fqdn.apply(h => {
    return `http://${h}/api/{key}`;
});
github pulumi / examples / azure-ts-cosmosapp-component / cosmosApp.ts View on Github external
const endpoints = locations.apply(ls => ls.map(location => {
            const app = buildLocation({ location });

            // An endpoint per region for Traffic Manager, link to the corresponding instance
            return new azure.trafficmanager.Endpoint(`tm${name}${location}`.substring(0, 16), {
                resourceGroupName: resourceGroup.name,
                profileName: profile.name,
                type: app.id ? "azureEndpoints" : "externalEndpoints",
                targetResourceId: app.id,
                target: app.url,
                endpointLocation: location,
            }, { parent: profile, deleteBeforeReplace: true, ...opts });
        }));
github pulumi / examples / azure-ts-cosmosapp-component / cosmosApp.ts View on Github external
}, parentOpts);

        const database = new azure.cosmosdb.SqlDatabase(`db-${name}`, {
            resourceGroupName: resourceGroup.name,
            accountName: cosmosAccount.name,
            name: args.databaseName,
        }, opts);

        const container = new azure.cosmosdb.SqlContainer(`sql-${name}`, {
            resourceGroupName: resourceGroup.name,
            accountName: cosmosAccount.name,
            databaseName: database.name,
        }, opts);

        // Traffic Manager as a global HTTP endpoint
        const profile = new azure.trafficmanager.Profile(`tm${name}`, {
            resourceGroupName: resourceGroup.name,
            trafficRoutingMethod: "Performance",
            dnsConfigs: [{
                // Subdomain must be globally unique, so we default it with the full resource group name
                relativeName: pulumi.interpolate`${name}${resourceGroup.name}`,
                ttl: 60,
            }],
            monitorConfigs: [{
                protocol: "HTTP",
                port: 80,
                path: "/api/ping",
            }],
        }, parentOpts);

        const buildLocation = args.factory({ resourceGroup, cosmosAccount, database, container, opts: parentOpts });
github pulumi / examples / azure-ts-serverless-url-shortener-global / index.ts View on Github external
// Define a database under the Cosmos DB Account
const database = new azure.cosmosdb.SqlDatabase("Database", {
    resourceGroupName: resourceGroup.name,
    accountName: account.name,
});

// Define a SQL Collection under the Cosmos DB Database
const collection = new azure.cosmosdb.SqlContainer("Urls", {
    resourceGroupName: resourceGroup.name,
    accountName: account.name,
    databaseName: database.name,
});

// Traffic Manager as a global HTTP endpoint
const profile = new azure.trafficmanager.Profile("UrlShortEndpoint", {
    resourceGroupName: resourceGroup.name,
    trafficRoutingMethod: "Performance",
    dnsConfigs: [{
        // Subdomain must be globally unique, so we default it with the full resource group name
        relativeName: resourceGroup.name,
        ttl: 60,
    }],
    monitorConfigs: [{
        protocol: "HTTP",
        port: 80,
        path: "/api/ping",
    }],
});

// Azure Function to accept new URL shortcodes and save to Cosmos DB
const fn = new azure.appservice.HttpEventSubscription("AddUrl", {

@pulumi/azure

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Nat

Apache-2.0
Latest version published 1 month ago

Package Health Score

87 / 100
Full package analysis