Skip to content

Working example of using assume_role_with_saml? #884

Answered by relausen-tlg
relausen-tlg asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for spending time on my stupid questions 😄.

Yes, the region_provider is the same in both snippets. I really like that!

I also like the original snippet better, and now I'm really embarrassed, since I managed to overlook the ConfigLoader::no_credentials method. Adding a call to that method in the loader made the original snippet work!

So now I have this working code, which lives up to your recommendation 😄:

// The region variable in the first line here is set if given by a command line parameter.
let region_provider = RegionProviderChain::first_try(region.map(Region::new))
    .or_default_provider()
    .or_else(Region::new("eu-west-1"));

let config = aws_config::from_env()
    .n…

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@relausen-tlg
Comment options

@DavidSouther
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@relausen-tlg
Comment options

@ysaito1001
Comment options

@relausen-tlg
Comment options

Answer selected by ysaito1001
@KennethWilke
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants