How to use the @pulumi/pulumi.StackReference 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 / kubernetes-guides / orig / gcp / infrastructure / config.ts View on Github external
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import * as pulumi from "@pulumi/pulumi";

const config = new pulumi.Config();

export const identityStackName = config.require("identityStackName");
const identityStack = new pulumi.StackReference(identityStackName);

//
// GCP-specific config.
//

// project is the GCP project you are going to deploy to.
export const project = identityStack.getOutput("project");

// zone is the zone in which to build the cluster.
export const zone = new pulumi.Config("gcp").get("zone");

//
// Kubernetes-specific config.
//

// envName is the name of the environment represented by this cluster.
github pulumi / infrastructure-as-code-workshop / labs / aws / typescript / lab-05 / code / step3.ts View on Github external
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";

let pulumiConfig = new pulumi.Config();

// Existing Pulumi stack reference in the format:
// // e.g. "myUser/myProject/dev"
const clusterStackRef = new pulumi.StackReference(pulumiConfig.require("clusterStackRef"));

// Get the kubeconfig from the cluster stack output.
const kubeconfig = clusterStackRef.getOutput("kubeconfig").apply(JSON.stringify);

// Create the k8s provider with the kubeconfig.
const provider = new k8s.Provider("k8sProvider", {kubeconfig});

const ns = new k8s.core.v1.Namespace("app-ns", {
    metadata: { name: "joe-duffy" },
}, {provider});

const appLabels = { app: "iac-workshop" };
const deployment = new k8s.apps.v1.Deployment("app-dep", {
    metadata: { namespace: ns.metadata.name },
    spec: {
        selector: { matchLabels: appLabels },
github pulumi / kubernetes-guides / aws / 03-cluster-configuration / config.ts View on Github external
import * as pulumi from "@pulumi/pulumi";

let pulumiConfig = new pulumi.Config();

// Existing Pulumi stack reference in the format:
// // e.g. "myUser/myProject/dev"
const identityStackRef = new pulumi.StackReference(pulumiConfig.require("identityStackRef"));
const infraStackRef = new pulumi.StackReference(pulumiConfig.require("infraStackRef"));

export const config = {
    // Identity
    adminsIamRoleArn: identityStackRef.getOutput("adminsIamRoleArn"),
    devsIamRoleArn         : identityStackRef.getOutput("devsIamRoleArn"),
    stdNodegroupIamRoleArn : identityStackRef.getOutput("stdNodegroupIamRoleArn"),
    perfNodegroupIamRoleArn: identityStackRef.getOutput("perfNodegroupIamRoleArn"),

    // Infrastructure / Networking
    vpcId: infraStackRef.getOutput("vpcId"),
    publicSubnetIds: infraStackRef.getOutput("publicSubnetIds"),
    privateSubnetIds: infraStackRef.getOutput("privateSubnetIds"),

    /*
    defaultVpcId: infraStackRef.getOutput("defaultVpcId"),
    defaultPublicSubnetIds: infraStackRef.getOutput("defaultPublicSubnetIds"),
github pulumi / kubernetes-guides / orig / services / wordpress / config.ts View on Github external
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";

const config = new pulumi.Config();

const infrastructureStackName = config.require("infrastructureStackName");
const infrastructureStack = new pulumi.StackReference(infrastructureStackName);

export const k8sProvider = new k8s.Provider(`${infrastructureStackName}`, {
    kubeconfig: infrastructureStack.getOutput("kubeconfig"),
});
github pulumi / kubernetes-guides / apps / deployment-secret / config.ts View on Github external
import * as pulumi from "@pulumi/pulumi";

let pulumiConfig = new pulumi.Config();

// Existing Pulumi stack reference in the format:
// // e.g. "myUser/myProject/dev"
const infraStackRef = new pulumi.StackReference(pulumiConfig.require("infraStackRef"));
const clusterStackRef = new pulumi.StackReference(pulumiConfig.require("clusterStackRef"));

export const config = {
    // Infra
    privateSubnetIds: infraStackRef.getOutput("privateSubnetIds"),
    publicSubnetIds: infraStackRef.getOutput("publicSubnetIds"),

    // Cluster
    kubeconfig: clusterStackRef.getOutput("kubeconfig"),
    clusterName: clusterStackRef.getOutput("clusterName"),
    securityGroupIds: clusterStackRef.getOutput("securityGroupIds"),
    clusterSvcsNamespaceName: clusterStackRef.getOutput("clusterSvcsNamespaceName"),
    appSvcsNamespaceName: clusterStackRef.getOutput("appSvcsNamespaceName"),
    appsNamespaceName: clusterStackRef.getOutput("appsNamespaceName"),

    // Misc
github pulumi / kubernetes-guides / azure / 02-managed-infra / config.ts View on Github external
import * as pulumi from "@pulumi/pulumi";

const pulumiConfig = new pulumi.Config();

// Existing Pulumi stack reference in the format:
// // e.g. "myUser/myProject/dev"
const identityStackRef = new pulumi.StackReference(pulumiConfig.require("identityStackRef"));

export const config = {
    // Resource Group
    resourceGroupName:      identityStackRef.getOutput("resourceGroupName"),
};
github pulumi / kubernetes-guides / gcp / 05-app-services / config.ts View on Github external
import * as pulumi from "@pulumi/pulumi";

let pulumiConfig = new pulumi.Config();

// Existing Pulumi stack reference in the format:
// // e.g. "myUser/myProject/dev"
const identityStackRef = new pulumi.StackReference(pulumiConfig.require("identityStackRef"));
const clusterStackRef = new pulumi.StackReference(pulumiConfig.require("clusterStackRef"));

export const config = {
    project: identityStackRef.requireOutput("project"),

    // Cluster
    kubeconfig: clusterStackRef.requireOutput("kubeconfig"),
    clusterName: clusterStackRef.getOutput("clusterName"),
    appSvcsNamespaceName: clusterStackRef.getOutput("appSvcsNamespaceName"),
    appsNamespaceName: clusterStackRef.getOutput("appsNamespaceName"),
};
github pulumi / kubernetes-guides / azure / 03-cluster-configuration / config.ts View on Github external
import * as azure from "@pulumi/azure";
import * as pulumi from "@pulumi/pulumi";

const pulumiConfig = new pulumi.Config();

// Existing Pulumi stack reference in the format:
// // e.g. "myUser/myProject/dev"

const identityStackRef = new pulumi.StackReference(pulumiConfig.require("identityStackRef"));
const infraStackRef = new pulumi.StackReference(pulumiConfig.require("infraStackRef"));

export const config = {
    // Resource Group
    resourceGroupName:        identityStackRef.getOutput("resourceGroupName"),

    // Identity
    adServerAppId:            identityStackRef.getOutput("adServerAppId"),
    adServerAppSecret:        identityStackRef.getOutput("adServerAppSecret"),
    adClientAppId:            identityStackRef.getOutput("adClientAppId"),
    adClientAppSecret:        identityStackRef.getOutput("adClientAppSecret"),
    adGroupAdmins:            identityStackRef.getOutput("adGroupAdmins"),
    adGroupDevs:              identityStackRef.getOutput("adGroupDevs"),

    // Infrastructure / Networking
    subnetId:                 infraStackRef.getOutput("subnetId"),
    logAnalyticsWorkspaceId:  infraStackRef.getOutput("logAnalyticsWorkspaceId"),
github pulumi / kubernetes-guides / general-cluster-services / datadog-daemonset / config.ts View on Github external
import * as pulumi from "@pulumi/pulumi";

let pulumiConfig = new pulumi.Config();

// Existing Pulumi stack reference in the format:
// // e.g. "myUser/myProject/dev"
const clusterStackRef = new pulumi.StackReference(pulumiConfig.require("clusterStackRef"));

export const config = {
    // Cluster
    kubeconfig: clusterStackRef.getOutput("kubeconfig"),
    clusterSvcsNamespaceName: clusterStackRef.getOutput("clusterSvcsNamespaceName"),
    appSvcsNamespaceName: clusterStackRef.getOutput("appSvcsNamespaceName"),
    appsNamespaceName: clusterStackRef.getOutput("appsNamespaceName"),

    // Misc
    datadogApiKey: pulumiConfig.require("datadogApiKey"),
};
github pulumi / kubernetes-guides / gcp / 03-cluster-configuration / config.ts View on Github external
import * as pulumi from "@pulumi/pulumi";

let pulumiConfig = new pulumi.Config();

const identityStackName = new pulumi.StackReference(pulumiConfig.require("identityStackName"));
const infraStackName = new pulumi.StackReference(pulumiConfig.require("infraStackName"));

export const config = {
    adminsIamServiceAccountSecret: identityStackName.requireOutput("adminsIamServiceAccountSecret"),
    devsIamServiceAccountSecret: identityStackName.requireOutput("devsIamServiceAccountSecret"),
    project: identityStackName.requireOutput("project"),
    adminsAccountId: identityStackName.requireOutput("adminsAccountId"),
    devsAccountId: identityStackName.requireOutput("devsAccountId"),
    networkName: infraStackName.requireOutput("networkName"),
    subnetworkName: infraStackName.requireOutput("subnetworkName"),
};