https://pulumi.com logo
#general
Title
# general
w

worried-engineer-33884

07/29/2019, 5:19 PM
is it possible to self reference an output in another input? e.g. if i wanted the description to be like
Copy code
description: `this is a resource who's arn is ${this.arn}`
b

better-rainbow-14549

07/29/2019, 5:34 PM
sorry didnt see self-reference, not sure if you can do that
w

white-balloon-205

07/29/2019, 5:36 PM
In general no - this is not possible.
w

worried-engineer-33884

07/29/2019, 5:41 PM
i have an issue where I'm trying to write a JSON setting to a AWS DMS ReplicationTask's
replicationTaskSettings
property:
Copy code
{
  "Logging": {
    "LoggingEnabled": true
  }
}
https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/aws/dms/#ReplicationTaskArgs-replicationTaskSettings The problem is that the default setting (which is kept in JSON format in AWS) contains a lot of default values, which get merged with the JSON document I submit to turn on logging. As a result, every time i
pulumi up
it looks like the values have diverged, so i get an 'update' operation every time. To copy all the default values into the JSON document I submit, with logging turned on of course, I need to know the task's ARN — one of the settings is
CloudWatchLogStream
who's default value is
"dms-task-<the ARN of the task>
. I'm trying to figure out the best way to deal with this. Any ideas?
w

white-balloon-205

07/29/2019, 5:58 PM
I actually have some code doing all of this for an internal tool. It is indeed a bit painful due to how DMS works here. I ended up explicitly including the full JSON in our code to fully specify this - and marked it up with comments about where things diverge from defaults. For the log stream, I ended up doing a
refresh
and then hard-coding in the resulting value. This makes it a little harder to stand up from scratch correctly, but provides a way to close the loop for an existing deployment. You can also consider using
ignoreChanges
to ignore any perceived changes in these settings.
👍 1
w

worried-engineer-33884

07/29/2019, 6:01 PM
cc @dazzling-memory-8548 ☝ïļ
Thanks Luke, this gives us some options to run with.
ignoreChanges
doesn't seem to be working for replicationTaskSettings. It continues to see a diff and wants to update.
I'm probably hitting https://github.com/pulumi/pulumi/issues/2936 — ignoreChanges may be broken
w

white-balloon-205

07/30/2019, 4:33 PM
Depending on exactly how you are relying on it - yes 2936 may be required before this would fully suppress the diff.
w

worried-engineer-33884

07/30/2019, 4:52 PM
i'm just adding
Copy code
ignoreChanges: ["replicationTaskSettings"]
to the aws.dms.ReplicationTask resource. I wrote a custom resource to take care of the settings and manage the diff properly, but it's not fixing the problem since ignoreChanges isn't working and ReplicationTask continues to want to re-write the settings value.
Looks like ignoreChanges was fixed! 🎉 How do i peg my npm dependency to pulumi master while I wait for a release? The package.json is buried so I can't seem to do it in the usual way.
nvm, it looks like npm doesn't support this well — is there a pulumi release on the horizon?
w

white-balloon-205

08/01/2019, 4:12 PM
How do i peg my npm dependency to pulumi master
You can use
"@pulumi/pulumi": "dev"
to pin to the dev tag which is the latest
master
build.
w

worried-engineer-33884

08/01/2019, 5:12 PM
Thanks! That works, but I'm realizing that the ignoreChanges fix is more about the CLI than the node library.
I have pulumi cli v0.17.27 and the "dev" @pulumi/pulumi installed — but still not seeing ignoreChanges working.. or maybe i'm doing something wrong
w

white-balloon-205

08/01/2019, 5:19 PM
I believe the improvements to
ignoreChanges
need to be brought into providers as well before you'll see a change. I think that is still in progress. Which provider in particular are you interested in?
w

worried-engineer-33884

08/01/2019, 5:32 PM
aws
w

white-balloon-205

08/01/2019, 5:47 PM
This is pending https://github.com/pulumi/pulumi-terraform/pull/441, which will then need to get picked up by an AWS provider release.
w

worried-engineer-33884

08/01/2019, 5:49 PM
quite the daisy chain! ðŸĪŠ ok, thanks for the info, Luke
saw the pulumi-terraform PR got merged!
is this sufficient for the provider side? https://github.com/pulumi/pulumi-aws/pull/685