AccessKey

Struct AccessKey 

Source
pub struct AccessKey { /* private fields */ }
Available on crate feature iam only.
Expand description

AWS::IAM::AccessKey

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§

Source§

impl AccessKey

Source

pub fn new(logical_id: LogicalId, user_name: WillBe<UserName>) -> AccessKey

Source

pub fn serial(self, serial: i64) -> Self

Source

pub fn status(self, status: AccessKeyStatus) -> Self

Trait Implementations§

Source§

impl Clone for AccessKey

Source§

fn clone(&self) -> AccessKey

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl HaveAtt<SecretAccessKey> for AccessKey

Source§

const KEY: &'static str = "SecretAccessKey"

Source§

impl LogicalIdentified for AccessKey

Source§

impl ManagedResource for AccessKey

Source§

fn resource_type(&self) -> &'static str

Source§

impl Referenced for AccessKey

Source§

type To = AccessKeyId

Source§

fn referenced(&self) -> RefInner

Source§

impl Serialize for AccessKey

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.