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

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

Open
ViktorCollin opened this issue Feb 13, 2023 · 4 comments
Open
Labels
area/providers 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 service/apigatewayv2

Comments

@ViktorCollin
Copy link

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

@ViktorCollin ViktorCollin added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Feb 13, 2023
@Frassle Frassle transferred this issue from pulumi/pulumi Feb 13, 2023
@squaremo
Copy link
Contributor

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"
        }

@squaremo squaremo added area/providers and removed needs-triage Needs attention from the triage team labels Feb 14, 2023
@thomas11 thomas11 added the bug/diff kind/bug related to Pulumi generating wrong diffs on preview or up. label Apr 26, 2023
@orballo
Copy link

orballo commented Dec 22, 2023

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

@t0yv0 t0yv0 mentioned this issue May 7, 2024
5 tasks
@t0yv0 t0yv0 removed the bug/diff kind/bug related to Pulumi generating wrong diffs on preview or up. label Sep 24, 2024
@t0yv0
Copy link
Member

t0yv0 commented Sep 24, 2024

This seems to reproduce upstream hashicorp/terraform-provider-aws#39477 and we inherit the behavior.

@t0yv0
Copy link
Member

t0yv0 commented Sep 24, 2024

Might not be ideal but can workaround with:

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";

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

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

@t0yv0 t0yv0 added awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). service/apigatewayv2 labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/providers 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 service/apigatewayv2
Projects
None yet
Development

No branches or pull requests

5 participants