Skip to content

Commit

Permalink
Fix IMDSv2 test to allow /tmp to be immutable (#4673)
Browse files Browse the repository at this point in the history
The IMDSv2 test provisions a RC of the pulumi-aws-provider inside an AWS
test account and checks if it can authenticate. Unfortunately something
changed in the cloud that no longer permits unix programs to make
changes to `/tmp`. The test relied to this for no good reason; the
updated version creates a dedicated folder /home/ec2-user/repro to
perform the check.

Fixes #4670
  • Loading branch information
t0yv0 authored Oct 28, 2024
1 parent 855caa5 commit 804f14f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions provider/test-programs/imds-auth/imds-v2/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ resources:
bucket: ${upload-bucket.id}
key: pulumi-resource-aws
source:
fn::FileAsset: ${localProviderBuild}
fn::fileAsset: ${localProviderBuild}

my-instance-profile:
type: aws:iam/instanceProfile:InstanceProfile
Expand Down Expand Up @@ -167,14 +167,19 @@ resources:
type: command:remote:Command
properties:
create: |
cd /tmp
# Install pulumi and pulumi-resource-aws into PATH
export PATH="/home/ec2-user/.pulumi/bin:$PATH"
cp /tmp/pulumi-resource-aws /home/ec2-user/.pulumi/bin/
chmod a+x /home/ec2-user/.pulumi/bin/pulumi-resource-aws
echo "pulumi version:"
pulumi version
echo "pulumi-resource-aws version:"
pulumi-resource-aws -version
mkdir /home/ec2-user/repro
cp /tmp/Pulumi.yaml /home/ec2-user/repro/Pulumi.yaml
cd /home/ec2-user/repro
mkdir ./pulumi-state
export PULUMI_CONFIG_PASSPHRASE=123456
export PATH="/tmp:$PATH"
export PATH="/home/ec2-user/.pulumi/bin:$PATH"
chmod a+x /tmp/pulumi-resource-aws
pulumi version # ensure in PATH
pulumi-resource-aws --help # ensure in PATH
pulumi stack init dev
pulumi stack select dev
pulumi config
Expand Down

0 comments on commit 804f14f

Please sign in to comment.