aws-sdk-rust icon indicating copy to clipboard operation
aws-sdk-rust copied to clipboard

Please document (and verify via tests) which http_connector/tcp_connector gets used for IMDS (to allow `https_only` for others)

Open joshtriplett opened this issue 3 years ago • 4 comments
trafficstars

Describe the bug

Setting up a custom connector requires providing that connector in several places: in the ProviderConfig, in the SdkConfig, and in the various API clients.

One of the first two gets used for IMDS, to retrieve things like the region or authentication tokens. Providing a connector that only supports https will break in this case ("Unsupported scheme http").

Please document which of the connectors gets used for IMDS, and that that connector must support HTTP.

Ideally, please also verify via tests that that connector gets used for http to IMDS (and never for https), and other connectors are never used for http, only https.

Expected Behavior

I'd like to get some kind of indication that https_only won't work for one specific connector, and a clear indication of which connector.

Current Behavior

"Unsupported scheme http"

Reproduction Steps

Configure a hyper-rustls connector, calling .https_only() on its builder during setup.

Use that connector in the provider config (via .http_connector) and the SdkConfig (via .http_connector and indirectly via the provider config passed to .configure).

Observe the failure documented above.

Possible Solution

No response

Additional Information/Context

No response

Version

├── aws-config v0.15.0
│   ├── aws-http v0.15.0
│   │   ├── aws-smithy-http v0.45.0
│   │   │   ├── aws-smithy-eventstream v0.45.0
│   │   │   │   ├── aws-smithy-types v0.45.0
│   │   │   ├── aws-smithy-types v0.45.0 (*)
│   │   ├── aws-smithy-types v0.45.0 (*)
│   │   ├── aws-types v0.15.0
│   │   │   ├── aws-smithy-async v0.45.0
│   │   │   ├── aws-smithy-client v0.45.0
│   │   │   │   ├── aws-smithy-async v0.45.0 (*)
│   │   │   │   ├── aws-smithy-http v0.45.0 (*)
│   │   │   │   ├── aws-smithy-http-tower v0.45.0
│   │   │   │   │   ├── aws-smithy-http v0.45.0 (*)
│   │   │   │   ├── aws-smithy-types v0.45.0 (*)
│   │   │   ├── aws-smithy-http v0.45.0 (*)
│   │   │   ├── aws-smithy-types v0.45.0 (*)
│   ├── aws-sdk-sso v0.15.0
│   │   ├── aws-endpoint v0.15.0
│   │   │   ├── aws-smithy-http v0.45.0 (*)
│   │   │   ├── aws-types v0.15.0 (*)
│   │   ├── aws-http v0.15.0 (*)
│   │   ├── aws-sig-auth v0.15.0
│   │   │   ├── aws-sigv4 v0.15.0
│   │   │   │   ├── aws-smithy-eventstream v0.45.0 (*)
│   │   │   │   ├── aws-smithy-http v0.45.0 (*)
│   │   │   ├── aws-smithy-eventstream v0.45.0 (*)
│   │   │   ├── aws-smithy-http v0.45.0 (*)
│   │   │   ├── aws-types v0.15.0 (*)
│   │   ├── aws-smithy-async v0.45.0 (*)
│   │   ├── aws-smithy-client v0.45.0 (*)
│   │   ├── aws-smithy-http v0.45.0 (*)
│   │   ├── aws-smithy-http-tower v0.45.0 (*)
│   │   ├── aws-smithy-json v0.45.0
│   │   │   └── aws-smithy-types v0.45.0 (*)
│   │   ├── aws-smithy-types v0.45.0 (*)
│   │   ├── aws-types v0.15.0 (*)
│   ├── aws-sdk-sts v0.15.0
│   │   ├── aws-endpoint v0.15.0 (*)
│   │   ├── aws-http v0.15.0 (*)
│   │   ├── aws-sig-auth v0.15.0 (*)
│   │   ├── aws-smithy-async v0.45.0 (*)
│   │   ├── aws-smithy-client v0.45.0 (*)
│   │   ├── aws-smithy-http v0.45.0 (*)
│   │   ├── aws-smithy-http-tower v0.45.0 (*)
│   │   ├── aws-smithy-query v0.45.0
│   │   │   ├── aws-smithy-types v0.45.0 (*)
│   │   ├── aws-smithy-types v0.45.0 (*)
│   │   ├── aws-smithy-xml v0.45.0
│   │   ├── aws-types v0.15.0 (*)
│   ├── aws-smithy-async v0.45.0 (*)
│   ├── aws-smithy-client v0.45.0 (*)
│   ├── aws-smithy-http v0.45.0 (*)
│   ├── aws-smithy-http-tower v0.45.0 (*)
│   ├── aws-smithy-json v0.45.0 (*)
│   ├── aws-smithy-types v0.45.0 (*)
│   ├── aws-types v0.15.0 (*)
├── aws-sdk-ec2 v0.15.0
│   ├── aws-endpoint v0.15.0 (*)
│   ├── aws-http v0.15.0 (*)
│   ├── aws-sig-auth v0.15.0 (*)
│   ├── aws-smithy-async v0.45.0 (*)
│   ├── aws-smithy-client v0.45.0 (*)
│   ├── aws-smithy-http v0.45.0 (*)
│   ├── aws-smithy-http-tower v0.45.0 (*)
│   ├── aws-smithy-query v0.45.0 (*)
│   ├── aws-smithy-types v0.45.0 (*)
│   ├── aws-smithy-xml v0.45.0 (*)
│   ├── aws-types v0.15.0 (*)
├── aws-sdk-s3 v0.15.0
│   ├── aws-endpoint v0.15.0 (*)
│   ├── aws-http v0.15.0 (*)
│   ├── aws-sig-auth v0.15.0 (*)
│   ├── aws-sigv4 v0.15.0 (*)
│   ├── aws-smithy-async v0.45.0 (*)
│   ├── aws-smithy-client v0.45.0 (*)
│   ├── aws-smithy-eventstream v0.45.0 (*)
│   ├── aws-smithy-http v0.45.0 (*)
│   ├── aws-smithy-http-tower v0.45.0 (*)
│   ├── aws-smithy-types v0.45.0 (*)
│   ├── aws-smithy-xml v0.45.0 (*)
│   ├── aws-types v0.15.0 (*)
├── aws-sdk-sts v0.15.0 (*)
├── aws-smithy-client v0.45.0 (*)

Environment details (OS name and version, etc.)

Debian, latest sid

Logs

No response

joshtriplett avatar Jul 10 '22 07:07 joshtriplett

Following up on this: several existing bits of documentation showing how to use ProviderConfig give examples that build a connector with https_only, and those examples will fail for this reason: the connector won't be able to access IMDS.

joshtriplett avatar Jul 10 '22 09:07 joshtriplett

I'm looking at how we define and use connectors in the SDK right now with the aim of simplifying things. I'll make sure, when the design solidifies, to make it as obvious as possible what can be set, how, and where it will be used.

Velfi avatar Jul 14 '22 17:07 Velfi

That sounds great. I would love to see a simplified model here. Thank you!

joshtriplett avatar Jul 14 '22 17:07 joshtriplett

The team is not going to be able to address this issue in the short term but we do consider it important and we'll be thinking about it.

Velfi avatar Jul 18 '22 16:07 Velfi

The right thing to do here is adding an https_only flag to ConnectorSettings. That will allow us to conditionally create the right connectors.

rcoh avatar Jul 25 '23 20:07 rcoh

Per the announcement in the latest release:

Behavior change: Credential providers now share the HTTP connector used by the SDK. If you want to keep a separate connector for clients, use <service>::ConfigBuilder::http_connector when constructing the client.

Velfi avatar Aug 03 '23 18:08 Velfi

This looks like this has been documented in the latest version. Please let us know if you still have any questions/concerns about this.

jmklix avatar Mar 15 '24 18:03 jmklix

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Mar 15 '24 18:03 github-actions[bot]