victorious-xylophone-55816
02/18/2020, 8:21 PMvictorious-xylophone-55816
02/18/2020, 8:22 PMvictorious-xylophone-55816
02/18/2020, 8:27 PMcool-egg-852
02/18/2020, 10:40 PMup
non-interactively?bright-orange-69401
02/19/2020, 8:29 AMResource
configuration in Pulumi ?
I'm trying to set up an SSO between Okta and AWS using Pulumi, and that requires 3 steps with 2 Resources
:
1. Create <http://okta.App|okta.App>
which generates metadata
2. Inject metadata and create aws.iam.IdentityProvider
, which has an ARN
3. Inject IdentityProvider
ARN back into the <http://okta.App|okta.App>
Resource created in step 1
I'm trying to pack this logic into a Component
but I struggle with step 3: can't seem to update a Resource
as part of a Component
Also tried using _import
but there's an URN conflict because the imported resource (step 3) would actually be the same as step 1...
Should I try creating a Dynamic Provider for that ? Can't it be done natively ?quiet-painter-30539
02/19/2020, 1:16 PMbetter-rainbow-14549
02/19/2020, 1:42 PMcalm-quill-21760
02/19/2020, 7:38 PMlet vpcList = vpcConfig.map(entry => {
return new aws.ec2.Vpc(entry.name, {cidrBlock: entry.cidrBlock, tags: {Name: entry.name}});
});
let vpcNameToId: { [index: string]: any } = {};
for (let vpc of vpcList) {
// create a lookup
const vpcName = vpc.tags.apply(v => v?.Name ?? null);
vpcName.apply(theName => {
console.log("Applying " + theName + "=" + vpc.id.apply(v => `${v}`));
// vpcNameToId[theName] = vpcId;
});
}
Results in:
Applying vpc0=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.
icy-london-58403
02/19/2020, 9:10 PMbetter-actor-92669
02/20/2020, 9:40 AMpulumi-gcp
module to create a CloudSQL DB Instance https://github.com/pulumi/pulumi-gcp/blob/master/sdk/python/pulumi_gcp/sql/database_instance.py. Since pulumi-postgresql
connects to an instance similarly to pgsql, I define PGHOST
, PGUSER
, and PGPASSWORD
during Pulumi runtime. Since the CloudSQL Instance is created via the same execution, I define dependencies like:
opts=ResourceOptions(
depends_on=[cloud_pgsql_main_1],
),
Nevertheless, it doesn't seem to work as it tries to connect to the instance immediately, however the instance is obviously not ready, and pulumi up
fails. Do you think it is possible that two separate modules pulumi-gcp
and pulumi-postgresql
do not appropriately share dependencies during runtime?quiet-wolf-18467
bitter-dentist-28132
02/20/2020, 5:42 PMpulumi.runtime.listResourceOutputs(k8s.apps.v1.Deployment.isInstance)
to collect information about the currently-deployed deployments. that project was shelved, and when i came back to it recently i discovered that it no longer works. i see that signature now asks for a type, so I gave it k8s.apps.v1.Deployment
but it still fails. does anyone know why this might be?stocky-student-96739
02/20/2020, 5:58 PMincalculable-portugal-13011
02/20/2020, 6:31 PMlet appVpc = aws.ec2.getVpc({id: "my-vpc-id"});
const webServerLoadBalancer = new awsx.lb.ApplicationLoadBalancer("web-server-lb-" + userEnv, {
securityGroups: [],
vpc: appVpc,
subnets: ["subnet-1", "subnet-2", "subnet-3"]
});
const webServerLoadBalancerListener = webServerLoadBalancer.createListener("ws-https-" + userEnv, {
port: 443,
protocol: "HTTPS",
certificateArn: "my-cert-arn"
});
const webServerLoadBalancerRedirectToHttpsListener = webServerLoadBalancer.createListener("ws-redirect-to-https", {
port: 80,
protocol: "HTTP",
defaultAction: {
type: "redirect",
redirect: {
protocol: "HTTPS",
port: "443",
statusCode: "HTTP_301"
}
}
});
const webServerCluster = new awsx.ecs.Cluster("web-server-" + userEnv, {
securityGroups: ["sg-1"],
vpc: appVpc
});
const webServerFargateService = new awsx.ecs.FargateService("web-server-" + userEnv, {
cluster: webServerCluster,
networkConfiguration: {
subnets: ["subnet-1", "subnet-2", "subnet-3"]
},
taskDefinitionArgs: {
containers: {
webServer: {
image: "my-org/web-server:" + userEnv,
portMappings: [
webServerLoadBalancerListener
],
healthCheck: {...healthCheckArgs}
}
}
}
});
the error I’m receiving is that error: aws:ecs/service:Service resource 'web-server-dev' has a problem: "network_configuration.0.subnets": required field is not set
, which doesn’t make sense to me. per the docs, I’m setting the networkConfiguration
property of the service, and I’m tried both wrapping that property in an array and as an object. no dice either way. any thoughts?able-zoo-58396
02/20/2020, 8:18 PM// create cluster
const cluster = new awsx.ecs.Cluster(`cluster`, {
name: `demo-cluster`
});
// create image
const img = awsx.ecs.Image.fromDockerBuild(`image`, {
context: './app',
});
// create task
const task = new awsx.ecs.FargateTaskDefinition(`task`, {
container: {
image: img,
memoryReservation: 2048
}
});
// create the cloudwatch event and lambda function using the "onSchedule" helper function
aws.cloudwatch.onSchedule(`task-schedule`, 'rate(5 minutes)',
async (req) => {
// run the task in our cluster
const result = await task.run({cluster});
return { statusCode: 200, body: "OK" };
}
);
Everything seems to build and deploy to AWS correctly. I see the Lambda function, CloudWatch event, logs, task definition, etc. It's all there and linked up. And when I look at my CloudWatch logs for that Lambda function, I see that it's attempting to run every 5 minutes.
However, I'm getting this error when it runs:
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module '@pulumi/awsx/ecs/index.js'\nRequire stack:\n- /var/task/__index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module '@pulumi/awsx/ecs/index.js'",
"Require stack:",
"- /var/task/__index.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object.<anonymous> (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:955:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)",
" at Module.load (internal/modules/cjs/loader.js:811:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:723:14)",
" at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)",
" at internal/main/run_main_module.js:17:11"
]
}
During the Pulumi "magic" of packaging and building the Lambda handler, it looks like it's telling Lambda to look for some Pulumi modules that aren't installed. Any ideas on why this is happening?
Thank you, thank you!!able-zoo-58396
02/20/2020, 8:29 PMtask
in the Lamdba callback that I'm creating with onSchedule
.
So, this DOES work:
const task = new awsx.ecs.FargateTaskDefinition(`task`, {
container: {
image: img,
memoryReservation: 2048
}
});
aws.cloudwatch.onSchedule(`task-schedule`, 'rate(5 minutes)',
async (req) => {
console.log('Is this thing on?')
return { statusCode: 200, body: "OK" };
}
);
But as soon as I reference the task
in the callback, I get errors about missing modules. Even if I'm not trying to run the task:
aws.cloudwatch.onSchedule(`task-schedule`, 'rate(5 minutes)',
async (req) => {
console.log(task); // just try to log the object -- don't even try to run it
return { statusCode: 200, body: "OK" };
}
);
This is the error that Lambda throws when it tries to run the callback:
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module '@pulumi/awsx/ecs/index.js'\nRequire stack:\n- /var/task/__index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
...
}
So, it seems like is's an issue with how Pulumi is packaging the Lambda function, right?
I'll add that the container image doesn't contain any references to Pulumi or dependencies, so the error probably isn't related to the image. I'm using the same image on other Fargate Services created by Pulumi, and it's running fine.incalculable-portugal-13011
02/20/2020, 10:46 PMimage
property something that implements ContainerImageProvider
, but there’s no way in awsx.ecr
to actually pull an existing image – only to create one via buildAndPushImage
. if I use aws.ecr.getImage
, it returns a getImageResult
which is incompatible as it doesn’t implement ContainerImageProvider
quiet-painter-30539
02/21/2020, 9:13 AMearly-intern-90238
02/21/2020, 3:02 PMrapid-eye-32575
02/21/2020, 3:12 PMbitter-dentist-28132
02/21/2020, 7:09 PMbest-summer-38252
02/22/2020, 2:24 AMlate-advantage-85073
02/22/2020, 3:51 AMgreat-manchester-70568
02/22/2020, 8:39 AMincalculable-portugal-13011
02/22/2020, 5:39 PMaloof-psychiatrist-4562
02/22/2020, 5:50 PMpulumi-awsx
for python? I see its 13 months stagnant. Do you have design docs which you follow for each of these projects? Looking at the node one, it looks like structure and patterns may have changed a bit.full-dress-10026
02/22/2020, 8:28 PMnutritious-judge-27316
02/22/2020, 9:33 PMbillions-glass-17089
02/22/2020, 9:47 PMnutritious-fireman-41151
02/23/2020, 5:34 AMpulumi-python:dynamic:Resource :
error: Exception calling application: There is no current event loop in thread 'ThreadPoolExecutor-0_0'.