I converted this TF snippet ``` resource "aws_iam_...
# general
l
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
I would say the state is not the same as your
tfstate
Maybe use a
pulumi refresh
if your resource does really exist ?
l
@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
Oh nice you found a way though this !
m
@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
@microscopic-florist-22719 It took me a while, but here is the requested issue: https://github.com/pulumi/pulumi-aws/issues/686
m
Thanks!