Git Product home page Git Product logo

Comments (4)

t0yv0 avatar t0yv0 commented on May 27, 2024 1

Thanks for reporting this @armaneous , I'm sorry this does not work as expected. Our team will be taking a look subject to time availability.

from pulumi-aws.

arwilczek90 avatar arwilczek90 commented on May 27, 2024 1

I can confirm that we are seeing this as well with a function that ignores a specific tag. In our use case this is a tag that is updated at deploy time by our CI system to a version for our observability tools to read.

import * as pulumi from '@pulumi/pulumi';
import * as aws from '@pulumi/aws';

const tags = {tag1: 'value1', tag2:'value2'};

function stubNodeArchive(handler: string): pulumi.asset.AssetArchive {
  const parts = handler.split('.');
  if (parts.length !== 2) {
    throw new Error(`handler must be like "module.function"`);
  }

  const fileName = parts[0] + '.js';
  const functionName = parts[1];

  const contents: pulumi.asset.AssetMap = {};
  contents[fileName] = new pulumi.asset.StringAsset(`
          exports.${functionName} = async function(event, context) {
              console.log("EVENT: \n" + JSON.stringify(event, null, 2))
              return context.logStreamName
          };
      `);

  return new pulumi.asset.AssetArchive(contents);
}

const lambdaRole = new aws.iam.Role(
      `lambda-role`,
      {
        assumeRolePolicy: pulumi.jsonStringify({
          Version: '2012-10-17',
          Statement: [
            {
              Action: 'sts:AssumeRole',
              Effect: 'Allow',
              Principal: {
                Service: 'lambda.amazonaws.com',
              },
            },
          ],
        }),
        tags: {...tags},
      }
);
 
const _lambdaPolicyRoleAttachement = new aws.iam.RolePolicyAttachment(
      `basic-lpra`,
      {
        policyArn: 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole', // The default lambda policy for cloudwatch,etc.
        role: lambdaRole.name,
      }
 );


const lambda = new aws.lambda.Function(
      `repro-lambda`,
      {
        name: `repro-lambda`,
        code: stubNodeArchive(handler), // This is ignored after first provision because CI updates this using the aws cli, but basically just uploads a zip with a hello world for initial provisioning. You ca
        handler: 'index.handler',
        role: lambdaRole.arn,
        runtime: 'nodejs18.x',
        memorySize: 256,
        layers: [],
        timeout: 10,
        tags: {...tags}, // This is just any object of tags, just change one outside of pulumi and refresh.
      },
      { ignoreChanges: ['code', 'tags.version', 'tags_all.version', 'tagsAll.version']}
);

This accurately ignores all the tags and code updates however it also says the lambda has a 0 change update every time its run because state still sees the version tag.

from pulumi-aws.

mikhailshilkov avatar mikhailshilkov commented on May 27, 2024

@t0yv0 Is this another issue of diff calculation in the bridge? Should we link it to the epic then?

from pulumi-aws.

t0yv0 avatar t0yv0 commented on May 27, 2024

CC @mjeffryes I'm not sure which epic - I've been labelling these as bug/diff for the moment. On the surface it looks very much like one of those issues.

@armaneous if you have a chance to add a source program that reproduces this this could help us out a lot to make it easier to resolve. Thank you!

from pulumi-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.