pub struct AccessKey { /* private fields */ }Available on crate feature
iam only.Expand description
Creates a new AWS secret access key and corresponding AWS access key ID for the specified user. The default status for new keys is Active. For information about quotas on the number of keys you can create, see IAM and AWS STS quotas in the IAM User Guide.
use four::{
LogicalId,
iam::{
resource::AccessKey,
UserName,
},
};
let access_key_id = LogicalId::try_from("myaccesskey").unwrap();
let user_name = UserName::try_new("myuser-name").unwrap();
let access_key = AccessKey::new(access_key_id, user_name.into());
let lhs = serde_json::to_string(&access_key).unwrap();
let mut rhs = r#"
{
"Type": "AWS::IAM::AccessKey",
"Properties": {
"UserName": "myuser-name"
}
}
"#.to_string();
rhs.retain(|c| c != '\n' && c != ' ');
assert_eq!(lhs, rhs);
Implementations§
Trait Implementations§
Source§impl HaveAtt<SecretAccessKey> for AccessKey
impl HaveAtt<SecretAccessKey> for AccessKey
Source§impl LogicalIdentified for AccessKey
impl LogicalIdentified for AccessKey
fn logical_id(&self) -> &LogicalId
Source§impl ManagedResource for AccessKey
impl ManagedResource for AccessKey
fn resource_type(&self) -> &'static str
Source§impl Referenced for AccessKey
impl Referenced for AccessKey
type To = AccessKeyId
fn referenced(&self) -> RefInner
Auto Trait Implementations§
impl Freeze for AccessKey
impl !RefUnwindSafe for AccessKey
impl !Send for AccessKey
impl !Sync for AccessKey
impl Unpin for AccessKey
impl !UnwindSafe for AccessKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more