This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit # exit on first error | |
set -o nounset # exit on using unset variables | |
set -o pipefail # exit on any error in a pipeline | |
set -x # enable debugging | |
# Script to mirror multi-arch images from Docker Hub to Amazon ECR Public. | |
# Usage: ./mirror-multi-arch-repos.sh <source-image>:<tag> <ecr-repo-name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DynamoDBClient} from '@aws-sdk/client-dynamodb'; | |
import { GetCommand } from '@aws-sdk/lib-dynamodb'; | |
import { marshall, unmarshall } from '@aws-sdk/util-dynamodb'; | |
import { SFNClient, ListExecutionsCommand } from '@aws-sdk/client-sfn'; | |
const logRequestMiddleware = (next, _context) => async (args) => { | |
console.log('Request:', args.request); | |
return next(args); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"configurations": [ | |
{ | |
"name": "Jest file", | |
"type": "pwa-node", | |
"request": "launch", | |
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/jest", | |
"args": [ | |
"${fileBasenameNoExtension}", | |
"--runInBand", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws quicksight register-user --region us-east-1 --aws-account-id 1234567890 \ | |
--identity-type IAM --email [email protected] --user-role ADMIN --namespace default \ | |
--session-name ClickstreamExploreUser \ | |
--iam-arn arn:aws:iam::1234567890:role/clickstream-v12-dev-ClickStreamApiQuickSightEmbedRo-yQ90NyWORHnq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install tools | |
pip3 install certbot acme certbot-dns-route53 | |
# | |
export DOMAIN_NAME=clickstream.example.com | |
export CERT_NAME=$DOMAIN_NAME-$(/bin/date +%s) | |
# request fress SSL cert via DNS chanllege | |
certbot certonly --dns-route53 -d $DOMAIN_NAME --email [email protected] --agree-tos --non-interactive --work-dir ./ --logs-dir ./ --config-dir ./ -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DescribeParametersCommand, SSMClient } from "@aws-sdk/client-ssm"; | |
import { UserAgent } from '@aws-sdk/types'; | |
import * as log4js from "log4js"; | |
log4js.configure({ | |
appenders: { out: { type: "stdout" } }, | |
categories: { default: { appenders: ["out"], level: "debug" } }, | |
}); | |
const logger = log4js.getLogger(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npx license-report --fields=name --fields=licenseType --only=prod --output=csv --delimiter=" under the " --package=/path/to/package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudformation create-stack --template-url https://bucketname.s3.cn-north-1.amazonaws.com.cn/tmp/pipeline.yml --parameters ParameterKey=PipelineType,ParameterValue=Feature ParameterKey=ContainerImageSupport,ParameterValue=true ParameterKey=IsRepositoryExist,ParameterValue=true ParameterKey=RepositoryName,ParameterValue=clickstream-branch-main ParameterKey=RepositoryDescription,ParameterValue=xxx ParameterKey=BranchName,ParameterValue=ingestion-server-del-ecs --capabilities CAPABILITY_IAM --stack-name v5-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cloudFrontS3 = new CloudFrontToS3(this, 'control-plane', { | |
insertHttpSecurityHeaders: false, | |
cloudFrontDistributionProps: { | |
comment: 'It is managed by ServerlessTODO app.', | |
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2019, | |
httpVersion: HttpVersion.HTTP2_AND_3, | |
additionalBehaviors: { | |
['/prod/*']: { | |
origin: new HttpOrigin(Fn.select(2, Fn.split('/', api.url)), { | |
protocolPolicy: OriginProtocolPolicy.HTTPS_ONLY, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euxo pipefail | |
BUCKET=aws-gcr-solutions-assets | |
mirror-helm() { | |
local repoName=$1 | |
local chartName=$2 |
NewerOlder