white-rainbow-68240
07/13/2020, 1:18 PMsalmon-ghost-86211
07/15/2020, 2:52 PMuserIamAccessKeys.id
or userIamAccessKeys.secret
is the only content
on the BucketObject, it writes successfully.
If encryptedKeys
ciphertext is the content
, the text written is [object Object]
.
I can't seem to use toJSON
or toString
or .apply
to build the ciphertext.
How do I pull out some details from the AccessKey
, convert it to Ciphertext
and insert it into the BucketObject
content
?
const userIamAccessKeys = new aws.iam.AccessKey(
"iam-access-key",
{ user: iamUser.name, },
{ dependsOn: iamUser }
);
const encryptedKeys = new aws.kms.Ciphertext(
"user-encrypted-keys",
{
keyId: myKms.keyId,
plaintext: `{
"access_key": ${userIamAccessKeys.id},
"secret_key": ${userIamAccessKeys.secret}
}
`
},
{ dependsOn: userIamAccessKeys }
);
// Store the already encrypted access keys in S3
const accessKeysInS3 = new aws.s3.BucketObject(
"access-keys-in-s3",
{
bucket: myS3Bucket.apply(bucket => bucket.id),
content: encryptedKeys.toString(),
key: "accesskeys.json.enc"
},
{ dependsOn: [userIamAccessKeys, encryptedKeys] }
);
ripe-russia-4239
07/15/2020, 8:00 PMsetMocks()
call, but I haven’t verified that yet.ripe-russia-4239
07/15/2020, 8:36 PMquiet-hairdresser-18834
07/16/2020, 7:23 PMbillions-lock-80282
07/29/2020, 2:03 PMPromise<pulumi.Output<string>[]>
? This is for an ec2 instance subnet field.bland-telephone-59986
07/29/2020, 2:32 PMquiet-hairdresser-18834
07/31/2020, 1:24 AMnutritious-battery-42762
08/05/2020, 12:44 PMnutritious-battery-42762
08/05/2020, 12:46 PMproud-spoon-58287
08/07/2020, 9:04 AMexport class KsqlDbCluster {
private readonly _clusterName: string
constructor(clusterName: string) {
this._clusterName = clusterName
}
private readonly _k8nCluster: gcp.container.Cluster = this.buildCluster(this._clusterName)
I am invoking this class this way
const ksqlDbClusterName = 'ksqldb-cluster'
const ksqlDbCluster = new KsqlDbCluster(ksqlDbClusterName)
Why in the world this._clusterName
is undefined?proud-spoon-58287
08/07/2020, 9:05 AMproud-spoon-58287
08/07/2020, 11:28 AMkubernetes:core:Namespace (ksqldb-cluster):
error: configured Kubernetes cluster is unreachable: failed to parse kubeconfig data in `kubernetes:config:kubeconfig`; this must be a YAML literal string and not a filename or path - yaml: line 2: mapping values are not allowed in this context
proud-spoon-58287
08/07/2020, 11:28 AMlittle-cartoon-10569
08/10/2020, 5:04 AMawsx.ec2.Vpc.fromExistingIds
to load a Vpc created elsewhere so that I can create a new route on one of its subnets. But awsx.ec2.Vpc#privateSubnets
is async
, and typescript doesn't allow use of await
in constructors.
I assume that I have to use an async function called after my constructor?little-cartoon-10569
08/11/2020, 2:26 AMType 'OutputInstance<number>' is missing the following properties from type 'OutputInstance<number>': apply, getand
'import("/pulumi/projects/node_modules/@pulumi/pulumi/index").OutputInstance<number>' is not assignable to type 'import("/pulumi/projects/node_modules/@pulumi/pulumi/output").OutputInstance<number>'.I deleted my node_modules and ran
npm install
and npm upgrade
. Any other suggestions?proud-spoon-58287
08/12/2020, 10:52 AMproud-spoon-58287
08/12/2020, 10:58 AMprehistoric-account-60014
08/12/2020, 6:57 PMInvalid Stripe API version: [object Object]
. This is due a serialization issue. Here’s a snippet with the dynamic provider’s source. Any ideas how to avoid this?breezy-butcher-78604
08/14/2020, 5:01 AMInput<T>
values? I'm passing an Input<aws.ecs.Secret[]>
to a module i'm writing and I want to do some processing on the various values of valueFrom
within the aws.ecs.Secret[]
so I can collate them into a list of secret ARNs to add to an IAM policy. i can see heaps of docs on using Output<T>
via apply()
etc but there doesn't seem to be any documentation (that I can find) about working with Input<T>
little-cartoon-10569
08/15/2020, 7:59 AMtry {
const stack = new pulumi.StackReference('stackName');
const someId = peerStack.requireOutput("resourceId") as pulumi.Output<string>;
} catch (e) {
if (e instanceof Error) {
pulumi.log.error(e.message);
return pulumi.output(`${e.message}`);
} else {
pulumi.log.error("Unknown object thrown");
return pulumi.output("Unknown error");
}
}
I'm expecting this code to report the error and continue working. But I'm getting
error: Running program '/pulumi/projects/main/pulumi/projects/example' failed with an unhandled exception:
Error: Required output 'someId' does not exist on stack 'stackName'.
at /pulumi/projects/node_modules/@pulumi/pulumi/stackReference.js:72:23
...And preview fails. Even though I have handled the exception... How can I conditionally skip a section of my code if a required output isn't present in another stack?
breezy-butcher-78604
08/19/2020, 8:31 AMawsx.ecs.FargateTaskDefinition
using secrets that contain Output<string>
however the underlying type - aws.ecs.Secret
has properties that are string
only. example code below:
const secret = new aws.secretsmanager.Secret("my-secret", {});
const taskDefinition = new awsx.ecs.FargateTaskDefinition("my-task-definition", {
executionRole: executionRole,
logGroup: logGroup,
container: {
image: "my-image:latest",
memory: 128,
cpu: 512,
portMappings: [{
protocol: "tcp",
containerPort: 8080,
}],
secrets: [
{ name: "MY_SECRET", valueFrom: secret.arn }
]
}
});
this produces build errors since the aws.ecs.Secret
type is defined as follows:
interface Secret {
name: string;
valueFrom: string;
}
and valueFrom
expects a string and not an Output<string>
which is returned from secret.arn
how can i coerce the types to allow this to work?abundant-airplane-93796
08/19/2020, 3:43 PMexport const gcpConfig = {
regions: config.requireObject<Array<string>>('gcp-regions'),
};
offending config value looks like
myconfig:gcp-regions:
- us-east1
Stack B - Infra:
Utilizes a custom resource that creates a GCP network and a bunch of subnets
const envConfig = new pulumi.StackReference('yadayada');
const gcpConfig = envConfig.getOutput('gcpConfig');
const regions = gcpConfig.apply((v) => v.regions);
Unfortunately I can't figure out any way to manipulate regions
back into an array of strings I can iterate over.
Can someone please help?ancient-megabyte-79588
08/20/2020, 5:20 PMexports
...
I have a pulumi app that is modularized in a simple Typescript fashion. I have a "MyModules" folder and I have files in there with exported functions. This all works great from running pulumi and letting me have manageable files to deal with. What doesn't work though is if one of these functions needs to export something out to the pulumi service as a stack output.
export const keyvaultId = keyvault.id
does not work in the function in the module. export
has to be outside of the function.
exports["keyvaultId"] = keyvault.id
and exports.keyvaultId = keyvault.id
which work in the function do not seem to be getting exported into the stack outputs.
If I put an exports.<name> = value;
in the top-level index.ts, it does work.
I would have expected the exports to work anywhere I use it and the stack output is correctly updated. Is this an incorrect expectation?dazzling-memory-8548
08/21/2020, 10:12 PMCallbackFunction
in order to take advantage of the automatic serialization (https://www.pulumi.com/docs/tutorials/aws/serializing-functions/). This works fine in most cases but starts to break down when we put resources in different modules. I have repository A
that contains my pulumi stack and resources, and a repository B
that contains shared pulumi Component
s and typescript helper functions in sub-modules.
If I create a CallbackFunction
in A
that uses a sub-module from B
, I run into `ImportModuleError`s, even if that sub-module in B
doesn't directly include any references to @pulumi/*
modules. It appears the serialization pulls in the entire B
module, rather than just the needed sub-module, causing the lambda to try to import erroneous pulumi libraries.
Situations like this seem to be correctly handled when all of the dependencies are in A
, but the serializer gets tripped up when a dependent module itself has pulumi dependencies.
Is this a potential bug in the serializer, or should I be using a different pattern to avoid this (split modules so they don't share pulumi code with vanilla lambda helpers)? Is there a way to ask the serializer to be more aggressive about inlining dependent code?
Thanks.
cc @worried-engineer-33884worried-painting-67291
08/24/2020, 5:43 PMworried-painting-67291
08/24/2020, 5:44 PMgetTable
and apply
but I thought I read somewhere that it might not be the best approach (to work with the preview and whatnot)worried-painting-67291
08/24/2020, 7:56 PMstocky-spoon-28903
08/24/2020, 8:33 PMworried-painting-67291
08/24/2020, 9:25 PMthen()
and if getTable fails.. then I call new aws.dynamodb.Table.
One problem, though, seems to be that even if the stack didn't create the resource.. it will still try to delete it when I delete the stack. Another problem also seems to be in refreshing the state of the stack.. but that is less important and isn't consistently a problem..worried-painting-67291
08/24/2020, 9:25 PMthen()
and if getTable fails.. then I call new aws.dynamodb.Table.
One problem, though, seems to be that even if the stack didn't create the resource.. it will still try to delete it when I delete the stack. Another problem also seems to be in refreshing the state of the stack.. but that is less important and isn't consistently a problem..