Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS SDK client and configuration appears to not work in some cases #802

Closed
k-cross opened this issue May 4, 2023 · 4 comments
Closed

ECS SDK client and configuration appears to not work in some cases #802

k-cross opened this issue May 4, 2023 · 4 comments
Labels
bug This issue is a bug.

Comments

@k-cross
Copy link

k-cross commented May 4, 2023

Describe the bug

I use multiple SDKs and they all work fine setting up a client with something like this:

EC2 Example:

  28   │         let region_provider = RegionProviderChain::first_try(Region::new(region.to_owned()))
  29   │             .or_default_provider()
  30   │             .or_else(Region::new("us-west-2"));
  31   │         let shared_config = aws_config::from_env().region(region_provider).load().await;
  32   │         let client = Client::new(&shared_config);

For ECS I get failures and the documented way to setup a client for a region does not work.

error[E0277]: the trait bound `aws_sdk_ecs::config::Region: aws_config::meta::region::ProvideRegion` is not satisfied
  --> src/cloud/amazon/container_service.rs:23:22
   |
23 |             .or_else(Region::new("us-west-2"));
   |              ------- ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `aws_config::meta::region::ProvideRegion` is not implemented for `aws_sdk_ecs::config::Region`
   |              |
   |              required by a bound introduced by this call

Expected Behavior

I expect for their to be a path where the proper traits are implemented to setup a region provider for ECS.

Current Behavior

Compilation fails.

Reproduction Steps

        let region_provider = RegionProviderChain::default_provider();
        
        let shared_config = aws_config::from_env().region(region_provider).load().await;
        let client = Client::new(&shared_config);

this fail to compile due to invalid types. adding an actual region beyond the default will complain about undefined traits

Possible Solution

Adding a aws_sdk_ecs::Region to define traits on and a using the SdkConfig type defined in aws_config would probably solve the issues.

Additional Information/Context

I'm not sure why ECS deviates from EC2, NetworkManager, Config, and S3 SDKs so much, but that's the behavior I expect from setting up clients in any of the service SDKs at this point. It's quite possible I'm just doing things wrong.

Version

Rust 1.69.0


├── aws-config v0.49.0
│   ├── aws-http v0.49.0
│   │   ├── aws-smithy-http v0.49.0
│   │   │   ├── aws-smithy-eventstream v0.49.0
│   │   │   │   ├── aws-smithy-types v0.49.0
│   │   │   ├── aws-smithy-types v0.49.0 (*)
│   │   ├── aws-smithy-types v0.49.0 (*)
│   │   ├── aws-types v0.49.0
│   │   │   ├── aws-smithy-async v0.49.0
│   │   │   ├── aws-smithy-client v0.49.0
│   │   │   │   ├── aws-smithy-async v0.49.0 (*)
│   │   │   │   ├── aws-smithy-http v0.49.0 (*)
│   │   │   │   ├── aws-smithy-http-tower v0.49.0
│   │   │   │   │   ├── aws-smithy-http v0.49.0 (*)
│   │   │   │   ├── aws-smithy-types v0.49.0 (*)
│   │   │   ├── aws-smithy-http v0.49.0 (*)
│   │   │   ├── aws-smithy-types v0.49.0 (*)
│   ├── aws-sdk-sso v0.19.0
│   │   ├── aws-endpoint v0.49.0
│   │   │   ├── aws-smithy-http v0.49.0 (*)
│   │   │   ├── aws-smithy-types v0.49.0 (*)
│   │   │   ├── aws-types v0.49.0 (*)
│   │   ├── aws-http v0.49.0 (*)
│   │   ├── aws-sig-auth v0.49.0
│   │   │   ├── aws-sigv4 v0.49.1
│   │   │   │   ├── aws-smithy-eventstream v0.49.0 (*)
│   │   │   │   ├── aws-smithy-http v0.49.0 (*)
│   │   │   ├── aws-smithy-eventstream v0.49.0 (*)
│   │   │   ├── aws-smithy-http v0.49.0 (*)
│   │   │   ├── aws-types v0.49.0 (*)
│   │   ├── aws-smithy-async v0.49.0 (*)
│   │   ├── aws-smithy-client v0.49.0 (*)
│   │   ├── aws-smithy-http v0.49.0 (*)
│   │   ├── aws-smithy-http-tower v0.49.0 (*)
│   │   ├── aws-smithy-json v0.49.0
│   │   │   └── aws-smithy-types v0.49.0 (*)
│   │   ├── aws-smithy-types v0.49.0 (*)
│   │   ├── aws-types v0.49.0 (*)
│   ├── aws-sdk-sts v0.19.0
│   │   ├── aws-endpoint v0.49.0 (*)
│   │   ├── aws-http v0.49.0 (*)
│   │   ├── aws-sig-auth v0.49.0 (*)
│   │   ├── aws-smithy-async v0.49.0 (*)
│   │   ├── aws-smithy-client v0.49.0 (*)
│   │   ├── aws-smithy-http v0.49.0 (*)
│   │   ├── aws-smithy-http-tower v0.49.0 (*)
│   │   ├── aws-smithy-query v0.49.0
│   │   │   ├── aws-smithy-types v0.49.0 (*)
│   │   ├── aws-smithy-types v0.49.0 (*)
│   │   ├── aws-smithy-xml v0.49.0
│   │   ├── aws-types v0.49.0 (*)
│   ├── aws-smithy-async v0.49.0 (*)
│   ├── aws-smithy-client v0.49.0 (*)
│   ├── aws-smithy-http v0.49.0 (*)
│   ├── aws-smithy-http-tower v0.49.0 (*)
│   ├── aws-smithy-json v0.49.0 (*)
│   ├── aws-smithy-types v0.49.0 (*)
│   ├── aws-types v0.49.0 (*)
├── aws-sdk-config v0.19.0
│   ├── aws-endpoint v0.49.0 (*)
│   ├── aws-http v0.49.0 (*)
│   ├── aws-sig-auth v0.49.0 (*)
│   ├── aws-smithy-async v0.49.0 (*)
│   ├── aws-smithy-client v0.49.0 (*)
│   ├── aws-smithy-http v0.49.0 (*)
│   ├── aws-smithy-http-tower v0.49.0 (*)
│   ├── aws-smithy-json v0.49.0 (*)
│   ├── aws-smithy-types v0.49.0 (*)
│   ├── aws-types v0.49.0 (*)
├── aws-sdk-ec2 v0.19.0
│   ├── aws-endpoint v0.49.0 (*)
│   ├── aws-http v0.49.0 (*)
│   ├── aws-sig-auth v0.49.0 (*)
│   ├── aws-smithy-async v0.49.0 (*)
│   ├── aws-smithy-client v0.49.0 (*)
│   ├── aws-smithy-http v0.49.0 (*)
│   ├── aws-smithy-http-tower v0.49.0 (*)
│   ├── aws-smithy-query v0.49.0 (*)
│   ├── aws-smithy-types v0.49.0 (*)
│   ├── aws-smithy-xml v0.49.0 (*)
│   ├── aws-types v0.49.0 (*)
├── aws-sdk-ecs v0.27.0
│   ├── aws-credential-types v0.55.2
│   │   ├── aws-smithy-async v0.55.2
│   │   ├── aws-smithy-types v0.55.2
│   ├── aws-endpoint v0.55.2
│   │   ├── aws-smithy-http v0.55.2
│   │   │   ├── aws-smithy-types v0.55.2 (*)
│   │   ├── aws-smithy-types v0.55.2 (*)
│   │   ├── aws-types v0.55.2
│   │   │   ├── aws-credential-types v0.55.2 (*)
│   │   │   ├── aws-smithy-async v0.55.2 (*)
│   │   │   ├── aws-smithy-client v0.55.2
│   │   │   │   ├── aws-smithy-async v0.55.2 (*)
│   │   │   │   ├── aws-smithy-http v0.55.2 (*)
│   │   │   │   ├── aws-smithy-http-tower v0.55.2
│   │   │   │   │   ├── aws-smithy-http v0.55.2 (*)
│   │   │   │   │   ├── aws-smithy-types v0.55.2 (*)
│   │   │   │   ├── aws-smithy-types v0.55.2 (*)
│   │   │   ├── aws-smithy-http v0.55.2 (*)
│   │   │   ├── aws-smithy-types v0.55.2 (*)
│   ├── aws-http v0.55.2
│   │   ├── aws-credential-types v0.55.2 (*)
│   │   ├── aws-smithy-http v0.55.2 (*)
│   │   ├── aws-smithy-types v0.55.2 (*)
│   │   ├── aws-types v0.55.2 (*)
│   ├── aws-sig-auth v0.55.2
│   │   ├── aws-credential-types v0.55.2 (*)
│   │   ├── aws-sigv4 v0.55.2
│   │   │   ├── aws-smithy-http v0.55.2 (*)
│   │   ├── aws-smithy-http v0.55.2 (*)
│   │   ├── aws-types v0.55.2 (*)
│   ├── aws-smithy-async v0.55.2 (*)
│   ├── aws-smithy-client v0.55.2 (*)
│   ├── aws-smithy-http v0.55.2 (*)
│   ├── aws-smithy-http-tower v0.55.2 (*)
│   ├── aws-smithy-json v0.55.2
│   │   └── aws-smithy-types v0.55.2 (*)
│   ├── aws-smithy-types v0.55.2 (*)
│   ├── aws-types v0.55.2 (*)
├── aws-sdk-networkmanager v0.19.0
│   ├── aws-endpoint v0.49.0 (*)
│   ├── aws-http v0.49.0 (*)
│   ├── aws-sig-auth v0.49.0 (*)
│   ├── aws-smithy-async v0.49.0 (*)
│   ├── aws-smithy-client v0.49.0 (*)
│   ├── aws-smithy-http v0.49.0 (*)
│   ├── aws-smithy-http-tower v0.49.0 (*)
│   ├── aws-smithy-json v0.49.0 (*)
│   ├── aws-smithy-types v0.49.0 (*)
│   ├── aws-types v0.49.0 (*)
├── aws-sdk-s3 v0.19.0
│   ├── aws-endpoint v0.49.0 (*)
│   ├── aws-http v0.49.0 (*)
│   ├── aws-sig-auth v0.49.0 (*)
│   ├── aws-sigv4 v0.49.1 (*)
│   ├── aws-smithy-async v0.49.0 (*)
│   ├── aws-smithy-checksums v0.49.0
│   │   ├── aws-smithy-http v0.49.0 (*)
│   │   ├── aws-smithy-types v0.49.0 (*)
│   ├── aws-smithy-client v0.49.0 (*)
│   ├── aws-smithy-eventstream v0.49.0 (*)
│   ├── aws-smithy-http v0.49.0 (*)
│   ├── aws-smithy-http-tower v0.49.0 (*)
│   ├── aws-smithy-types v0.49.0 (*)
│   ├── aws-smithy-xml v0.49.0 (*)
│   ├── aws-types v0.49.0 (*)
├── aws-types v0.49.0 (*)


### Environment details (OS name and version, etc.)

MacOS Intel 13.3.1 (a)

### Logs

_No response_
@k-cross k-cross added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 4, 2023
@jdisanti
Copy link
Contributor

jdisanti commented May 4, 2023

This is a version consistency issue. The aws-config crate is set to 0.49, which depends on the 0.49 set of runtime support crates, but the aws-sdk-ecs crate is on 0.27, which depends on the 0.55.2 set of runtime crates. The Region type in 0.49 is not the same Region type as in 0.55.2 due to semver.

You can resolve this by switching dependencies to the versions listed in the Crate Versions table at the bottom of the most recent SDK release: https://github.com/awslabs/aws-sdk-rust/releases/tag/release-2023-05-01

This is an unfortunate side effect of our crates being 0.x, and it should go away once we have a 1.x release.

@k-cross
Copy link
Author

k-cross commented May 5, 2023

Awesome, thank you for the speedy response. I'll set that up immediately!

@Velfi Velfi removed the needs-triage This issue or PR still needs to be triaged. label May 8, 2023
@Velfi
Copy link
Contributor

Velfi commented May 8, 2023

I'm closing this since it turned out to be a version mismatch issue.

@Velfi Velfi closed this as completed May 8, 2023
@github-actions
Copy link

github-actions bot commented May 8, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants