-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathformat.ts
More file actions
45 lines (42 loc) · 1.14 KB
/
format.ts
File metadata and controls
45 lines (42 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { RawAwsSystemManagerActivation } from './data'
import { AwsSystemManagerActivation } from '../../types/generated'
import { formatTagsFromMap } from '../../utils/format'
import { systemManagerActivationArn } from '../../utils/generateArns'
export default ({
service,
account,
region,
}: {
service: RawAwsSystemManagerActivation
account: string
region: string
}): AwsSystemManagerActivation => {
const {
ActivationId: activationId,
Description: description,
DefaultInstanceName: defaultInstanceName,
IamRole: iamRole,
RegistrationLimit: registrationLimit,
RegistrationsCount: registrationsCount,
ExpirationDate: expirationDate,
Expired: expired,
CreatedDate: createdDate,
Tags: tags,
} = service
const arn = systemManagerActivationArn({ region, account, id: activationId })
return {
id: activationId,
accountId: account,
arn,
region,
description,
defaultInstanceName,
iamRole,
registrationLimit,
registrationsCount,
expirationDate: expirationDate?.toISOString(),
expired,
createdDate: createdDate?.toISOString(),
tags: formatTagsFromMap(tags),
}
}