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

Unexpected diff with reserved ips #946

Open
kumavis opened this issue Jan 27, 2025 · 5 comments
Open

Unexpected diff with reserved ips #946

kumavis opened this issue Jan 27, 2025 · 5 comments
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec

Comments

@kumavis
Copy link

kumavis commented Jan 27, 2025

Describe what happened

"floatingip" was renamed "reservedip" at digitalocean. see the note at the top of this blog post

somewhere the old name is being used and shows up as an anomalous diff

      ~ resources: [
          ~ [1]: "do:floatingip:164.90.244.175" => "do:reservedip:164.90.244.175"
        ]

Sample program

const sshKey = digitalocean.getSshKeyOutput({
  name: sshKeyName,
});

const droplet = new digitalocean.Droplet('primary', {
  image: 'ubuntu-20-04-x64',
  name: 'test-droplet',
  region,
  size: digitalocean.DropletSlug.DropletS1VCPU1GB,
  sshKeys: [sshKey.fingerprint],
  monitoring: true,
  dropletAgent: false,
  userData: makeBashScript(
    sshSecurityEnhancements,
    installDocker,
  ),
});

const reservedIp = new digitalocean.ReservedIp(`primary`, {
  region,
});

new digitalocean.ReservedIpAssignment(`primary`, {
  ipAddress: reservedIp.ipAddress,
  dropletId: fixForDoId(droplet.id),
});

const project = new digitalocean.Project('primary', {
  name: 'playground2',
  description: 'A project to represent development resources.',
  // purpose: 'Web Application',
  // environment: 'Development',
  resources: [
    droplet.dropletUrn,
    reservedIp.reservedIpUrn,
  ],
});

Log output

No response

Affected Resource(s)

No response

Output of pulumi about

CLI          
Version      3.147.0
Go Version   go1.23.5
Go Compiler  gc

Plugins
KIND      NAME          VERSION
resource  digitalocean  4.38.0
resource  docker        4.6.1
language  nodejs        3.147.0

Host     
OS       darwin
Version  15.2
Arch     arm64

This project is written in nodejs: executable='/Users/xyz/.nvm/versions/node/v20.18.0/bin/node' version='v20.18.0'

Current Stack: organization/learn-pulumi/hello-do-docker

TYPE                                                          URN
pulumi:pulumi:Stack                                           urn:pulumi:hello-do-docker::learn-pulumi::pulumi:pulumi:Stack::learn-pulumi-hello-do-docker
pulumi:providers:digitalocean                                 urn:pulumi:hello-do-docker::learn-pulumi::pulumi:providers:digitalocean::default_4_38_0
digitalocean:index/reservedIp:ReservedIp                      urn:pulumi:hello-do-docker::learn-pulumi::digitalocean:index/reservedIp:ReservedIp::primary
pulumi:providers:docker                                       urn:pulumi:hello-do-docker::learn-pulumi::pulumi:providers:docker::default_4_6_1
docker:index/remoteImage:RemoteImage                          urn:pulumi:hello-do-docker::learn-pulumi::docker:index/remoteImage:RemoteImage::example-whoami
docker:index/container:Container                              urn:pulumi:hello-do-docker::learn-pulumi::docker:index/container:Container::example-whoami
digitalocean:index/droplet:Droplet                            urn:pulumi:hello-do-docker::learn-pulumi::digitalocean:index/droplet:Droplet::primary
pulumi:providers:docker                                       urn:pulumi:hello-do-docker::learn-pulumi::pulumi:providers:docker::docker
digitalocean:index/reservedIpAssignment:ReservedIpAssignment  urn:pulumi:hello-do-docker::learn-pulumi::digitalocean:index/reservedIpAssignment:ReservedIpAssignment::primary
digitalocean:index/project:Project                            urn:pulumi:hello-do-docker::learn-pulumi::digitalocean:index/project:Project::primary


Found no pending operations associated with hello-do-docker

Backend        
Name           xyzs-MacBook-Pro.local
URL            file://~
User           xyz
Organizations  
Token type     personal

Dependencies:
NAME                  VERSION
@pulumi/pulumi        3.147.0
@types/node           18.19.74
typescript            5.7.3
@pulumi/digitalocean  4.38.0
@pulumi/docker        4.6.1

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).

@kumavis kumavis added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jan 27, 2025
@VenelinMartinov VenelinMartinov removed the needs-triage Needs attention from the triage team label Jan 29, 2025
@VenelinMartinov
Copy link
Contributor

@kumavis thanks for your ticket and sorry you had issues. Given the resource was renamed it seems expected that the URN of the resource has changed too.

What is anomalous about the diff?

@VenelinMartinov VenelinMartinov added the awaiting-feedback Blocked on input from the author label Jan 29, 2025
@kumavis
Copy link
Author

kumavis commented Feb 4, 2025

What is anomalous about the diff?

"floatingip" was renamed to "reservedip" internally at digitalocean, but refers to the same feature.

(do:floatingip:..., do:reservedip:...) refer to the exact same instance of a reserved ip on digitalocean. this rename needs to be handled somewhere in pulumi

     ~ [1]: "do:floatingip:164.90.244.175" => "do:reservedip:164.90.244.175"

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Feb 4, 2025
@corymhall
Copy link

@kumavis if you change the resource type for a resource that you have already created (i.e. new digitalocean.FloatingIp => new digitalocean.ReservedIp) then it will cause a diff. You can tell Pulumi to treat the two resources as the same thing by using Aliases

I think this should work for your case.

const reservedIp = new digitalocean.ReservedIp(`primary`, {
  region,
}, {
  aliases: [ { type: 'do:floatingip' } ],
});

@corymhall corymhall added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Feb 4, 2025
@kumavis
Copy link
Author

kumavis commented Feb 6, 2025

if you change the resource type for a resource that you have already created (i.e. new digitalocean.FloatingIp => new digitalocean.ReservedIp) then it will cause a diff.

i have not done this. i have not made any change. this diff is appear despite not making any change, thus "anomalous" diff.

You can tell Pulumi to treat the two resources as the same thing by using Aliases

thanks ill take a look

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Feb 6, 2025
@corymhall
Copy link

@kumavis ah ok I misunderstood the issue. It looks like this is an issue with the upstream provider not yet supporting reserved ip in the Project resource.

You could try the workaround they suggest or you could use the FloatingIp resource since it is still available.

@corymhall corymhall added awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). and removed needs-triage Needs attention from the triage team labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

4 participants