Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After importing ec2 LaunchTemplate pulumi is overriding the field metadataOptions #2410

Closed
infa-nang opened this issue Mar 10, 2023 · 4 comments
Assignees
Labels
area/import An issue related to `pulumi import` or the import resource option. awaiting-feedback Blocked on input from the author kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed resolution/no-repro This issue wasn't able to be reproduced
Milestone

Comments

@infa-nang
Copy link

What happened?

We have imported aws:ec2/launchTemplate:LaunchTemplate and below is properties.metadataOptions field generated by pulumi

metadataOptions:
        httpProtocolIpv6:
        httpPutResponseHopLimit: 2
        instanceMetadataTags:

and we got the below warning
warning: aws:ec2/launchTemplate:LaunchTemplate resource 'eks-7ebac768-64e1-c53e-564a-96421a8be6ad' has a problem: expected metadata_options.0.instance_metadata_tags to be one of [disabled enabled], got . Examine values at 'LaunchTemplate.MetadataOptions.InstanceMetadataTags'.

we manually fixed the metadataOptions as below

metadataOptions:
        httpProtocolIpv6: disabled
        httpPutResponseHopLimit: 2
        instanceMetadataTags: disabled

then we executed pulumi preview -r --diff and below mentioned is the diff

    ~ aws:ec2/launchTemplate:LaunchTemplate: (update)
      ~ metadataOptions: {
          + httpProtocolIpv6    : "disabled"
          + instanceMetadataTags: "disabled"
        }

then we ran pulumi up, we observed that pulumi updated the httpPutResponseHopLimit to 0, and again we did a pulumi preview -r --diff if was showing the below diff

 ~ metadataOptions: {
          ~ httpPutResponseHopLimit: 0 => 2
          + instanceMetadataTags   : "disabled"
        }

Expected Behavior

  • Pulumi should not updated httpPutResponseHopLimit
  • It should import httpProtocolIpv6 and instanceMetadataTags fields properly

Steps to reproduce

  • pulumi import aws:ec2/launchTemplate:LaunchTemplate aws-some-launch-template-name aws-some-launch-template-id
  • pulumi preview -r --diff
  • pulumi up -r

Output of pulumi about

CLI
Version 3.55.0
Go Version go1.20
Go Compiler gc

Plugins
NAME VERSION
yaml unknown

Host
OS darwin
Version 12.6.2
Arch x86_64

This project is written in yaml

Current Stack: dev

TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::pulumi-import::pulumi:pulumi:Stack::pulumi-import-dev
pulumi:providers:aws urn:pulumi:dev::pulumi-import::pulumi:providers:aws::default
aws:ec2/launchTemplate:LaunchTemplate urn:pulumi:dev::pulumi-import::aws:ec2/launchTemplate:LaunchTemplate::aws-some-launch-template-name

Found no pending operations associated with dev

Backend
Name INM1D5LG7MD6M
URL file://state
User nang
Organizations

No dependencies found

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@infa-nang infa-nang added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Mar 10, 2023
@rquitales rquitales removed the needs-triage Needs attention from the triage team label Mar 13, 2023
@rquitales
Copy link
Member

Thanks for reporting this! From the surface, it looks like we may need better handling of default values since the empty fields in the generated Pulumi code is likely due to an empty response from the AWS API server. I will have to take a deeper look into this to see what's the best way to resolve the issues you reported.

@rquitales rquitales self-assigned this Mar 13, 2023
@rquitales rquitales added the area/import An issue related to `pulumi import` or the import resource option. label Mar 13, 2023
@t0yv0
Copy link
Member

t0yv0 commented Apr 22, 2024

Related: #1940 import LaunchTemplate warnings

This was referenced Apr 22, 2024
@corymhall
Copy link
Contributor

@infa-nang I've just tried to reproduce this issue and I haven't been able to. If you are still seeing this issue can you provide a code example that we can use to reproduce? I've tried a couple different scenarios, but the launch template always imports cleanly.

@corymhall corymhall added needs-repro Needs repro steps before it can be triaged or fixed awaiting-feedback Blocked on input from the author labels Jul 3, 2024
@corymhall corymhall added the resolution/no-repro This issue wasn't able to be reproduced label Jul 22, 2024
@corymhall
Copy link
Contributor

@infa-nang I'm going to go ahead and close this issue since we can't reproduce the issue. If you are still seeing this issue please let us know and I can reopen this.

@mjeffryes mjeffryes added this to the 0.108 milestone Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import An issue related to `pulumi import` or the import resource option. awaiting-feedback Blocked on input from the author kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed resolution/no-repro This issue wasn't able to be reproduced
Projects
None yet
Development

No branches or pull requests

5 participants