brave-window-69382
02/09/2020, 5:05 PMnew aws.alb.loadbalancer
I'm trying to use an output in a userdata script:
const test = "test"
const dnsName = lb.dnsName
const userData =
``#!/bin/bash`
echo Test string: ${test}
`echo ${dnsName}``
console.log(userData)
The diagnostic log produces:
#!/bin/bash
echo Test string: test
echo Calling [toString] on an [Output<T>] is not supported.
To 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``
See <https://pulumi.io/help/outputs> for more details.
This function may throw in a future version of @pulumi/pulumi.
I've been through the output documentation in the URL in addition to combing this Slack workspace but I can't seem to find a solution here. How can I use the dnsName output from the lb resource as a pure string?incalculable-dream-27508
02/09/2020, 5:08 PMexport
ends up as output
incalculable-dream-27508
02/09/2020, 5:10 PMincalculable-dream-27508
02/09/2020, 5:14 PMcurl $(pulumi stack output url)
incalculable-dream-27508
02/09/2020, 5:16 PMuserData
rough-tomato-98795
02/10/2020, 11:59 AM@pulumi/kubernetes/yaml/ConfigFile
providing a file path to it. Is that a valid way? I am getting error when pulomi tryies to parse that yaml.colossal-room-15708
02/11/2020, 9:59 AMcolossal-room-15708
02/11/2020, 10:05 AMsalmon-account-74572
02/11/2020, 9:51 PMpulumi preview
) is saying a resource must be replaced?salmon-account-74572
02/11/2020, 9:52 PMstocky-spoon-28903
02/12/2020, 1:57 PMsalmon-account-74572
02/12/2020, 6:18 PMsecurityGroups
instead of vpcSecurityGroupIds
. Switching to the latter resolves the problem.stocky-spoon-28903
02/12/2020, 6:18 PMsecurityGroups
is for EC2 classicstocky-spoon-28903
02/12/2020, 6:19 PMbroad-dog-22463
02/12/2020, 9:51 PMicy-london-58403
02/17/2020, 6:59 PMprefix.ts(130,21): error TS2564: Property 'endpoint' has no initializer and is not definitely assigned in the constructor.
prefix.ts(131,21): error TS2564: Property 'token' has no initializer and is not definitely assigned in the constructor.
prefix.ts(132,21): error TS2564: Property 'description' has no initializer and is not definitely assigned in the constructor.
I followed the directions on: https://www.pulumi.com/docs/intro/concepts/programming-model/#dynamicproviders
I made my create return the same names as the public readonly
members of my Resource
. What am I doing wrong?
Partial of my code:
class PrefixProvider implements pulumi.dynamic.ResourceProvider {
public async create(inputs: PrefixInputs): Promise<pulumi.dynamic.CreateResult> {
pulumi.log.debug("prefix create...")
let netboxClient = new Client({
host: inputs.endpoint,
token: inputs.token,
})
let description = `${inputs.platform} | ${inputs.region} | ${inputs.type} | ${inputs.name}`
var async_function = async function(): Promise<AxiosResponse<createPrefixResponse>> {
return await netboxClient.createPrefix({
prefix: inputs.prefix,
description: description,
vrf: inputs.vrfID,
})
}
const response = await async_function()
return {
id: response.data.id.toString(),
outs: {
endpoint: inputs.endpoint,
token: inputs.token,
description: description,
},
}
}
public async delete(id: pulumi.ID, props: PrefixInputs): Promise<void> {
pulumi.log.debug("prefix delete...")
let netboxClient = new Client({
host: props.endpoint,
token: props.token,
})
var async_function = async function() {
return await netboxClient.deletePrefix({
id: Number(id),
})
}
const response = await async_function()
}
}
export class Prefix extends pulumi.dynamic.Resource {
public readonly endpoint: pulumi.Output<string>
public readonly token: pulumi.Output<string>
public readonly description: pulumi.Output<string>
constructor(name: string, props: PrefixResourceInputs, opts?: pulumi.CustomResourceOptions) {
super(new PrefixProvider(), name, {...props, endpoint: undefined, token: undefined, description: undefined}, opts)
}
}
acceptable-army-69872
02/18/2020, 4:20 PMimportant-ram-83431
02/19/2020, 11:30 AMconst cluster = new eks.Cluster(name, {
vpcId: vpc.id,
subnetIds: vpc.publicSubnetIds,
storageClasses: "gp2",
deployDashboard: false,
nodeGroupOptions: {
spotPrice: "0.038",
instanceType: "m5.large",
desiredCapacity: 6,
minSize: 6,
maxSize: 24,
}
});
important-ram-83431
02/19/2020, 11:30 AMconst rancherCluster = new rancher2.Cluster(name, {
name: name,
description: "Imported Cluster for Airflow (" + name + ")",
driver: "imported",
enableClusterAlerting: true,
enableClusterIstio: true,
enableClusterMonitoring: true,
});
const rancherClusterImport = new k8s.yaml.ConfigFile(name + "-import", {
file: rancherCluster.clusterRegistrationToken.manifestUrl,
}, {
provider: cluster.provider,
dependsOn: [cluster, rancherCluster]
});
});
important-ram-83431
02/19/2020, 11:32 AMrancherCluster.clusterRegistrationToken.manifestUrl.apply((manifestUrl) => {
new k8s.yaml.ConfigFile(name + "-import", {
file: manifestUrl
}, {
provider: cluster.provider,
dependsOn: [cluster, rancherCluster]
});
});
important-ram-83431
02/19/2020, 11:32 AMimportant-ram-83431
02/19/2020, 11:34 AMfresh-pilot-59899
02/21/2020, 9:09 PMtemplate:
config:
azure:region:
description: Azure location where to provision the resources created by this component.
azure:environment:
description: The Azure environment to use (`public`, `usgovernment`, `german`, `china`)
default: public
stocky-island-3676
02/25/2020, 4:36 PMtsc
returns an error in `@pulumi/pulumi`:
node_modules/@pulumi/pulumi/queryable/index.d.ts:8:60 - error TS2304: Cannot find name 'Omit'.
8 export declare type ResolvedResource<T extends Resource> = Omit<Resolved<T>, "urn" | "getProvider">;
Package versions 1.11.0
, 1.10.0
& 1.9.0
return the same error (didn’t test others, yet).limited-rainbow-51650
02/26/2020, 4:07 PMlimited-rainbow-51650
02/26/2020, 4:15 PMdelightful-truck-1268
02/27/2020, 9:32 PMrough-tomato-98795
02/28/2020, 8:40 AMlimited-rainbow-51650
02/28/2020, 9:52 AMconfig:
pulumi:providers:
gitlab:
secure: AAABAIAhjQk...
How can I retrieve the gitlab
secret in Typescript code? I tried the following two ways:
• new pulumi.Config("pulumi").requireSecret("providers.gitlab")
• new pulumi.Config("pulumi:providers").requireSecret("gitlab")
Neither of these two work.bored-furniture-11856
02/29/2020, 10:46 PMmetadata : {
annotations: {
<http://pulumi.com/autonamed|pulumi.com/autonamed>: "true"
}
labels : {
<http://app.kubernetes.io/managed-by|app.kubernetes.io/managed-by>: "pulumi"
}
name : "foo-api-2rwgcw01"
namespace : "backend"
}
Is there any way around that? Or is it a missing feature? Any chance to set the Service name to foo-api
? https://github.com/pulumi/pulumi-kubernetesx/blob/master/nodejs/kubernetesx/kx.ts#L260bored-furniture-11856
02/29/2020, 10:46 PMmetadata : {
annotations: {
<http://pulumi.com/autonamed|pulumi.com/autonamed>: "true"
}
labels : {
<http://app.kubernetes.io/managed-by|app.kubernetes.io/managed-by>: "pulumi"
}
name : "foo-api-2rwgcw01"
namespace : "backend"
}
Is there any way around that? Or is it a missing feature? Any chance to set the Service name to foo-api
? https://github.com/pulumi/pulumi-kubernetesx/blob/master/nodejs/kubernetesx/kx.ts#L260gorgeous-egg-16927
03/02/2020, 3:26 PMconst svc = new kx.Service("nginx", {
metadata: { name: "nginx" },
spec: {
ports: { http: 80 },
selector: deployment.spec.selector.matchLabels,
type: kx.types.ServiceType.LoadBalancer,
}
})