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

Use shared Tag type #815

Closed
2 tasks
lcmgh opened this issue May 30, 2023 · 2 comments
Closed
2 tasks

Use shared Tag type #815

lcmgh opened this issue May 30, 2023 · 2 comments
Labels
feature-request A feature should be added or improved.

Comments

@lcmgh
Copy link

lcmgh commented May 30, 2023

Describe the feature

In my use case I rely on matching tags from resources of different SD origin (IAM, EC2, RDS). I found that each SDK brings its own tag type.

https://docs.rs/aws-sdk-iam/latest/aws_sdk_iam/types/struct.Tag.html

Does it make sense for you to move this type to https://docs.rs/aws-types/0.55.3/aws_types/ ?

Use Case

Eliminates the need to implement sdk specific functions when working with tags, e.g. currently I can't equal between a tag of the IAM and the RDS crate

pub fn find_ec2_tag_value(tags: &[aws_sdk_ec2::types::Tag], tag: &str) -> Option<String> {
    tags.iter().find_map(|s| {
        if s.key().unwrap() == tag { // Todo: Avoid unwrap
            s.value().map(|v| v.to_string())
        } else {
            None
        }
    })
}

pub fn find_iam_tag_value(tags: &[aws_sdk_iam::types::Tag], tag: &str) -> Option<String> {
    tags.iter().find_map(|s| {
        if s.key().unwrap() == tag { // Todo: Avoid unwrap
            s.value().map(|v| v.to_string())
        } else {
            None
        }
    })
}

Proposed Solution

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

A note for the community

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue, please leave a comment
@lcmgh lcmgh added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 30, 2023
@jdisanti
Copy link
Contributor

This has been discussed before in #75, and #497 was raised to make types common between the DynamoDB crates. The current recommendation is to write a separate type that implements From for all the types in the SDK crates and work with that instead. We don't currently have a safe way to provide this as part of the SDK itself.

@Velfi Velfi removed the needs-triage This issue or PR still needs to be triaged. label May 31, 2023
@lcmgh lcmgh closed this as completed May 31, 2023
@github-actions
Copy link

⚠️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
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants