Skip to content

Instantly share code, notes, and snippets.

AWSTemplateFormatVersion: '2010-09-09'
Transform:
- AWS::LanguageExtensions
- AWS::Serverless-2016-10-31
Description: SAM Template for CbEventSourceManager
Parameters:
CircuitBreakerAlarmArn:
Description: Alarm that is base for the circuit breaker
Type: String
package handler
import (
"context"
"fmt"
"github.com/Ryanair/gofrlib/log"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/lambda"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
"github.com/pkg/errors"
AWSTemplateFormatVersion: '2010-09-09'
Transform:
- AWS::LanguageExtensions
- AWS::Serverless-2016-10-31
Description: SAM Template for CbEventSourceManager
Parameters:
Project:
Type: String
ProjectGroup:
@SodaDev
SodaDev / gist:6ba66b4c65ff94fee8f9ecd9cd4e0289
Created November 28, 2023 09:23
Elasticache Serverless Cost Diagram
{
"metrics": [
[ { "expression": "pricestorage+(ecpus/1000000*0.0038)", "label": "Serverless Elasticache Pricing", "id": "price", "yAxis": "right" } ],
[ { "expression": "SUM(METRICS())/1000", "label": "ECPus", "id": "ecpus" } ],
[ { "expression": "$YOUR_CLUSTER_GB_SIZE*0.14*24*30", "label": "PriceStorage", "id": "pricestorage", "yAxis": "right", "visible": false } ],
[ "AWS/ElastiCache", "NetworkBytesOut", "CacheClusterId", "$YOUR_CLUSTER_NAME-001", "CacheNodeId", "0001", { "region": "$YOUR_REGION", "id": "m1", "visible": false } ],
[ "...", "$YOUR_CLUSTER_NAME-002", ".", ".", { "region": "$YOUR_REGION", "id": "m2", "visible": false } ],
[ "...", "$YOUR_CLUSTER_NAME-003", ".", ".", { "region": "$YOUR_REGION", "id": "m3", "visible": false } ],
[ ".", "NetworkBytesIn", ".", "$YOUR_CLUSTER_NAME-001", ".", ".", { "region": "$YOUR_REGION", "id": "m4", "visible": false } ],
[ "...", "$YOUR_CLUSTER_NAME-002", ".", ".", { "region": "$YOUR_REGION", "
- name: core-api-errors-sampling-policy
type: and
and:
and_sub_policy:
- name: error-policy
type: status_code
status_code:
status_codes:
- "ERROR"
- name: probabilistic-policy
2023-03-05T19:17:01.381000 <--- Loaded 5 messages
2023-03-05T19:17:01.381000 xxx> 1
2023-03-05T19:17:01.381000 ---> 2
2023-03-05T19:17:01.381000 xxx> 3
2023-03-05T19:17:01.381000 xxx> 4
2023-03-05T19:17:01.381000 ---> 5
2023-03-05T19:17:06.405000 <--- Loaded 7 messages
2023-03-05T19:17:06.405000 ---> 1
2023-03-05T19:17:06.405000 ---> 3
2023-03-05T19:17:06.405000 xxx> 4
@SodaDev
SodaDev / gist:5f9e448f23a828ac337aa5789093124f
Created March 5, 2023 18:23
Article SQS - Batch processing partial failures
2023-02-26T19:19:17.383000 <--- Loaded 4 messages
2023-02-26T19:19:17.383000 ---> Test event 5
2023-02-26T19:19:17.383000 ---> Test event 3
2023-02-26T19:19:17.383000 xxx> Test event 6
2023-02-26T19:19:17.383000 xxx> Test event 10
2023-02-26T19:19:28.457000 <--- Loaded 6 messages
2023-02-26T19:19:28.457000 xxx> Test event 4
2023-02-26T19:19:28.457000 xxx> Test event 2
2023-02-26T19:19:28.457000 ---> Test event 1
@SodaDev
SodaDev / gist:76c8a572f438248e7ca4a715034112a9
Created March 5, 2023 14:51
Batch processing without partial failures
2023-02-26T01:38:11.420000 <--- Loaded 6 messages
2023-02-26T01:38:11.420000 ---> Test event 1
2023-02-26T01:38:11.420000 ---> Test event 5
2023-02-26T01:38:11.420000 ---> Test event 9
2023-02-26T01:38:11.420000 xxx> Test event 10
2023-02-26T01:38:26.068000 <--- Loaded 4 messages
2023-02-26T01:38:26.068000 xxx> Test event 3
2023-02-26T01:38:51.377000 <--- Loaded 5 messages
2023-02-26T11:24:51.473000 <--- Loaded 1 messages
2023-02-26T11:24:51.473000 xxx> Test event 4
2023-02-26T11:24:51.477000 <--- Loaded 1 messages
2023-02-26T11:24:51.477000 ---> Test event 3
2023-02-26T11:24:52.819000 <--- Loaded 1 messages
2023-02-26T11:24:52.819000 ---> Test event 2
2023-02-26T11:24:52.843000 <--- Loaded 1 messages
2023-02-26T11:24:52.843000 ---> Test event 5
2023-02-26T11:24:52.877000 <--- Loaded 1 messages
2023-02-26T11:24:52.877000 ---> Test event 1
AWSTemplateFormatVersion: 2010-09-09
Description: SSO Account Setup
Parameters:
InstanceARN:
Type: String
AllowedPattern: arn:aws:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}
Description: 'Enter AWS SSO InstanceARN. Ex: arn:aws:sso:::instance/ssoins-xxxxxxxxxxxxxxxx'
ConstraintDescription: AWS SSO InstanceARN - gather with aws sso-admin list-instances
IdentityStoreId: