How to use the @pulumi/pulumi.interpolate function in @pulumi/pulumi

To help you get started, we’ve selected a few @pulumi/pulumi 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-stream-analytics / index.ts View on Github external
type: "Json",
        encoding: "UTF8",
        format: "Array",
    },
});

// Create an Azure Function to subscribe to the output and print all outputs of the job
outputHub.onEvent("analytics-output", {
    callback: async (context, event) => {
        console.log(JSON.stringify(event));
    },
});

const url = pulumi.interpolate`https://${namespace.name}.servicebus.windows.net`;
export const sasToken = pulumi.all([url, namespace.defaultPrimaryKey]).apply(([u, pk]) => createSharedAccessToken(u, "RootManageSharedAccessKey", pk));
export const inputEndpoint = pulumi.interpolate`${url}/${inputHub.name}/messages?timeout=60&api-version=2014-01`;
github pulumi / examples / azure-ts-appservice-docker / index.ts View on Github external
appServicePlanId: plan.id,
    appSettings: {
      WEBSITES_ENABLE_APP_SERVICE_STORAGE: "false",
      DOCKER_REGISTRY_SERVER_URL: pulumi.interpolate`https://${registry.loginServer}`,
      DOCKER_REGISTRY_SERVER_USERNAME: registry.adminUsername,
      DOCKER_REGISTRY_SERVER_PASSWORD: registry.adminPassword,
      WEBSITES_PORT: "80", // Our custom image exposes port 80. Adjust for your app as needed.
    },
    siteConfig: {
        alwaysOn: true,
        linuxFxVersion: pulumi.interpolate`DOCKER|${myImage.imageName}`,
    },
    httpsOnly: true,
});

export const getStartedEndpoint = pulumi.interpolate`https://${getStartedApp.defaultSiteHostname}`;
github pulumi / examples / aws-ts-pulumi-miniflux / index.ts View on Github external
{ name: "ADMIN_USERNAME", value: adminUsername },
                    { name: "ADMIN_PASSWORD", value: adminPassword },
                ],
            },
        },
    },
}, {
    customTimeouts: {
        create: "20m",
        update: "20m",
        delete: "20m",
    },
});

// Export the publicly accessible URL.
export const url = pulumi.interpolate `http://${listener.endpoint.hostname}:${listener.endpoint.port}`;
github pulumi / examples / azure-ts-api-management / index.ts View on Github external
firstName: "Robo",
   lastName: "Bot",
   email: "robobot@yourcompany.com",
});

// Create a subscription to the product for the user
const subscription = new azure.apimanagement.Subscription("bot-subscription", {
   resourceGroupName: resourceGroup.name,
   apiManagementName: service.name,
   displayName: "Bot Subscription",
   productId: product.id,
   userId: user.id,
   state: "active",
});

export const endpoint = pulumi.interpolate`${service.gatewayUrl}/${api.path}/Pulumi`;
export const key = subscription.primaryKey;
github pulumi / examples / kubernetes-ts-multicloud / app.ts View on Github external
const service = new k8s.core.v1.Service(`${name}-demo-app`, {
            spec: {
                loadBalancerIP: args.staticAppIP, // Required for AKS - automatic LoadBalancer still in preview.
                selector: appLabels,
                ports: [{port: 80, targetPort: 8080}],
                type: "LoadBalancer",
            },
        }, {provider: args.provider, parent: this});

        // The address appears in different places depending on the Kubernetes service provider.
        let address = service.status.loadBalancer.ingress[0].hostname;
        if (name === "gke" || name === "aks") {
            address = service.status.loadBalancer.ingress[0].ip;
        }

        this.appUrl = pulumi.interpolate`http://${address}:${service.spec.ports[0].port}`;

        this.registerOutputs();
    }
}
github pulumi / pulumi-cloud / aws / examples / customDomain / index.ts View on Github external
let deployment = endpoint.publish();

// Add a DNS CNAME record for the subdomain pointing to the API custom domain.
let recordSet = new aws.route53.Record(subdomain, {
    name: subdomain,
    zoneId: hostedZoneId,
    type: "A",
    aliases: [{
        name: deployment.customDomains[0].cloudfrontDomainName,
        zoneId: deployment.customDomains[0].cloudfrontZoneId,
        evaluateTargetHealth: false,
    }]
});

// Export the custom domain URL for the HTTP Endpoint.
export let url = pulumi.interpolate `https://${recordSet.fqdn}/`;
github pulumi / pulumi-aws / examples / queue / index.ts View on Github external
const awssdk = await import("aws-sdk");
    const s3 = new awssdk.S3();

    const recordFile = "lastEvent.json";

    console.log("Storing sqs message to S3.");
    await s3.putObject({
        Bucket: bucket.id.get(),
        Key: recordFile,
        Body: JSON.stringify(event),
    }).promise();
    console.log("Stored sqs message to S3.");
}, { batchSize: 1 });

export const queueUrl = queue.id;
export const bucketUrl = pulumi.interpolate `s3://${bucket.id}`;
github pulumi / infrastructure-as-code-workshop / labs / aws / typescript / lab-03 / code / step5.ts View on Github external
const web = atg.createListener("web", { port: 80 });

const containerImage = awsx.ecs.Image.fromPath("app-img", "./app");

const appService = new awsx.ecs.FargateService("app-svc", {
    cluster,
    taskDefinitionArgs: {
        container: {
            image: containerImage,
            portMappings: [ web ],
        },
    },
    desiredCount: 3,
});

export const url = pulumi.interpolate`${web.endpoint.hostname}`;
github pulumi / pulumi-google-native / examples / functions-ts / index.ts View on Github external
import * as random from "@pulumi/random"

const config = new pulumi.Config("google-native");
const project = config.require("project");
const region = config.require("region");

const randomString = new random.RandomString("name", {
    upper: false,
    number: false,
    special: false,
    length: 8,
});

const bucket = new google.storage.v1.Bucket("bucket", {
    project,
    name: pulumi.interpolate`bucket-${randomString.result}`,
});

const bucketObject = new google.storage.v1.BucketObject("bucketObject", {
    name: "zip",
    bucket: bucket.name,
    source: new pulumi.asset.AssetArchive({
        ".": new pulumi.asset.FileArchive("./pythonfunc"),
    }),
});

const functionName = pulumi.interpolate`func-${randomString.result}`;
const func = new google.cloudfunctions.v1.Function("function-py", {
    project,
    location: region,
    name: pulumi.interpolate`projects/${project}/locations/${region}/functions/${functionName}`,
    sourceArchiveUrl: pulumi.interpolate`gs://${bucket.name}/${bucketObject.name}`,
github pulumi / automation-api-examples / nodejs / databaseMigration-ts / index.ts View on Github external
skipFinalSnapshot: true,
            dbSubnetGroupName: subnetGroup.name,
            vpcSecurityGroupIds: [securityGroup.id],
        });

        const clusterInstance = new aws.rds.ClusterInstance("dbInstance", {
            clusterIdentifier: cluster.clusterIdentifier,
            instanceClass: aws.rds.InstanceType.T3_Small,
            engine: aws.rds.EngineType.AuroraMysql,
            engineVersion: "5.7.mysql_aurora.2.03.2",
            publiclyAccessible: true,
            dbSubnetGroupName: subnetGroup.name,
        });

        return {
            host: pulumi.interpolate`${cluster.endpoint}`,
            dbName,
            dbUser,
            dbPass
        };
    };