pulumi / pulumi-aws

An Amazon Web Services (AWS) Pulumi resource package, providing multi-language access to AWS
Apache License 2.0
432 stars 153 forks source link

Always changed `aws.apigatewayv2.Stage.defaultRouteSettings.loggingLevel` #2364

Open ViktorCollin opened 1 year ago

ViktorCollin commented 1 year ago

What happened?

Creating a resource of type aws.apigatewayv2.Stage with a property defaultRouteSettings.loggingLevel set to either ERROR or INFO will always report a diff [diff: ~defaultRouteSettings]

As far as i can find there is no logging level setting for HTTP API (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging.html) it is only relevant for REST API

Expected Behavior

I don't expect there to be any diff between two consecutive runs of pulumi up

Steps to reproduce

  1. create the following resoruce and run pulumi up
    const apiStage = new aws.apigatewayv2.Stage(
    'stage',
    {
    apiId: api.id,
    name: '$default',
    accessLogSettings: {
      destinationArn: logGroup.arn,
      format: JSON.stringify(logFormat),
    },
    defaultRouteSettings: { loggingLevel: 'ERROR' }
    },
    );

    2 Run pulumi preview or pulumi up it will display a diff which is unexpected

Output of pulumi about

CLI
Version 3.54.0 Go Version go1.19.5 Go Compiler gc

Plugins NAME VERSION aws 5.29.1 aws-apigateway 1.0.1 docker 3.6.1 nodejs unknown

Host
OS darwin Version 12.6 Arch x86_64

This project is written in nodejs: executable='...node' version='v16.18.0'

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

squaremo commented 1 year ago

Confirmed, with this program:

"use strict";
const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");
const awsx = require("@pulumi/awsx");

const example = new aws.apigatewayv2.Api("example", {
    protocolType: "HTTP",
});

const apiStage = new aws.apigatewayv2.Stage(
 'stage',
  {
      apiId: example.id,
      defaultRouteSettings: { loggingLevel: 'ERROR' }
  },
);

When I run pulumi up the first time, it creates things, then the second time, it says there's a difference:

$ pulumi up                                                                                                                                                                                                           

Previewing update (foo):                                                                                                                                                                                              
     Type                       Name          Plan       Info                                                                                                                                                         
     pulumi:pulumi:Stack        aws-2364-foo                                                                                                                                                                          
 ~   └─ aws:apigatewayv2:Stage  stage         update     [diff: ~defaultRouteSettings]                                                                                                                                

Resources:                                                                                                                                                                                                            
    ~ 1 to update                                                                                                                                                                                                     
    2 unchanged                                                                                                                                                                                                       

Do you want to perform this update? details                                                                                                                                                                           
  pulumi:pulumi:Stack: (same)                                                                                                                                                                                         
    [urn=urn:pulumi:foo::aws-2364::pulumi:pulumi:Stack::aws-2364-foo]                                                                                                                                                 
    ~ aws:apigatewayv2/stage:Stage: (update)                                                                                                                                                                          
        [id=stage-0bce1f6]                                                                                                                                                                                            
        [urn=urn:pulumi:foo::aws-2364::aws:apigatewayv2/stage:Stage::stage]                                                                                                                                           
        [provider=urn:pulumi:foo::aws-2364::pulumi:providers:aws::default_5_29_1::0a0aa264-fb15-4450-9f4e-62a0967d56ad]                                                                                               
      ~ defaultRouteSettings: {
          + loggingLevel: "ERROR"
        }
orballo commented 7 months ago

I ran into this same issue but with the args accessLogSettings.destinationArn.