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

limited-rainbow-51650

07/19/2019, 10:21 AM
I converted this TF snippet
Copy code
resource "aws_iam_user_login_profile" "ringo" {
  user    = aws_iam_user.ringo.name
  pgp_key = "keybase:ringods"
}
to Pulumi TS code
Copy code
const iam_user_login_profile_ringo = new aws.iam.UserLoginProfile("ringo",
    {
        user: iam_user_ringo.name,
        pgpKey: "keybase:ringods"
    },
    {
        import: "ringo"
    })
But on
preview
, I get this warning:
Copy code
...
=   └─ aws:iam:UserLoginProfile  ringo                       import     [diff: +pgpKey]; 1 warning

Diagnostics:
  aws:iam:UserLoginProfile (ringo):
    warning: inputs to import do not match the existing resource; importing this resource will fail
The PGP key indicator is the same string. How come a difference is detected?
a

ambitious-van-68615

07/19/2019, 10:31 AM
I would say the state is not the same as your
tfstate
Maybe use a
pulumi refresh
if your resource does really exist ?
l

limited-rainbow-51650

07/19/2019, 10:52 AM
@ambitious-van-68615
refresh
didn’t help. But I guess this has something to do with some of the properties of a UserLoginProfile only done at creation time. Not sure if
import
is applicable for this type of resource. From the docs:
pgpKey: Either a base-64 encoded PGP public key, or a keybase username in the form
keybase:username
. Only applies on resource creation. Drift detection is not possible with this argument.
I solved it by manually removing my console login password on my IAM user, then just creating the
UserLoginProfile
resource. It gave me a new password and I am all set.
a

ambitious-van-68615

07/19/2019, 12:49 PM
Oh nice you found a way though this !
m

microscopic-florist-22719

07/19/2019, 3:20 PM
@limited-rainbow-51650 would you mind filing an issue for this specific resource? My guess is that the underlying TF provider does not return that property when reading the
UserLoginProfile
state from AWS, and so we see a difference.
We're working on extending the
ignoreChanges
resource option to handle cases like this.
l

limited-rainbow-51650

08/02/2019, 7:48 AM
@microscopic-florist-22719 It took me a while, but here is the requested issue: https://github.com/pulumi/pulumi-aws/issues/686
m

microscopic-florist-22719

08/02/2019, 6:06 PM
Thanks!