-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
128 lines (94 loc) · 4.76 KB
/
README
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
NAME
RT-Extension-AWS-Assets - Manage AWS resources in RT assets
DESCRIPTION
Manage AWS resources in RT assets
RT VERSION
Works with RT 5.0
INSTALLATION
perl Makefile.PL
make
make install
May need root permissions
Edit your /opt/rt4/etc/RT_SiteConfig.pm
Add this line:
Plugin('RT::Extension::AWS::Assets');
Clear your mason cache
rm -rf /opt/rt5/var/mason_data/obj
Restart your webserver
USAGE
This extension is designed to fetch data for EC2 and RDS instances in
AWS and create RT asset records for each. It also can fetch information
on reserved instances and create assets records for these, in a
different catalog.
Once you have fetched the above information, you can use linking in RT
to associate an AWS resource, like an AWS EC2 instance, with a
reservation you have purchased. The extension provides a page in the RT
web UI at https://myrt.com/AWS/LinkAsset.html?id=123 to match AWS
resources with reservations based on the service, instance type, and
region.
CONFIGURATION
The following configuration options need to be set to use this
extension.
AWS API Credentials
In the AWS IAM console, create keys for external access and set:
Set($AWS_ACCESS_KEY, 'foo');
Set($AWS_SECRET_KEY, 'barbaz');
Asset Catalogs
Set the following with the names of the catalogs to use for AWS
resources (like EC2 and RDS instances) and reserved instances.
Set($AWSAssetsInstanceCatalog, 'AWS Resources');
Set($AWSAssetsReservedInstancesCatalog, 'AWS Reserved Instances');
Data Field Mapping
Information from AWS resources is stored mostly in custom fields on
assets in RT. Use this configuration to define which custom fields to
populate. The names mostly map to the name provided by AWS in the API.
The EC2 and RDS keys are for AWS resources. The EC2:RI and RDS:RI are
for reserved instances.
Set($AWSAssetsUpdateFields, {
'EC2' => ['Instance Type', 'Platform', 'Placement:Tenancy', 'Placement:Availability Zone', 'Tags:Name', 'Tags:customer'],
'RDS' => ['Instance Type', 'Engine', 'Allocated Storage', 'Availability Zone', 'Name', 'MultiAZ', 'TagList:customer'],
'EC2:RI' => ['Instance Type', 'Platform', 'Tenancy', 'Reservation Start', 'Reservation End', 'Duration', 'Offering Class', 'Offering Type', 'Name', 'Product Description', 'State'],
'RDS:RI' => ['Instance Type', 'Platform', 'Reservation Start', 'Reservation End', 'Duration', 'Offering Type', 'Name', 'MultiAZ', 'Product Description', 'State'],
}
);
Asset Linking Page
This format defines the columns shown on the reservation linking page.
Set($AWSAssetsLinkFormat, q{'<a
href="__WebPath__/Asset/Display.html?id=__id__">__id__</a>/TITLE:#'}
.q{,'<a
href="__WebHomePath__/Asset/Display.html?id=__id__">__Name__</a>/TITLE:N
ame'} .q{,'__CustomFieldView.{AWS ID}__'}
.q{,'__CustomFieldView.{customer}__'} .q{,'__CustomFieldView.{Instance
Type}__'} .q{,'__CustomFieldView.{Engine}__'} );
To link to this page, create a saved search to find any unlinked
reserved instance records. A search like this should find these records:
Catalog = 'AWS Reserved Instances' AND DependedOnBy IS NULL AND ( CF.{State} = 'payment-pending' OR CF.{State} = 'active' )
After creating the search, go to the Advanced page and add this line to
the Format:
'<a href="__WebPath__/AWS/LinkAsset.html?id=__id__" target="_blank">Link
to Resource</a>/TITLE:Link to Resource'
That will show a column linking to the reservation linking page.
AWS IDs Used for Assets
AWS uses different identifiers with different services. This extension
uses the below mapping of AWS value to RT custom fields on assets. When
a new asset is created, the named custom fields must exist and they will
be set. On update, this value is used to load new data from the existing
assets.
EC2 AWS Value: "Instance ID" RT Asset CF: "AWS ID"
RDS AWS Value: "DBI Resource ID" RT Asset CF: "AWS ID"
EC2 Reserved Instance
AWS Value: "Reserved Instances ID" RT Asset CF: "AWS Reserved
Instance ID"
RDS Reserved Instance
AWS Value: "Lease ID" RT Asset CF: "AWS Reserved Instance ID"
METHODS
Accept a loaded RT::Asset object and a Paws Instance object.
AUTHOR
All bugs should be reported via email to
or via the web at
http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-AWS-Assets
LICENSE AND COPYRIGHT
This software is Copyright (c) 2024 by Best Practical Solutions, LLC
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991