pulumi-aws icon indicating copy to clipboard operation
pulumi-aws copied to clipboard

Do not skip metadata API check by default

Open t0yv0 opened this issue 1 year ago • 4 comments

This PR explores reverting the default aws:skipMetadataApiCheck=false setting to enable the provider to be able to seamlessly authenticate against an IMDS(v2) endpoints in the AWS environment. It appears that doing so no longer slows down the provider startup time perceptibly. The way I tested the speed delta was by measuring local empty preview of an AWS s3 Bucket using AWS_PROFILE authentication with local <-> us-east-1 there is no perceptible difference.

Fixes: https://github.com/pulumi/pulumi-aws/issues/1692

An integration test is added that exercises pulumi preview on an EC2 instance with IMDSv2 and asserts that the provider can authenticate successfully.

Background:

  • https://github.com/pulumi/pulumi-aws/issues/873
  • https://github.com/pulumi/pulumi-aws/pull/1288

t0yv0 avatar May 17 '24 20:05 t0yv0

Does the PR have any schema changes?

Looking good! No breaking changes found. No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

github-actions[bot] avatar May 17 '24 20:05 github-actions[bot]

I've got the newly written test pass locally but it unfortunately is tripping up some other tests in the suite, will need another pass. Also as a side note in my VA -> us-east-1 setup I'm only getting 2MB/s from CopyFile and only slightly more up to 2.5MB/s from uploading to S3, this is a bit disappointing to upload the 700MB aws provider (yes we need to slim this down):

  helper-bucket:
    type: aws:s3:Bucket

  provider-obj:
    type: aws:s3:BucketObjectv2
    properties:
      bucket: ${helper-bucket.bucket}
      source:
        fn::fileAsset: ./pulumi-resource-aws
      etag:
        fn::invoke:
          function: std:filemd5
          arguments:
            input: ./pulumi-resource-aws
          return: result

t0yv0 avatar May 17 '24 23:05 t0yv0

Disregard the above comment, had to troubleshoot and fix local home network

t0yv0 avatar May 20 '24 13:05 t0yv0

I've only tested IMDS(v2) not IMDS(v1) but I have no reasons to believe that reverting to defaults wouldn't fix that as well.

t0yv0 avatar May 21 '24 21:05 t0yv0