AWS
AWS
AWS section
See pip Installation.
AWS Cloudwatch Alarm
- AWS -> Cloudwatch
- Select check-box against log group that needs an alarm
- Actions -> “Create Metric Alarm”
Define Pattern
- Filter Pattern = “ERROR”
- Next
Assign metric
- Filter name = “preview/SmartMeter/ERROR” or “preview/smart-meter-api-metric/error”
- MetricNameSpace = “smartmeter/preview
- MetricName = “ERROR”
- Metric Value = 1
- Default = “BLANK”
- Unit = “count”
Review -> Create/Assign Pattern
Create Alarm
- AWS -> Cloudwatch -> logs
- Select log group
- Metric Filter Tab -> Check-box to select -> Create Alarm
Specify Metirc Conditions
Metric
- Metric Name = “ERROR”
- Statistics = “Sum”
- Period = “5 minutes” Conditions
- Threshold = “Static”
- Whenever = “Greater than or Equal”
- than = “1” Additional Datapoints to Alarm => 1 out of 1 Missing data treatment => as Good
Notification
- Alarm state trigger = “In ALARM”
- Select an existing SNS topic = “monitoring-alerts” (SlackCloudWatch) Next
- Alarm Name = “API-smart-meter-Errors”
- Alarm Description = “Manually added”
Create Alarm
1
$ echo "dummy text"
Add certificate
- Navigate to certificate manager
- Request a certificate
- Request Public Certificate
- fqdn
blah-micro-srv.preview.trustpower.io
*.blah-micro-srv.preview.trustpower.io
- Validation Method = DNS
- Add Tags -> Review -> submit request
- Create Route53 records for
blah-micro-srv.preview.trustpower.io
- Validation should complete
- Copy ARN to env variable in secrets manager
AWS IAM - update passwords
1
2
3
4
5
6
7
8
$ # Get list of users
$ aws iam list-users | jq -r '.Users[].UserName'
$ aws iam get-user --user-name <username>
$ aws iam get-login-profile --user-name <username>
$ aws iam update-login-profile --user-name <username> --password-reset-required
$ aws iam update-login-profile --user-name <username> --password 'blah' --password-reset-required
$ aws iam list-access-keys --user-name <username>
$ aws iam update-access-key --access-key-id <value> --status Active # Note console access needs to be enabled