Hi, I'm new to Pulumi and working on a POC with th...
# general
b
Hi, I'm new to Pulumi and working on a POC with the Typescript Kubernetes Crosswalk guide for GKE. I'm currently receiving the following error from the Pulumi CLI:
error: resource 'urn:pulumi:dev::<OMITTED>::pulumi:pulumi:StackReference::<OMITTED>/<OMITTED>/dev' registered twice (read and read)
I'm not sure what I would need to do next to remedy this error. Any help would be greatly appreciated.
g
Generally this error occurs when you specify the same logical name for multiple resources/stackreferences of the same type. e.g.
Copy code
const stack1 = new pulumi.StackReference("dev", ...);
const stack2 = new pulumi.StackReference("dev", ...);
So in that example code I provided you would need to change the
"dev"
logical name for one of the stack reference resources.
b
Thank you for the quick response. I'm working my way through the K8s Crosswalk Guide (GCP) by combining all steps into a single stack, for example (index.ts):
Copy code
import * as pulumi from '@pulumi/pulumi';

import { identityStack } from './src/identity';
import { vpcStack } from './src/vpc';
import { clusterStack } from './src/cluster';

const projectName = pulumi.getProject();

// STEP 1: Identity
export const {
  project,
  adminsAccountId,
  adminsIamServiceAccountSecret,
  devsAccountId,
  devsIamServiceAccountSecret
} = identityStack();

// Step 2: Managed Infra
export const {
  networkName,
  subnetworkName
} = vpcStack(projectName);


// STEP 3: Cluster Config
export const {
  kubeconfig,
  clusterName,
  clusterSvcsNamespaceName,
  appSvcsNamespaceName,
  appsNamespaceName,
} = clusterStack(
    projectName,
    networkName,
    subnetworkName,
    devsAccountId,
    project,
);

// STEP 4: Cluster Services
// dataDogStack(projectConfig, kubeconfig, clusterSvcsNamespaceName, appSvcsNamespaceName);

// STEP 5: App Services
// appServicesStack(clusterName, kubeconfig);
Am I interpreting / implementing the general flow of how to use Pulumi in its intended manner?