important-ram-83431
06/27/2019, 9:18 AMimportant-ram-83431
06/27/2019, 9:20 AMimportant-ram-83431
06/27/2019, 9:20 AMimportant-ram-83431
06/27/2019, 9:21 AMimportant-ram-83431
06/27/2019, 9:31 AMimportant-ram-83431
06/27/2019, 9:31 AMorange-tailor-85423
06/27/2019, 4:26 PMglamorous-thailand-23651
06/27/2019, 9:59 PMfierce-pager-95248
06/28/2019, 11:07 PMimport * as k8s from '@pulumi/kubernetes';
import * as k8sInput from '@pulumi/kubernetes/types/input';
import * as pulumi from '@pulumi/pulumi';
export class EnvoyDeployment extends k8s.apps.v1.Deployment {
constructor(name: string,
args: k8stypes.apps.v1.Deployment,
opts?: pulumi.CustomResourceOptions) {
const pod = args.spec.template.spec;
// Add an Envoy sidecar container.
pod.containers = pod.containers || [];
pod.containers.push({
name: "envoy",
image: "lyft/envoy:latest",
command: ["/usr/local/bin/envoy"],
args: [
"--concurrency 4",
"--config-path /etc/envoy/envoy.json",
"--mode serve"
],
ports: [{ containerPort: 80, protocol: "TCP" }],
resources: {
limits: { cpu: "1000m", memory: "512Mi" },
requests: { cpu: "100m", memory: "64Mi" }
},
volumeMounts: [{ name: "envoy-conf", mountPath: "/etc/envoy" }]
});
// Add an associated Volume for Envoy's config, mounted as a ConfigMap.
pod.volumes = pod.volumes || [];
pod.volumes.push({
name: "envoy-conf", configMap: { name: "envoy" },
});
super(name, args, opts);
}
}
but the compiler is giving my fits
Property 'template' does not exist on type 'Input<DeploymentSpec>'.
Property 'template' does not exist on type 'Promise<DeploymentSpec>'.
on const pod = args.spec.template.spec;
Is this no longer a valid example? Could anyone help point out what I'm missing here?wooden-room-54680
06/30/2019, 8:47 PMComponentResourceOptions.providers
? I see pulumi has an internal function convertToProvidersMap
to convert from Record<string, ProviderResource> | ProviderResource[]
to map, but it's not exported. I need to pass the provider to a kubernetes resource inside a component.glamorous-waitress-51149
07/02/2019, 4:08 PMglamorous-waitress-51149
07/02/2019, 4:08 PMconst primaryVpc = awsx.ec2.Vpc.fromExistingIds("primary", {
vpcId: primaryVpcId
});
glamorous-waitress-51149
07/03/2019, 8:30 AMmicroscopic-airline-90245
07/11/2019, 4:58 PMjolly-egg-4894
07/12/2019, 9:23 PMSES -> S3 -> Lambda
which works just fine. but now I want to have 2 onObjectCreate
lambdas either:
on the same bucket looking at different prefixes (SES -> S3 'email prefix' -> Lambda 1 -> S3 -> 'other prefix' -> Lambda 2
)
or a clean way to do SES -> S3 1 -> Lambda 1 -> S3 2 -> Lambda 2
early-match-56268
07/13/2019, 12:27 PMmodern-bear-85657
07/15/2019, 6:58 PM$ pulumi new aws-typescript
This command will walk you through creating a new Pulumi project.
Enter a value or leave blank to accept the (default), and press <ENTER>.
Press ^C at any time to quit.
project name: (my-project) <org>/my-project
Sorry, '<org>/my-project is not a valid project name. A project name may only contain alphanumeric, hyphens, underscores, and periods.
loud-sugar-50419
07/16/2019, 6:37 AMreturn (output as any).promise() as Promise<T>;
when I try to export a security group const awsx.ec2.SecurityGroup and then try to test all the ingressRules which is an array it will fail as there is no promise function to the array.
So I changed the promise if the output is not of type OutputImpl then convert it to an output and then use it
export function promise<T>(output: pulumi.Output<T>): Promise<T | undefined> {
if (output.constructor.name != 'OutputImpl'){
return (pulumi.output(output) as any).promise() as Promise<T>;
}else
{
return (output as any).promise() as Promise<T>;
}
}
and then in the spec test I got the array[]
const ssh_rule:Array<awsx.ec2.IngressSecurityGroupRule> | undefined = await promise(baseVpc.baseSgObj.ingressRules);
how do I get all the cidrblocks as
If I call the promise function promise(baseVpc.baseSgObj.ingressRules[0].securityGroupRule.cidrBlocks)
specifying the array index it will work as the object implements an output which has a promise.
How to convert pulumi output back to its original form ?loud-sugar-50419
07/16/2019, 8:34 AMif(ssh_rule){
ssh_rule.map(item => {
item.securityGroupRule.cidrBlocks.apply( (i) => {
expect(i).not.contain("0.0.0.0/0")
})
})
}
jolly-egg-4894
07/16/2019, 8:37 AM```
if(ssh_rule){
ssh_rule.map(item => {
item.securityGroupRule.cidrBlocks.apply((i) => {
expect(i).not.contain("0.0.0.0/0")
})
})
}
```
jolly-egg-4894
07/16/2019, 8:37 AMif(ssh_rule){
ssh_rule.map(item => {
item.securityGroupRule.cidrBlocks.apply((i) => {
expect(i).not.contain("0.0.0.0/0")
})
})
}
loud-sugar-50419
07/16/2019, 8:40 AMfierce-cpu-94517
07/16/2019, 1:42 PMexport const vpc = new awsx.ec2.Vpc("vpc", {
numberOfAvailabilityZones: 3,
});
I'm struggling to find a way to grab the private subnet so that I can use it to create an EC2 instance.
This is what I came to thus far:
const privateSubnets = pulumi.output(vpc.privateSubnets).apply(
subnets => subnets.filter(x => x.subnet.availabilityZone == pulumi.output("us-east-1a"))
);
export const server = new aws.ec2.Instance("server", {
instanceType: aws.ec2.C5InstanceLarge,
vpcSecurityGroupIds: [ vpc.sgInternal.id ],
subnetId: privateSubnets.apply(x => x[0].id),
ami: "ami-;02507631a9f7bc956",
});
I'm getting the following error:
$ pulumi up
Previewing update (xxx):
Type Name Plan Info
pulumi:pulumi:Stack xxx 1 error; 5 messages
Diagnostics:
pulumi:pulumi:Stack (xxx):
TypeError: Cannot read property 'id' of undefined
at exports.server.aws.ec2.Instance.subnetId.privateSubnets.apply.x (ec2.ts:24:46)
at OutputImpl.<anonymous> (node_modules/@pulumi/pulumi/output.js:104:47)
at Generator.next (<anonymous>)
at fulfilled (node_modules/@pulumi/pulumi/output.js:17:58)
ambitious-van-68615
07/16/2019, 4:20 PMconst functionhw = new gcp.cloudfunctions.Function(functionName, {
sourceArchiveBucket: bucket.name,
runtime: "nodejs10",
sourceArchiveObject: bucketObjecthw.name,
entryPoint: "helloGet",
httpsTriggerUrl: `<https://us-central1-project-id.cloudfunctions.net/${functionName}>`,
triggerHttp: true,
});
Even if I use really unique values (both for my project and globally), it sets this suffixsalmon-beard-79336
07/17/2019, 2:29 PMexport interface CosmosContainerArgs {
region: pulumi.Input<string>;
endpoint: pulumi.Input<string>;
masterKey: pulumi.Input<string>;
client: any;
}
class MyResource extends pulumi.dynamic.Resource {
constructor(name: string, props: MyResourceInputs, opts?: pulumi.CustomResourceOptions) {
let region = args.region;
let endpoint = args.endpoint;
let masterKey = args.masterKey;
let connectionPolicy = new cosmos.ConnectionPolicy();
connectionPolicy.PreferredLocations = [args.region];
const client = new cosmos.CosmosClient({
endpoint,
auth: { masterKey },
connectionPolicy,
});
args.client = client;
super(myprovider, name, props, opts);
}
}
Trying to initialise a custom client in the resource constructor, so the I can pass it on to the provider to work with. What is the best way to approach this? The above fails because arg.region
returns Promise
Type 'Input<string>' is not assignable to type 'string'.
Type 'Promise<string>' is not assignable to type 'string'.
salmon-beard-79336
07/17/2019, 2:40 PMincalculable-lock-7238
07/17/2019, 2:55 PMconst cluster = new eks.Cluster(clusterName, {
vpcId: vpc.id,
subnetIds: vpc.privateSubnetIds,
instanceType: instanceType,
desiredCapacity: desiredCapacity,
minSize: minSize,
maxSize: maxSize,
storageClasses: storageClass,
deployDashboard: deployDashboard
});
...
let es = new aws.elasticsearch.Domain(
"elasticsearch",
{
....
vpcOptions: {
vpcId: vpc.id,
subnetIds: vpc.privateSubnetIds
}
}
);
getting a
Diagnostics:
aws:elasticsearch:Domain (elasticsearch):
error: aws:elasticsearch/domain:Domain resource 'elasticsearch' has a problem: "vpc_options.0.vpc_id": this field cannot be set
how can this be set properly?incalculable-lock-7238
07/17/2019, 3:27 PMloud-sugar-50419
07/18/2019, 6:35 AMlimited-rainbow-51650
07/18/2019, 9:49 PM.ts
files, all called from index.ts
?