pulumi / pulumi-aws

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

Perma diff in EC2 LaunchConfiguration `userData` causes replaces #4446

Closed flostadler closed 1 month ago

flostadler commented 1 month ago

Describe what happened

Since version v6.51.0 the userData property of EC2 Launch Configurations shows a diff on every deployment. The userData property is marked as ForceNew, so this causes replacements. This can cause downtime, because this can cascade into ASG instances being replaced.

This does not reproduce under v6.50.1 of the provider. My suspicion is that this is caused by the rollout of PlanResourceChange as there were no changes to the LaunchConfiguration resource in the last 3 months (see).

Sample program

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

const amiId = pulumi.interpolate`/aws/service/eks/optimized-ami/1.30/amazon-linux-2023/x86_64/standard/recommended/image_id`.apply(name =>
    aws.ssm.getParameter({ name }, { async: true })
  ).apply(result => result.value);

const userData = `#!/bin/bash

/etc/eks/bootstrap.sh
`;

const nodeLaunchConfiguration = new aws.ec2.LaunchConfiguration("test",
    {
        associatePublicIpAddress: true,
        imageId: amiId,
        instanceType: "t2.medium",
        userData: userData,
    }
);

Log output

No response

Affected Resource(s)

aws:ec2:LaunchConfiguration

Output of pulumi about

n/a

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

flostadler commented 1 month ago

This impacts EKS as well: https://github.com/pulumi/pulumi-eks/issues/1345.

flostadler commented 1 month ago

If you're running into this, you can downgrade to v6.50.1 of the AWS provider while we're working on fixing this

flostadler commented 1 month ago

I was able to pin-point it to this: https://github.com/pulumi/pulumi-terraform-bridge/issues/2408

pulumi-bot commented 1 month ago

This issue has been addressed in PR #4450 and shipped in release v6.51.1.