WEBVTT

1
00:00:00.320 --> 00:00:02.560
<v Instructor>So let's have a look at cost allocation tags.</v>

2
00:00:02.560 --> 00:00:06.690
So they're used to track your AWS costs on a detailed level.

3
00:00:06.690 --> 00:00:08.250
So this is the kind of report you would get

4
00:00:08.250 --> 00:00:10.920
if you download your cost and report.

5
00:00:10.920 --> 00:00:12.440
And then, as you can see,

6
00:00:12.440 --> 00:00:14.490
you have a column name, Total Cost,

7
00:00:14.490 --> 00:00:17.290
and then you have a bunch of different colors, ah columns,

8
00:00:17.290 --> 00:00:20.680
user:Owner, user:Stack, user:Cost Center, user:Application,

9
00:00:20.680 --> 00:00:22.563
and they are cost allocation tags, okay.

10
00:00:22.563 --> 00:00:25.540
This is because you wanted to separate your cost report

11
00:00:25.540 --> 00:00:28.030
based on the different values of these tags.

12
00:00:28.030 --> 00:00:30.170
So you have two types of tags for cost allocation tags.

13
00:00:30.170 --> 00:00:33.410
You have AWS generated tags and they automatically

14
00:00:33.410 --> 00:00:35.010
are applied to the resource you create

15
00:00:35.010 --> 00:00:36.640
because they are generated by AWS.

16
00:00:36.640 --> 00:00:39.020
And they will start with a Prefix AWS.

17
00:00:39.020 --> 00:00:42.730
For example, this Prefix AWS column, createdBy,

18
00:00:42.730 --> 00:00:43.830
is very important.

19
00:00:43.830 --> 00:00:46.980
That represents who has created a specific resource.

20
00:00:46.980 --> 00:00:49.730
And so you could create a cost report

21
00:00:49.730 --> 00:00:52.110
based on who has created what.

22
00:00:52.110 --> 00:00:55.630
And so you can incur cost back to a specific person.

23
00:00:55.630 --> 00:00:59.170
Now, user-defined tasks, ah tags, are defined by the users

24
00:00:59.170 --> 00:01:01.630
and they start with the Prefix user colons,

25
00:01:01.630 --> 00:01:04.480
just as the one on the table on the right hand side.

26
00:01:04.480 --> 00:01:06.830
So, let's go in the console to see how we can define

27
00:01:06.830 --> 00:01:09.570
these cost allocation tags and use them.

28
00:01:09.570 --> 00:01:11.720
So, on the left hand side of your Cost Management,

29
00:01:11.720 --> 00:01:13.700
you have Cost allocation tags.

30
00:01:13.700 --> 00:01:15.120
And as we can see, we have two options.

31
00:01:15.120 --> 00:01:18.060
We have the User-defined cost allocation tags

32
00:01:18.060 --> 00:01:21.220
and the AWS-generated cost allocation tags.

33
00:01:21.220 --> 00:01:22.990
So, if you go in here for example,

34
00:01:22.990 --> 00:01:26.610
and we wanted to enable this aws:createdby tag,

35
00:01:26.610 --> 00:01:28.350
we could activate it,

36
00:01:28.350 --> 00:01:29.830
and then once it's activated

37
00:01:29.830 --> 00:01:31.330
is going to be taken into account

38
00:01:31.330 --> 00:01:33.460
when generating cost report.

39
00:01:33.460 --> 00:01:34.293
So as you can see,

40
00:01:34.293 --> 00:01:36.450
you have a bunch of different generated tags,

41
00:01:36.450 --> 00:01:38.820
for example, cloudformation:stack-id, and so on,

42
00:01:38.820 --> 00:01:40.240
if you wanted to.

43
00:01:40.240 --> 00:01:43.500
Next, for User-defined cost allocation tags,

44
00:01:43.500 --> 00:01:45.380
this is if you wanted to define your own tags.

45
00:01:45.380 --> 00:01:47.750
For example, say you're using Environment

46
00:01:47.750 --> 00:01:49.280
for dev test and prod,

47
00:01:49.280 --> 00:01:51.880
and you wanted to separate your cost by environment.

48
00:01:51.880 --> 00:01:54.210
In this case, you could activate, again,

49
00:01:54.210 --> 00:01:56.443
a User-defined cost allocation tag,

50
00:01:57.720 --> 00:01:59.620
and this would be up to you of course,

51
00:01:59.620 --> 00:02:01.180
to use that tag properly.

52
00:02:01.180 --> 00:02:03.320
So, if you go into the EC2,

53
00:02:03.320 --> 00:02:05.980
and we're going to launch an instance directly,

54
00:02:05.980 --> 00:02:08.280
so let me show you what I mean by that.

55
00:02:08.280 --> 00:02:10.660
So, we're going to launch an instance.

56
00:02:10.660 --> 00:02:12.113
And then Amazon Linux 2,

57
00:02:13.930 --> 00:02:14.940
t2.micro,

58
00:02:14.940 --> 00:02:17.320
And then on the tags side,

59
00:02:17.320 --> 00:02:19.720
here, I'm supposed to use the Environment tag,

60
00:02:19.720 --> 00:02:22.160
for example, Developments,

61
00:02:22.160 --> 00:02:24.640
and this is where that tag would be picked up

62
00:02:24.640 --> 00:02:27.540
for cost allocation purposes, okay.

63
00:02:27.540 --> 00:02:29.460
So, I'm now going to go ahead and create this instance,

64
00:02:29.460 --> 00:02:33.430
but you see that you need to start tagging your resources

65
00:02:33.430 --> 00:02:35.570
with your correct tags for them to appear, obviously,

66
00:02:35.570 --> 00:02:39.893
and be separated in this cost allocation tags reports.

67
00:02:41.640 --> 00:02:44.120
Which brings us to the cost and usage reports.

68
00:02:44.120 --> 00:02:46.370
So this is a report used to dive deeper

69
00:02:46.370 --> 00:02:48.280
into your cost and usage.

70
00:02:48.280 --> 00:02:50.410
And it contains the most comprehensive set

71
00:02:50.410 --> 00:02:52.560
of AWS cost and usage that available.

72
00:02:52.560 --> 00:02:54.730
This includes all the additional metadata

73
00:02:54.730 --> 00:02:56.850
about your services, pricing, and reservations.

74
00:02:56.850 --> 00:02:58.720
So, you will get some information

75
00:02:58.720 --> 00:03:01.600
about the Amazon EC2 Reserved Instances in there.

76
00:03:01.600 --> 00:03:04.530
So, this cost and usage report will list the AWS usage

77
00:03:04.530 --> 00:03:06.720
for each service used by your accounts

78
00:03:06.720 --> 00:03:09.300
with hourly or daily line items.

79
00:03:09.300 --> 00:03:10.780
And any tags you have activated

80
00:03:10.780 --> 00:03:12.150
for cost allocation purposes.

81
00:03:12.150 --> 00:03:15.360
And this is why cost allocation tags are very important.

82
00:03:15.360 --> 00:03:18.970
You can configure it to do daily exports into Amazon S3.

83
00:03:18.970 --> 00:03:20.980
And then you can analyze this data

84
00:03:20.980 --> 00:03:23.413
using Athena, Redshift, or QuickSight.

85
00:03:24.320 --> 00:03:25.420
So, to get that report,

86
00:03:25.420 --> 00:03:28.080
on the left hand side on Cost and Usage Reports,

87
00:03:28.080 --> 00:03:29.900
I can create a report.

88
00:03:29.900 --> 00:03:33.083
And then we can, say for example, DemoReport.

89
00:03:34.900 --> 00:03:37.190
We can include resource IDs if you wanted to.

90
00:03:37.190 --> 00:03:40.660
And then automatically refresh this report if we needed to.

91
00:03:40.660 --> 00:03:42.860
Then we need to set up an S3 bucket

92
00:03:42.860 --> 00:03:45.990
to deliver this bucket, this information to.

93
00:03:45.990 --> 00:03:50.210
So we can do it, demo-cost-report-stephane,

94
00:03:50.210 --> 00:03:54.110
and we'll use the Region US East Northern Virginia.

95
00:03:54.110 --> 00:03:55.000
Next.

96
00:03:55.000 --> 00:03:57.510
And then we confirm the default policy that would be applied

97
00:03:57.510 --> 00:04:00.820
to the buckets to allow the delivery of these reports.

98
00:04:00.820 --> 00:04:02.880
We could say the time granularity that we want,

99
00:04:02.880 --> 00:04:04.200
for example, Daily.

100
00:04:04.200 --> 00:04:06.900
And whether or not we want to Create a new report version

101
00:04:06.900 --> 00:04:08.350
or Overwrite existing reports,

102
00:04:08.350 --> 00:04:10.150
so I'll Create a new report version.

103
00:04:10.150 --> 00:04:12.060
Then we can enable the integration

104
00:04:12.060 --> 00:04:14.210
with Athena, Redshift, and QuickSight if we wanted to,

105
00:04:14.210 --> 00:04:17.400
as well as a specific compression mechanism.

106
00:04:17.400 --> 00:04:21.210
Click on Next, and we'll see, I'll call it costreports,

107
00:04:21.210 --> 00:04:22.860
as a Prefix.

108
00:04:22.860 --> 00:04:24.100
Next.

109
00:04:24.100 --> 00:04:26.130
And then Review and Complete.

110
00:04:26.130 --> 00:04:29.600
And this will enable the delivery of this report

111
00:04:29.600 --> 00:04:32.800
directly into your S3 bucket, every day.

112
00:04:32.800 --> 00:04:34.470
Another thing you can do is to,

113
00:04:34.470 --> 00:04:36.360
you can enable some of these reports

114
00:04:36.360 --> 00:04:39.270
and they can take up to 24 hours to be enabled, okay.

115
00:04:39.270 --> 00:04:41.790
But you can start analyzing your costs using Cost Explorer.

116
00:04:41.790 --> 00:04:45.400
And you would use the same cost allocation tags as before.

117
00:04:45.400 --> 00:04:47.280
You can monitor your RI's using Cost Explorer,

118
00:04:47.280 --> 00:04:50.010
or you can get a AWS Usage Report,

119
00:04:50.010 --> 00:04:53.310
and this could be based for any kind of service.

120
00:04:53.310 --> 00:04:55.360
For example, let's do a service that we all know,

121
00:04:55.360 --> 00:04:56.913
such as Amazon EC2.

122
00:04:59.160 --> 00:05:01.930
Which is right here.

123
00:05:01.930 --> 00:05:03.530
And then All Usage Types,

124
00:05:03.530 --> 00:05:05.300
for the Current billing period.

125
00:05:05.300 --> 00:05:08.330
And the Granularity is, let's do for last month,

126
00:05:08.330 --> 00:05:10.460
and the Granularity is by Days.

127
00:05:10.460 --> 00:05:12.260
And then let's Download this report.

128
00:05:13.350 --> 00:05:14.693
Which is a CSV.

129
00:05:17.640 --> 00:05:21.480
And here I am getting my report of the Operation,

130
00:05:21.480 --> 00:05:22.440
the UsageType,

131
00:05:22.440 --> 00:05:23.570
the Service,

132
00:05:23.570 --> 00:05:25.400
and so on, as well as StartTime,

133
00:05:25.400 --> 00:05:27.730
the EndTime, and the UsageValue.

134
00:05:27.730 --> 00:05:30.500
So this is a really, really big report as you can see.

135
00:05:30.500 --> 00:05:34.040
And when I do have my cost allocation tags in place,

136
00:05:34.040 --> 00:05:36.830
because they can take a little bit of time to populate,

137
00:05:36.830 --> 00:05:39.590
then I will start seeing them as well in this report.

138
00:05:39.590 --> 00:05:41.530
So that's it for this cost lecture.

139
00:05:41.530 --> 00:05:42.370
I hope you liked it.

140
00:05:42.370 --> 00:05:44.320
And I will see you in the next lecture.

