some-kitchen-64615
04/21/2020, 9:43 AMstale-minister-93676
04/21/2020, 1:37 PMgetCluster
returns a promise. I'm then trying to use getProject
with cluster id via cluster.then(cluster => cluster.id)
however I get an error saying Error: Promises cannot be passed in as arguments to a data source call.
How am I supposed to get around that?limited-rainbow-51650
04/21/2020, 4:34 PMbrave-angle-33257
04/21/2020, 6:31 PMgetOutputSync
get removed in pulumi 2.0.0 ??stale-minister-93676
04/21/2020, 6:46 PMincalculable-church-62932
04/21/2020, 9:01 PMorange-policeman-59119
04/21/2020, 9:41 PM$NAME
aka istio-citadel
- the name of the resource
• $KIND/$NAME
aka deployment.apps/istio-citadel
- the resource kind and name
• $SPACE/NAME
aka istio-system/istio-citadel
- the namespace and name of the resource (omitting the resource kind)
Non-namespaced resources:
• $NAME
aka istio-citadel
- the name of the resource
• $KIND/$NAME
aka deployment.apps/istio-citadel
- the resource kind and nameorange-policeman-59119
04/21/2020, 9:42 PM{ import: '???' }
on the chart, or do I use per-yaml resource transformations?orange-policeman-59119
04/21/2020, 10:58 PMInput/Output
) value to the import
property? I am able to pass an Input/Output to the metadata.name
and metadata.namespace
into the object args, but I cannot then reference said name and namespace in the import
arg?
2. Is it possible to pass in a value for opts: { import: ??? }
that automatically determines what to import? For Kubernetes resources where the name and namespace are part of the resource itself, that is, for any given object defining { metadata: ObjectMeta }
we can determine the ID deterministically, so having to repeat it seems un-DRY.orange-policeman-59119
04/21/2020, 10:58 PMthousands-byte-82197
04/22/2020, 9:00 AMmammoth-caravan-51104
04/22/2020, 11:36 AMsteep-angle-29984
04/22/2020, 11:41 AMstocky-island-3676
04/22/2020, 2:59 PMenforcementLevel: "advisory"
, directly at the resource? To get this check out of the list of policy violations. Similar like nolint
flags.
2. How can you check if a value is a secret value, i.e. encrypted in the stack? Just read that secrets are unencrypted in policy-pack checks.stocky-motorcycle-65008
04/22/2020, 3:21 PMstocky-motorcycle-65008
04/22/2020, 3:22 PMstocky-motorcycle-65008
04/22/2020, 3:22 PMstocky-motorcycle-65008
04/22/2020, 3:22 PMstocky-motorcycle-65008
04/22/2020, 3:23 PMfast-dinner-32080
04/22/2020, 3:23 PMstocky-motorcycle-65008
04/22/2020, 3:23 PMstocky-motorcycle-65008
04/22/2020, 3:24 PMmillions-judge-24978
04/22/2020, 3:33 PMvpc.privateSubnetIds
and vpc.publicSubnetIds
are promises, can’t just call .concat
cool-egg-852
04/22/2020, 4:29 PMpulumi config -s LinioIT/pr1234 set --path <http://app.reviewApp.pr|app.reviewApp.pr> 1234
error: a map was expected for key "pr"
?adventurous-park-10099
04/22/2020, 9:15 PMapply
termination, recovering from state mismatches, and the like?mysterious-australia-14256
04/23/2020, 9:39 AMbland-lamp-16797
04/23/2020, 10:59 AMterraform_remote_state
?
so for example, if I would have dev/staging
i would like to import from staging some dev outputs ?eager-pillow-75917
04/23/2020, 11:19 AMrhythmic-finland-36256
04/23/2020, 11:50 AMeager-pillow-75917
04/23/2020, 12:03 PMTo get the value of an Output<T> as an Output<string> consider either:
1: o.apply(v => `prefix${v}suffix`)
2: pulumi.interpolate `prefix${v}suffix`
eager-pillow-75917
04/23/2020, 12:03 PMTo get the value of an Output<T> as an Output<string> consider either:
1: o.apply(v => `prefix${v}suffix`)
2: pulumi.interpolate `prefix${v}suffix`
faint-motherboard-95438
04/23/2020, 12:14 PMOutput
properly.wonderful-dog-9045
04/23/2020, 12:14 PMx
you can manipulate it with with x.apply(x => doSomethingWithX(x))
eager-pillow-75917
04/23/2020, 12:21 PMimport * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
const env = pulumi.getStack();
const infra = new pulumi.StackReference(`acmecorp/infra/${env}`);
const provider = new k8s.Provider("k8s", { kubeconfig: infra.getOutput("kubeConfig") });
const service = new k8s.core.v1.Service(..., { provider: provider });
I got this snippet from https://www.pulumi.com/docs/intro/concepts/organizing-stacks-projects/#inter-stack-dependenciesinfra.getOutput("kubeConfig")
like it is in the documentation, I get the above error.wonderful-dog-9045
04/23/2020, 12:26 PMinfra.getOutput()
eager-pillow-75917
04/23/2020, 12:27 PMconst infra = new pulumi.StackReference("acmecorp/infra/${env}");
export const kubeConfig = infra.getOutput("kubeConfig");
let provider;
kubeConfig.apply(clusterNameOutput => {
bucket = new k8s.Provider("k8s", { kubeconfig: kubeConfig });
});
wonderful-dog-9045
04/23/2020, 12:29 PMfaint-motherboard-95438
04/23/2020, 12:31 PMkubeConfig
?eager-pillow-75917
04/23/2020, 2:10 PMconst infra = new pulumi.StackReference("infra-staging");
export const clusterNameOutput = infra.getOutput("stagingClusterName");
clusterNameOutput.apply(clusterNameOutput => {
const bucket = new gcp.storage.Bucket(`my-test-bucket-${clusterNameOutput}`)
});
faint-motherboard-95438
04/23/2020, 2:13 PMinfra-staging
exporting your stagingClusterName
.
But there’s already a problem in your code here: you shouldn’t try to use outputs in the name of a component, that should be a static string.eager-pillow-75917
04/23/2020, 2:15 PMfaint-motherboard-95438
04/23/2020, 2:28 PMinfra-staging
creates a cluster and exports the config like this:
export const { kubeconfig } = cluster
You can then do somewhere else something like this:
const infraStack = new pulumi.StackReference('infra-staging')
const k8sProvider = new k8s.Provider('k8s-provider', {
kubeconfig: infraStack.getOutput('kubeconfig')
})
const myNamespace = new k8s.core.v1.Namespace('whatever', {}, { provider: k8sProvider })