acceptable-army-69872
03/24/2020, 12:23 PMSpecify a single resource URN to update.
say update on purpose. Kind of a bummer that this is a different behavior than terraform for the same verbage.gentle-diamond-70147
03/24/2020, 3:32 PMSpecify a single resource URN to update
, I don't believe it's meant to be on resource update but pulumi update
, so it should work for creating resources too. That's what I would expect too.loud-napkin-70080
03/26/2020, 11:15 PMchilly-laptop-44574
03/28/2020, 12:33 AM└── infrastructure
└── network
├── dev
├── prod
└── stage
├── 01-host-project
│ ├── Pulumi.stage.yaml
│ └── Pulumi.yaml
└── 02-host-vpc
├── Pulumi.stage.yaml
└── Pulumi.yaml
Is it possible to have package.json
and node_module
global on let say this level < stage
folder>
└── infrastructure
└── network
└── stage
So npm install
is done only once?creamy-traffic-12121
03/30/2020, 4:13 PMcreamy-traffic-12121
03/30/2020, 4:13 PMconst topicSubscription = new aws.sns.TopicSubscription("topic", {
topic: snsTopic,
protocol: "lambda",
endpoint: lambda.arn
})
This is throwing the following error when running `$ pulumi up`:
error: Running program '/Users/michaelstott/sns' failed with an unhandled exception:
TypeError: Cannot read property 'arn' of undefined
at Object.<anonymous> (/Users/michaelstott/sns/sns.ts:10:25)
at Module._compile (internal/modules/cjs/loader.js:955:30)
The lambda in question is defined in another file and would be provisioned normally if not for this error. It seems that Pulumi is attempting to create the topic before the lambda is created. Is there a workaround for this?incalculable-engineer-92975
03/31/2020, 1:58 PMcalm-jewelry-71872
03/31/2020, 3:53 PMminiature-arm-21874
04/01/2020, 1:55 PM80 tcp 0.0.0.0/0
outbound rule to the created group in the console to test. as soon as i create this it works but also then allows http traffic to my container which i don't want. i just need https externally.
what's the best way to make this work? I've added my own security group with an egress rule with 80 tcp 0.0.0.0/0
for now which makes my healthchecks pass and attached it to the LB. breezy-cricket-40277
04/01/2020, 1:58 PMresource plugin azure is expected to have version >=2.3.1, but has ; the wrong version may be on your path, or this may be a bug in the plugin
Is there any required configuration missing?miniature-arm-21874
04/01/2020, 3:52 PMconst repo = new awsx.ecr.Repository('my-ecr-repository');
const image = aws.ecr.getImage({
repositoryName: repo.repository.name.apply((name) => name),
imageTag: 'latest',
});
I get Type 'Output<string>' is not assignable to type 'string'. [Error/2322]
for repositoryNamealert-restaurant-79151
04/01/2020, 5:11 PM"Received 0 SUCCESS signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement"
what do I do wrong?alert-restaurant-79151
04/01/2020, 5:12 PMaws:cloudformation:Stack (resetCases):
error: 1 error occurred:
* creating urn:pulumi:test::testing::awsx:x:ecs:Cluster$awsx:x:autoscaling:AutoScalingGroup$aws:cloudformation/stack:Stack::resetCases: ROLLBACK_COMPLETE: ["The following resource(s) failed to create: [Instances]. . Rollback requested by user." "Received 0 SUCCESS signal(s) out of 2. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement"]
square-rose-64819
04/01/2020, 6:07 PMchilly-laptop-44574
04/02/2020, 5:55 AMasync function waitForServiceAccount(accountNum: string): Promise<any> {
if (!pulumi.runtime.isDryRun()) {
// Wait for up to 10 minutes
for (let i = 0; i < 60; i++) {
const objectViewer = await gcp.serviceAccount.getAccount({
accountId: `service-${accountNum}`
});
if (objectViewer.email && objectViewer.name && objectViewer.uniqueId) {
return objectViewer.email;
}
<http://pulumi.log.info|pulumi.log.info>(`Waiting for Service Account ${accountNum} (${i})`)
// Wait for 10s between polls
await new Promise(r => setTimeout(r, 10000));
}
throw new Error("timed out waiting for Job to complete");
}
}
const email= serviceProject.number.apply(projectNumber => waitForServiceAccount(projectNumber));
serviceProject
is of course created before but in the same ts file.
Getting this error:
error: Request "Create IAM Members roles/compute.securityAdmin serviceAccount:Calling [toString] on an [Output<T>] is not supported.\n\nTo get the value of an Output<T> as an Output<string> consider either:\n1: o.apply(v => `prefix${v}suffix`)\n2: pulumi.interpolate `prefix${v}suffix`\n\nSee <https://pulumi.io/help/outputs> for more details.\nThis function may throw in a future version of @pulumi/pulumi. for \"project \\\"xxxxxxxx\\\"\"" returned error: Error applying IAM policy for project "xxxxxxxx": Error setting IAM policy for project "xxxxxxxxxx": googleapi: Error 400: Invalid service account (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`
busy-magazine-48939
04/02/2020, 8:14 AMexport const something…
will be shown in pulumi log, hard to traverse through this noize.high-lamp-12603
04/02/2020, 4:50 PM// VPC Stack
import * as awsx from '@pulumi/awsx';
const vpc = new awsx.ec2.Vpc('application-vpc', {
cidrBlock: '10.128.0.0/19',
enableDnsSupport: true,
enableDnsHostnames: true,
subnets: [...Array(3).keys()].map((i) => ({ name: `private-${i}`, type: 'private' })),
numberOfNatGateways: 1,
});
export const { id, privateSubnetIds } = vpc;
// EKS Stack - Stack References Only
import * as awsx from '@pulumi/awsx';
import * as eks from '@pulumi/eks';
import * as pulumi from '@pulumi/pulumi';
import { last } from 'lodash';
const env = last(pulumi.getStack().split('.'));
const vpcStack = new pulumi.StackReference(`infra.vpc.${env}`);
const vpcId = vpcStack.getOutput('vpcId');
const privateSubnetIds = vpcStack.getOutput('privateSubnetIds');
export const eksCluster = new eks.Cluster('applicatin-eks-cluster', {
vpcId,
privateSubnetIds,
});
// EKS Stack - Only pass minimal references (ideal)
import * as awsx from '@pulumi/awsx';
import * as eks from '@pulumi/eks';
import * as pulumi from '@pulumi/pulumi';
import { last } from 'lodash';
const env = last(pulumi.getStack().split('.'));
const vpcStack = new pulumi.StackReference(`infra.vpc.${env}`);
const vpcId = vpcStack.getOutput('vpcId');
const vpc = awsx.ec2.Vpc.fromExistingIds('application-vpc', {
vpcId,
});
export const eksCluster = new eks.Cluster('applicatin-eks-cluster', {
vpcId: vpc.id,
privateSubnetIds: vpc.privateSubnetIds,
});
Option 1 works but outputting every will get messy quickly with increased complexity. Option 2 doesn’t actually work because fromExistingIds
doesn’t actually hydrate the subnets. Any suggestions or better examples?high-lamp-12603
04/02/2020, 10:19 PMaws.cloudwatch.onSchedule
and new aws.lambda.Function
to create the typescript bundle. I can’t seem to get dependencies pulled in correctly. I either get errors like which could not be serialized because it was a native code function
or Could not include required dependency
. I feel like I’m missing something obviousbillowy-oxygen-65892
04/03/2020, 2:54 PMsquare-rose-64819
04/06/2020, 7:53 PMdependsOn
to a value that may be nullbreezy-butcher-78604
04/07/2020, 7:59 AMsrc/
rather than in the top level dir. my function definition looks like this:
const myFunction = new aws.serverless.Function("my-func", {
callback: (a, b, c) => { console.log(a,b,c); }
});
but when i run pulumi up
i get the following error:
Error reading file '<path-to-project>/src/package.json' when computing package dependencies. Error: ENOENT: no such file or directory, open '<path-to-project>/src/package.json'
is there a way I can get pulumi to look up a directory? or is there a way i can define a function inline without it having to check the package.json?rough-tomato-98795
04/07/2020, 2:30 PMcolossal-room-15708
04/08/2020, 10:00 PMtemplate.json
) into this property?
I tried way too many things now and they all seem way too complex (SO answers usually are).boundless-airport-99052
04/09/2020, 3:58 PMpulumi.Output
with await
to be used in an async
method?boundless-airport-99052
04/09/2020, 4:00 PMComponentResource
and want to use await
in the initialize
function as below:
export class MyComponent extends pulumi.ComponentResource {
protected async initialize(args: Inputs): Promise<any> {
await pulumi.output(args.inputA).apply(value => ....)
}
}
miniature-arm-21874
04/10/2020, 6:30 PMconst lambda = async (event, context) => {
const knex = Knex(...);
knex.query(...)
}
this establishes a connection inside of the function invocation and as a result
can't be used between separate invocations with lambda's container use but also
takes time to start up each time as a result.
The best practices suggest initialising sdks and connections outside of the handler
https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html
is it possible to create lambdas a bit like in the below example?
const knex = Knex(...);
const lambda = async (event, context) => {
knex.query(...)
}
eager-pillow-75917
04/13/2020, 12:35 PMindex.ts
. I am separating my infrastructure into separate file for sake of organization and separation. But I noticed that I not only have to import to index.ts, but I have to use it somehow. Even it is a simple export of output in the end for Pulumi to deploy whatever it is on the import. Is there a better way to do this? A best practice maybe that most of you are following?cuddly-smartphone-89735
04/15/2020, 3:53 PMComponentResource
, that slowly grows too big to be all in one file. Is it good practice to structure parts of the resources in another file using a function or plain class, so that the "internal" structure is not reflected in the pulumi state, but I still get to make it more readable? Would you prefer a function or a plain class? Or a whole other concept for this?limited-rainbow-51650
04/16/2020, 10:21 AMexport abstract class Network extends pulumi.ComponentResource
. In package B, depending on A, I create a concrete subclass class GoogleNetwork extends network.Network
. In the same file where this concrete class is defined, I use it via this.virtualNetwork = new GoogleNetwork(name)
. The build works, but when running tests, I get this error:
TypeError: Class constructor Network cannot be invoked without 'new'
at new GoogleNetwork (/Users/ringods/Projects/cumundi/blueprints/libraries/packages/network-gcp/src/index.ts:21:23)
at GoogleNetworkBuilder.network (/Users/ringods/Projects/cumundi/blueprints/libraries/packages/network-gcp/src/index.ts:29:31)
at Object.<anonymous> (/Users/ringods/Projects/cumundi/blueprints/libraries/packages/network-gcp/test/simple.ts:5:6)
...
This is probably something missing in my tsconfig.json
files, but I failed to find what so far. I experimented with the following compilerOptions
so far: target
, module
, moduleResolution
limited-rainbow-51650
04/16/2020, 12:37 PMTypeError: Class constructor …
error message, I bump into this SO article:
https://stackoverflow.com/questions/50203369/class-constructor-cannot-be-invoked-without-new-typescript-with-commonjs/50203532#50203532
Where they advice to set the target
at least to ES6
. Like the Pulumi libs, I target: "ES2016"
, so that shouldn’t be a problem, right.