Uniform IAM datetime ISO 8601 handling (#2169)
`str(datetime.utcnow())` returns a timestamp that's not of the same format as the AWS SDK uses, in short it's missing the `T` between the date and the time. This causes issues for e.g. Terraform and probably other AWS Go SDK users. There seems to be some differences between endpoints whether they return milliseconds or not, the AWS API docs were reviewed and the decision whether to return timestamps with milliseconds or not based on the example response documented. As the timstamps are generated for uniqueness rather than being hardcoded and then directly cast to a UTC (Z) formed timestamp pytz was removed as timezone correctness is probably not important.
This commit is contained in:
parent
664b27d8e7
commit
d25a7ff936
@ -8,10 +8,9 @@ import re
|
|||||||
from cryptography import x509
|
from cryptography import x509
|
||||||
from cryptography.hazmat.backends import default_backend
|
from cryptography.hazmat.backends import default_backend
|
||||||
|
|
||||||
import pytz
|
|
||||||
from moto.core.exceptions import RESTError
|
from moto.core.exceptions import RESTError
|
||||||
from moto.core import BaseBackend, BaseModel
|
from moto.core import BaseBackend, BaseModel
|
||||||
from moto.core.utils import iso_8601_datetime_without_milliseconds
|
from moto.core.utils import iso_8601_datetime_without_milliseconds, iso_8601_datetime_with_milliseconds
|
||||||
|
|
||||||
from .aws_managed_policies import aws_managed_policies_data
|
from .aws_managed_policies import aws_managed_policies_data
|
||||||
from .exceptions import IAMNotFoundException, IAMConflictException, IAMReportNotPresentException, MalformedCertificate, \
|
from .exceptions import IAMNotFoundException, IAMConflictException, IAMReportNotPresentException, MalformedCertificate, \
|
||||||
@ -28,11 +27,15 @@ class MFADevice(object):
|
|||||||
serial_number,
|
serial_number,
|
||||||
authentication_code_1,
|
authentication_code_1,
|
||||||
authentication_code_2):
|
authentication_code_2):
|
||||||
self.enable_date = datetime.now(pytz.utc)
|
self.enable_date = datetime.utcnow()
|
||||||
self.serial_number = serial_number
|
self.serial_number = serial_number
|
||||||
self.authentication_code_1 = authentication_code_1
|
self.authentication_code_1 = authentication_code_1
|
||||||
self.authentication_code_2 = authentication_code_2
|
self.authentication_code_2 = authentication_code_2
|
||||||
|
|
||||||
|
@property
|
||||||
|
def enabled_iso_8601(self):
|
||||||
|
return iso_8601_datetime_without_milliseconds(self.enable_date)
|
||||||
|
|
||||||
|
|
||||||
class Policy(BaseModel):
|
class Policy(BaseModel):
|
||||||
is_attachable = False
|
is_attachable = False
|
||||||
@ -58,8 +61,16 @@ class Policy(BaseModel):
|
|||||||
self.next_version_num = 2
|
self.next_version_num = 2
|
||||||
self.versions = [PolicyVersion(self.arn, document, True)]
|
self.versions = [PolicyVersion(self.arn, document, True)]
|
||||||
|
|
||||||
self.create_datetime = datetime.now(pytz.utc)
|
self.create_date = datetime.utcnow()
|
||||||
self.update_datetime = datetime.now(pytz.utc)
|
self.update_date = datetime.utcnow()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def created_iso_8601(self):
|
||||||
|
return iso_8601_datetime_with_milliseconds(self.create_date)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def updated_iso_8601(self):
|
||||||
|
return iso_8601_datetime_with_milliseconds(self.update_date)
|
||||||
|
|
||||||
|
|
||||||
class SAMLProvider(BaseModel):
|
class SAMLProvider(BaseModel):
|
||||||
@ -83,7 +94,11 @@ class PolicyVersion(object):
|
|||||||
self.is_default = is_default
|
self.is_default = is_default
|
||||||
self.version_id = 'v1'
|
self.version_id = 'v1'
|
||||||
|
|
||||||
self.create_datetime = datetime.now(pytz.utc)
|
self.create_date = datetime.utcnow()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def created_iso_8601(self):
|
||||||
|
return iso_8601_datetime_with_milliseconds(self.create_date)
|
||||||
|
|
||||||
|
|
||||||
class ManagedPolicy(Policy):
|
class ManagedPolicy(Policy):
|
||||||
@ -139,11 +154,15 @@ class Role(BaseModel):
|
|||||||
self.path = path or '/'
|
self.path = path or '/'
|
||||||
self.policies = {}
|
self.policies = {}
|
||||||
self.managed_policies = {}
|
self.managed_policies = {}
|
||||||
self.create_date = datetime.now(pytz.utc)
|
self.create_date = datetime.utcnow()
|
||||||
self.tags = {}
|
self.tags = {}
|
||||||
self.description = ""
|
self.description = ""
|
||||||
self.permissions_boundary = permissions_boundary
|
self.permissions_boundary = permissions_boundary
|
||||||
|
|
||||||
|
@property
|
||||||
|
def created_iso_8601(self):
|
||||||
|
return iso_8601_datetime_with_milliseconds(self.create_date)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name):
|
def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name):
|
||||||
properties = cloudformation_json['Properties']
|
properties = cloudformation_json['Properties']
|
||||||
@ -198,7 +217,11 @@ class InstanceProfile(BaseModel):
|
|||||||
self.name = name
|
self.name = name
|
||||||
self.path = path or '/'
|
self.path = path or '/'
|
||||||
self.roles = roles if roles else []
|
self.roles = roles if roles else []
|
||||||
self.create_date = datetime.now(pytz.utc)
|
self.create_date = datetime.utcnow()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def created_iso_8601(self):
|
||||||
|
return iso_8601_datetime_with_milliseconds(self.create_date)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name):
|
def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name):
|
||||||
@ -250,9 +273,13 @@ class SigningCertificate(BaseModel):
|
|||||||
self.id = id
|
self.id = id
|
||||||
self.user_name = user_name
|
self.user_name = user_name
|
||||||
self.body = body
|
self.body = body
|
||||||
self.upload_date = datetime.strftime(datetime.utcnow(), "%Y-%m-%d-%H-%M-%S")
|
self.upload_date = datetime.utcnow()
|
||||||
self.status = 'Active'
|
self.status = 'Active'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def uploaded_iso_8601(self):
|
||||||
|
return iso_8601_datetime_without_milliseconds(self.upload_date)
|
||||||
|
|
||||||
|
|
||||||
class AccessKey(BaseModel):
|
class AccessKey(BaseModel):
|
||||||
|
|
||||||
@ -261,14 +288,16 @@ class AccessKey(BaseModel):
|
|||||||
self.access_key_id = random_access_key()
|
self.access_key_id = random_access_key()
|
||||||
self.secret_access_key = random_alphanumeric(32)
|
self.secret_access_key = random_alphanumeric(32)
|
||||||
self.status = 'Active'
|
self.status = 'Active'
|
||||||
self.create_date = datetime.strftime(
|
self.create_date = datetime.utcnow()
|
||||||
datetime.utcnow(),
|
self.last_used = datetime.utcnow()
|
||||||
"%Y-%m-%dT%H:%M:%SZ"
|
|
||||||
)
|
@property
|
||||||
self.last_used = datetime.strftime(
|
def created_iso_8601(self):
|
||||||
datetime.utcnow(),
|
return iso_8601_datetime_without_milliseconds(self.create_date)
|
||||||
"%Y-%m-%dT%H:%M:%SZ"
|
|
||||||
)
|
@property
|
||||||
|
def last_used_iso_8601(self):
|
||||||
|
return iso_8601_datetime_without_milliseconds(self.last_used)
|
||||||
|
|
||||||
def get_cfn_attribute(self, attribute_name):
|
def get_cfn_attribute(self, attribute_name):
|
||||||
from moto.cloudformation.exceptions import UnformattedGetAttTemplateException
|
from moto.cloudformation.exceptions import UnformattedGetAttTemplateException
|
||||||
@ -283,15 +312,16 @@ class Group(BaseModel):
|
|||||||
self.name = name
|
self.name = name
|
||||||
self.id = random_resource_id()
|
self.id = random_resource_id()
|
||||||
self.path = path
|
self.path = path
|
||||||
self.created = datetime.strftime(
|
self.create_date = datetime.utcnow()
|
||||||
datetime.utcnow(),
|
|
||||||
"%Y-%m-%d-%H-%M-%S"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.users = []
|
self.users = []
|
||||||
self.managed_policies = {}
|
self.managed_policies = {}
|
||||||
self.policies = {}
|
self.policies = {}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def created_iso_8601(self):
|
||||||
|
return iso_8601_datetime_with_milliseconds(self.create_date)
|
||||||
|
|
||||||
def get_cfn_attribute(self, attribute_name):
|
def get_cfn_attribute(self, attribute_name):
|
||||||
from moto.cloudformation.exceptions import UnformattedGetAttTemplateException
|
from moto.cloudformation.exceptions import UnformattedGetAttTemplateException
|
||||||
if attribute_name == 'Arn':
|
if attribute_name == 'Arn':
|
||||||
@ -306,10 +336,6 @@ class Group(BaseModel):
|
|||||||
else:
|
else:
|
||||||
return "arn:aws:iam::{0}:group/{1}/{2}".format(ACCOUNT_ID, self.path, self.name)
|
return "arn:aws:iam::{0}:group/{1}/{2}".format(ACCOUNT_ID, self.path, self.name)
|
||||||
|
|
||||||
@property
|
|
||||||
def create_date(self):
|
|
||||||
return self.created
|
|
||||||
|
|
||||||
def get_policy(self, policy_name):
|
def get_policy(self, policy_name):
|
||||||
try:
|
try:
|
||||||
policy_json = self.policies[policy_name]
|
policy_json = self.policies[policy_name]
|
||||||
@ -335,7 +361,7 @@ class User(BaseModel):
|
|||||||
self.name = name
|
self.name = name
|
||||||
self.id = random_resource_id()
|
self.id = random_resource_id()
|
||||||
self.path = path if path else "/"
|
self.path = path if path else "/"
|
||||||
self.created = datetime.utcnow()
|
self.create_date = datetime.utcnow()
|
||||||
self.mfa_devices = {}
|
self.mfa_devices = {}
|
||||||
self.policies = {}
|
self.policies = {}
|
||||||
self.managed_policies = {}
|
self.managed_policies = {}
|
||||||
@ -350,7 +376,7 @@ class User(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def created_iso_8601(self):
|
def created_iso_8601(self):
|
||||||
return iso_8601_datetime_without_milliseconds(self.created)
|
return iso_8601_datetime_with_milliseconds(self.create_date)
|
||||||
|
|
||||||
def get_policy(self, policy_name):
|
def get_policy(self, policy_name):
|
||||||
policy_json = None
|
policy_json = None
|
||||||
@ -421,7 +447,7 @@ class User(BaseModel):
|
|||||||
|
|
||||||
def to_csv(self):
|
def to_csv(self):
|
||||||
date_format = '%Y-%m-%dT%H:%M:%S+00:00'
|
date_format = '%Y-%m-%dT%H:%M:%S+00:00'
|
||||||
date_created = self.created
|
date_created = self.create_date
|
||||||
# aagrawal,arn:aws:iam::509284790694:user/aagrawal,2014-09-01T22:28:48+00:00,true,2014-11-12T23:36:49+00:00,2014-09-03T18:59:00+00:00,N/A,false,true,2014-09-01T22:28:48+00:00,false,N/A,false,N/A,false,N/A
|
# aagrawal,arn:aws:iam::509284790694:user/aagrawal,2014-09-01T22:28:48+00:00,true,2014-11-12T23:36:49+00:00,2014-09-03T18:59:00+00:00,N/A,false,true,2014-09-01T22:28:48+00:00,false,N/A,false,N/A,false,N/A
|
||||||
if not self.password:
|
if not self.password:
|
||||||
password_enabled = 'false'
|
password_enabled = 'false'
|
||||||
@ -1050,7 +1076,7 @@ class IAMBackend(BaseBackend):
|
|||||||
if key.access_key_id == access_key_id:
|
if key.access_key_id == access_key_id:
|
||||||
return {
|
return {
|
||||||
'user_name': key.user_name,
|
'user_name': key.user_name,
|
||||||
'last_used': key.last_used
|
'last_used': key.last_used_iso_8601,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
raise IAMNotFoundException(
|
raise IAMNotFoundException(
|
||||||
|
@ -818,12 +818,12 @@ CREATE_POLICY_TEMPLATE = """<CreatePolicyResponse>
|
|||||||
<Policy>
|
<Policy>
|
||||||
<Arn>{{ policy.arn }}</Arn>
|
<Arn>{{ policy.arn }}</Arn>
|
||||||
<AttachmentCount>{{ policy.attachment_count }}</AttachmentCount>
|
<AttachmentCount>{{ policy.attachment_count }}</AttachmentCount>
|
||||||
<CreateDate>{{ policy.create_datetime.isoformat() }}</CreateDate>
|
<CreateDate>{{ policy.created_iso_8601 }}</CreateDate>
|
||||||
<DefaultVersionId>{{ policy.default_version_id }}</DefaultVersionId>
|
<DefaultVersionId>{{ policy.default_version_id }}</DefaultVersionId>
|
||||||
<Path>{{ policy.path }}</Path>
|
<Path>{{ policy.path }}</Path>
|
||||||
<PolicyId>{{ policy.id }}</PolicyId>
|
<PolicyId>{{ policy.id }}</PolicyId>
|
||||||
<PolicyName>{{ policy.name }}</PolicyName>
|
<PolicyName>{{ policy.name }}</PolicyName>
|
||||||
<UpdateDate>{{ policy.update_datetime.isoformat() }}</UpdateDate>
|
<UpdateDate>{{ policy.updated_iso_8601 }}</UpdateDate>
|
||||||
</Policy>
|
</Policy>
|
||||||
</CreatePolicyResult>
|
</CreatePolicyResult>
|
||||||
<ResponseMetadata>
|
<ResponseMetadata>
|
||||||
@ -841,8 +841,8 @@ GET_POLICY_TEMPLATE = """<GetPolicyResponse>
|
|||||||
<Path>{{ policy.path }}</Path>
|
<Path>{{ policy.path }}</Path>
|
||||||
<Arn>{{ policy.arn }}</Arn>
|
<Arn>{{ policy.arn }}</Arn>
|
||||||
<AttachmentCount>{{ policy.attachment_count }}</AttachmentCount>
|
<AttachmentCount>{{ policy.attachment_count }}</AttachmentCount>
|
||||||
<CreateDate>{{ policy.create_datetime.isoformat() }}</CreateDate>
|
<CreateDate>{{ policy.created_iso_8601 }}</CreateDate>
|
||||||
<UpdateDate>{{ policy.update_datetime.isoformat() }}</UpdateDate>
|
<UpdateDate>{{ policy.updated_iso_8601 }}</UpdateDate>
|
||||||
</Policy>
|
</Policy>
|
||||||
</GetPolicyResult>
|
</GetPolicyResult>
|
||||||
<ResponseMetadata>
|
<ResponseMetadata>
|
||||||
@ -929,12 +929,12 @@ LIST_POLICIES_TEMPLATE = """<ListPoliciesResponse>
|
|||||||
<member>
|
<member>
|
||||||
<Arn>{{ policy.arn }}</Arn>
|
<Arn>{{ policy.arn }}</Arn>
|
||||||
<AttachmentCount>{{ policy.attachment_count }}</AttachmentCount>
|
<AttachmentCount>{{ policy.attachment_count }}</AttachmentCount>
|
||||||
<CreateDate>{{ policy.create_datetime.isoformat() }}</CreateDate>
|
<CreateDate>{{ policy.created_iso_8601 }}</CreateDate>
|
||||||
<DefaultVersionId>{{ policy.default_version_id }}</DefaultVersionId>
|
<DefaultVersionId>{{ policy.default_version_id }}</DefaultVersionId>
|
||||||
<Path>{{ policy.path }}</Path>
|
<Path>{{ policy.path }}</Path>
|
||||||
<PolicyId>{{ policy.id }}</PolicyId>
|
<PolicyId>{{ policy.id }}</PolicyId>
|
||||||
<PolicyName>{{ policy.name }}</PolicyName>
|
<PolicyName>{{ policy.name }}</PolicyName>
|
||||||
<UpdateDate>{{ policy.update_datetime.isoformat() }}</UpdateDate>
|
<UpdateDate>{{ policy.updated_iso_8601 }}</UpdateDate>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</Policies>
|
</Policies>
|
||||||
@ -958,7 +958,7 @@ CREATE_INSTANCE_PROFILE_TEMPLATE = """<CreateInstanceProfileResponse xmlns="http
|
|||||||
<InstanceProfileName>{{ profile.name }}</InstanceProfileName>
|
<InstanceProfileName>{{ profile.name }}</InstanceProfileName>
|
||||||
<Path>{{ profile.path }}</Path>
|
<Path>{{ profile.path }}</Path>
|
||||||
<Arn>{{ profile.arn }}</Arn>
|
<Arn>{{ profile.arn }}</Arn>
|
||||||
<CreateDate>{{ profile.create_date }}</CreateDate>
|
<CreateDate>{{ profile.created_iso_8601 }}</CreateDate>
|
||||||
</InstanceProfile>
|
</InstanceProfile>
|
||||||
</CreateInstanceProfileResult>
|
</CreateInstanceProfileResult>
|
||||||
<ResponseMetadata>
|
<ResponseMetadata>
|
||||||
@ -977,7 +977,7 @@ GET_INSTANCE_PROFILE_TEMPLATE = """<GetInstanceProfileResponse xmlns="https://ia
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -985,7 +985,7 @@ GET_INSTANCE_PROFILE_TEMPLATE = """<GetInstanceProfileResponse xmlns="https://ia
|
|||||||
<InstanceProfileName>{{ profile.name }}</InstanceProfileName>
|
<InstanceProfileName>{{ profile.name }}</InstanceProfileName>
|
||||||
<Path>{{ profile.path }}</Path>
|
<Path>{{ profile.path }}</Path>
|
||||||
<Arn>{{ profile.arn }}</Arn>
|
<Arn>{{ profile.arn }}</Arn>
|
||||||
<CreateDate>{{ profile.create_date }}</CreateDate>
|
<CreateDate>{{ profile.created_iso_8601 }}</CreateDate>
|
||||||
</InstanceProfile>
|
</InstanceProfile>
|
||||||
</GetInstanceProfileResult>
|
</GetInstanceProfileResult>
|
||||||
<ResponseMetadata>
|
<ResponseMetadata>
|
||||||
@ -1000,7 +1000,7 @@ CREATE_ROLE_TEMPLATE = """<CreateRoleResponse xmlns="https://iam.amazonaws.com/d
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
{% if role.permissions_boundary %}
|
{% if role.permissions_boundary %}
|
||||||
<PermissionsBoundary>
|
<PermissionsBoundary>
|
||||||
@ -1041,7 +1041,7 @@ UPDATE_ROLE_DESCRIPTION_TEMPLATE = """<UpdateRoleDescriptionResponse xmlns="http
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date.isoformat() }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
{% if role.tags %}
|
{% if role.tags %}
|
||||||
<Tags>
|
<Tags>
|
||||||
@ -1067,7 +1067,7 @@ GET_ROLE_TEMPLATE = """<GetRoleResponse xmlns="https://iam.amazonaws.com/doc/201
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
{% if role.tags %}
|
{% if role.tags %}
|
||||||
<Tags>
|
<Tags>
|
||||||
@ -1108,7 +1108,7 @@ LIST_ROLES_TEMPLATE = """<ListRolesResponse xmlns="https://iam.amazonaws.com/doc
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
{% if role.permissions_boundary %}
|
{% if role.permissions_boundary %}
|
||||||
<PermissionsBoundary>
|
<PermissionsBoundary>
|
||||||
@ -1145,7 +1145,7 @@ CREATE_POLICY_VERSION_TEMPLATE = """<CreatePolicyVersionResponse xmlns="https://
|
|||||||
<Document>{{ policy_version.document }}</Document>
|
<Document>{{ policy_version.document }}</Document>
|
||||||
<VersionId>{{ policy_version.version_id }}</VersionId>
|
<VersionId>{{ policy_version.version_id }}</VersionId>
|
||||||
<IsDefaultVersion>{{ policy_version.is_default }}</IsDefaultVersion>
|
<IsDefaultVersion>{{ policy_version.is_default }}</IsDefaultVersion>
|
||||||
<CreateDate>{{ policy_version.create_datetime }}</CreateDate>
|
<CreateDate>{{ policy_version.created_iso_8601 }}</CreateDate>
|
||||||
</PolicyVersion>
|
</PolicyVersion>
|
||||||
</CreatePolicyVersionResult>
|
</CreatePolicyVersionResult>
|
||||||
<ResponseMetadata>
|
<ResponseMetadata>
|
||||||
@ -1159,7 +1159,7 @@ GET_POLICY_VERSION_TEMPLATE = """<GetPolicyVersionResponse xmlns="https://iam.am
|
|||||||
<Document>{{ policy_version.document }}</Document>
|
<Document>{{ policy_version.document }}</Document>
|
||||||
<VersionId>{{ policy_version.version_id }}</VersionId>
|
<VersionId>{{ policy_version.version_id }}</VersionId>
|
||||||
<IsDefaultVersion>{{ policy_version.is_default }}</IsDefaultVersion>
|
<IsDefaultVersion>{{ policy_version.is_default }}</IsDefaultVersion>
|
||||||
<CreateDate>{{ policy_version.create_datetime }}</CreateDate>
|
<CreateDate>{{ policy_version.created_iso_8601 }}</CreateDate>
|
||||||
</PolicyVersion>
|
</PolicyVersion>
|
||||||
</GetPolicyVersionResult>
|
</GetPolicyVersionResult>
|
||||||
<ResponseMetadata>
|
<ResponseMetadata>
|
||||||
@ -1176,7 +1176,7 @@ LIST_POLICY_VERSIONS_TEMPLATE = """<ListPolicyVersionsResponse xmlns="https://ia
|
|||||||
<Document>{{ policy_version.document }}</Document>
|
<Document>{{ policy_version.document }}</Document>
|
||||||
<VersionId>{{ policy_version.version_id }}</VersionId>
|
<VersionId>{{ policy_version.version_id }}</VersionId>
|
||||||
<IsDefaultVersion>{{ policy_version.is_default }}</IsDefaultVersion>
|
<IsDefaultVersion>{{ policy_version.is_default }}</IsDefaultVersion>
|
||||||
<CreateDate>{{ policy_version.create_datetime }}</CreateDate>
|
<CreateDate>{{ policy_version.created_iso_8601 }}</CreateDate>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</Versions>
|
</Versions>
|
||||||
@ -1200,7 +1200,7 @@ LIST_INSTANCE_PROFILES_TEMPLATE = """<ListInstanceProfilesResponse xmlns="https:
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -1208,7 +1208,7 @@ LIST_INSTANCE_PROFILES_TEMPLATE = """<ListInstanceProfilesResponse xmlns="https:
|
|||||||
<InstanceProfileName>{{ instance.name }}</InstanceProfileName>
|
<InstanceProfileName>{{ instance.name }}</InstanceProfileName>
|
||||||
<Path>{{ instance.path }}</Path>
|
<Path>{{ instance.path }}</Path>
|
||||||
<Arn>{{ instance.arn }}</Arn>
|
<Arn>{{ instance.arn }}</Arn>
|
||||||
<CreateDate>{{ instance.create_date }}</CreateDate>
|
<CreateDate>{{ instance.created_iso_8601 }}</CreateDate>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</InstanceProfiles>
|
</InstanceProfiles>
|
||||||
@ -1287,7 +1287,7 @@ CREATE_GROUP_TEMPLATE = """<CreateGroupResponse>
|
|||||||
<GroupName>{{ group.name }}</GroupName>
|
<GroupName>{{ group.name }}</GroupName>
|
||||||
<GroupId>{{ group.id }}</GroupId>
|
<GroupId>{{ group.id }}</GroupId>
|
||||||
<Arn>{{ group.arn }}</Arn>
|
<Arn>{{ group.arn }}</Arn>
|
||||||
<CreateDate>{{ group.create_date }}</CreateDate>
|
<CreateDate>{{ group.created_iso_8601 }}</CreateDate>
|
||||||
</Group>
|
</Group>
|
||||||
</CreateGroupResult>
|
</CreateGroupResult>
|
||||||
<ResponseMetadata>
|
<ResponseMetadata>
|
||||||
@ -1302,7 +1302,7 @@ GET_GROUP_TEMPLATE = """<GetGroupResponse>
|
|||||||
<GroupName>{{ group.name }}</GroupName>
|
<GroupName>{{ group.name }}</GroupName>
|
||||||
<GroupId>{{ group.id }}</GroupId>
|
<GroupId>{{ group.id }}</GroupId>
|
||||||
<Arn>{{ group.arn }}</Arn>
|
<Arn>{{ group.arn }}</Arn>
|
||||||
<CreateDate>{{ group.create_date }}</CreateDate>
|
<CreateDate>{{ group.created_iso_8601 }}</CreateDate>
|
||||||
</Group>
|
</Group>
|
||||||
<Users>
|
<Users>
|
||||||
{% for user in group.users %}
|
{% for user in group.users %}
|
||||||
@ -1509,7 +1509,7 @@ LIST_ACCESS_KEYS_TEMPLATE = """<ListAccessKeysResponse>
|
|||||||
<UserName>{{ user_name }}</UserName>
|
<UserName>{{ user_name }}</UserName>
|
||||||
<AccessKeyId>{{ key.access_key_id }}</AccessKeyId>
|
<AccessKeyId>{{ key.access_key_id }}</AccessKeyId>
|
||||||
<Status>{{ key.status }}</Status>
|
<Status>{{ key.status }}</Status>
|
||||||
<CreateDate>{{ key.create_date }}</CreateDate>
|
<CreateDate>{{ key.created_iso_8601 }}</CreateDate>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</AccessKeyMetadata>
|
</AccessKeyMetadata>
|
||||||
@ -1577,7 +1577,7 @@ LIST_INSTANCE_PROFILES_FOR_ROLE_TEMPLATE = """<ListInstanceProfilesForRoleRespon
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -1585,7 +1585,7 @@ LIST_INSTANCE_PROFILES_FOR_ROLE_TEMPLATE = """<ListInstanceProfilesForRoleRespon
|
|||||||
<InstanceProfileName>{{ profile.name }}</InstanceProfileName>
|
<InstanceProfileName>{{ profile.name }}</InstanceProfileName>
|
||||||
<Path>{{ profile.path }}</Path>
|
<Path>{{ profile.path }}</Path>
|
||||||
<Arn>{{ profile.arn }}</Arn>
|
<Arn>{{ profile.arn }}</Arn>
|
||||||
<CreateDate>{{ profile.create_date }}</CreateDate>
|
<CreateDate>{{ profile.created_iso_8601 }}</CreateDate>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</InstanceProfiles>
|
</InstanceProfiles>
|
||||||
@ -1704,7 +1704,7 @@ GET_ACCOUNT_AUTHORIZATION_DETAILS_TEMPLATE = """<GetAccountAuthorizationDetailsR
|
|||||||
<GroupName>{{ group.name }}</GroupName>
|
<GroupName>{{ group.name }}</GroupName>
|
||||||
<Path>{{ group.path }}</Path>
|
<Path>{{ group.path }}</Path>
|
||||||
<Arn>{{ group.arn }}</Arn>
|
<Arn>{{ group.arn }}</Arn>
|
||||||
<CreateDate>{{ group.create_date }}</CreateDate>
|
<CreateDate>{{ group.created_iso_8601 }}</CreateDate>
|
||||||
<GroupPolicyList>
|
<GroupPolicyList>
|
||||||
{% for policy in group.policies %}
|
{% for policy in group.policies %}
|
||||||
<member>
|
<member>
|
||||||
@ -1754,7 +1754,7 @@ GET_ACCOUNT_AUTHORIZATION_DETAILS_TEMPLATE = """<GetAccountAuthorizationDetailsR
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -1762,7 +1762,7 @@ GET_ACCOUNT_AUTHORIZATION_DETAILS_TEMPLATE = """<GetAccountAuthorizationDetailsR
|
|||||||
<InstanceProfileName>{{ profile.name }}</InstanceProfileName>
|
<InstanceProfileName>{{ profile.name }}</InstanceProfileName>
|
||||||
<Path>{{ profile.path }}</Path>
|
<Path>{{ profile.path }}</Path>
|
||||||
<Arn>{{ profile.arn }}</Arn>
|
<Arn>{{ profile.arn }}</Arn>
|
||||||
<CreateDate>{{ profile.create_date }}</CreateDate>
|
<CreateDate>{{ profile.created_iso_8601 }}</CreateDate>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</InstanceProfileList>
|
</InstanceProfileList>
|
||||||
@ -1770,7 +1770,7 @@ GET_ACCOUNT_AUTHORIZATION_DETAILS_TEMPLATE = """<GetAccountAuthorizationDetailsR
|
|||||||
<Arn>{{ role.arn }}</Arn>
|
<Arn>{{ role.arn }}</Arn>
|
||||||
<RoleName>{{ role.name }}</RoleName>
|
<RoleName>{{ role.name }}</RoleName>
|
||||||
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
<AssumeRolePolicyDocument>{{ role.assume_role_policy_document }}</AssumeRolePolicyDocument>
|
||||||
<CreateDate>{{ role.create_date }}</CreateDate>
|
<CreateDate>{{ role.created_iso_8601 }}</CreateDate>
|
||||||
<RoleId>{{ role.id }}</RoleId>
|
<RoleId>{{ role.id }}</RoleId>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -1788,15 +1788,15 @@ GET_ACCOUNT_AUTHORIZATION_DETAILS_TEMPLATE = """<GetAccountAuthorizationDetailsR
|
|||||||
<Document>{{ policy_version.document }}</Document>
|
<Document>{{ policy_version.document }}</Document>
|
||||||
<IsDefaultVersion>{{ policy_version.is_default }}</IsDefaultVersion>
|
<IsDefaultVersion>{{ policy_version.is_default }}</IsDefaultVersion>
|
||||||
<VersionId>{{ policy_version.version_id }}</VersionId>
|
<VersionId>{{ policy_version.version_id }}</VersionId>
|
||||||
<CreateDate>{{ policy_version.create_datetime }}</CreateDate>
|
<CreateDate>{{ policy_version.created_iso_8601 }}</CreateDate>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</PolicyVersionList>
|
</PolicyVersionList>
|
||||||
<Arn>{{ policy.arn }}</Arn>
|
<Arn>{{ policy.arn }}</Arn>
|
||||||
<AttachmentCount>1</AttachmentCount>
|
<AttachmentCount>1</AttachmentCount>
|
||||||
<CreateDate>{{ policy.create_datetime }}</CreateDate>
|
<CreateDate>{{ policy.created_iso_8601 }}</CreateDate>
|
||||||
<IsAttachable>true</IsAttachable>
|
<IsAttachable>true</IsAttachable>
|
||||||
<UpdateDate>{{ policy.update_datetime }}</UpdateDate>
|
<UpdateDate>{{ policy.updated_iso_8601 }}</UpdateDate>
|
||||||
</member>
|
</member>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</Policies>
|
</Policies>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user