Skip to content

How can I create SdkConfig with a region from String? #617

Answered by jdisanti
ababo asked this question in Q&A
Discussion options

You must be logged in to vote

Region has two constructor methods. The from_static is like you say, it can only take a &'static str. But if you use new instead, then you can pass in a string since it takes a Cow<'static, str>. So with new, the following should just work:

let region_string: String = "us-east-1".into();
let region = Region::new(region_string);

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ababo
Comment options

Answer selected by Velfi
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
2 participants