From 59072e779748c7079cb3f23b96a319ff42807a56 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Fri, 25 Oct 2024 21:55:34 -0400 Subject: [PATCH 1/2] Fix IMDSv2 test to allow /tmp to be immutable --- .../imds-auth/imds-v2/Pulumi.yaml | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/provider/test-programs/imds-auth/imds-v2/Pulumi.yaml b/provider/test-programs/imds-auth/imds-v2/Pulumi.yaml index c5be8cfb2d8..0c25b07772f 100644 --- a/provider/test-programs/imds-auth/imds-v2/Pulumi.yaml +++ b/provider/test-programs/imds-auth/imds-v2/Pulumi.yaml @@ -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 @@ -167,14 +167,21 @@ 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 + stat /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 + rm -rf ./pulumi-state 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 From e0caf7ceb1ee015a5d0015a8fda28e4cb9a00f23 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Fri, 25 Oct 2024 22:05:25 -0400 Subject: [PATCH 2/2] Fix unnecesary lines --- provider/test-programs/imds-auth/imds-v2/Pulumi.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/provider/test-programs/imds-auth/imds-v2/Pulumi.yaml b/provider/test-programs/imds-auth/imds-v2/Pulumi.yaml index 0c25b07772f..bc119d7277f 100644 --- a/provider/test-programs/imds-auth/imds-v2/Pulumi.yaml +++ b/provider/test-programs/imds-auth/imds-v2/Pulumi.yaml @@ -171,7 +171,6 @@ resources: 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 - stat /home/ec2-user/.pulumi/bin/pulumi-resource-aws echo "pulumi version:" pulumi version echo "pulumi-resource-aws version:" @@ -179,7 +178,6 @@ resources: mkdir /home/ec2-user/repro cp /tmp/Pulumi.yaml /home/ec2-user/repro/Pulumi.yaml cd /home/ec2-user/repro - rm -rf ./pulumi-state mkdir ./pulumi-state export PULUMI_CONFIG_PASSPHRASE=123456 pulumi stack init dev