[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: cdn: Update README.org.
From: |
Chris Marusich |
Subject: |
03/03: cdn: Update README.org. |
Date: |
Sat, 12 Jan 2019 02:27:51 -0500 (EST) |
marusich pushed a commit to branch master
in repository maintenance.
commit ba5026796c6654611cf66d4a28beffede88641ad
Author: Chris Marusich <address@hidden>
Date: Fri Jan 11 22:50:51 2019 -0800
cdn: Update README.org.
* cdn/README.org: Explain how to check the bill using the AWS CLI.
---
cdn/README.org | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/cdn/README.org b/cdn/README.org
index 2ab4161..8462209 100644
--- a/cdn/README.org
+++ b/cdn/README.org
@@ -251,6 +251,50 @@ See the following for details:
https://docs.aws.amazon.com/cli/latest/reference/cloudfront/create-invalidation.html
https://docs.aws.amazon.com/cli/latest/reference/cloudfront/get-invalidation.html
+*** View estimated charges without using the AWS Management Console
+Define a function like this:
+
+#+BEGIN_EXAMPLE
+# This metric is only available in the us-east-1 region. We use the
+# "--iso-8601=seconds" option because that format is always suitable
+# for input to the "-d" option. But note that the AWS CLI seems to
+# expect a "Z" at the end of its timestamps. To see more data, try
+# changing "$now - 6 hours" to something else, like "$now - 3 days".
+get_estimated_charges() {
+ local now="$(date -u --iso-8601=seconds)"
+ AWS_DEFAULT_REGION=us-east-1 aws cloudwatch get-metric-statistics \
+ --namespace AWS/Billing \
+ --metric-name EstimatedCharges \
+ --statistics Maximum \
+ --dimensions Name=Currency,Value=USD \
+ --unit None \
+ --period 21600 \
+ --start-time "$(date -u -d "$now - 6 hours" '+%FT%TZ')" \
+ --end-time "$(date -u -d "$now" '+%FT%TZ')"
+}
+#+END_EXAMPLE
+
+Run it like this (assuming you're using a non-default AWS_PROFILE):
+
+#+BEGIN_EXAMPLE
+AWS_PROFILE=guix get_estimated_charges
+#+END_EXAMPLE
+
+Example output:
+
+#+BEGIN_EXAMPLE
+$ AWS_PROFILE=guix get_estimated_charges
+{
+ "Label": "EstimatedCharges",
+ "Datapoints": [
+ {
+ "Timestamp": "2019-01-11T23:15:00Z",
+ "Maximum": 0.0,
+ "Unit": "None"
+ }
+ ]
+}
+#+END_EXAMPLE
* How to use AWS without Terraform
Sometimes, it's useful to verify the result of Terraform's activities
@@ -1327,6 +1371,10 @@ configuration. For details, see:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html
+**** Update the billing Contact Information if necessary
+It seems any further customization of the billing information (e.g.,
+contact address) must be made manually using the AWS Management
+Console.
** Configuration structure
There can be multiple files (*.tf, *.tfvars), or just one file. Name