pulumi / pulumi-aws-native

AWS Native Provider for Pulumi
Apache License 2.0
95 stars 17 forks source link

rum - Create AppMonitor returns name instead of id #333

Open piwysocki opened 2 years ago

piwysocki commented 2 years ago

Hello!

Issue details

I'm creating new rum AppMonitor:

new awsnative.rum.AppMonitor("name_of_app_monitor", { domain: "*.example.com" });

and getting output where id = "name_of_app_monitor".

Based on documentation we should get all inputs and additionally unique ID for this managed resource: https://www.pulumi.com/registry/packages/aws-native/api-docs/rum/appmonitor/#outputs

Steps to reproduce

  1. Create AppMonitor
  2. Check output

Expected: ID Actual: Name

obraz

piwysocki commented 2 years ago

We have to put AppMonitor ID into RUM code snippet:

https://github.com/aws-observability/aws-rum-web/blob/main/docs/cdn_installation.md#arguments

obraz

viveklak commented 2 years ago

I believe this is an instance where CloudControl is returning the wrong identifier back? Trying this out and capturing the payload for the requests should help.

danielrbradley commented 2 years ago

I've reproduced the issue and yes, it appear that AWS CloudControl uses the name as the identifier for this resource. They haven't yet added the monitor ID to the resource schema so that's not available indirectly either. Will report this upstream.

danielrbradley commented 2 years ago

Repro:

        monitor, err := rum.NewAppMonitor(ctx, "mon", &rum.AppMonitorArgs{
            Domain: pulumi.String("*.example.com"),
        })
        if err != nil {
            return err
        }

        ctx.Export("monid", monitor.ID())
        ctx.Export("monname", monitor.Name)

Outputs:

Outputs:
  + monid  : "mon-53833c9"
  + monname: "mon-53833c9"

Relevant cloudcontrol schema sections:

{
  ...
  "properties" : {
    "Name" : {...},
    "Domain" : {...},
    "CwLogEnabled" : {...},
    "Tags" : {...},
    "AppMonitorConfiguration" : {...}
  },
  "createOnlyProperties" : [ "/properties/Name" ],
  "primaryIdentifier" : [ "/properties/Name" ],
  ...
}
piwysocki commented 2 years ago

Can we get a link to the reported issue upstream?

danielrbradley commented 2 years ago

Unfortunately this reporting is via an internal channel which isn't linkable.

Could I also ask what your usecase is for needing this property? Are you needing this value for use elsewhere?

piwysocki commented 2 years ago

I have to modify ID in RUM code snippet: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-get-started-insert-code-snippet.html

piwysocki commented 2 years ago

Hi, how is it going? Can you remove "needs-repro" label?

piwysocki commented 2 years ago

Hi, I can see in AWS docs that sample response from CreateAppMonitor is guid:

https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_CreateAppMonitor.html

obraz

Are we close to fix this issue?

danielrbradley commented 2 years ago

Great! It looks like the issue's been resolved upstream then. Will close this as fixed.

piwysocki commented 2 years ago

Hi, can I ask where is the code change?

https://github.com/pulumi/pulumi-aws-native/blob/e60427c280bac55a20be6babf615fb437d17290f/aws-cloudformation-schema/aws-rum-appmonitor.json

this file is not correct:

"createOnlyProperties" : [ "/properties/Name" ], "primaryIdentifier" : [ "/properties/Name" ],

why this item is closed?

piwysocki commented 2 years ago

Great! It looks like the issue's been resolved upstream then. Will close this as fixed.

it's not fixed

danielrbradley commented 2 years ago

Ah my misunderstanding. I thought you were showing a screenshot of the id being returned correctly now. Will re-open.

michalpodolak commented 2 years ago

Hi,

is there any update on resolving this issue?

Unfortunately this issue is blocking me from using CloudWatchRUM.

piwysocki commented 2 years ago

Hi, is there any update on this?

danielrbradley commented 2 years ago

Hi, is there any update on this?

No, there's not yet been a fix published upstream.

piwysocki commented 2 years ago

this is not fixed yet. Can you remove label "resolution/fixed" and add "awaiting-upstream"?

corymhall commented 1 month ago

Looks like this has been fixed upstream, but is still an issue. I've created https://github.com/pulumi/pulumi-aws-native/issues/1734