Example #1
0
        internal InstanceRoleCredential(string roleName, IamSecurityCredentials credential)
        {
            if (credential == null)
            {
                throw new ArgumentNullException(nameof(credential));
            }

            RoleName        = roleName ?? throw new ArgumentNullException(nameof(roleName));
            AccessKeyId     = credential.AccessKeyId;
            SecretAccessKey = credential.SecretAccessKey;
            SecurityToken   = credential.Token;
            Expires         = credential.Expiration;
        }
        internal InstanceRoleCredential(string roleName, IamSecurityCredentials credential)
            : this(roleName)
        {
            #region Preconditions

            if (credential == null)
            {
                throw new ArgumentNullException(nameof(credential));
            }

            #endregion

            AccessKeyId     = credential.AccessKeyId;
            SecretAccessKey = credential.SecretAccessKey;
            SecurityToken   = credential.Token;
            Expires         = credential.Expiration;
        }
Example #3
0
        internal InstanceRoleCredential(string roleName, IamSecurityCredentials credential)
        {
            RoleName = roleName ?? throw new ArgumentNullException(nameof(roleName));

            Set(credential);
        }